summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua/plugins/barbar.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/plugins/barbar.lua')
-rw-r--r--.config/nvim/lua/plugins/barbar.lua77
1 files changed, 77 insertions, 0 deletions
diff --git a/.config/nvim/lua/plugins/barbar.lua b/.config/nvim/lua/plugins/barbar.lua
new file mode 100644
index 0000000..7b6c69d
--- /dev/null
+++ b/.config/nvim/lua/plugins/barbar.lua
@@ -0,0 +1,77 @@
1return {
2 {
3 "romgrk/barbar.nvim",
4 dependencies = {
5 'lewis6991/gitsigns.nvim',
6 "nvim-tree/nvim-web-devicons"
7 },
8 init = function()
9 vim.g.barbar_auto_setup = false -- disable auto-setup
10 local map = require("helpers.keys").map
11
12 -- move to previous/next
13 map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', "switch to previous buffer")
14 map('n', '<A-.>', '<Cmd>BufferNext<CR>', "switch to next buffer")
15
16 -- re-order to previous/next
17 map('n', '<A-e>', '<Cmd>BufferMovePrevious<CR>', "move buffer back")
18 map('n', '<A-i>', '<Cmd>BufferMoveNext<CR>', "move buffer forward")
19
20 -- goto buffer in position...
21 map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>')
22 map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>')
23 map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>')
24 map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>')
25 map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>')
26 map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>')
27 map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>')
28 map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>')
29 map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>')
30 map('n', '<A-0>', '<Cmd>BufferLast<CR>')
31
32 -- pin/unpin buffer
33 map('n', '<A-p>', '<Cmd>BufferPin<CR>', "pin buffer")
34 -- close buffer
35 map('n', '<A-c>', '<Cmd>BufferClose<CR>', "close buffer")
36 -- magic buffer-picking mode
37 map('n', '<leader>dg', '<Cmd>BufferPick<CR>', "buffer picking mode")
38 -- sort automatically by...
39 map('n', '<Leader>db', '<Cmd>BufferOrderByBufferNumber<CR>', "sort buffers by number")
40 map('n', '<Leader>dd', '<Cmd>BufferOrderByDirectory<CR>', "sort buffers by directory")
41 map('n', '<Leader>dl', '<Cmd>BufferOrderByLanguage<CR>', "sort buffers by language")
42 map('n', '<Leader>dw', '<Cmd>BufferOrderByWindowNumber<CR>', "sort buffers by window number")
43 end,
44 opts = {
45 animation = false,
46 auto_hide = true,
47 tabpages = true,
48 closable = true,
49 clickable = false,
50 icons = {
51 diagnostics = {
52 [vim.diagnostic.severity.ERROR] = {enabled = true, icon = '❌'},
53 [vim.diagnostic.severity.WARN] = {enabled = false},
54 [vim.diagnostic.severity.INFO] = {enabled = false},
55 [vim.diagnostic.severity.HINT] = {enabled = true},
56 },
57 filetype = {
58 custom_colors = false,
59 enabled = true,
60 },
61 separator = { left = '▎', right = ''},
62 modified = { button = ''},
63 pinned = { button = '', filename = true, separator = { right = ''}},
64 },
65
66 insert_at_end = false,
67 insert_at_start = false,
68
69 maximum_padding = 1,
70 minimum_padding = 1,
71 maximum_length = 30,
72 semantic_letters = true,
73 letters = 'arstneoidhqwfpluy;zxcvkmARSTNEOIDHQWFPLUYZXCVKM',
74 no_name_title = nil,
75 },
76 },
77}