From a3bad06a4681c322538d609aa1c0bd18880f77c6 Mon Sep 17 00:00:00 2001 From: mpaulson Date: Wed, 14 Dec 2022 06:52:52 -0700 Subject: [PATCH] feat: better dev + ignoring certain servers (just eslint for now) --- after/plugin/fugitive.lua | 2 -- after/plugin/lsp.lua | 26 +++++++++++++++++++++++--- dev | 5 +++++ 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100755 dev diff --git a/after/plugin/fugitive.lua b/after/plugin/fugitive.lua index 067d8a98..21df11cf 100644 --- a/after/plugin/fugitive.lua +++ b/after/plugin/fugitive.lua @@ -7,14 +7,12 @@ autocmd("BufWinEnter", { group = ThePrimeagen_Fugitive, pattern = "*", callback = function() - print("help", vim.bo.ft) if vim.bo.ft ~= "fugitive" then return end local bufnr = vim.api.nvim_get_current_buf() local opts = {buffer = bufnr, remap = false} - print("great success", vim.bo.ft, bufnr, vim.inspect(opts)) vim.keymap.set("n", "p", function() vim.cmd [[ Git push ]] end, opts) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 6311b052..9c99d73f 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -18,17 +18,37 @@ local cmp_mappings = lsp.defaults.cmp_mappings({ [""] = cmp.mapping.complete(), }) -lsp.set_preferences({ - sign_icons = { } -}) +-- disable completion with tab +-- this helps with copilot setup +cmp_mappings[''] = nil +cmp_mappings[''] = nil lsp.setup_nvim_cmp({ mapping = cmp_mappings }) +lsp.set_preferences({ + suggest_lsp_servers = false, + sign_icons = { + error = 'E', + warn = 'W', + hint = 'H', + info = 'I' + } +}) + +vim.diagnostic.config({ + virtual_text = true, +}) + lsp.on_attach(function(client, bufnr) local opts = {buffer = bufnr, remap = false} + if client.name == "eslint" then + vim.cmd [[ LspStop eslint ]] + return + end + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) diff --git a/dev b/dev new file mode 100755 index 00000000..6f51fbc7 --- /dev/null +++ b/dev @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +rm -rf ~/.config/nvim +ln -s $(pwd) ~/.config/nvim +