diff --git a/cfg/nvim/init.lua b/cfg/nvim/init.lua index cad3a09..a990553 100644 --- a/cfg/nvim/init.lua +++ b/cfg/nvim/init.lua @@ -1,3 +1,4 @@ +-- START GLOBAL CONFIG vim.wo.number = true -- show numbers vim.o.scrolloff = 15 -- scrll if n lines left vim.o.hlsearch = false -- highlight search @@ -21,23 +22,31 @@ nmap("fw", require("telescope.builtin").live_grep) nmap("e", vim.diagnostic.open_float) +-- END GLOBAL CONFIG + -- START LSP local cmp = require("cmp") local lspconfig = require("lspconfig") local servers = { - tsserver = {}, + tsserver = { + settings = { + completions = { + completeFunctionCalls = true + } + } + }, pylsp = {}, lua_ls = {}, rnix = {}, - eslint = { - cmd = { "eslint", "--stdin", "--stdin-filename", "%:p" } - } + gopls = {} } local cmp_capabilities = require("cmp_nvim_lsp").default_capabilities() -local on_attach = function(_, bufnr) +local on_attach = function(client, bufnr) nmap("ca", vim.lsp.buf.code_action) - nmap('l', function() vim.lsp.buf.format() end) + nmap("l", function() + vim.lsp.buf.format() + end) nmap("K", vim.lsp.buf.hover) nmap("gr", require("telescope.builtin").lsp_references) end @@ -56,8 +65,7 @@ cmp.setup({ for server, cfg in pairs(servers) do lspconfig[server].setup({ - cmd = cfg.cmd, - settings = cfg.settings, + cfg, capabilities = cmp_capabilities, on_attach = on_attach, }) diff --git a/configuration.nix b/configuration.nix index 7029eef..a20adfe 100644 --- a/configuration.nix +++ b/configuration.nix @@ -55,14 +55,15 @@ grim home-manager jmtpfs + jq libgccjit libmtp lolcat mako mlocate mupdf - nodejs_20 nodePackages_latest.pnpm + nodejs_20 pinentry-qt piper rustup diff --git a/home.nix b/home.nix index 2faddf3..0973d66 100644 --- a/home.nix +++ b/home.nix @@ -47,10 +47,11 @@ enable = true; viAlias = true; extraPackages = with pkgs; [ - nodePackages_latest.eslint - nodePackages_latest.prettier - nodePackages_latest.typescript - nodePackages_latest.typescript-language-server + go + gopls + nodePackages_latest.prettier + nodePackages_latest.typescript + nodePackages_latest.typescript-language-server alejandra libclang lua