From fd1a3c6d61b1cfd22cb6c9fda4a9aa737aa2d764 Mon Sep 17 00:00:00 2001 From: khaydarov Date: Sat, 26 Apr 2025 03:54:12 +0500 Subject: [PATCH] lsp keymap and comment inline git blame --- init.lua | 17 ++++++++++++++-- lua/custom/plugins/inline_blame.lua | 30 ++++++++++++++--------------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/init.lua b/init.lua index 92b7d8b6..0ca6c4b6 100644 --- a/init.lua +++ b/init.lua @@ -662,7 +662,17 @@ require('lazy').setup({ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { -- clangd = {}, - -- gopls = {}, + gopls = { + hints = { + rangeVariableTypes = true, + parameterNames = true, + constantValues = true, + assignVariableTypes = true, + compositeLiteralFields = true, + compositeLiteralTypes = true, + functionTypeParameters = true, + }, + }, -- pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs @@ -803,6 +813,9 @@ require('lazy').setup({ --- @type blink.cmp.Config opts = { keymap = { + [''] = { 'select_prev', 'snippet_backward', 'fallback' }, + [''] = { 'select_next', 'snippet_forward', 'fallback' }, + [''] = { 'hide', 'fallback' }, -- 'default' (recommended) for mappings similar to built-in completions -- to accept ([y]es) the completion. -- This will auto-import if your LSP supports it. @@ -824,7 +837,7 @@ require('lazy').setup({ -- : Toggle signature help -- -- See :h blink-cmp-config-keymap for defining your own keymap - preset = 'default', + preset = 'enter', -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps diff --git a/lua/custom/plugins/inline_blame.lua b/lua/custom/plugins/inline_blame.lua index 97a16202..52703d74 100644 --- a/lua/custom/plugins/inline_blame.lua +++ b/lua/custom/plugins/inline_blame.lua @@ -1,17 +1,17 @@ return { - 'f-person/git-blame.nvim', - -- load the plugin at startup - event = 'VeryLazy', - -- Because of the keys part, you will be lazy loading this plugin. - -- The plugin will only load once one of the keys is used. - -- If you want to load the plugin at startup, add something like event = "VeryLazy", - -- or lazy = false. One of both options will work. - opts = { - -- your configuration comes here - -- for example - enabled = true, -- if you want to enable the plugin - message_template = ' • <>', -- template for the blame message, check the Message template section for more options - date_format = '%m-%d-%Y %H:%M:%S', -- template for the date, check Date format section for more options - virtual_text_column = 1, -- virtual text start column, check Start virtual text at column section for more options - }, + -- 'f-person/git-blame.nvim', + -- -- load the plugin at startup + -- event = 'VeryLazy', + -- -- Because of the keys part, you will be lazy loading this plugin. + -- -- The plugin will only load once one of the keys is used. + -- -- If you want to load the plugin at startup, add something like event = "VeryLazy", + -- -- or lazy = false. One of both options will work. + -- opts = { + -- -- your configuration comes here + -- -- for example + -- enabled = true, -- if you want to enable the plugin + -- message_template = ' • <>', -- template for the blame message, check the Message template section for more options + -- date_format = '%m-%d-%Y %H:%M:%S', -- template for the date, check Date format section for more options + -- virtual_text_column = 1, -- virtual text start column, check Start virtual text at column section for more options + -- }, }