-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from elC0mpa/setuplsp
Setuplsp
- Loading branch information
Showing
10 changed files
with
243 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"diagnostics.globals": [ | ||
"vim" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,42 @@ | ||
{ | ||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, | ||
"aerial.nvim": { "branch": "master", "commit": "e75a3df2c20b3a98c786f5e61587d74a7a6b61d6" }, | ||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, | ||
"aerial.nvim": { "branch": "master", "commit": "140f48fb068d21c02e753c63f7443649e55576f0" }, | ||
"bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" }, | ||
"bufferline.nvim": { "branch": "main", "commit": "2e3c8cc5a57ddd32f1edd2ffd2ccb10c09421f6c" }, | ||
"coc.nvim": { "branch": "release", "commit": "ebe2a2058ed85d3884f8010a53bac25edbf9675c" }, | ||
"bufferline.nvim": { "branch": "main", "commit": "0b2fd861eee7595015b6561dade52fb060be10c4" }, | ||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, | ||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, | ||
"conform.nvim": { "branch": "master", "commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c" }, | ||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, | ||
"gitsigns.nvim": { "branch": "main", "commit": "f4928ba14eb6c667786ac7d69927f6aee6719f1e" }, | ||
"image.nvim": { "branch": "master", "commit": "61c76515cfc3cdac8123ece9e9761b20c3dc1315" }, | ||
"friendly-snippets": { "branch": "main", "commit": "00ba9dd3df89509f95437b8d595553707c46d5ea" }, | ||
"gitsigns.nvim": { "branch": "main", "commit": "863903631e676b33e8be2acb17512fdc1b80b4fb" }, | ||
"image.nvim": { "branch": "master", "commit": "c4e826027e0428e3a5d7a95700be7a3ce49c2587" }, | ||
"indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" }, | ||
"lazy.nvim": { "branch": "main", "commit": "5473e3d77c13e40fc4758fa977a1f2c14d0b4ceb" }, | ||
"leap.nvim": { "branch": "main", "commit": "c099aecaf858574909bd38cbadb8543c4dd16611" }, | ||
"lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, | ||
"neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, | ||
"neogit": { "branch": "master", "commit": "af1d8d88f426a4da63c913f3b81a37350dbe8d02" }, | ||
"noice.nvim": { "branch": "main", "commit": "daa5f6908e97c89ca3e9861e03bdf356ea48cc72" }, | ||
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, | ||
"nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" }, | ||
"lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, | ||
"leap.nvim": { "branch": "main", "commit": "c6bfb191f1161fbabace1f36f578a20ac6c7642c" }, | ||
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, | ||
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, | ||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, | ||
"neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, | ||
"neogit": { "branch": "master", "commit": "75ee709d18625a94aef90d94ccac4e562c9a0046" }, | ||
"noice.nvim": { "branch": "main", "commit": "c1ba80ccf6b3bd8c7fc88fe2e61085131d44ad65" }, | ||
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, | ||
"nvim-autopairs": { "branch": "master", "commit": "f158dcb865c36f72c92358f87787dab2c272eaf3" }, | ||
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, | ||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, | ||
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, | ||
"nvim-treesitter": { "branch": "master", "commit": "0758155d4dfacfa959ad82ffa3879cb69c82e719" }, | ||
"nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" }, | ||
"nvim-ufo": { "branch": "main", "commit": "1b5f2838099f283857729e820cc05e2b19df7a2c" }, | ||
"nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, | ||
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, | ||
"promise-async": { "branch": "main", "commit": "28c1d5a295eb5310afa2523d4ae9aa41ec5a9de2" }, | ||
"telescope.nvim": { "branch": "master", "commit": "bfcc7d5c6f12209139f175e6123a7b7de6d9c18a" }, | ||
"todo-comments.nvim": { "branch": "main", "commit": "96fee098a90e7c09c9811aa7df71d773ba8b9b53" }, | ||
"toggleterm.nvim": { "branch": "main", "commit": "8ed0f52006d3207ec6c94de7db62da840937ef2a" }, | ||
"tokyonight.nvim": { "branch": "main", "commit": "6adfcde66e8af2f22dd5d76060980abd8daa0df8" }, | ||
"nvim-lint": { "branch": "master", "commit": "968a35d54b3a4c1ce66609cf80b14d4ae44fe77f" }, | ||
"nvim-lspconfig": { "branch": "master", "commit": "76e7c8b029e6517f3689390d6599e9b446551704" }, | ||
"nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" }, | ||
"nvim-treesitter": { "branch": "master", "commit": "140f534ce9c02189921b80f5c8a68ab9e3f92ce8" }, | ||
"nvim-treesitter-refactor": { "branch": "master", "commit": "d8b74fa87afc6a1e97b18da23e762efb032dc270" }, | ||
"nvim-ufo": { "branch": "main", "commit": "203c9f434feec57909ab4b1e028abeb3349b7847" }, | ||
"nvim-web-devicons": { "branch": "master", "commit": "1e5a2a796a88b5d696acb07dd5c285b13d13da21" }, | ||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, | ||
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, | ||
"telescope.nvim": { "branch": "master", "commit": "cb3f98d935842836cc115e8c9e4b38c1380fbb6b" }, | ||
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, | ||
"toggleterm.nvim": { "branch": "main", "commit": "137d06fb103952a0fb567882bb8527e2f92d327d" }, | ||
"tokyonight.nvim": { "branch": "main", "commit": "817bb6ffff1b9ce72cdd45d9fcfa8c9cd1ad3839" }, | ||
"vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, | ||
"vim-startify": { "branch": "master", "commit": "4e089dffdad46f3f5593f34362d530e8fe823dcf" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
return { | ||
"stevearc/conform.nvim", | ||
keys = { | ||
{ | ||
"<space>f", | ||
function() | ||
require("conform").format({ async = true }) | ||
end, | ||
mode = "", | ||
desc = "Format buffer", | ||
}, | ||
}, | ||
opts = { | ||
formatters_by_ft = { | ||
lua = { "stylua" }, | ||
|
||
javascript = { "prettierd", "prettier", stop_after_first = true }, | ||
javascriptreact = { "prettierd", "prettier", stop_after_first = true }, | ||
typescript = { "prettierd", "prettier", stop_after_first = true }, | ||
typescriptreact = { "prettierd", "prettier", stop_after_first = true }, | ||
vue = { "prettierd", "prettier", stop_after_first = true }, | ||
css = { "prettierd", "prettier", stop_after_first = true }, | ||
scss = { "prettierd", "prettier", stop_after_first = true }, | ||
less = { "prettierd", "prettier", stop_after_first = true }, | ||
html = { "prettierd", "prettier", stop_after_first = true }, | ||
json = { "prettierd", "prettier", stop_after_first = true }, | ||
jsonc = { "prettierd", "prettier", stop_after_first = true }, | ||
yaml = { "prettierd", "prettier", stop_after_first = true }, | ||
markdown = { "prettierd", "prettier", stop_after_first = true }, | ||
["markdown.mdx"] = { "prettierd", "prettier", stop_after_first = true }, | ||
graphql = { "prettierd", "prettier", stop_after_first = true }, | ||
|
||
go = { "gofumpt", "goimports" }, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
return { | ||
"mfussenegger/nvim-lint", | ||
config = function () | ||
require("lint").linters_by_ft = { | ||
javascript = { "eslint_d" }, | ||
javascriptreact = { "eslint_d" }, | ||
typescript = { "eslint_d" }, | ||
typescriptreact = { "eslint_d" }, | ||
vue = { "eslint_d" }, | ||
|
||
go = { "golangcilint" }, | ||
} | ||
end, | ||
keys = { | ||
{ | ||
"<space>l", | ||
function() | ||
require("lint").try_lint() | ||
end, | ||
mode = "", | ||
desc = "Lint buffer", | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
return { | ||
{ | ||
"hrsh7th/cmp-nvim-lsp", | ||
}, | ||
{ | ||
"L3MON4D3/LuaSnip", | ||
-- follow latest release. | ||
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release) | ||
-- install jsregexp (optional!). | ||
build = "make install_jsregexp", | ||
dependencies = { | ||
"saadparwaiz1/cmp_luasnip", | ||
"rafamadriz/friendly-snippets" | ||
} | ||
}, | ||
{ | ||
"hrsh7th/nvim-cmp", | ||
config = function() | ||
local cmp = require("cmp") | ||
require("luasnip.loaders.from_vscode").lazy_load() | ||
cmp.setup({ | ||
snippet = { | ||
-- REQUIRED - you must specify a snippet engine | ||
expand = function(args) | ||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users. | ||
end, | ||
}, | ||
window = { | ||
completion = cmp.config.window.bordered(), | ||
documentation = cmp.config.window.bordered(), | ||
}, | ||
mapping = cmp.mapping.preset.insert({ | ||
['<C-b>'] = cmp.mapping.scroll_docs(-4), | ||
['<C-f>'] = cmp.mapping.scroll_docs(4), | ||
['<C-Space>'] = cmp.mapping.complete(), | ||
['<C-e>'] = cmp.mapping.abort(), | ||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. | ||
}), | ||
sources = cmp.config.sources({ | ||
{ name = 'nvim_lsp' }, | ||
{ name = 'luasnip' }, -- For luasnip users. | ||
}, { | ||
{ name = 'buffer' }, | ||
}) | ||
}) | ||
|
||
cmp.setup.cmdline({ '/', '?' }, { | ||
mapping = cmp.mapping.preset.cmdline(), | ||
sources = { | ||
{ name = 'buffer' } | ||
} | ||
}) | ||
|
||
cmp.setup.cmdline(':', { | ||
mapping = cmp.mapping.preset.cmdline(), | ||
sources = cmp.config.sources({ | ||
{ name = 'path' } | ||
}, { | ||
{ name = 'cmdline' } | ||
}), | ||
matching = { disallow_symbol_nonprefix_matching = false } | ||
}) | ||
end | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
return { | ||
{ | ||
"williamboman/mason.nvim", | ||
config = true | ||
}, | ||
{ | ||
"williamboman/mason-lspconfig.nvim", | ||
opts = { | ||
ensure_installed = { "dockerls", "gopls", "html", "css_variables", "css_ls", "cssmodules_ls", "tailwindcss", "tsserver", "eslint" } | ||
} | ||
}, | ||
{ | ||
"neovim/nvim-lspconfig", | ||
config = function() | ||
local capabilities = require("cmp_nvim_lsp").default_capabilities() | ||
require 'lspconfig'.gopls.setup { | ||
capabilities = capabilities | ||
} | ||
require 'lspconfig'.lua_ls.setup { | ||
capabilities = capabilities | ||
} | ||
require 'lspconfig'.dockerls.setup { | ||
capabilities = capabilities | ||
} | ||
require 'lspconfig'.html.setup { | ||
capabilities = capabilities | ||
} | ||
require 'lspconfig'.css_ls.setup { | ||
capabilities = capabilities | ||
} | ||
require 'lspconfig'.css_variables.setup { | ||
capabilities = capabilities | ||
} | ||
require 'lspconfig'.cssmodules_ls.setup { | ||
capabilities = capabilities | ||
} | ||
require 'lspconfig'.cssls.setup { | ||
capabilities = capabilities | ||
} | ||
require 'lspconfig'.tailwindcss.setup { | ||
capabilities = capabilities | ||
} | ||
|
||
require 'lspconfig'.tsserver.setup { | ||
capabilities = capabilities | ||
} | ||
require 'lspconfig'.eslint.setup { | ||
capabilities = capabilities | ||
} | ||
|
||
vim.api.nvim_create_autocmd('LspAttach', { | ||
group = vim.api.nvim_create_augroup('UserLspConfig', {}), | ||
callback = function(ev) | ||
-- Enable completion triggered by <c-x><c-o> | ||
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' | ||
|
||
-- Buffer local mappings. | ||
-- See `:help vim.lsp.*` for documentation on any of the below functions | ||
local opts = { buffer = ev.buf } | ||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) | ||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) | ||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) | ||
vim.keymap.set({ 'n', 'v' }, 'ga', vim.lsp.buf.code_action, opts) | ||
vim.keymap.set('n', 'gR', require('telescope.builtin').lsp_references, opts) | ||
end, | ||
}) | ||
end | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters