1 " vim: foldmethod=marker:foldlevel=0
10 set mouse="" " if Vim is compiled with mouse support
12 set viminfo='100,<50,s10,f1,%,n~/secure/vim/info
13 set viewdir=~/secure/vim/view
15 set directory=~/secure/vim/tmp
16 set undodir=~/secure/vim/undo
26 set backspace=indent,eol
28 set highlight-=v:Visual
34 set listchars=trail:·,tab:>→,nbsp:% ",eol:¶
36 set completeopt-=preview
37 set diffopt+=indent-heuristic,algorithm:histogram
42 highlight ExtraWhitespace ctermbg=green ctermfg=blue
43 match ExtraWhitespace /\s\+$/
53 set wildmode=longest:list
54 set tags=.tags/**/tags;
55 set wildignore=**/.git,**/.tags
60 map <F4> :nohlsearch<CR>:MarkClear<CR>
69 autocmd BufWinEnter * normal zR
70 highlight FoldColumn ctermfg=cyan ctermbg=black
71 highlight CursorColumn ctermfg=cyan ctermbg=red
76 set statusline=%F\ %m%r%h%w%q%k
77 set statusline+=%{len(getqflist())?'[Q]':''}
78 set statusline+=%{len(getloclist(0))?'[L]':''}
80 set statusline+=%n\ %#Question#%Y
81 set statusline+=%#DiffChange#%{strlen(&fenc)?&fenc:&enc}%{&bomb?'-bom':''}\ %{&ff}
82 set statusline+=%#DiffAdd#%l/%L
83 set statusline+=%#Todo#%c%V:0x%B
84 set statusline+=%#Comment#%o
85 set statusline+=%#Error#%{LintStatus()}
86 set statusline+=%*\ %P
88 function! LintStatus() " it is overrided in ftplugins
94 autocmd BufWinLeave *.* mkview
95 autocmd BufWinEnter *.* silent loadview
104 nmap <leader>- <C-w>\|<C-w>_
105 nmap <leader>= <C-w>=
106 nmap <Del> :close<CR>
107 autocmd VimResized * wincmd =
110 " Tmux window naming {{{
113 autocmd BufEnter * let &titlestring = expand("%:t")
117 nmap <F7> :Gvsplit <C-R><C-W><CR>zR
118 nmap <F9> :diffupdate<CR>:syntax off<CR>:syntax on<CR>
121 " *-lists indentation and formatting {{{
123 set formatlistpat=^\\s*\\*\ \\s*
124 set formatoptions+=onj
128 set spelllang=ru,en_gb
129 highlight SpellBad cterm=inverse ctermfg=red ctermbg=black
130 highlight SpellLocal term=reverse ctermfg=red ctermbg=cyan
133 " Unimpaired-like textwidth switching {{{
134 nmap [ob :set textwidth=72<CR>
135 nmap ]ob :set textwidth=0<CR>
142 imap <F1> <C-O>:help!<CR>
148 let g:sh_no_error = 1
152 nmap <space> f<space>
153 vmap <space> I<space><ESC>gv
157 nmap <leader>p "_diwP
159 nnoremap <leader>d "_d
160 vnoremap <leader>d "_d
168 imap <C-b> <C-x><C-o>
169 nmap <F2> :set wrap!<CR>:set wrap?<CR>
170 nmap <Tab> :buffers<CR>:b<Space>
171 nmap <silent> <Home> :registers<CR>
172 nmap <leader>' yiwciw"<C-r>""<ESC>
173 nmap <leader>h1 yypVr=o
174 nmap <leader>sc 024i-<ESC>a >8 <ESC>24a-<ESC>
175 nmap <leader><C-]> :vertical wincmd ]<CR>
180 command! -bar -nargs=? -bang Tmp :silent vnew<bang>|setlocal buftype=nofile bufhidden=hide noswapfile buflisted filetype=<args> modifiable