|
|
@ -95,6 +95,8 @@ require('lazy').setup({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ 'b0o/schemastore.nvim', dependencies = { "neovim/nvim-lspconfig" } },
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
-- Autocompletion
|
|
|
|
-- Autocompletion
|
|
|
|
'hrsh7th/nvim-cmp',
|
|
|
|
'hrsh7th/nvim-cmp',
|
|
|
@ -222,7 +224,7 @@ require('lazy').setup({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
-- "gc" to comment visual regions/lines
|
|
|
|
-- "gc" to comment visual regions/lines
|
|
|
|
{ 'numToStr/Comment.nvim', opts = {} },
|
|
|
|
{ 'numToStr/Comment.nvim', opts = {} },
|
|
|
|
|
|
|
|
|
|
|
|
-- Fuzzy Finder (files, lsp, etc)
|
|
|
|
-- Fuzzy Finder (files, lsp, etc)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -257,8 +259,8 @@ require('lazy').setup({
|
|
|
|
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
|
|
|
|
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
|
|
|
|
-- These are some example plugins that I've included in the kickstart repository.
|
|
|
|
-- These are some example plugins that I've included in the kickstart repository.
|
|
|
|
-- Uncomment any of the lines below to enable them.
|
|
|
|
-- Uncomment any of the lines below to enable them.
|
|
|
|
-- require 'kickstart.plugins.autoformat',
|
|
|
|
require 'kickstart.plugins.autoformat',
|
|
|
|
-- require 'kickstart.plugins.debug',
|
|
|
|
require 'kickstart.plugins.debug',
|
|
|
|
|
|
|
|
|
|
|
|
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
|
|
|
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
|
|
|
-- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
|
|
|
|
-- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
|
|
|
@ -266,7 +268,7 @@ require('lazy').setup({
|
|
|
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
|
|
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
|
|
|
--
|
|
|
|
--
|
|
|
|
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
|
|
|
|
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
|
|
|
|
-- { import = 'custom.plugins' },
|
|
|
|
{ import = 'custom.plugins' },
|
|
|
|
}, {})
|
|
|
|
}, {})
|
|
|
|
|
|
|
|
|
|
|
|
-- [[ Setting options ]]
|
|
|
|
-- [[ Setting options ]]
|
|
|
@ -320,12 +322,6 @@ vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
|
|
|
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
|
|
|
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
|
|
|
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
|
|
|
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
|
|
|
|
|
|
|
|
|
|
|
-- Diagnostic keymaps
|
|
|
|
|
|
|
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
|
|
|
|
|
|
|
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
|
|
|
|
|
|
|
|
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
|
|
|
|
|
|
|
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- [[ Highlight on yank ]]
|
|
|
|
-- [[ Highlight on yank ]]
|
|
|
|
-- See `:help vim.highlight.on_yank()`
|
|
|
|
-- See `:help vim.highlight.on_yank()`
|
|
|
|
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
|
|
|
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
|
|
@ -347,12 +343,21 @@ require('telescope').setup {
|
|
|
|
['<C-d>'] = false,
|
|
|
|
['<C-d>'] = false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
vimgrep_arguments = {
|
|
|
|
|
|
|
|
'rg',
|
|
|
|
|
|
|
|
'--color=never',
|
|
|
|
|
|
|
|
'--no-heading',
|
|
|
|
|
|
|
|
'--with-filename',
|
|
|
|
|
|
|
|
'--line-number',
|
|
|
|
|
|
|
|
'--column',
|
|
|
|
|
|
|
|
'--smart-case',
|
|
|
|
|
|
|
|
'--hidden'
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-- Enable telescope fzf native, if installed
|
|
|
|
-- Enable telescope fzf native, if installed
|
|
|
|
pcall(require('telescope').load_extension, 'fzf')
|
|
|
|
pcall(require('telescope').load_extension, 'fzf')
|
|
|
|
|
|
|
|
|
|
|
|
-- Telescope live_grep in git root
|
|
|
|
-- Telescope live_grep in git root
|
|
|
|
-- Function to find the git root directory based on the current buffer's path
|
|
|
|
-- Function to find the git root directory based on the current buffer's path
|
|
|
|
local function find_git_root()
|
|
|
|
local function find_git_root()
|
|
|
@ -419,72 +424,75 @@ vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc =
|
|
|
|
|
|
|
|
|
|
|
|
-- [[ Configure Treesitter ]]
|
|
|
|
-- [[ Configure Treesitter ]]
|
|
|
|
-- See `:help nvim-treesitter`
|
|
|
|
-- See `:help nvim-treesitter`
|
|
|
|
-- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}'
|
|
|
|
require('nvim-treesitter.configs').setup {
|
|
|
|
vim.defer_fn(function()
|
|
|
|
-- Add languages to be installed here that you want installed for treesitter
|
|
|
|
require('nvim-treesitter.configs').setup {
|
|
|
|
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim', 'css', 'scss' },
|
|
|
|
-- Add languages to be installed here that you want installed for treesitter
|
|
|
|
|
|
|
|
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' },
|
|
|
|
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
|
|
|
|
|
|
|
auto_install = false,
|
|
|
|
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
|
|
|
|
|
|
|
auto_install = false,
|
|
|
|
highlight = { enable = true },
|
|
|
|
|
|
|
|
indent = { enable = true },
|
|
|
|
highlight = { enable = true },
|
|
|
|
incremental_selection = {
|
|
|
|
indent = { enable = true },
|
|
|
|
enable = true,
|
|
|
|
incremental_selection = {
|
|
|
|
keymaps = {
|
|
|
|
|
|
|
|
init_selection = '<c-space>',
|
|
|
|
|
|
|
|
node_incremental = '<c-space>',
|
|
|
|
|
|
|
|
scope_incremental = '<c-s>',
|
|
|
|
|
|
|
|
node_decremental = '<M-space>',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
textobjects = {
|
|
|
|
|
|
|
|
select = {
|
|
|
|
enable = true,
|
|
|
|
enable = true,
|
|
|
|
|
|
|
|
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
|
|
|
keymaps = {
|
|
|
|
keymaps = {
|
|
|
|
init_selection = '<c-space>',
|
|
|
|
-- You can use the capture groups defined in textobjects.scm
|
|
|
|
node_incremental = '<c-space>',
|
|
|
|
['aa'] = '@parameter.outer',
|
|
|
|
scope_incremental = '<c-s>',
|
|
|
|
['ia'] = '@parameter.inner',
|
|
|
|
node_decremental = '<M-space>',
|
|
|
|
['af'] = '@function.outer',
|
|
|
|
|
|
|
|
['if'] = '@function.inner',
|
|
|
|
|
|
|
|
['ac'] = '@class.outer',
|
|
|
|
|
|
|
|
['ic'] = '@class.inner',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
textobjects = {
|
|
|
|
move = {
|
|
|
|
select = {
|
|
|
|
enable = true,
|
|
|
|
enable = true,
|
|
|
|
set_jumps = true, -- whether to set jumps in the jumplist
|
|
|
|
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
|
|
|
goto_next_start = {
|
|
|
|
keymaps = {
|
|
|
|
[']m'] = '@function.outer',
|
|
|
|
-- You can use the capture groups defined in textobjects.scm
|
|
|
|
[']]'] = '@class.outer',
|
|
|
|
['aa'] = '@parameter.outer',
|
|
|
|
},
|
|
|
|
['ia'] = '@parameter.inner',
|
|
|
|
goto_next_end = {
|
|
|
|
['af'] = '@function.outer',
|
|
|
|
[']M'] = '@function.outer',
|
|
|
|
['if'] = '@function.inner',
|
|
|
|
[']['] = '@class.outer',
|
|
|
|
['ac'] = '@class.outer',
|
|
|
|
|
|
|
|
['ic'] = '@class.inner',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
move = {
|
|
|
|
goto_previous_start = {
|
|
|
|
enable = true,
|
|
|
|
['[m'] = '@function.outer',
|
|
|
|
set_jumps = true, -- whether to set jumps in the jumplist
|
|
|
|
['[['] = '@class.outer',
|
|
|
|
goto_next_start = {
|
|
|
|
|
|
|
|
[']m'] = '@function.outer',
|
|
|
|
|
|
|
|
[']]'] = '@class.outer',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
goto_next_end = {
|
|
|
|
|
|
|
|
[']M'] = '@function.outer',
|
|
|
|
|
|
|
|
[']['] = '@class.outer',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
goto_previous_start = {
|
|
|
|
|
|
|
|
['[m'] = '@function.outer',
|
|
|
|
|
|
|
|
['[['] = '@class.outer',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
goto_previous_end = {
|
|
|
|
|
|
|
|
['[M'] = '@function.outer',
|
|
|
|
|
|
|
|
['[]'] = '@class.outer',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
swap = {
|
|
|
|
goto_previous_end = {
|
|
|
|
enable = true,
|
|
|
|
['[M'] = '@function.outer',
|
|
|
|
swap_next = {
|
|
|
|
['[]'] = '@class.outer',
|
|
|
|
['<leader>a'] = '@parameter.inner',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
swap_previous = {
|
|
|
|
|
|
|
|
['<leader>A'] = '@parameter.inner',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
swap = {
|
|
|
|
end, 0)
|
|
|
|
enable = true,
|
|
|
|
|
|
|
|
swap_next = {
|
|
|
|
|
|
|
|
['<leader>a'] = '@parameter.inner',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
swap_previous = {
|
|
|
|
|
|
|
|
['<leader>A'] = '@parameter.inner',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Diagnostic keymaps
|
|
|
|
|
|
|
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
|
|
|
|
|
|
|
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
|
|
|
|
|
|
|
|
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
|
|
|
|
|
|
|
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
|
|
|
|
|
|
|
|
|
|
|
|
-- [[ Configure LSP ]]
|
|
|
|
-- [[ Configure LSP ]]
|
|
|
|
-- This function gets run when an LSP connects to a particular buffer.
|
|
|
|
-- This function gets run when an LSP connects to a particular buffer.
|
|
|
@ -506,10 +514,10 @@ local on_attach = function(_, bufnr)
|
|
|
|
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
|
|
|
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
|
|
|
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
|
|
|
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
|
|
|
|
|
|
|
|
|
|
|
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
|
|
|
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
|
|
|
|
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
|
|
|
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
|
|
|
nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
|
|
|
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
|
|
|
|
nmap('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
|
|
|
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
|
|
|
|
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
|
|
|
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
|
|
|
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
|
|
|
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
|
|
|
|
|
|
|
|
|
|
@ -531,29 +539,6 @@ local on_attach = function(_, bufnr)
|
|
|
|
end, { desc = 'Format current buffer with LSP' })
|
|
|
|
end, { desc = 'Format current buffer with LSP' })
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- document existing key chains
|
|
|
|
|
|
|
|
require('which-key').register {
|
|
|
|
|
|
|
|
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
|
|
|
|
|
|
|
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
|
|
|
|
|
|
|
|
['<leader>g'] = { name = '[G]it', _ = 'which_key_ignore' },
|
|
|
|
|
|
|
|
['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' },
|
|
|
|
|
|
|
|
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
|
|
|
|
|
|
|
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
|
|
|
|
|
|
|
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
|
|
|
|
|
|
|
|
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
-- register which-key VISUAL mode
|
|
|
|
|
|
|
|
-- required for visual <leader>hs (hunk stage) to work
|
|
|
|
|
|
|
|
require('which-key').register({
|
|
|
|
|
|
|
|
['<leader>'] = { name = 'VISUAL <leader>' },
|
|
|
|
|
|
|
|
['<leader>h'] = { 'Git [H]unk' },
|
|
|
|
|
|
|
|
}, { mode = 'v' })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- mason-lspconfig requires that these setup functions are called in this order
|
|
|
|
|
|
|
|
-- before setting up the servers.
|
|
|
|
|
|
|
|
require('mason').setup()
|
|
|
|
|
|
|
|
require('mason-lspconfig').setup()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Enable the following language servers
|
|
|
|
-- Enable the following language servers
|
|
|
|
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
|
|
|
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
|
|
|
--
|
|
|
|
--
|
|
|
@ -564,18 +549,20 @@ require('mason-lspconfig').setup()
|
|
|
|
-- define the property 'filetypes' to the map in question.
|
|
|
|
-- define the property 'filetypes' to the map in question.
|
|
|
|
local servers = {
|
|
|
|
local servers = {
|
|
|
|
-- clangd = {},
|
|
|
|
-- clangd = {},
|
|
|
|
-- gopls = {},
|
|
|
|
gopls = {},
|
|
|
|
-- pyright = {},
|
|
|
|
-- pyright = {},
|
|
|
|
-- rust_analyzer = {},
|
|
|
|
rust_analyzer = {},
|
|
|
|
-- tsserver = {},
|
|
|
|
tsserver = {},
|
|
|
|
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lua_ls = {
|
|
|
|
lua_ls = {
|
|
|
|
Lua = {
|
|
|
|
Lua = {
|
|
|
|
workspace = { checkThirdParty = false },
|
|
|
|
workspace = { checkThirdParty = false, library = vim.api.nvim_get_runtime_file("", true) },
|
|
|
|
telemetry = { enable = false },
|
|
|
|
telemetry = { enable = false },
|
|
|
|
-- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
|
|
|
diagnostics = {
|
|
|
|
-- diagnostics = { disable = { 'missing-fields' } },
|
|
|
|
globals = {
|
|
|
|
|
|
|
|
'vim', 'require'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -585,15 +572,42 @@ require('neodev').setup()
|
|
|
|
|
|
|
|
|
|
|
|
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
|
|
|
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
|
|
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
|
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
|
|
|
|
|
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
|
|
|
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
|
|
|
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Ensure the servers above are installed
|
|
|
|
-- Ensure the servers above are installed
|
|
|
|
local mason_lspconfig = require 'mason-lspconfig'
|
|
|
|
local mason_lspconfig = require 'mason-lspconfig'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require('mason').setup()
|
|
|
|
mason_lspconfig.setup {
|
|
|
|
mason_lspconfig.setup {
|
|
|
|
ensure_installed = vim.tbl_keys(servers),
|
|
|
|
ensure_installed = vim.tbl_keys(servers),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require('lspconfig').jsonls.setup {
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
|
|
|
|
json = {
|
|
|
|
|
|
|
|
schemas = require('schemastore').json.schemas(),
|
|
|
|
|
|
|
|
validate = { enable = true },
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
yaml = {
|
|
|
|
|
|
|
|
schemas = require('schemastore').yaml.schemas(),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require('lspconfig').ltex.setup {
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
|
|
|
|
ltex = {
|
|
|
|
|
|
|
|
language = "en-US",
|
|
|
|
|
|
|
|
diagnosticsSeverity = "information",
|
|
|
|
|
|
|
|
additionalRules = {
|
|
|
|
|
|
|
|
motherTongue = "en-US"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mason_lspconfig.setup_handlers {
|
|
|
|
mason_lspconfig.setup_handlers {
|
|
|
|
function(server_name)
|
|
|
|
function(server_name)
|
|
|
|
require('lspconfig')[server_name].setup {
|
|
|
|
require('lspconfig')[server_name].setup {
|
|
|
@ -602,7 +616,7 @@ mason_lspconfig.setup_handlers {
|
|
|
|
settings = servers[server_name],
|
|
|
|
settings = servers[server_name],
|
|
|
|
filetypes = (servers[server_name] or {}).filetypes,
|
|
|
|
filetypes = (servers[server_name] or {}).filetypes,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end,
|
|
|
|
end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-- [[ Configure nvim-cmp ]]
|
|
|
|
-- [[ Configure nvim-cmp ]]
|
|
|
@ -626,12 +640,12 @@ cmp.setup {
|
|
|
|
['<C-p>'] = cmp.mapping.select_prev_item(),
|
|
|
|
['<C-p>'] = cmp.mapping.select_prev_item(),
|
|
|
|
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
|
|
|
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
|
|
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
|
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
|
|
['<C-Space>'] = cmp.mapping.complete {},
|
|
|
|
['<C-e>'] = cmp.mapping.complete {},
|
|
|
|
['<CR>'] = cmp.mapping.confirm {
|
|
|
|
['<CR>'] = cmp.mapping.confirm {
|
|
|
|
behavior = cmp.ConfirmBehavior.Replace,
|
|
|
|
behavior = cmp.ConfirmBehavior.Replace,
|
|
|
|
select = true,
|
|
|
|
select = true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
['<Tab>'] = cmp.mapping(function(fallback)
|
|
|
|
['<C-j>'] = cmp.mapping(function(fallback)
|
|
|
|
if cmp.visible() then
|
|
|
|
if cmp.visible() then
|
|
|
|
cmp.select_next_item()
|
|
|
|
cmp.select_next_item()
|
|
|
|
elseif luasnip.expand_or_locally_jumpable() then
|
|
|
|
elseif luasnip.expand_or_locally_jumpable() then
|
|
|
@ -640,7 +654,7 @@ cmp.setup {
|
|
|
|
fallback()
|
|
|
|
fallback()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end, { 'i', 's' }),
|
|
|
|
end, { 'i', 's' }),
|
|
|
|
['<S-Tab>'] = cmp.mapping(function(fallback)
|
|
|
|
['<C-k>'] = cmp.mapping(function(fallback)
|
|
|
|
if cmp.visible() then
|
|
|
|
if cmp.visible() then
|
|
|
|
cmp.select_prev_item()
|
|
|
|
cmp.select_prev_item()
|
|
|
|
elseif luasnip.locally_jumpable(-1) then
|
|
|
|
elseif luasnip.locally_jumpable(-1) then
|
|
|
|