dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 23d841a8525989d402d21df3866e01fa238dba11
parent 4abde0061a34f30d6a972f1ece0cd97bb51e3c32
Author: Alex Balgavy <a.balgavy@gmail.com>
Date:   Sun,  2 Aug 2020 14:09:49 +0200

vim: section mappings for bib files

Former-commit-id: dcd9c9a142e3d185f7b4eda6c1d8a7911f83f182
Diffstat:
Mvim/after/ftplugin/bib.vim | 32++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+), 0 deletions(-)

diff --git a/vim/after/ftplugin/bib.vim b/vim/after/ftplugin/bib.vim @@ -1,2 +1,34 @@ command! BibOpenFile exe 'call system("open '.findfile(expand("<cfile>")).'")' nnoremap go :BibOpenFile<CR> + +function! s:NextSection(backwards, visual) + if a:visual + normal! gv + endif + let pattern = '\v(^\@[a-zA-Z]+\{)|%^|%$' + execute 'silent normal! ' . (a:backwards ? '?' : '/') . pattern . (a:backwards ? '?' : '/') . "b\r" +endfunction + +noremap <script> <buffer> <silent> ]] + \ :call <SID>NextSection(0, 0)<cr> + +noremap <script> <buffer> <silent> [[ + \ :call <SID>NextSection(1, 0)<cr> + +noremap <script> <buffer> <silent> ][ + \ :call <SID>NextSection(0, 0)<cr> + +noremap <script> <buffer> <silent> [] + \ :call <SID>NextSection(1, 0)<cr> + +vnoremap <script> <buffer> <silent> ]] + \ :<c-u>call <SID>NextSection(0, 1)<cr> + +vnoremap <script> <buffer> <silent> [[ + \ :<c-u>call <SID>NextSection(1, 1)<cr> + +vnoremap <script> <buffer> <silent> ][ + \ :<c-u>call <SID>NextSection(0, 1)<cr> + +vnoremap <script> <buffer> <silent> [] + \ :<c-u>call <SID>NextSection(1, 1)<cr>