diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-08-10 23:15:04 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-08-10 23:15:04 +0200 |
commit | 540268d618627079c9b958a955b586e1888b46a8 (patch) | |
tree | 1a22a5feb457135178b9d4fe8b6c1755f5ca66bc /.config/nvim/lua/core/bufferline.lua | |
parent | e79bd3273f58ba38e8fcd716090b89326791afbb (diff) |
Major refactor of nvim
Diffstat (limited to '.config/nvim/lua/core/bufferline.lua')
-rw-r--r-- | .config/nvim/lua/core/bufferline.lua | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/.config/nvim/lua/core/bufferline.lua b/.config/nvim/lua/core/bufferline.lua index d4e4b4f..6306614 100644 --- a/.config/nvim/lua/core/bufferline.lua +++ b/.config/nvim/lua/core/bufferline.lua @@ -1,28 +1,20 @@ -vim.api.nvim_set_keymap("n", "<S-x>", ":BufferClose<CR>", { noremap = true, silent = true }) -vim.api.nvim_set_keymap("n", "<S-l>", ":BufferNext<CR>", { noremap = true, silent = true }) -vim.api.nvim_set_keymap("n", "<S-h>", ":BufferPrevious<CR>", { noremap = true, silent = true }) -vim.api.nvim_set_keymap("n", "<leader>c", ":BufferClose<CR>", { noremap = true, silent = true }) +local M = {} -O.plugin.which_key.mappings["b"] = { - name = "Buffers", - j = { "<cmd>BufferPick<cr>", "jump to buffer" }, - f = { "<cmd>Telescope buffers<cr>", "Find buffer" }, - w = { "<cmd>BufferWipeout<cr>", "wipeout buffer" }, - e = { - "<cmd>BufferCloseAllButCurrent<cr>", - "close all but current buffer", - }, - h = { "<cmd>BufferCloseBuffersLeft<cr>", "close all buffers to the left" }, - l = { - "<cmd>BufferCloseBuffersRight<cr>", - "close all BufferLines to the right", - }, - D = { - "<cmd>BufferOrderByDirectory<cr>", - "sort BufferLines automatically by directory", - }, - L = { - "<cmd>BufferOrderByLanguage<cr>", - "sort BufferLines automatically by language", - }, -} +M.config = function() + options.builtin.bufferline = { + active = true, + keymap = { + normal_mode = { + ["<S-l>"] = ":BufferNext<CR>", + ["<S-h>"] = ":BufferPrevious<CR>", + }, + }, + } +end + +M.setup = function() + local keymap = require "keymappings" + keymap.append_to_defaults(options.builtin.bufferline.keymap) +end + +return M |