diff --git a/modules/editor/neovim/default.nix b/modules/editor/neovim/default.nix index c2edf52..db7ab89 100644 --- a/modules/editor/neovim/default.nix +++ b/modules/editor/neovim/default.nix @@ -27,7 +27,7 @@ shellAliases = { vim = "nvim"; }; shellAbbrs = { v = lib.mkForce "nvim"; - vl = lib.mkForce "nvim -c 'normal! `0'"; + vl = lib.mkForce "vim -c 'normal! `0' -c 'bdelete 1'"; vll = "nvim -c 'Telescope oldfiles'"; }; }; diff --git a/modules/editor/neovim/lua/packer/lsp.lua b/modules/editor/neovim/lua/packer/lsp.lua index b1ce138..cd8f2a6 100644 --- a/modules/editor/neovim/lua/packer/lsp.lua +++ b/modules/editor/neovim/lua/packer/lsp.lua @@ -57,7 +57,7 @@ M.packer = function(use) vim.keymap.set("n", "R", vim.lsp.buf.rename) vim.keymap.set("n", "]e", vim.diagnostic.goto_next) vim.keymap.set("n", "[e", vim.diagnostic.goto_prev) - vim.keymap.set("n", "e", vim.diagnostic.open_float) + vim.keymap.set("n", "de", vim.diagnostic.open_float) vim.keymap.set("n", "E", vim.lsp.buf.code_action) end, }) diff --git a/modules/editor/neovim/lua/packer/visuals.lua b/modules/editor/neovim/lua/packer/visuals.lua index e7821a1..25ac39f 100644 --- a/modules/editor/neovim/lua/packer/visuals.lua +++ b/modules/editor/neovim/lua/packer/visuals.lua @@ -7,7 +7,15 @@ M.packer = function(use) branch = "main", requires = { "nvim-lua/plenary.nvim" }, config = function() - require("gitsigns").setup() + local gitsigns = require("gitsigns") + gitsigns.setup() + vim.keymap.set("n", "gB", gitsigns.blame_line) + vim.keymap.set("n", "gp", gitsigns.preview_hunk) + vim.keymap.set("v", "gp", gitsigns.preview_hunk) + vim.keymap.set("n", "gd", gitsigns.diffthis) + vim.keymap.set("n", "rgf", gitsigns.reset_buffer) + vim.keymap.set("v", "hs", gitsigns.stage_hunk) + vim.keymap.set("v", "hs", gitsigns.reset_hunk) end, }) @@ -25,6 +33,34 @@ M.packer = function(use) end, }) + -- Buffer line ("tabs") + use({ + "akinsho/bufferline.nvim", + tag = "v2.*", + requires = "kyazdani42/nvim-web-devicons", + config = function() + require("bufferline").setup({ + options = { + diagnostics = "nvim_lsp", + always_show_bufferline = false, + separator_style = "slant", + offsets = { { filetype = "NvimTree" } }, + }, + }) + vim.keymap.set("n", "x", " :bdelete") + end, + }) + + -- File explorer + use({ + "kyazdani42/nvim-tree.lua", + requires = { "kyazdani42/nvim-web-devicons" }, + config = function() + require("nvim-tree").setup() + vim.keymap.set("n", "e", ":NvimTreeToggle") + end, + }) + -- Markdown pretty view use("ellisonleao/glow.nvim")