File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -360,6 +360,16 @@ function! buffet#bswitch(index)
360360 execute ' silent buffer ' . buffer_id
361361endfunction
362362
363+ function ! buffet#bnext ()
364+ let next_buffer_id = (s: last_current_buffer_id+ 1 )% len (s: buffer_ids )
365+ call buffet#bswitch (next_buffer_id)
366+ endfunction
367+
368+ function ! buffet#bprev ()
369+ let next_buffer_id = (s: last_current_buffer_id- 1 )
370+ call buffet#bswitch (next_buffer_id)
371+ endfunction
372+
363373" inspired and based on https://vim.fandom.com/wiki/Deleting_a_buffer_without_closing_the_window
364374function ! buffet#bwipe (bang , buffer )
365375 let btarget = s: GetBuffer (a: buffer )
Original file line number Diff line number Diff line change @@ -243,6 +243,9 @@ for s:n in range(0, g:buffet_max_plug)
243243 execute printf (" noremap <silent> <Plug>BuffetSwitch(%d) :call buffet#bswitch(%d)<cr>" , s: n , s: n )
244244endfor
245245
246+ noremap <silent> <Plug> BuffetNext :call buffet#bnext()<cr>
247+ noremap <silent> <Plug> BuffetPrev :call buffet#bprev()<cr>
248+
246249command ! - bang -complete =buffer -nargs =? Bw call buffet#bwipe (<q-bang> , <q-args> )
247250command ! - bang -complete =buffer -nargs =? Bonly call buffet#bonly (<q-bang> , <q-args> )
248251
You can’t perform that action at this time.
0 commit comments