caenrique/swap-buffers.nvim

github github
buffers plugin
star 12
stars
alert-circle 0
open issues
users 1
subscribers
git-branch 0
forks
CREATED

2021-07-30

UPDATED

2 months ago

packer

require('packer').startup(function()
  use 'caenrique/swap-buffers.nvim'
end)

paq

require "paq" { 
  'caenrique/swap-buffers.nvim'
}

Lua plugin to swap buffers easily between split windows without changing the window layout

How to use

call the lua function swap_buffers giving it on of h j k l as a parameter:

nnoremap <C-h> <cmd>lua require('swap-buffers').swap_buffers('h')<CR>

This will map Ctrl-h to swap the current buffer with the one on the left. The same can be done for right, top and bottom.

Configuration

Default values:

require('swap-buffers').setup({
  ignore_filetypes = {'NvimTree'}
})

Installation

Using packer.nvim

require('packer').startup {
  use {"caenrique/swap-buffers.nvim"}
}