Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
Add wrapper for quickfix mappings.
Browse files Browse the repository at this point in the history
  • Loading branch information
albertosantini committed Mar 8, 2016
1 parent 8f77679 commit 18ffca0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plugin/mappings.vim
@@ -1,6 +1,15 @@
" Util mappings
nnoremap <f4> :cw<cr>:cn<cr>
nnoremap <S-f4> :cw<cr>:cp<cr>

function! <SID>TryCatch(TryCmd, CatchCmd)
try
execute a:TryCmd
catch /^Vim\%((\a\+)\)\=:E553/
execute a:CatchCmd
endtry
endfunction

nnoremap <f4> :cw<cr>:call <SID>TryCatch("cn", "cfirst")<cr>
nnoremap <S-f4> :cw<cr>:call <SID>TryCatch("cp", "clast")<cr>
nnoremap <f6> :bn<cr>
nnoremap <S-f6> :bp<cr>
nnoremap <Leader>l :ls<cr>
Expand Down

0 comments on commit 18ffca0

Please sign in to comment.