• Stars
    star
    497
  • Rank 88,652 (Top 2 %)
  • Language
    Vim Script
  • Created over 13 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Vim plugin to list, select and switch between buffers.

Summary

  • Use <Leader>b (typically: \b) to open a window listing all buffers. In this window, you can use normal movement keys to select a buffer and then:

    • <ENTER> to edit the selected buffer in the previous window
    • <C-V> to edit the selected buffer in a new vertical split
    • <C-S> to edit the selected buffer in a new horizontal split
    • <C-T> to edit the selected buffer in a new tab page
  • Use gb (or <M-b>) and gB (or <M-S-b>) to flip through the most-recently used buffer stack without opening the buffer listing "drawer".

  • Use <Leader><LEFT>, <Leader><UP>, <Leader><RIGHT>, <Leader><DOWN> to split a new window left, up, right, or down, respectively, and edit the previous MRU buffer there.

Many other options are supported: (e.g. open in existing window/tab, or in the same window; preview buffer without leaving buffer listing; "pin" the buffer listing so that it is open all the time, etc. etc.)

Details

Buffergator is a plugin for listing, navigating between, and selecting buffers to edit. Upon invocation (using the command, :BuffergatorOpen or BuffergatorToggle, or the provided key mapping, <Leader>b), a "catalog" of listed buffers are displayed in a separate new window split (vertical or horizontal, based on user options; default = vertical). From this "buffer catalog", a buffer can be selected and opened in an existing window, a new window split (vertical or horizontal), or a new tab page.

Selected buffers can be "previewed", i.e. opened in a window or tab page, but with focus remaining in the buffer catalog. Even better, you can "walk" up and down the list of buffers shown in the catalog by using <C-N> (or <SPACE>) / <C-P> (or <C-SPACE>). These keys select the next/previous buffer in succession, respectively, opening it for preview without leaving the buffer catalog viewer.

The buffer opening commands follow that of NERDTree. Examples:

  • Use movement keys (h,j,k,l) to select a buffer from the list, then type <CR> or o to open it in the previous window.
  • Type 42 and <CR> or o to open buffer number 42 in the previous window.
  • You can use go to open the currently selected buffer in the previous window, but with focus remaining in the buffer catalog (42go will do the same, but will select buffer number 42).
  • You can use s to open the currently selected buffer in new vertical split. S will open the buffer in a new vertical split, but keep the focus in the buffer catalog. (42s or 42S will do the same, but will select buffer number 42)
  • You can use i to open the currently selected buffer in new horizontal split. I will open the buffer in a new vertical split, but keep the focus in the buffer catalog. (42i or 42I will do the same, but will select buffer number 42)
  • You can use t to open the currently selected buffer in new tab (42t will do the same, but will select buffer number 42).

To reduce strain on muscle-memory, the following Ctrl-P keymaps are also supported:

  • <C-V> : open in new vertical split
  • <C-S> : open in new horizontal split
  • <C-T> : open in new tab

Other key maps allow you to jump to a target buffer in an open window/split/tab page if it is already active there instead of creating a new window. Minimal management of buffers (wiping/dropping) are also provided.

Buffergator also provides a way to list tab pages and buffers associated with windows in tab pages (the "tab page catalog", which can be invoked using the command :BuffergatorTabsOpen or the provided key mapping, <Leader>to).

The buffer listing can be sorted alphabetically by filename, by full filepath, by extension followed by filename, or by most-recently used (MRU).

By default, Buffergator provides global key maps that invoke its main commands: <Leader>b to open and <Leader>B to close the buffer catalog, and <Leader>to to open and <Leader>tc to close the tab page catalog. In addition, in normal mode from any buffer, you can flip through the MRU (most-recently-used) buffer list without opening the buffer catalog by using the gb (or <M-b>) and gB (or <M-S-b>) keys, or flip through the buffers in buffer (number) order by using [b and ]b. If you prefer to map other keys, or do not want any keys mapped at all, set g:buffergator_suppress_keymaps to 1 in your $VIMRUNTIME.

[NOTE: If you have other plugins installed that have key maps that start with <Leader>b (e.g., BufExplorer, which uses <Leader>bs, <Leader>bv, etc.), then you may notice a slight delay or lag when typing the default <Leader>b to start Buffergator. In this case, you should either use another keymap for Buffergator or BufExplorer.]

Detailed usage description given in the help file, which can be viewed on-line here:

http://github.com/jeetsukumaran/vim-buffergator/blob/master/doc/buffergator.txt

Source code repository can be found here:

http://github.com/jeetsukumaran/vim-buffergator

NOTE: There are many other plugins that provide similar functionality. This plugin is very much in the "BufExplorer" and "SelectBuf" vein, in that it provides a full-window buffer "view" of the buffers. I wanted a plugin that (a) listed the loaded buffers in a (optionally-)persistant "drawer", (b) allowed me to preview buffers without leaving the drawer, and (c) allowed me to walk up and down the list of buffers, previewing them, but without leaving the drawer. None of the existing plugins did this (as far as I know), and hence I rolled out this one. The other plugins provide more functionality with respect to other operations (e.g., buffer management), that I did not have an immediate need for, so I did not incorporate it into this plugin.

More Repositories

1

vim-pythonsense

A Vim plugin that provides text objects and motions for Python classes, methods, functions, and doc strings.
Vim Script
211
star
2

vim-indentwise

A Vim plugin for indent-level based motion.
Vim Script
210
star
3

DendroPy

A Python library for phylogenetic scripting, simulation, data processing and manipulation.
Python
204
star
4

Syrupy

System Resource Usage Profiler
Python
194
star
5

vim-filebeagle

A VINE-spired (Vim Is Not Emacs) file system explorer.
Vim Script
162
star
6

vim-markology

Vim mark visualization, navigation and management
Vim Script
72
star
7

vim-buffersaurus

Vim plugin to search, index, and navigate buffer content using regular expression patterns.
Vim Script
42
star
8

cmake-pandocology

Compile documents using Pandoc under the CMake build system
CMake
38
star
9

vim-nefertiti

Dark-background Vim Color Scheme with Dynamic Brightness Control (GUI-only)
Vim Script
31
star
10

fuzzysnake

Find, list, filter, and edit or otherwise act on files from the terminal using fuzzy-matching or regular expressions.
Python
28
star
11

GitCommandsDashboardWidget

OS X Dashboad Widget listing Git commands and usage.
JavaScript
18
star
12

vim-filesearch

Vim plugin for searching the local filesystem for files by name or content, using glob or regular expression patterns.
Vim Script
14
star
13

vim-gazetteer

Semantic location information for Vim.
Vim Script
10
star
14

YonderGit

Simplified Git Remote Repository Management
Python
9
star
15

vim-python-indent-black

Vim Script
8
star
16

quickfix-rex.nvim

Lua
8
star
17

delineate

Package for species delimitation analysis
Python
7
star
18

promptitude

A shell prompt with an attitude: enhanced (BASH) shell prompt with VCS (Git) branch and status information.
Shell
7
star
19

telescope-grab-lines.nvim

Lua
6
star
20

ToggleCrypt

AES/Rijndael encryption/decryption of files; provides for temporary unlocking of files for editing.
Python
6
star
21

2015-SSB-AnnArbor-Biogeography

R
5
star
22

telescope-rtp

Lua
5
star
23

telescope-buffer-lines.nvim

Find lines from across all open buffers and insert selected into current buffer.
Lua
5
star
24

GDBCommandsDashboardWidget

OS X Dashboard Widget for GNU Debugger Commands
JavaScript
5
star
25

obsidian-bibliosidian

TypeScript
5
star
26

obsidian-impresario

TeX
5
star
27

treeshrew

C++
3
star
28

Archipelago1

Simulation of island diversification patterns using a spatially-explicit birth-death branching process in a virtual landscape with islands, carrying capacities, different dispersal probabilities, etc.
Python
3
star
29

distriscopia

Probability distribution visualization
JavaScript
3
star
30

vim-linearly

A Vim plugin providing operators to manipulate line units: split text into natural language sentence lines or on arbitrary regular expressions; join lines with optional delimiters.
Vim Script
2
star
31

PySeqGen

Wrapper around Seq-Gen molecular sequence generator
Python
2
star
32

tutorials_cheatsheets

Collection of cheatsheets and tutorials for various software and tools
R
2
star
33

jdalias

Jump to Aliased Directory: An aliased-directory command-line navigation system. Manages a set of user-specified aliases pointing to directories tha allow the user to "jump" from one directory to another using very quickly and efficiently.
Python
2
star
34

Ginkgo

Forward-time spatially-explicit agent-based simulations of phylogeographic history over dynamic landscapes and environments.
C++
2
star
35

possum

Multi-population molecular population genetic summary statistic calculation utility
Shell
1
star
36

ctrlp-pythonic.vim

Python code navigation extension for the CtrlP Vim plugin
Vim Script
1
star
37

archipelago

R
1
star
38

obsidian-vault-configuration

JavaScript
1
star
39

pikun

An information theoretic toolkit for analysis and visualization of species delimitation model space.
Python
1
star
40

nexmlvalidator

Stand-alone Self-contained NeXML Validation Utility
Java
1
star
41

vim-pandoctitude

Equipping Your Vim With a Pandoc Attitude!
Vim Script
1
star
42

piikun

Species delimitation partition model space analysis and visualization.
Python
1
star
43

Arroyo-of-Sun-and-Moon

CSS
1
star