-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
74 lines (63 loc) · 2.34 KB
/
vimrc
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
set nocompatible
filetype on
syntax enable
set t_Co=256 tabstop=2 shiftwidth=2 softtabstop=2 backspace=2
set autochdir autoread cursorline expandtab hlsearch incsearch
set noai magic number showcmd showmatch wildmenu mouse=a
set tags=tags; fdm=marker scrolloff=3 laststatus=2
set encoding=utf-8 fileformat=unix
set fileencodings=ucs-bom,utf-8,latin1 fileencoding=utf-8
set background=light
colorscheme my256
match Search '\s\+$' "Search: Orange; ErrorMsg: Red; SpellBad: Pink
" indentation: (default at http://vimdoc.sourceforge.net/htmldoc/indent.html)
" changed: :0 (switch-case); ls (case-block)
set cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:0,=s,ls,b0,g0,hs,ps,ts,is,+s,c3,C0,/0,(2s,us,U0,w0,W0,m0,j0,J0,)20,*70,#0
" Fn keys
nnoremap <silent> <F5> :NERDTreeToggle<CR>
nnoremap <silent> <F9> :TagbarToggle<CR>
nnoremap <silent> <F10> :set nu!<CR>
" disable default C-j mapping
let g:BASH_Ctrl_j = 'off'
" space: switch window
nnoremap <Space> <C-W>w
" gtags search (search symbol and open folding)
nnoremap \ :GtagsCursor<CR>zO
" gtags next (next item in quickfix list and open folding)
nnoremap <C-N> :cn<CR>zO
" gtags prev (previous item in quickfix list and open folding)
nnoremap <C-P> :cp<CR>zO
" ctags: show list if more than one is found
nnoremap <C-]> g<C-]>
" jump between windows
nnoremap <C-H> <C-W>h
nnoremap <C-J> <C-W>j
nnoremap <C-K> <C-W>k
nnoremap <C-L> <C-W>l
" disable netrw
"let g:loaded_netrw = 1
"let g:loaded_netrwPlugin = 1
if has('persistent_undo')
set undodir=~/.vim/undodir undofile undolevels=1000 undoreload=10000
endif
function MyPluginOptions()
" Tagbar
if exists(":TagbarToggle")
set statusline=%F%m\ [%{&fenc},%{&ff}]%y%r\ %{tagbar#currenttag('%s','','')}%=%{strftime('%F\ %H:%M')}\ \|%c\|\ -%l/%L-\ %P
let g:tagbar_sort = 0
let g:tagbar_left = 1
let g:tagbar_indent = 0
autocmd FileType tagbar setlocal nocursorline nocursorcolumn
endif
" MBE
let g:miniBufExplBuffersNeeded = 1
let g:miniBufExplCycleArround = 1
endfunction
au VimEnter * call MyPluginOptions()
" autoexit if quickfix is the last window
au BufEnter * if &buftype=="quickfix" && winnr('$') == 1 | quit | endif
" remember last position
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" open quickfix window when changed
au QuickFixCmdPost [^l]* nested cwindow
au QuickFixCmdPost l* nested lwindow