forked from oryband/dotvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
718 lines (584 loc) · 20 KB
/
vimrc
File metadata and controls
718 lines (584 loc) · 20 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
cd ~/workspace/winwag/
nmap <silent> <Leader>t :CommandT ~/workspace/winwag/<CR>
nmap <silent> <Leader>b :CommandTBuffer<CR>
" Great sources & credits:
" gmarik's vimrc - https://github.com/gmarik/vimfiles/blob/master/vimrc
" durdn's vimrc - https://github.com/durdn/cfg/blob/master/.vimrc
" FactoryLab's Vim Git repo - https://github.com/factorylabs/vimfiles
" Example vimrc - http://www.vi-improved.org/vimrc.php
"
" Graphical cheat sheet - http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html
" Initialization
set nocompatible " Disable vi compatibility (more efficient, and besides - we're using non-vi tricks here).
set fileformats=unix,dos,mac " Set file end-of-line priority.
"set statusline= " FIXME: Reset status line here.
behave xterm
filetype on
filetype plugin indent on " Automatically detect file types, and enable file-type-specific plugins and indentation.
"VimOrganizer (ORGMODE for Vim)
au! BufRead,BufWrite,BufWritePost,BufNewFile *.org
au BufEnter *.org call org#SetOrgFileType()
au BufEnter *.org AutoComplPopDisable
au BufEnter *.org setl tw=80
"Vim LaTeX
" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'
" Plugin Bundles - http://vim-scripts.org/vim/scripts.html
" To install/update type ':BundleInstall!' <-- NOTE the exclamation mark '!'
" To clean ununsed plugins type ':BundleClean!'
" Plugin manager initialization
set runtimepath+=$HOME/.vim/vundle.git/
call vundle#rc()
" Git
Bundle "tpope/vim-fugitive.git"
" Colors
Bundle "altercation/vim-colors-solarized"
Bundle "nanotech/jellybeans.vim"
Bundle "desert256.vim"
" Syntax
Bundle "hsitz/VimOrganizer"
Bundle "jcf/vim-latex"
Bundle "vim-scripts/VOoM"
Bundle "tpope/vim-markdown"
Bundle "pangloss/vim-javascript"
Bundle "briangershon/html5.vim"
Bundle "digitaltoad/vim-jade"
Bundle "groenewege/vim-less"
"Bundle "ChrisYip/Better-CSS-Syntax-for-Vim"
Bundle "sukima/xmledit"
Bundle "css3"
Bundle "django.vim"
Bundle "python.vim--Vasiliev"
Bundle "indentpython.vim"
let python_highlight_all=1 " Enable all plugin's highlighting.
let python_slow_sync=1 " For fast machines.
let python_print_as_function=1 " Color 'print' function.
" Linting / Error correction
Bundle "scrooloose/syntastic"
"Bundle "oryband/syntastic"
let g:syntastic_enable_signs=1 " Show sidebar signs.
"let g:syntastic_auto_loc_list=1 " Auto open errors window upon detection.
set statusline+=%#warningmsg# " Add Error ruler.
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
nnoremap <silent> ` :Errors<CR>
" NOTE: For Javascript:
" 1. Install exuberant-ctags & Node.js using your favorite package manager,
" 2. Install Node Package Manager (npm): Execute `curl http://npmjs.org/install.sh | sh` - See http://npmjs.org for more info.
" 3. Install jshint: Execute `npm install jshint`
" 4. Create a .jshintrc file @ your HOME dir (~/). Example: https://github.com/oryband/dotfiles/blob/master/jshintrc
" 5. Overwrite .vim/bundle/syntastic/syntax_checkers/javascript.vim with this one: https://github.com/oryband/dotvim/blob/master/syntax_checkers/javascript.vim TODO: Find a way to not need this line.
" Other plugins
Bundle "AutoTag"
Bundle "scrooloose/nerdcommenter"
Bundle "scrooloose/nerdtree"
Bundle "camelcasemotion"
map <silent> w <Plug>CamelCaseMotion_w
map <silent> b <Plug>CamelCaseMotion_b
map <silent> e <Plug>CamelCaseMotion_e
sunmap w
sunmap b
sunmap e
Bundle "ShowMarks"
" Only show alphabetic marks.
let g:showmarks_include="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
" Marks will be shown in format of 'm[mark char]' e.g. 'mA'.
let g:showmarks_textlower="\.\t"
let g:showmarks_textupper="\.\t"
let g:showmarks_textother="\.\t"
Bundle "majutsushi/tagbar"
nnoremap <silent> \ :TagbarToggle<CR>
Bundle 'minibufexpl.vim'
let g:miniBufExplModSelTarget = 1 " Don't open buffer in a non-modifiable buffer (e.g. TagList window).
"let g:miniBufExplVSplit = 13 " Vertical column static width in chars
"let g:miniBufExplMaxSize = 2 " Vertical column max size.
"let g:miniBufExplForceSyntaxEnable = 1 " Use this if you encounter highlighting bugs (colors not changing).
Bundle "godlygeek/tabular"
Bundle "IndexedSearch"
Bundle "tpope/vim-unimpaired"
Bundle "AutoComplPop"
" Terminal / GUI
set t_Co=256 " Set terminal to display 256 colors.
if has("win32") " Fix Windows specific encoding problem.
set encoding=utf-8
endif
" Colors
set background=dark
colorscheme jellybeans
"colorscheme desert256
" let g:solarized_termcolors=256 " Use this if you don't use Solarized as your terminal colors.
"colorscheme solarized
function! GlobalColorSettings() " Set global color settings, regardless of colorscheme currently in use.
" Set 'TODO' & 'FIXME' strings to be bold and standout as hell.
highlight Todo term=standout ctermfg=196 ctermbg=226 guifg=#ff4500 guibg=#eeee00
" TODO: colorscheme jellybeans only.
highlight Operator term=underline ctermfg=215 guifg=#ffb964
" Set cursor color to be like in jellybeans.vim colorscheme, but with black text (previously white).
highlight Cursor ctermfg=Black ctermbg=153 guifg=#000000 guibg=#b0d0f0
endfunction
autocmd colorscheme * call GlobalColorSettings() " Call the global color settings on every colorscheme change.
" Formatting
set nowrap " No line wrapping.
set linebreak " Wrap at word.
"set textwidth=0 " Desirable text width. Used for text auto-wrapping. 0 means no auto-wrapping.
"autocmd FileType * set formatoptions=r,2 " Enable auto-wrapping comments, comment leader auto-insertion in <Insert> mode, auto-format paragraphs, keep last line indentation. Disable all other format options. NOTE: Requires 'set autoindent'. autocmd FileType is required since formatoptions i set differently for each fiel type (.c, .py, etc.).
set backspace=indent,eol,start " Enable backspace key. Erase previously entered characters in insert mode.
set number " Show line numbers.
set numberwidth=5 " Width of numbers column.
" Syntax
syntax on " Syntax highlighting.
autocmd BufWinEnter,FileType html setfiletype htmldjango " Special syntax for html+django.
autocmd BufWinEnter,FileType *.json,*jshintrc setfiletype javascript
set showmatch " Show matching brace on insertion or cursor over.
set matchtime=3 " How many tenths of a second to wait before showing matching braces.
set matchpairs+=<:> " Treat '<','>' as matching braces.
" Omni Completion
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
" Indentation
set autoindent " Automatically set the indent of a new line (local to buffer).
set smartindent
"set shiftround " Round shift actions. i.e. When at 3 spaces, and I hit > ... go to 4, not 5. FIXME: Doesn't work.
" expandtab = All tabs will be spaces.
" softabstop = How many spaces will a tab take when 'expandtab' is on.
" smarttab = delete chunks of spaces like tabs.
" tabstop = How many spaces is a tab (visually).
" shiftwidth = How many spaces will a 'shift' command take.
autocmd BufWinEnter,FileType *,python,javascript set expandtab smarttab tabstop=4 softtabstop=4 shiftwidth=4 " This includes default behaviour.
autocmd BufWinEnter,FileType html,css set expandtab smarttab tabstop=2 softtabstop=2 shiftwidth=2 " FIXME: Doesn't work.
" Searching
"set hlsearch " Highlight search.
set smartcase " Be case sensitive when input has a capital letter.
set incsearch " Show matches while typing.
set ignorecase " Ignore case when searching.
" Folding
set foldenable " Turn on folding.
set foldmethod=marker " Fold on the marker.
set foldlevel=100 " Don't autofold anything (but I can still fold manually).
set foldopen=block,hor,tag,percent,mark,quickfix " Which movements open folds.
" Backup
set nobackup " Disable file backup before file overwrite attempt.
set nowritebackup
"set undofile " Keep undo actions even when a file (buffer) is closed.
"if has ("win32") " Set undo files location.
"set undodir=$HOME\vimfiles\undo
"set undodir+=C:\tmp
"set undodir+=C:\temp
"set undodir+=.
"else
"set undodir=$HOME/.vim/undo
"set undodir+=/var/tmp
"set undodir+=/tmp
"set undodir+=.
"endif
" Window splitting
"set equalalways " Multiple windows, when created, are equal in size. NOTE: Doesn't work well with MiniBufExpl.vim
set splitbelow splitright " New windows are created to the bottom-right.
" Status Line
set shortmess=at " Shortens messages in status line, truncates long messages.
set laststatus=2 " Always show status line.
set showcmd " Display an incomplete command in status line.
set ruler " Show file status ruler. NOTE: Doesn't work with buftabs.vim plugin.
"set ch=2 " Make command line two lines high
" Invisible characters.
if ! has("win32")
set listchars=tab:▸\ ,trail:¬,eol:« " Invisible characters.
"set listchars=tab:°\ ,trail:·,eol:☠ " Alternate invisible characters.
endif
"set list " Display invisible characters.
set nolist " Don't display invisible characters.
" Mouse
set mouse=a " Enable mouse.
"set mouse-=a " Disable mouse.
set mousehide " Hide mouse after chars typed.
behave xterm " Make mouse behave like in xterm (instead of, e.g. Windows' command-prompt mouse).
set selectmode=mouse " Enable visule selection with mouse.
" Bells
set novisualbell " No blinking
"set noerrorbells " No noise.
"set vb t_vb= " Disable any beeps or flashes on error
" Ignored files
set wildignore+=*.jpg,*.jpeg,*.png,*.gif " Ignore images
set wildignore+=*.pdf " Ignore PDF files
set wildignore+=*.pyc,*.pyo " Ignore compiled Python files
" Key mappings
" Map arrow keys to window-change actions.
"map <Up> <C-w>k
"map <Down> <C-w>j
map <Left> <C-w>h
map <Right> <C-w>l
" Map up/down keys to page-up/down.
map <Up> <C-b>
map <Down> <C-f>
" General
let mapleader="," " Set <leader> key to comma.
set history=256 " Number of things to remember in history.
set timeoutlen=250 " Time to wait after ESC (default causes an annoying delay).
"set autoread " Reload file if changed outside of Vim (DANGEROUS!).
set clipboard+=unnamed " Enable OS clipboard integration.
set hidden " The current buffer can be put to the background without writing to disk.
autocmd BufWinEnter * lcd %:p:h " Sets current-directory of current buffer/file. We avoid using `set autchdir` instead, because it can cause problems with some plugins.
"autocmd bufwritepost .vimrc source $MYVIMRC " Source .vimrc after saving it.
" Search tag list from current dir up till root.
set tags=./tags;/
"set debug=msg " Show Vim error messages.
"set timeoutlen=500 " Set key-combination timeout.
"set wildignorecase " case-insensitive dir/file completion.
"Cut, copy and paste
vmap <C-c> "+yi
vmap <C-x> "+c
nmap <C-v> <ESC>"+p
imap <C-v> <ESC>"+pa
call pathogen#infect()
:vnoremap > >gv
:vnoremap < <gv
" Alternative using Tab/Shift-Tab (for gvim).
:vnoremap <Tab> >gv
:vnoremap <S-Tab> <gv
Bundle 'tpope/vim-endwise'
Bundle 'tpope/vim-surround'
Bundle 'tpope/vim-ragtag'
Bundle 'tpope/vim-unimpaired'
Bundle 'msanders/snipmate.vim'
Bundle 'ervandew/supertab'
Bundle 'tomtom/tlib_vim'
Bundle 'tomtom/tcomment_vim'
Bundle 'tomtom/tselectbuffer_vim'
Bundle 'tsaleh/vim-matchit'
Bundle 'vim-scripts/taglist.vim'
Bundle 'Townk/vim-autoclose'
Bundle 'trapd00r/x11colors.vim'
Bundle 'lilydjwg/colorizer'
Bundle 'shemerey/vim-project'
" }}}
" General settings {{{
set title
set mouse=a
set shortmess=at " shorten error messages
set nrformats+=alpha " in-/decrease letters with C-a/C-x
set modeline " enable modelines
set modelines=5
set number " enable line numbers
set ruler " enable something
set cursorline " enable hiliting of cursor line
set backspace=2 " backspace over EOL etc.
set background=dark " i prefer dark backgrounds
set hidden " buffer switching should be quick
set confirm " ask instead of just print errors
set equalalways " make splits equal size
set lazyredraw " don't redraw while executing macros
set noshowmode " don't display mode, it's already in the status line
let mapleader=","
let maplocalleader=","
" }}}
" General Keybinds {{{
" Set MapLeader
let mapleader = ","
" Delete previous word with C-BS
imap <C-BS> <C-W>
" Toggle Buffer Selection and list Tag Lists
map <F2> <Esc>:TSelectBuffer<CR>
map <F4> <Esc>:TlistToggle<CR>
" Set text wrapping toggles
nmap <silent> <leader>w :set invwrap<CR>:set wrap?<CR>
" Set up retabbing on a source file
nmap <silent> <leader>rr :1,$retab<CR>
" cd to the directory containing the file in the buffer
nmap <silent> <leader>cd :lcd %:h<CR>
" Make the directory that contains the file in the current buffer.
" This is useful when you edit a file in a directory that doesn't
" (yet) exist
nmap <silent> <leader>md :!mkdir -p %:p:h<CR>
" }}}
" {{{ Window movement
nmap <M-h> :winc h<CR>
nmap <M-j> :winc j<CR>
nmap <M-k> :winc k<CR>
nmap <M-l> :winc l<CR>
" }}}
" GUI or no GUI, that's the question {{{
if has('gui_running')
set guicursor+=a:blinkon0 " Cursor doesn't blink - it's annoying
set guioptions-=m " No Menubar
set guioptions-=T " No Toolbar
set guioptions-=l " No Scrollbar left
set guioptions-=L " No Scrollbar left when split
set guioptions-=r " No Scrollbar right
set guioptions-=r " No Scrollbar right when split
set laststatus=2 " always show statusline
" set gfn=Pragmata\ 6.5
set gfn=Neep\ Medium\ Semi-Condensed\ 9
" set gfn=Mensch\ 7
set lines=40 " Height
set columns=85 " Width
colorscheme nucolors
else
colorscheme jellybeans
endif
" }}}
" Status line {{{
set laststatus=2 " always show statusline
" Generic Statusline {{{
function! SetStatus()
setl statusline+=
\%1*\ %f
\%H%M%R%W%7*\ ┃
\%2*\ %Y\ <<<\ %{&ff}%7*\ ┃
endfunction
function! SetRightStatus()
setl statusline+=
\%5*\ %{StatusFileencoding()}%7*\ ┃
\%5*\ %{StatusBuffersize()}%7*\ ┃
\%=%<%7*\ ┃
\%5*\ %{StatusWrapON()}
\%6*%{StatusWrapOFF()}\ %7*┃
\%5*\ %{StatusInvisiblesON()}
\%6*%{StatusInvisiblesOFF()}\ %7*┃
\%5*\ %{StatusExpandtabON()}
\%6*%{StatusExpandtabOFF()}\ %7*┃
\%5*\ w%{StatusTabstop()}\ %7*┃
\%3*\ %l,%c\ >>>\ %P
\\
endfunction " }}}
" Update when leaving Buffer {{{
function! SetStatusLeaveBuffer()
setl statusline=""
call SetStatus()
endfunction
au BufLeave * call SetStatusLeaveBuffer() " }}}
" Update when switching mode {{{
function! SetStatusInsertMode(mode)
setl statusline=%4*
if a:mode == 'i'
setl statusline+=\ Einfügen\ ◥
elseif a:mode == 'r'
setl statusline+=\ Ersetzen\ ◥
elseif a:mode == 'normal'
setl statusline+=\ \ ◥
endif
call SetStatus()
call SetRightStatus()
endfunction
au VimEnter * call SetStatusInsertMode('normal')
au InsertEnter * call SetStatusInsertMode(v:insertmode)
au InsertLeave * call SetStatusInsertMode('normal')
au BufEnter * call SetStatusInsertMode('normal') " }}}
" Some Functions shamelessly ripped and modified from Cream
"fileencoding (three characters only) {{{
function! StatusFileencoding()
if &fileencoding == ""
if &encoding != ""
return &encoding
else
return " -- "
endif
else
return &fileencoding
endif
endfunc " }}}
" &expandtab {{{
function! StatusExpandtabON()
if &expandtab == 0
return "tabs"
else
return ""
endif
endfunction "
function! StatusExpandtabOFF()
if &expandtab == 0
return ""
else
return "tabs"
endif
endfunction " }}}
" tabstop and softtabstop {{{
function! StatusTabstop()
" show by Vim option, not Cream global (modelines)
let str = "" . &tabstop
" show softtabstop or shiftwidth if not equal tabstop
if (&softtabstop && (&softtabstop != &tabstop))
\ || (&shiftwidth && (&shiftwidth != &tabstop))
if &softtabstop
let str = str . ":sts" . &softtabstop
endif
if &shiftwidth != &tabstop
let str = str . ":sw" . &shiftwidth
endif
endif
return str
endfunction " }}}
" Buffer Size {{{
function! StatusBuffersize()
let bufsize = line2byte(line("$") + 1) - 1
" prevent negative numbers (non-existant buffers)
if bufsize < 0
let bufsize = 0
endif
" add commas
let remain = bufsize
let bufsize = ""
while strlen(remain) > 3
let bufsize = "," . strpart(remain, strlen(remain) - 3) . bufsize
let remain = strpart(remain, 0, strlen(remain) - 3)
endwhile
let bufsize = remain . bufsize
" too bad we can't use "¿" (nr2char(1068)) :)
let char = "b"
return bufsize . char
endfunction " }}}
" Show Invisibles {{{
function! StatusInvisiblesON()
"if exists("g:LIST") && g:LIST == 1
if &list
if &encoding == "latin1"
return "¶"
elseif &encoding == "utf-8"
return "¶"
else
return "$"
endif
else
return ""
endif
endfunction
function! StatusInvisiblesOFF()
"if exists("g:LIST") && g:LIST == 1
if &list
return ""
else
if &encoding == "latin1"
return "¶"
elseif &encoding == "utf-8"
return "¶"
else
return "$"
endif
endif
endfunction " }}}
" Wrap Enabled {{{
function! StatusWrapON()
if &wrap
return "wrap"
else
return ""
endif
endfunction
function! StatusWrapOFF()
if &wrap
return ""
else
return "wrap"
endif
endfunction
" }}}
" }}}
" Tabstops {{{
set tabstop=2
set shiftwidth=2
set softtabstop=2
set autoindent
set smartindent
set expandtab
" }}}
" Invisibles {{{
set listchars=tab:>\ ,eol:<
set list
nmap <silent> <F5> :set list!<CR>
" }}}
" Tabstops {{{
set tabstop=2
set shiftwidth=2
set softtabstop=2
set autoindent
set smartindent
set expandtab
" }}}
" Invisibles {{{
set listchars=tab:>\ ,eol:<
set list
nmap <silent> <F5> :set list!<CR>
" }}}
" Folds {{{
set foldmethod=marker
set foldcolumn=1
" au BufWinLeave * mkview
" au BufWinEnter * silent loadview
" }}}
" Pairings {{{
set showmatch
" }}}
" Margins {{{
set scrolloff=5
set sidescroll=5
" }}}
" Search {{{
set incsearch
set ignorecase
" Toggle that stupid highlight search
nmap <silent> ,n :set invhls<CR>:set hls?<CR>
" }}}
" Backup files {{{
set nobackup
set nowb
set noswapfile
" }}}
" Completion {{{
set wildmenu
set wildmode=longest,full,list
set ofu=syntaxcomplete#Complete
" }}}
" Snipmate {{{
imap <tab> <C-r>=TriggerSnippet()<CR>
" }}}
" NERDTree {{{
map <F3> :NERDTreeToggle<CR>
let NERDTreeChDirMode = 2
let NERDTreeShowBookmarks = 1
" }}}
" Wrapping {{{
set linebreak
set showbreak=↳\
" toggle wrapping
nmap <silent> <F12> :let &wrap = !&wrap<CR>
" }}}
" RagTag {{{
imap <M-O> <Esc>o
imap <C-J> <Down>
let g:ragtag_global_maps = 1
imap <C-Space> <C-X><Space>
imap <C-CR> <C-X><CR>
" }}}
" 'Bubbling' {{{
nmap <C-up> [e
nmap <C-down> ]e
vmap <C-up> [egv
vmap <C-down> ]egv
" }}}
" Formatting with Par (gqip) {{{
set formatprg=par\ -req
nmap <F9> gqip
" }}}
" Pasting {{{
set paste
nnoremap p ]p
nnoremap <c-p> p
" }}}
" Macros {{{
" Execute macro "q" with space
nmap <Space> @q
" Map @ to + for more comfortable macros on DE kb layout
nmap + @
" }}}
fun! RangerChooser()
silent !ranger --choosefile=/tmp/chosenfile `[ -z '%' ] && echo -n . || dirname %`
if filereadable('/tmp/chosenfile')
exec 'edit ' . system('cat /tmp/chosenfile')
call system('rm /tmp/chosenfile')
endif
redraw!
endfun
map ,r :call RangerChooser()<CR