From 46c09fac5213f52aaed392dd1fa93ecf389e1b74 Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Thu, 2 Feb 2023 09:37:20 +0100 Subject: [PATCH] nvim: moar settings --- .config/nvim/lua/config/plugins/cmp.lua | 8 -------- .config/nvim/lua/config/plugins/lsp-config.lua | 5 ++++- .config/nvim/lua/config/plugins/noice.lua | 2 ++ .config/nvim/lua/config/plugins/null-ls.lua | 1 + .config/nvim/lua/config/plugins/telescope.lua | 9 +++++++-- .config/nvim/lua/config/plugins/zenbones.lua | 2 ++ .config/nvim/lua/settings.lua | 6 +++--- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.config/nvim/lua/config/plugins/cmp.lua b/.config/nvim/lua/config/plugins/cmp.lua index 264b22d..c52f363 100644 --- a/.config/nvim/lua/config/plugins/cmp.lua +++ b/.config/nvim/lua/config/plugins/cmp.lua @@ -9,7 +9,6 @@ local M = { "hrsh7th/cmp-cmdline", "hrsh7th/cmp-nvim-lsp-signature-help", "onsails/lspkind-nvim", - "saadparwaiz1/cmp_luasnip", }, event = "InsertEnter", } @@ -42,12 +41,6 @@ function M.config() }), }, - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - mapping = { [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), @@ -73,7 +66,6 @@ function M.config() { name = "nvim_lsp" }, { name = "nvim_lsp_signature_help" }, { name = "buffer" }, - { name = "luasnip" }, { name = "copilot" }, { name = "tmux", diff --git a/.config/nvim/lua/config/plugins/lsp-config.lua b/.config/nvim/lua/config/plugins/lsp-config.lua index ae9689e..4cbf247 100644 --- a/.config/nvim/lua/config/plugins/lsp-config.lua +++ b/.config/nvim/lua/config/plugins/lsp-config.lua @@ -51,6 +51,7 @@ function M.config() -- simple setups -- local servers = { "bashls", + "bufls", "dockerls", "gopls", "jsonls", @@ -186,7 +187,9 @@ function M.config() }, }) - require("lspconfig").tsserver.setup({}) + require("lspconfig").tsserver.setup({ + root_dir = vim.loop.cwd, + }) -- npm install -g typescript typescript-language-server -- require("lspconfig").tsserver.setup({ diff --git a/.config/nvim/lua/config/plugins/noice.lua b/.config/nvim/lua/config/plugins/noice.lua index c73ea37..7d49f14 100644 --- a/.config/nvim/lua/config/plugins/noice.lua +++ b/.config/nvim/lua/config/plugins/noice.lua @@ -10,6 +10,8 @@ function M.config() require("noice").setup({ presets = { inc_rename = true, + long_message_to_split = true, + lsp_doc_border = true, }, }) end diff --git a/.config/nvim/lua/config/plugins/null-ls.lua b/.config/nvim/lua/config/plugins/null-ls.lua index dd43316..1176d75 100644 --- a/.config/nvim/lua/config/plugins/null-ls.lua +++ b/.config/nvim/lua/config/plugins/null-ls.lua @@ -13,6 +13,7 @@ function M.config() builtins.formatting.buf, builtins.formatting.cue_fmt, builtins.formatting.shfmt, + builtins.formatting.sqlfluff, builtins.formatting.buildifier, builtins.completion.spell, builtins.diagnostics.buf.with({ diff --git a/.config/nvim/lua/config/plugins/telescope.lua b/.config/nvim/lua/config/plugins/telescope.lua index b0b67e1..5c98516 100644 --- a/.config/nvim/lua/config/plugins/telescope.lua +++ b/.config/nvim/lua/config/plugins/telescope.lua @@ -22,7 +22,8 @@ function M.config() vim.keymap.set("n", "b", 'lua require("telescope.builtin").buffers()') vim.keymap.set("n", "f", 'lua require("telescope.builtin").oldfiles()') - vim.keymap.set("n", "", 'lua require("telescope.builtin").oldfiles()') + vim.keymap.set("n", "", 'lua require("telescope.builtin").oldfiles({cwd_only=true})') + vim.keymap.set("n", "", 'lua require("telescope.builtin").oldfiles()') vim.keymap.set("n", "d", 'lua require("telescope.builtin").diagnostics()') vim.keymap.set("n", "e", 'lua require("telescope.builtin").git_files()') vim.keymap.set("n", "g", 'lua require("telescope.builtin").git_status()') @@ -36,7 +37,11 @@ function M.config() vim.keymap.set("n", "gr", 'lua require("telescope.builtin").lsp_references()') vim.keymap.set("n", "gd", 'lua require("telescope.builtin").lsp_definitions()') vim.keymap.set("n", "g/", 'lua require("telescope.builtin").lsp_document_symbols()') - vim.keymap.set("n", "g?", 'lua require("telescope.builtin").lsp_workspace_symbols()') + vim.keymap.set( + "n", + "g?", + 'lua require("telescope.builtin").lsp_workspace_symbols({query=(vim.bo.filetype == "go" and "\'" or "")})' + ) vim.keymap.set("n", "ge", 'lua require("telescope.builtin").lsp_document_diagnostics()') vim.keymap.set("n", "Db", 'lua require("telescope").extensions.dap.list_breakpoints()') vim.keymap.set("n", "Dcc", 'lua require("telescope").extensions.dap.commands()') diff --git a/.config/nvim/lua/config/plugins/zenbones.lua b/.config/nvim/lua/config/plugins/zenbones.lua index a456fb2..8db8871 100644 --- a/.config/nvim/lua/config/plugins/zenbones.lua +++ b/.config/nvim/lua/config/plugins/zenbones.lua @@ -37,6 +37,7 @@ function M.config() -- Comment({ fg = "#114499", gui = "bold,italic" }), -- Comment({ fg = "#144EE1", gui = "bold,italic" }), Comment({ fg = "#8F001D", gui = "bold,italic" }), + Todo({ fg = "#FF0000", gui = "bold,underline" }), EndOfBuffer({ fg = "#CBCFE1" }), CopilotSuggestion({ fg = "#0066cc", gui = "bold,italic" }), LineNr({ fg = "#9FA8AC", gui = "bold,italic" }), @@ -72,6 +73,7 @@ function M.config() Hlargs({ fg = "#2274A5" }), IlluminatedWordText({ bg = "#FFEE99" }), + NotifyBackground({ bg = "#FFF8D6" }), NavicIcons({ fg = "#cc0000" }), NavicIconsFile({ fg = "#cc0000" }), diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index b8be49e..4b80a53 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -9,7 +9,7 @@ vim.o.splitright = true vim.o.ttimeout = true vim.o.ttimeoutlen = 50 vim.o.updatetime = 100 -vim.o.autochdir = true +vim.o.autochdir = false vim.o.backupdir = "/home/dln/.local/share/nvim/backup/" vim.o.backup = true vim.g.netrw_dirhistmax = 0 @@ -17,6 +17,7 @@ vim.o.clipboard = "unnamedplus" vim.g.do_filetype_lua = 1 vim.o.spell = false vim.o.spelllang = "en_us" +vim.opt.winbar = nil --- Indent vim.o.autoindent = true @@ -61,8 +62,7 @@ vim.o.cmdheight = 1 -- vim.o.statusline = "═" -- vim.o.title = true -- vim.o.titlestring = "%F%m %r %y" -vim.o.fillchars = - "stl: ,stlnc: ,eob:🮙" +vim.o.fillchars = "stl: ,stlnc: ,eob:🮙" -- vim.wo.foldmethod = "expr" -- vim.wo.foldexpr = "nvim_treesitter#foldexpr()" vim.g.netrw_dirhistmax = 0