From c87803a7b6a8e4a9886c6536839ac88f1f7db585 Mon Sep 17 00:00:00 2001 From: Markus Ullmann Date: Wed, 2 Aug 2023 00:49:24 +0200 Subject: [PATCH] Add romgrk/barbar.nvim plugin --- lua/custom/plugins/barbar.lua | 16 +++++++++++++ lua/keymaps.lua | 44 +++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 lua/custom/plugins/barbar.lua diff --git a/lua/custom/plugins/barbar.lua b/lua/custom/plugins/barbar.lua new file mode 100644 index 00000000..c505bd81 --- /dev/null +++ b/lua/custom/plugins/barbar.lua @@ -0,0 +1,16 @@ +return { + {'romgrk/barbar.nvim', + dependencies = { + 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status + 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons + }, + init = function() vim.g.barbar_auto_setup = false end, + opts = { + -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: + animation = true, + -- insert_at_start = true, + -- …etc. + }, + version = '^1.0.0', -- optional: only update when a new 1.x version is released + }, +} diff --git a/lua/keymaps.lua b/lua/keymaps.lua index f3b90838..f6d5757d 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -5,3 +5,47 @@ map({"n", "i", "v"}, "", ":wincmd k", {desc = "Select upper split"}) map({"n", "i", "v"}, "", ":wincmd j", {desc = "Select lower split"}) map({"n", "i", "v"}, "", ":wincmd h", {desc = "Select left split"}) map({"n", "i", "v"}, "", ":wincmd l", {desc = "Select right split"}) + +local map = vim.api.nvim_set_keymap +local opts = { noremap = true, silent = true } + +-- Move to previous/next +map('n', '', 'BufferPrevious', opts) +map('n', '', 'BufferNext', opts) +-- Re-order to previous/next +map('n', '', 'BufferMovePrevious', opts) +map('n', '>', 'BufferMoveNext', opts) +-- Goto buffer in position... +map('n', '', 'BufferGoto 1', opts) +map('n', '', 'BufferGoto 2', opts) +map('n', '', 'BufferGoto 3', opts) +map('n', '', 'BufferGoto 4', opts) +map('n', '', 'BufferGoto 5', opts) +map('n', '', 'BufferGoto 6', opts) +map('n', '', 'BufferGoto 7', opts) +map('n', '', 'BufferGoto 8', opts) +map('n', '', 'BufferGoto 9', opts) +map('n', '', 'BufferLast', opts) +-- Pin/unpin buffer +map('n', '', 'BufferPin', opts) +-- Close buffer +map('n', '', 'BufferClose', opts) +-- Wipeout buffer +-- :BufferWipeout +-- Close commands +-- :BufferCloseAllButCurrent +-- :BufferCloseAllButPinned +-- :BufferCloseAllButCurrentOrPinned +-- :BufferCloseBuffersLeft +-- :BufferCloseBuffersRight +-- Magic buffer-picking mode +map('n', '', 'BufferPick', opts) +-- Sort automatically by... +map('n', 'bb', 'BufferOrderByBufferNumber', opts) +map('n', 'bd', 'BufferOrderByDirectory', opts) +map('n', 'bl', 'BufferOrderByLanguage', opts) +map('n', 'bw', 'BufferOrderByWindowNumber', opts) + +-- Other: +-- :BarbarEnable - enables barbar (enabled by default) +-- :BarbarDisable - very bad command, should never be used