nvim fancy bufferline, file tree, git cmds

This commit is contained in:
Noah Masur 2022-07-12 03:53:30 +00:00
parent 50665737e2
commit ee305529ce
3 changed files with 39 additions and 3 deletions

View File

@ -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'";
};
};

View File

@ -57,7 +57,7 @@ M.packer = function(use)
vim.keymap.set("n", "<Leader>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", "<Leader>e", vim.diagnostic.open_float)
vim.keymap.set("n", "<Leader>de", vim.diagnostic.open_float)
vim.keymap.set("n", "<Leader>E", vim.lsp.buf.code_action)
end,
})

View File

@ -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", "<Leader>gB", gitsigns.blame_line)
vim.keymap.set("n", "<Leader>gp", gitsigns.preview_hunk)
vim.keymap.set("v", "<Leader>gp", gitsigns.preview_hunk)
vim.keymap.set("n", "<Leader>gd", gitsigns.diffthis)
vim.keymap.set("n", "<Leader>rgf", gitsigns.reset_buffer)
vim.keymap.set("v", "<Leader>hs", gitsigns.stage_hunk)
vim.keymap.set("v", "<Leader>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", "<Leader>x", " :bdelete<CR>")
end,
})
-- File explorer
use({
"kyazdani42/nvim-tree.lua",
requires = { "kyazdani42/nvim-web-devicons" },
config = function()
require("nvim-tree").setup()
vim.keymap.set("n", "<Leader>e", ":NvimTreeToggle")
end,
})
-- Markdown pretty view
use("ellisonleao/glow.nvim")