Skip to content

Commit

Permalink
Update README and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nat-418 committed Oct 8, 2022
1 parent aa94c6f commit fe20d5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ bufala.nvim
![Some tasty bufala](./bufala.jpg)

Bufala is a simple Neovim plugin that makes working with buffer windows easier.
It pulls out the "tiling window manager for buffers" concept from my
It pulls out the "tiling window manager for buffer windows" concept from my
[dbm.nvim](https://github.com/nat-418/dbm.nvim) plugin and refines it,
shipping only one command:

* `:Bufala {subcommand} {arguments...}`

There are a few subcommands:

* `{count} cycle` moves through buffers with an optional count.
* `focus` swaps the current buffer with the first or main buffer window.
* `split {direction} {target}` opens a new split with an optional
* `{count} cycle` moves through buffer windows with an optional count.
* `focus` swaps the current buffer window with the first or main buffer window.
* `split {direction} {target}` opens a new buffer window with an optional
direction and target. Valid directions are up, down, left, and right.
If no direction is given, Bufala will either abort or split based on
the `layout` configured in the `setup` function (see below).
Expand Down Expand Up @@ -42,10 +42,10 @@ Configuration
Bufala allows for the optional configuration of a default layout for windows
and splits in the `setup` function. These layouts are clones from suckless'
[dwm](https://dwm.suckless.org/). If you prefer the manual approach to
getting everything just right, using sessions, etc. you might not care
to use a layout. The layouts work well for cases where you want a more
fluid, dynamic experience and not really think about where things need
to go.
getting everything just right by placing each window individually, you
might not care to use a layout. The layouts work well for cases where you
want a more fluid, dynamic experience and not really think about where each
buffer window needs to go.

Currently implemented layouts are:

Expand Down
10 changes: 5 additions & 5 deletions lua/bufala.lua
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
-- Bufala is a Neovim plugin designed to make buffers more ergonomic.
-- Bufala is a Neovim plugin designed to make buffer windows more ergonomic.
-- Bufala wraps many of the more arcane <C-w> commands in functions
-- that, if nothing else, suit the author's use-case. Bufala is a
-- refinement of the buffer management in dbm.nvim, itself inspired
-- by tiling window managers.
-- refinement of the buffer window management in dbm.nvim, itself inspired
-- by tiling window managers like suckless' dwm.

M = {}
M.state = {}
M.state.layout = nil -- implemented layouts are stack, row, spiral, and dwindle.
M.state.last_split = nil

-- Go to the next buffer on screen in order of creation
-- Go to the next buffer window on screen in order of creation
M.cycle = function(count)
if count == nil then count = '' end
return vim.cmd(count .. ' wincmd w')
end

-- Swap the current buffer with the first / main buffer
-- Swap the current buffer window with the first / main buffer window
M.focus = function()
local a_buffer_number = vim.fn.bufnr()

Expand Down

0 comments on commit fe20d5e

Please sign in to comment.