Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/riddlew/swap-split.nvim

Swaps your current split with another split
https://github.com/riddlew/swap-split.nvim

Last synced: about 2 months ago
JSON representation

Swaps your current split with another split

Awesome Lists containing this project

README

        

# swap-split.nvim

A plugin for NVIM to help you easily swap your split buffers.

![Demo Video](./screenshots/demo.gif)

## Installation

Install using your favorite package manager.

Packer:
`use 'xorid/swap-split.nvim'`

## Configuration

While it's not required to use swap-split, you can call the setup funciton if you wish to make any changes to the default settings. Currently, there is only one option, which is the filetypes you want to ignore.

```lua
-- Default settings
require("swap-split").setup({
ignore_filetypes = {
"NvimTree"
}
})
```

### Keybinds

The swap function is unbound by default. You can either bind it to the command `:SwapSplit` or as a lua call `require('swap-split').swap()`

Vimscript:
```
nnoremap S SwapSplit
" -- or --
nnoremap S lua require("swap-split").swap()
```

Lua:
```lua
local map = vim.api.nvim_set_keymap
map('n', 'S', 'SwapSplit', { noremap = true })
-- or --
local map = vim.api.nvim_set_keymap
map('n', 'S', 'lua require("swap-split").swap()', { noremap = true })
```

### Selector Color
Customize this by setting the color of the highlight group `SwapSplitStatusLine`.

For example:

`hi SwapSplitStatusLine guifg=#000000 fuibg=#ff8383`