diff options
author | Luca Matei Pintilie <lucafulger@gmail.com> | 2023-02-03 20:12:10 +0000 |
---|---|---|
committer | Luca Matei Pintilie <lucafulger@gmail.com> | 2023-02-03 20:12:10 +0000 |
commit | 2333652b475797751f5c860f7fdacaabf1d5c492 (patch) | |
tree | d26cc7097a66ebb598dd43079e3ef3366207aaa6 | |
parent | 22e0dd0f9907738e6391f5ff26ba7c07cbe1bb9d (diff) | |
download | dotfiles-2333652b475797751f5c860f7fdacaabf1d5c492.tar dotfiles-2333652b475797751f5c860f7fdacaabf1d5c492.tar.gz dotfiles-2333652b475797751f5c860f7fdacaabf1d5c492.tar.bz2 dotfiles-2333652b475797751f5c860f7fdacaabf1d5c492.tar.lz dotfiles-2333652b475797751f5c860f7fdacaabf1d5c492.tar.xz dotfiles-2333652b475797751f5c860f7fdacaabf1d5c492.tar.zst dotfiles-2333652b475797751f5c860f7fdacaabf1d5c492.zip |
Add git related keybinds and colorcolumn to neovim config
-rw-r--r-- | .config/nvim/lua/general.lua | 1 | ||||
-rw-r--r-- | .config/nvim/lua/keybinds.lua | 6 | ||||
-rw-r--r-- | .config/nvim/lua/lsp.lua | 48 |
3 files changed, 32 insertions, 23 deletions
diff --git a/.config/nvim/lua/general.lua b/.config/nvim/lua/general.lua index 17b6885..28b4980 100644 --- a/.config/nvim/lua/general.lua +++ b/.config/nvim/lua/general.lua @@ -8,6 +8,7 @@ vim.opt.undofile = true vim.opt.backupcopy = "yes" vim.opt.undolevels = 1000 vim.opt.wrap = false +vim.opt.colorcolumn = "80,120" -- vim.opt.tabstop = 4 -- vim.opt.softtabstop = -1 diff --git a/.config/nvim/lua/keybinds.lua b/.config/nvim/lua/keybinds.lua index 3d4eac2..97d7548 100644 --- a/.config/nvim/lua/keybinds.lua +++ b/.config/nvim/lua/keybinds.lua @@ -26,6 +26,9 @@ vim.keymap.set("n", "<Leader>D", telescope.lsp_definitions) vim.keymap.set("n", "<Leader>R", telescope.lsp_references) vim.keymap.set("n", "<Leader>m", ":MinimapToggle<CR>") +vim.keymap.set("n", "<Leader>b", ":Gitsigns blame_line<CR>") +vim.keymap.set("n", "<Leader>h", ":Gitsigns preview_hunk<CR>") +vim.keymap.set("n", "<Leader>d", ":Gitsigns diffthis<CR>") vim.keymap.set("n", "<Leader>,", ":TroubleToggle<CR>") vim.keymap.set("n", "<Leader>t", ":belowright split | resize 5 | terminal<CR>") vim.keymap.set("n", "<Leader>s", ":w<CR>") @@ -50,6 +53,9 @@ wk.register({ ["r"] = "Rename"; ["n"] = "Show file tree"; ["m"] = "Toggle Minimap"; + ["b"] = "Blame line"; + ["h"] = "Preview hunk"; + ["d"] = "Diff this"; ["d"] = "Show diagnostics"; ["t"] = "Open terminal"; ["s"] = "Save file"; diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index f404e3d..c228893 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -23,23 +23,25 @@ cmp.setup({ { name = "nvim_lsp"; entry_filter = function(entry, ctx) - return require('cmp.types').lsp.CompletionItemKind[entry:get_kind()] ~= 'Text' + return require("cmp.types").lsp.CompletionItemKind[entry:get_kind()] ~= + "Text" end; }; { name = "vsnip"; entry_filter = function(entry, ctx) - return require('cmp.types').lsp.CompletionItemKind[entry:get_kind()] ~= 'Text' + return require("cmp.types").lsp.CompletionItemKind[entry:get_kind()] ~= + "Text" end; }; - }, - { + }, { { name = "buffer"; entry_filter = function(entry, ctx) - return require('cmp.types').lsp.CompletionItemKind[entry:get_kind()] ~= 'Text' + return require("cmp.types").lsp.CompletionItemKind[entry:get_kind()] ~= + "Text" end; - } + }; }); }) @@ -239,23 +241,23 @@ local null_ls = require("null-ls") null_ls.setup({ sources = { - null_ls.builtins.diagnostics.eslint, - null_ls.builtins.formatting.eslint, - -- null_ls.builtins.formatting.lua_format, - -- null_ls.builtins.formatting.prettier, - -- null_ls.builtins.formatting.rustfmt, - -- null_ls.builtins.code_actions.shellcheck, - -- null_ls.builtins.completion.spell, - -- null_ls.builtins.diagnostics.tsc, - -- null_ls.builtins.formatting.deno_fmt, - -- null_ls.builtins.code_actions.gitsigns.with({ - -- config = { - -- filter_actions = function(title) - -- return title:lower():match("blame") == nil -- filter out blame actions - -- end, - -- }, - -- }) - }, + null_ls.builtins.diagnostics.eslint; + null_ls.builtins.formatting.eslint; +-- null_ls.builtins.formatting.lua_format; +-- null_ls.builtins.formatting.prettier; + null_ls.builtins.formatting.rustfmt; +-- null_ls.builtins.code_actions.shellcheck; +-- null_ls.builtins.completion.spell; +-- null_ls.builtins.diagnostics.tsc; +-- null_ls.builtins.formatting.deno_fmt; +-- null_ls.builtins.code_actions.gitsigns.with({ +-- config = { +-- filter_actions = function(title) +-- return title:lower():match("blame") == nil -- filter out blame actions +-- end; +-- }; +-- }); + }; }) vim.diagnostic.config({ |