diff --git a/neovim/.config/nvim/lua/warrenhood/keybinds.lua b/neovim/.config/nvim/lua/warrenhood/keybinds.lua index 0b760c8..a61b584 100644 --- a/neovim/.config/nvim/lua/warrenhood/keybinds.lua +++ b/neovim/.config/nvim/lua/warrenhood/keybinds.lua @@ -3,10 +3,9 @@ local function map(m, k, v, opts) if not opts['silent'] then opts['silent'] = true end - vim.keymap.set(m, k, v, opts) + vim.keymap.set(m, k, v, opts) end - -- Save and Quit map('n', '', ':wq') map('i', '', ':wq') @@ -18,8 +17,8 @@ map('i', '', ':w') -- Telescope local telescope_builtin = require('telescope.builtin') map('n', 'ff', telescope_builtin.find_files, { desc = 'Find Files' }) -map('n', 'fg', telescope_builtin.live_grep, { desc = 'Live Grep'}) -map('n', 'fb', telescope_builtin.buffers, { desc = 'Find Buffers'}) +map('n', 'fg', telescope_builtin.live_grep, { desc = 'Live Grep' }) +map('n', 'fb', telescope_builtin.buffers, { desc = 'Find Buffers' }) map('n', 'fh', telescope_builtin.help_tags, { desc = 'Help Tags' }) -- NvimTree Toggle (File Explorer) @@ -82,7 +81,7 @@ map("n", "di", ":lua require('dapui').toggle()") -- luasnip -vim.cmd[[ +vim.cmd [[ " Use Tab to expand and jump through snippets imap luasnip#expand_or_jumpable() ? 'luasnip-expand-or-jump' : '' smap luasnip#jumpable(1) ? 'luasnip-jump-next' : '' @@ -95,7 +94,53 @@ smap luasnip#jumpable(-1) ? 'luasnip-jump-prev' : '", function () + map({ "n", "i", "t" }, "", function() vim.g.neovide_fullscreen = not vim.g.neovide_fullscreen end) end + + +-- barbar +local barbar_opts = { noremap = true, silent = true } + +-- Move to previous/next +map('n', '', 'BufferPrevious', barbar_opts) +map('n', '', 'BufferNext', barbar_opts) +-- Re-order to previous/next +map('n', '', 'BufferMovePrevious', barbar_opts) +map('n', '>', 'BufferMoveNext', barbar_opts) +-- Goto buffer in position... +map('n', '', 'BufferGoto 1', barbar_opts) +map('n', '', 'BufferGoto 2', barbar_opts) +map('n', '', 'BufferGoto 3', barbar_opts) +map('n', '', 'BufferGoto 4', barbar_opts) +map('n', '', 'BufferGoto 5', barbar_opts) +map('n', '', 'BufferGoto 6', barbar_opts) +map('n', '', 'BufferGoto 7', barbar_opts) +map('n', '', 'BufferGoto 8', barbar_opts) +map('n', '', 'BufferGoto 9', barbar_opts) +map('n', '', 'BufferLast', barbar_opts) +-- Pin/unpin buffer +map('n', '', 'BufferPin', barbar_opts) +-- Close buffer +map('n', '', 'BufferClose', barbar_opts) +-- Wipeout buffer +-- :BufferWipeout + +-- Close commands +-- :BufferCloseAllButCurrent +-- :BufferCloseAllButPinned +-- :BufferCloseAllButCurrentOrPinned +-- :BufferCloseBuffersLeft +-- :BufferCloseBuffersRight +-- Magic buffer-picking mode +map('n', '', 'BufferPick', barbar_opts) +-- Sort automatically by... +map('n', 'bb', 'BufferOrderByBufferNumber', barbar_opts) +map('n', 'bd', 'BufferOrderByDirectory', barbar_opts) +map('n', 'bl', 'BufferOrderByLanguage', barbar_opts) +map('n', 'bw', 'BufferOrderByWindowNumber', barbar_opts) + +-- Other: +-- :BarbarEnable - enables barbar (enabled by default) +-- :BarbarDisable - very bad command, should never be used diff --git a/neovim/.config/nvim/lua/warrenhood/plugins.lua b/neovim/.config/nvim/lua/warrenhood/plugins.lua index 045f712..209513d 100644 --- a/neovim/.config/nvim/lua/warrenhood/plugins.lua +++ b/neovim/.config/nvim/lua/warrenhood/plugins.lua @@ -146,7 +146,11 @@ require("packer").startup(function() end } -- Virtual text for nvim-dap - + -- Tab + use { + 'romgrk/barbar.nvim', + requires = {'kyazdani42/nvim-web-devicons'}, + } -- Automatically set up configuration after cloning packer.nvim