From 151bb53d85eca60cab0e28f99b0c7e8c1fe0b988 Mon Sep 17 00:00:00 2001 From: Luca Matei Pintilie Date: Sun, 16 Oct 2022 15:46:54 +0200 Subject: Add some neovim stuff --- .config/nvim/lua/general.lua | 6 ++++++ .config/nvim/lua/keybinds.lua | 4 ++++ .config/nvim/lua/lsp.lua | 2 ++ .config/nvim/lua/plugins.lua | 10 +++++++++- 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/general.lua b/.config/nvim/lua/general.lua index b7e3cef..088312a 100644 --- a/.config/nvim/lua/general.lua +++ b/.config/nvim/lua/general.lua @@ -9,6 +9,12 @@ vim.opt.backupcopy = "yes" vim.opt.undolevels = 1000 vim.opt.wrap = false +vim.opt.tabstop = 4 +vim.opt.softtabstop = -1 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true +vim.opt.autoindent = true + -- Comment the following lines to disable whitespace characters vim.opt.list = true vim.opt.listchars:append("space:⋅") diff --git a/.config/nvim/lua/keybinds.lua b/.config/nvim/lua/keybinds.lua index 80a058f..8f2de84 100644 --- a/.config/nvim/lua/keybinds.lua +++ b/.config/nvim/lua/keybinds.lua @@ -17,8 +17,10 @@ vim.keymap.set("n", "n", nt_api.tree.toggle) vim.keymap.set("n", "", vim.lsp.buf.code_action) vim.keymap.set("n", "K", vim.lsp.buf.hover) vim.keymap.set("n", "D", vim.lsp.buf.definition) +vim.keymap.set("n", "R", vim.lsp.buf.references) vim.keymap.set("n", "F", vim.lsp.buf.formatting) vim.keymap.set("n", "d", vim.diagnostic.open_float) +vim.keymap.set("n", "J", vim.lsp.buf.signature_help) vim.keymap.set("n", "f", telescope.find_files) vim.keymap.set("n", "", telescope.buffers) @@ -52,5 +54,7 @@ wk.register({ ["t"] = "Open terminal"; ["s"] = "Save file"; ["q"] = "Quit"; + ["R"] = "Show References"; + ["J"] = "Signature help"; }, { prefix = "" }); diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index 11059ff..29ac2de 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -69,6 +69,8 @@ local on_attach = function(client, bufnr) local inlayhints = require("lsp-inlayhints") inlayhints.setup() inlayhints.on_attach(client, bufnr) + local lsp_signature = require("lsp_signature") + lsp_signature.on_attach({ bind = true }, bufnr) end local lsputils = require("lspconfig").util diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 1f173da..60eebf0 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -57,6 +57,7 @@ local PKGS = { { url = "https://github.com/nanotee/sqls.nvim.git" }; { url = "https://github.com/lvimuser/lsp-inlayhints.nvim.git" }; { url = "https://github.com/sigmaSd/deno-nvim.git" }; + { url = "https://github.com/ray-x/lsp_signature.nvim.git" }; -- Dev container { url = "https://codeberg.org/esensar/nvim-dev-container.git" }; @@ -129,7 +130,7 @@ local function init_plugins() -- Available modes: foreground, background mode = "foreground"; -- Set the display mode. }) - vim.g.minimap_auto_start = 1 + vim.g.minimap_auto_start = 0 vim.g.minimap_highlight_range = 1 vim.g.minimap_highlight_search = 1 @@ -177,6 +178,13 @@ local function init_plugins() }) vim.fn["mkdp#util#install"]() + require("nvim-treesitter.configs").setup({ + ensure_installed = { "javascript"; "typescript"; "lua"; "c_sharp"; "jsonc" }; + sync_install = false; + auto_install = true; + highlight = { enable = true; disable = { "markdown"; "yaml"; "sql" } }; + }) + end return { -- cgit v1.2.3