diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-10-15 00:33:26 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-10-15 00:33:26 +0200 |
commit | 826ce094fecc4c6e07faf6e8b91387c2ae49842c (patch) | |
tree | 1820c843e4e260f6b51e8d269a972295a17e558c /config/essentials/nvim/lua/user/cmp | |
parent | c032a9d071ee4b7eb2bfe79ec03d2a7dc4020f15 (diff) | |
parent | a915b5ade1a47b9678e2f9963b13b49dbd406031 (diff) |
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'config/essentials/nvim/lua/user/cmp')
-rw-r--r-- | config/essentials/nvim/lua/user/cmp/init.lua | 7 | ||||
-rw-r--r-- | config/essentials/nvim/lua/user/cmp/php.lua | 1 | ||||
-rw-r--r-- | config/essentials/nvim/lua/user/cmp/rust.lua | 173 | ||||
-rw-r--r-- | config/essentials/nvim/lua/user/cmp/setup.lua | 17 |
4 files changed, 187 insertions, 11 deletions
diff --git a/config/essentials/nvim/lua/user/cmp/init.lua b/config/essentials/nvim/lua/user/cmp/init.lua index d40a67c..1ca0a10 100644 --- a/config/essentials/nvim/lua/user/cmp/init.lua +++ b/config/essentials/nvim/lua/user/cmp/init.lua @@ -4,11 +4,12 @@ require("user.cmp.arduino") require("user.cmp.bash") require("user.cmp.clangd") require("user.cmp.cs") -require("user.cmp.html") require("user.cmp.css") +require("user.cmp.emmet") +require("user.cmp.html") require("user.cmp.java") require("user.cmp.js") -require("user.cmp.emmet") require("user.cmp.lua") +require("user.cmp.php") require("user.cmp.python") -require("user.cmp.cs") +require("user.cmp.rust") diff --git a/config/essentials/nvim/lua/user/cmp/php.lua b/config/essentials/nvim/lua/user/cmp/php.lua new file mode 100644 index 0000000..9b2fa18 --- /dev/null +++ b/config/essentials/nvim/lua/user/cmp/php.lua @@ -0,0 +1 @@ +require'lspconfig'.phpactor.setup{} diff --git a/config/essentials/nvim/lua/user/cmp/rust.lua b/config/essentials/nvim/lua/user/cmp/rust.lua new file mode 100644 index 0000000..46a97eb --- /dev/null +++ b/config/essentials/nvim/lua/user/cmp/rust.lua @@ -0,0 +1,173 @@ +require'lspconfig'.rust_analyzer.setup{ + settings = { + ['rust-analyzer'] = { + diagnostics = { + enable = false; + } + } + }, + capabilities = + { + experimental = { + serverStatusNotification = true + }, + general = { + positionEncodings = { "utf-16" } + }, + textDocument = { + callHierarchy = { + dynamicRegistration = false + }, + codeAction = { + codeActionLiteralSupport = { + codeActionKind = { + valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } + } + }, + dataSupport = true, + dynamicRegistration = true, + isPreferredSupport = true, + resolveSupport = { + properties = { "edit" } + } + }, + completion = { + completionItem = { + commitCharactersSupport = false, + deprecatedSupport = false, + documentationFormat = { "markdown", "plaintext" }, + preselectSupport = false, + snippetSupport = false + }, + completionItemKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 } + }, + contextSupport = false, + dynamicRegistration = false + }, + declaration = { + linkSupport = true + }, + definition = { + dynamicRegistration = true, + linkSupport = true + }, + diagnostic = { + dynamicRegistration = false + }, + documentHighlight = { + dynamicRegistration = false + }, + documentSymbol = { + dynamicRegistration = false, + hierarchicalDocumentSymbolSupport = true, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + formatting = { + dynamicRegistration = true + }, + hover = { + contentFormat = { "markdown", "plaintext" }, + dynamicRegistration = true + }, + implementation = { + linkSupport = true + }, + inlayHint = { + dynamicRegistration = true, + resolveSupport = { + properties = {} + } + }, + publishDiagnostics = { + dataSupport = true, + relatedInformation = true, + tagSupport = { + valueSet = { 1, 2 } + } + }, + rangeFormatting = { + dynamicRegistration = true + }, + references = { + dynamicRegistration = false + }, + rename = { + dynamicRegistration = true, + prepareSupport = true + }, + semanticTokens = { + augmentsSyntaxTokens = true, + dynamicRegistration = false, + formats = { "relative" }, + multilineTokenSupport = false, + overlappingTokenSupport = true, + requests = { + full = { + delta = true + }, + range = false + }, + serverCancelSupport = false, + tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" }, + tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" } + }, + signatureHelp = { + dynamicRegistration = false, + signatureInformation = { + activeParameterSupport = true, + documentationFormat = { "markdown", "plaintext" }, + parameterInformation = { + labelOffsetSupport = true + } + } + }, + synchronization = { + didSave = true, + dynamicRegistration = false, + willSave = true, + willSaveWaitUntil = true + }, + typeDefinition = { + linkSupport = true + } + }, + window = { + showDocument = { + support = true + }, + showMessage = { + messageActionItem = { + additionalPropertiesSupport = false + } + }, + workDoneProgress = true + }, + workspace = { + applyEdit = true, + configuration = true, + didChangeWatchedFiles = { + dynamicRegistration = true, + relativePatternSupport = true + }, + inlayHint = { + refreshSupport = true + }, + semanticTokens = { + refreshSupport = true + }, + symbol = { + dynamicRegistration = false, + symbolKind = { + valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } + } + }, + workspaceEdit = { + resourceOperations = { "rename", "create", "delete" } + }, + workspaceFolders = true + } + } +} diff --git a/config/essentials/nvim/lua/user/cmp/setup.lua b/config/essentials/nvim/lua/user/cmp/setup.lua index 36d55e3..bb91e31 100644 --- a/config/essentials/nvim/lua/user/cmp/setup.lua +++ b/config/essentials/nvim/lua/user/cmp/setup.lua @@ -1,4 +1,4 @@ -local cmp = require'cmp' +local cmp = require 'cmp' cmp.setup({ snippet = { expand = function(args) @@ -14,11 +14,11 @@ cmp.setup({ ['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-Space>'] = cmp.mapping.complete(), ['<C-c>'] = cmp.mapping.abort(), - ['<C-k>'] = cmp.mapping.confirm({ select = true }), + ['<C-y>'] = cmp.mapping.confirm({ select = true }), }), sources = cmp.config.sources({ { name = 'nvim_lua' }, - { name = 'nvim_lsp'}, + { name = 'nvim_lsp' }, { name = 'path' }, { name = 'luasnip' }, { name = 'nvim_lsp_signature_help' }, @@ -44,21 +44,22 @@ cmp.setup.cmdline(':', { }) local function nnoremap(rhs, lhs, bufopts, desc) - bufopts.desc = desc - vim.keymap.set("n", rhs, lhs, bufopts) + bufopts.desc = desc + vim.keymap.set("n", rhs, lhs, bufopts) end +vim.keymap.set('c', '<tab>', '<C-z>', { silent = false }) -- to fix cmp -- Regular Neovim LSP client keymappings -local bufopts = { noremap=true, silent=true } +local bufopts = { noremap = true, silent = true } nnoremap('gD', vim.lsp.buf.declaration, bufopts, "Go to declaration") nnoremap('gd', vim.lsp.buf.definition, bufopts, "Go to definition") nnoremap('gi', vim.lsp.buf.implementation, bufopts, "Go to implementation") nnoremap('K', vim.lsp.buf.hover, bufopts, "Hover text") -nnoremap('<C-k>', vim.lsp.buf.signature_help, bufopts, "Show signature") +nnoremap('<leader>k', vim.lsp.buf.signature_help, bufopts, "Show signature") nnoremap('<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts, "Add workspace folder") nnoremap('<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts, "Remove workspace folder") nnoremap('<leader>wl', function() -print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, bufopts, "List workspace folders") nnoremap('<leader>D', vim.lsp.buf.type_definition, bufopts, "Go to type definition") nnoremap('<leader>rn', vim.lsp.buf.rename, bufopts, "Rename") |