Skip to content

Instantly share code, notes, and snippets.

@jameswritescode
Created May 9, 2019 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameswritescode/452c64861898e8b3c8f66ca06ad7708f to your computer and use it in GitHub Desktop.
Save jameswritescode/452c64861898e8b3c8f66ca06ad7708f to your computer and use it in GitHub Desktop.
nnoremap <silent> H :call <sid>tabline_control('tabN', 'bp')<cr>
nnoremap <silent> L :call <sid>tabline_control('tabn', 'bn')<cr>
function! s:tabline_control(tab_cmd, buf_cmd) abort
let a:tabnrs = []
tabdo call extend(a:tabnrs, [tabpagenr()])
exec len(a:tabnrs) > 1 ? a:tab_cmd : a:buf_cmd
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment