GithubHelp home page GithubHelp logo

mong8se / buffish.nvim Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 56 KB

A buffer switcher in the spirit of dirvish or vinegar.

License: GNU General Public License v3.0

Lua 90.13% Vim Script 9.87%
nvim lua neovim neovim-plugin nvim-lua

buffish.nvim's Introduction

Buffish

A buffer switcher in the spirit of dirvish or vinegar.

Opens a buffer list in the current window, so you can select a buffer to display in the same window.

As you switch buffers it sets the alternate buffer to the previous buffer so you can always swap between the last to buffers with c-^.

Usage

Map some key to :Buffish<CR> or to require("buffish").open() or type it.

If you want to use shortcuts (see below) also map a key to require("buffish.shortcuts").follow()

What do I see?

The list of filenames in open buffers.

Why only show the filename? Because it's quicker for visual identification.

If more than one filename matches, then it will include as much of the path that is necessary to make them unique. For example, if you have this/thing.txt and long/path/that/thing.txt open, it will show this/thing.txt and that/thing.txt. The full path is still available if you switch to visual mode, or yank the line.

It's sorted with the most recently used file at the top (which is the one you're leaving) to least recently used at the bottom.

It automatically starts with the cursor on the 2nd line (if there is one), so you can easily switch back and forth between two buffers.

What do I push?

Mappings in the list:

  1. <CR> to switch to the buffer
  2. dd to bd that buffer
  3. q to close without switching
  4. s to open that buffer in a split either horizontally or vertically, depending on how much space you have
  5. a to assigned a shortcut to this buffer (next key you type will be shortcut)
  6. r to remove the shortcut from that buffer

Also the line contains the full path so you can also yy to get the full path to the file, or use visual mode and yank a portion the normal way, etc.

Shortcuts

Shortcuts are meant to be mnemonic like m, v, c to go to your model, view, and controller respectively, or positional like q, w,e, r, etc.

Whatever helps you connect your fingers to particular buffers.

Map a key to require("buffish.shortcuts").follow()

After you hit the mapped follow key, hit the key for the shortcut that you assigned.

Aren't there a million of these already?

Probably

TODO

TODO: Will it even work on windows? Thanks to https://github.com/IRooc

TODO: Add signs or line number or various things from :ls maybe

TODO: Add configuration?

TODO: Tests?

buffish.nvim's People

Contributors

irooc avatar mong8se avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

irooc

buffish.nvim's Issues

Windows error on this line, which results in showing full path in bufferlist

Hi it seems to basically work fine on windows, only that it always shows full paths on windows. (Which for me is fine btw)

it is probably caused by a startup error on this line:
https://github.com/mong8se/buffish.nvim/blob/b9701bc7dd912cf1b5633043168192d1e2bd35b4/plugin/buffish.vim#LL20C88-L20C88

Error detected while processing C:\Users\username\AppData\Local\nvim-data\site\pack\packer\start\buffish.nvim\plugin\buffish.vim:
line   20:
E5107: Error loading lua [string ":lua"]:1: invalid escape sequence near '';C:'

Still using it and it is small and clean enough for my purposes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.