nvim: moar settings

This commit is contained in:
Daniel Lundin 2023-02-02 09:37:20 +01:00
parent 58ca67e659
commit 46c09fac52
7 changed files with 19 additions and 14 deletions

View file

@ -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 = {
["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
["<Down>"] = 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",

View file

@ -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({

View file

@ -10,6 +10,8 @@ function M.config()
require("noice").setup({
presets = {
inc_rename = true,
long_message_to_split = true,
lsp_doc_border = true,
},
})
end

View file

@ -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({

View file

@ -22,7 +22,8 @@ function M.config()
vim.keymap.set("n", "<leader>b", '<cmd>lua require("telescope.builtin").buffers()<CR>')
vim.keymap.set("n", "<leader>f", '<cmd>lua require("telescope.builtin").oldfiles()<CR>')
vim.keymap.set("n", "<space>", '<cmd>lua require("telescope.builtin").oldfiles()<CR>')
vim.keymap.set("n", "<space>", '<cmd>lua require("telescope.builtin").oldfiles({cwd_only=true})<CR>')
vim.keymap.set("n", "<leader><space>", '<cmd>lua require("telescope.builtin").oldfiles()<CR>')
vim.keymap.set("n", "<leader>d", '<cmd>lua require("telescope.builtin").diagnostics()<CR>')
vim.keymap.set("n", "<leader>e", '<cmd>lua require("telescope.builtin").git_files()<CR>')
vim.keymap.set("n", "<leader>g", '<cmd>lua require("telescope.builtin").git_status()<CR>')
@ -36,7 +37,11 @@ function M.config()
vim.keymap.set("n", "gr", '<cmd>lua require("telescope.builtin").lsp_references()<CR>')
vim.keymap.set("n", "gd", '<cmd>lua require("telescope.builtin").lsp_definitions()<CR>')
vim.keymap.set("n", "g/", '<cmd>lua require("telescope.builtin").lsp_document_symbols()<CR>')
vim.keymap.set("n", "g?", '<cmd>lua require("telescope.builtin").lsp_workspace_symbols()<CR>')
vim.keymap.set(
"n",
"g?",
'<cmd>lua require("telescope.builtin").lsp_workspace_symbols({query=(vim.bo.filetype == "go" and "\'" or "")})<CR>'
)
vim.keymap.set("n", "ge", '<cmd>lua require("telescope.builtin").lsp_document_diagnostics()<CR>')
vim.keymap.set("n", "Db", '<cmd>lua require("telescope").extensions.dap.list_breakpoints()<CR>')
vim.keymap.set("n", "Dcc", '<cmd>lua require("telescope").extensions.dap.commands()<CR>')

View file

@ -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" }),

View file

@ -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