Skip to content

Commit

Permalink
feat: better dev + ignoring certain servers (just eslint for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePrimeagen committed Dec 14, 2022
1 parent 6710864 commit a3bad06
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
2 changes: 0 additions & 2 deletions after/plugin/fugitive.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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", "<leader>p", function()
vim.cmd [[ Git push ]]
end, opts)
Expand Down
26 changes: 23 additions & 3 deletions after/plugin/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,37 @@ local cmp_mappings = lsp.defaults.cmp_mappings({
["<C-Space>"] = cmp.mapping.complete(),
})

lsp.set_preferences({
sign_icons = { }
})
-- disable completion with tab
-- this helps with copilot setup
cmp_mappings['<Tab>'] = nil
cmp_mappings['<S-Tab>'] = 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", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
Expand Down
5 changes: 5 additions & 0 deletions dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

rm -rf ~/.config/nvim
ln -s $(pwd) ~/.config/nvim

0 comments on commit a3bad06

Please sign in to comment.