-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc.local
59 lines (51 loc) · 1.5 KB
/
.vimrc.local
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
"" ESC
imap jj <ESC>
""paste toggle
set pastetoggle=<F5>
set showmode
" NERDtree - http://vim.sourceforge.net/scripts/script.php?script_id=1658
nnoremap <silent> <Leader>a :execute ':silent! NERDTreeToggle'<cr>
fun! InitNERDTree()
let isNERDTree = (&ft == 'nerdtree')
let dir = (argv() != []) ? fnamemodify(argv()[0], ':h') : expand('%:p:h')
sleep 1m
if (isNERDTree)
:execute ':NERDTree ' . dir
:wincmd h
else
:execute ':NERDTree ' . dir
:wincmd l
endif
:only
endfun
au vimenter * call InitNERDTree()
" YCM Options
let g:ycm_key_list_select_completion = ['<TAB>']
let g:ycm_key_list_previous_completion = ['<S-TAB>']
let g:ycm_auto_trigger = 1
" Markdown preview option
let vim_markdown_preview_github=1
let vim_markdown_preview_browser='Google Chrome'
let vim_markdown_preview_toggle=3
" Pymode options
let g:pymode_options_colorcolumn=0
nnoremap <C-W>O :call MaximizeToggle()<CR>
nnoremap <C-W>o :call MaximizeToggle()<CR>
nnoremap <C-W><C-O> :call MaximizeToggle()<CR>
function! MaximizeToggle()
if exists("s:maximize_session")
exec "source " . s:maximize_session
call delete(s:maximize_session)
unlet s:maximize_session
let &hidden=s:maximize_hidden_save
unlet s:maximize_hidden_save
else
let s:maximize_hidden_save = &hidden
let s:maximize_session = tempname()
set hidden
exec "mksession! " . s:maximize_session
only
endif
endfunction
" Search replace confirm
vnoremap <C-r> "hy:%s/<C-r>h//gc<left><left><left>"