diff options
Diffstat (limited to 'vim/init')
-rw-r--r-- | vim/init/config.vim | 4 | ||||
-rw-r--r-- | vim/init/keymaps.vim | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/vim/init/config.vim b/vim/init/config.vim index 74cbd39..4676942 100644 --- a/vim/init/config.vim +++ b/vim/init/config.vim | |||
@@ -188,11 +188,13 @@ augroup InitFileTypes | |||
188 | endif | 188 | endif |
189 | 189 | ||
190 | " Fold for heading and the following contents | 190 | " Fold for heading and the following contents |
191 | let hash_num = matchstr(getline(v:lnum), '^#\+') | 191 | let hash_num = matchstr(getline(v:lnum), '^\zs#\+\ze\s') |
192 | if !empty(hash_num) | 192 | if !empty(hash_num) |
193 | let foldlevel = g:markdown_apply_heading_level ? len(hash_num) - 1 : 1 | 193 | let foldlevel = g:markdown_apply_heading_level ? len(hash_num) - 1 : 1 |
194 | " HEADING | 194 | " HEADING |
195 | return len(hash_num) == 1 ? 0 : '>'.foldlevel | 195 | return len(hash_num) == 1 ? 0 : '>'.foldlevel |
196 | elseif match(getline(v:lnum), '^----') != -1 | ||
197 | return "<" | ||
196 | else | 198 | else |
197 | " Contents | 199 | " Contents |
198 | return "=" | 200 | return "=" |
diff --git a/vim/init/keymaps.vim b/vim/init/keymaps.vim index c0af8c8..bf3d7ab 100644 --- a/vim/init/keymaps.vim +++ b/vim/init/keymaps.vim | |||
@@ -92,6 +92,11 @@ nnoremap gF :e <cfile><CR> | |||
92 | xnoremap iq i" | 92 | xnoremap iq i" |
93 | xnoremap aq a" | 93 | xnoremap aq a" |
94 | 94 | ||
95 | nnoremap ze zszH | ||
96 | |||
97 | nnoremap 0 ^ | ||
98 | nnoremap ^ 0 | ||
99 | |||
95 | 100 | ||
96 | " READLINE {{{ | 101 | " READLINE {{{ |
97 | 102 | ||
@@ -495,8 +500,9 @@ function! CloseBufferSafely() | |||
495 | tabclose | 500 | tabclose |
496 | else | 501 | else |
497 | " Switch to proper buffer | 502 | " Switch to proper buffer |
498 | let next_buf = get(t:bufs, bufnr('#')) ? bufnr('#') : filter(t:bufs, 'v:val != '..bufnr)[0] | 503 | let next_buf = get(t:bufs, bufnr('#')) ? bufnr('#') : filter(t:bufs, 'v:val != '..bufnr)[-1] |
499 | exe "b "..next_buf | 504 | exe "b "..next_buf |
505 | " exe "buffer ".g:lastbuffer | ||
500 | call filter(t:bufs, 'v:val != '..bufnr) | 506 | call filter(t:bufs, 'v:val != '..bufnr) |
501 | endif | 507 | endif |
502 | 508 | ||