https://github.com/kizza/vim-reorder-buffers
Reorder you vim mutable vim buffers
https://github.com/kizza/vim-reorder-buffers
Last synced: 27 days ago
JSON representation
Reorder you vim mutable vim buffers
- Host: GitHub
- URL: https://github.com/kizza/vim-reorder-buffers
- Owner: kizza
- Created: 2022-07-20T12:50:36.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-23T03:59:11.000Z (almost 3 years ago)
- Last Synced: 2025-02-17T04:41:25.304Z (4 months ago)
- Language: TypeScript
- Size: 628 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reorder your vim buffers
[](https://github.com/kizza/vim-reorder-buffers/actions/workflows/tests.yml)The vim buffer list is immutable - and there's lots of context to how and why. Ultimately however there are numerous reasons where you want to move them around.
This plugin achieves reordering while adhering to the immutability - specifically it quite literally closes buffers and re-opens them in such a way as to be seamless (pretty much) for most use cases. Specifically I'm using [vim-buftabline](https://github.com/ap/vim-buftabline) below to visualise my buffers - and I wanted to be able to rearrange them from time to time.

## How to use it
The plugin provides two commands `:ShiftBufferLeft` and `:ShiftBufferRight`. These two do essentially what you expect.
**Bindings**
For the best experience you may wish to add some bindings to call these. I find that _leaning into_ the natural `gt` and `gT` tab navigation works well (with a prefixed ``)
```vim
nnoremap gT :ShiftBufferLeft
nnoremap gt :ShiftBufferRight
```**Auto-saving buffers**
Given the plugin closes buffers to reopen them... unsaved buffers present a problem. By default the plugin will warn (and do nothing) if there are unsaved buffers, or you can set the following to auto-save them by default.
```
let g:reorder_buffers_allow_auto_save = v:true
```