diff --git a/autoload/airline/extensions/tabline/buffers.vim b/autoload/airline/extensions/tabline/buffers.vim index 728b7ad..4f14a9b 100644 --- a/autoload/airline/extensions/tabline/buffers.vim +++ b/autoload/airline/extensions/tabline/buffers.vim @@ -172,6 +172,14 @@ function! s:select_tab(buf_index) endif endfunction +function! s:jump_to_tab(offset) + let l = s:current_visible_buffers + let i = index(l, bufnr('%')) + if i > -1 + exec 'b!' . l[float2nr(fmod(i + a:offset, len(l)))] + endif +endfunction + if s:buffer_idx_mode noremap AirlineSelectTab1 :call select_tab(0) noremap AirlineSelectTab2 :call select_tab(1) @@ -182,4 +190,6 @@ if s:buffer_idx_mode noremap AirlineSelectTab7 :call select_tab(6) noremap AirlineSelectTab8 :call select_tab(7) noremap AirlineSelectTab9 :call select_tab(8) + noremap AirlineSelectPrevTab :call jump_to_tab(-v:count1) + noremap AirlineSelectNextTab :call jump_to_tab(v:count1) endif