Update
This commit is contained in:
parent
a785f25b83
commit
843582f1c8
4 changed files with 114 additions and 64 deletions
|
|
@ -31,7 +31,10 @@ local options = {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
|
{ name = "luasnip" },
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
|
-- { name = 'nvim_lsp_signature_help' },
|
||||||
|
{ name = "nvim_lsp_document_symbol" },
|
||||||
{ name = "nvim_lua" },
|
{ name = "nvim_lua" },
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,58 +1,51 @@
|
||||||
require("mason-lspconfig").setup_handlers {
|
local default = {
|
||||||
-- The first entry (without a key) will be the default handler
|
on_attach = function(client, bufnr)
|
||||||
-- and will be called for each installed server that doesn't have
|
require "lsp_signature".on_attach(
|
||||||
-- a dedicated handler.
|
{
|
||||||
function(server_name) -- default handler (optional)
|
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||||
require("lspconfig")[server_name].setup {}
|
handler_opts = {
|
||||||
end,
|
border = "none"
|
||||||
-- Next, you can provide a dedicated handler for specific servers.
|
|
||||||
-- For example, a handler override for the `rust_analyzer`:
|
|
||||||
-- ["rust_analyzer"] = function ()
|
|
||||||
-- require("rust-tools").setup {}
|
|
||||||
-- end
|
|
||||||
["lua_ls"] = function()
|
|
||||||
require("lspconfig").lua_ls.setup {
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
diagnostics = {
|
|
||||||
globals = { "vim" },
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
library = {
|
|
||||||
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
|
|
||||||
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
|
|
||||||
[vim.fn.stdpath "data" .. "/lazy/extensions/nvchad_types"] = true,
|
|
||||||
[vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true,
|
|
||||||
},
|
|
||||||
maxPreload = 100000,
|
|
||||||
preloadFileSize = 10000,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
hint_enable = false,
|
||||||
|
doc_lines = 0,
|
||||||
|
floating_window_off_x = 999,
|
||||||
|
floating_window_off_y = 1,
|
||||||
|
-- floating_window = false,
|
||||||
}
|
}
|
||||||
|
, bufnr) -- Note: add in lsp client on-attach
|
||||||
end,
|
end,
|
||||||
|
capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
["ltex"] = function()
|
|
||||||
require("lspconfig").ltex.setup {
|
|
||||||
settings = {
|
|
||||||
ltex = {
|
|
||||||
language = "fr",
|
|
||||||
checkFrequency = "save"
|
|
||||||
},
|
|
||||||
-- set formatter
|
|
||||||
formatters = {
|
|
||||||
["latexindent"] = {
|
|
||||||
exe = "latexindent",
|
|
||||||
args = { "-sl", "-g /dev/stderr" },
|
|
||||||
stdin = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local servers = {
|
||||||
|
java_language_server = { cmd = {"java-language-server"} },
|
||||||
|
ocamllsp = {},
|
||||||
|
-- "pyright",
|
||||||
|
lua_ls = {},
|
||||||
|
clangd = {},
|
||||||
|
jedi_language_server = {},
|
||||||
|
nil_ls = {},
|
||||||
|
ltex = {
|
||||||
|
settings = {
|
||||||
|
ltex = {
|
||||||
|
language = "fr",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for server, config in pairs(servers) do
|
||||||
|
local lsp = require("lspconfig")[server]
|
||||||
|
|
||||||
|
-- print(server)
|
||||||
|
local config = vim.tbl_deep_extend("keep", config, default, lsp.document_config.default_config)
|
||||||
|
if config.cmd ~= nil then
|
||||||
|
if vim.fn.executable(config.cmd[1]) == 1 then
|
||||||
|
lsp.setup(config)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = false,
|
virtual_text = false,
|
||||||
-- signs = true,
|
-- signs = true,
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,11 @@ vim.keymap.set(
|
||||||
'<leader>ff',
|
'<leader>ff',
|
||||||
"<cmd> Telescope find_files follow=true <CR>"
|
"<cmd> Telescope find_files follow=true <CR>"
|
||||||
)
|
)
|
||||||
|
vim.keymap.set(
|
||||||
|
'n',
|
||||||
|
'<leader>fg',
|
||||||
|
"<cmd> Telescope live_grep <CR>"
|
||||||
|
)
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
'n',
|
'n',
|
||||||
'<leader>fF',
|
'<leader>fF',
|
||||||
|
|
@ -31,6 +36,15 @@ vim.keymap.set('n', '<leader>N', "<cmd> Neogit <cr>", { desc = "Open Neogit" })
|
||||||
vim.keymap.set('n', '<a-f1>', "<cmd> Copilot <cr>", { desc = "Start Copilot" })
|
vim.keymap.set('n', '<a-f1>', "<cmd> Copilot <cr>", { desc = "Start Copilot" })
|
||||||
vim.keymap.set('x', 'p', 'p:let @+=@0<CR>:let @"=@0<CR>', { desc = "Start Copilot" })
|
vim.keymap.set('x', 'p', 'p:let @+=@0<CR>:let @"=@0<CR>', { desc = "Start Copilot" })
|
||||||
|
|
||||||
|
-- Luasnip
|
||||||
|
local ls = require("luasnip")
|
||||||
|
vim.keymap.set({"i", "s"}, "<A-j>", function() ls.jump( 1) end, {silent = true})
|
||||||
|
vim.keymap.set({"i", "s"}, "<A-k>", function() ls.jump(-1) end, {silent = true})
|
||||||
|
|
||||||
|
-- Hop
|
||||||
|
vim.keymap.set({'n', 'v'}, 'f', "<cmd> HopWord <cr>", { desc = "HopWord" })
|
||||||
|
|
||||||
|
|
||||||
-- Global mappings.
|
-- Global mappings.
|
||||||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||||
-- Use LspAttach autocommand to only map the following keys
|
-- Use LspAttach autocommand to only map the following keys
|
||||||
|
|
|
||||||
|
|
@ -13,16 +13,17 @@ local plugins = {
|
||||||
require('configs.treesitter')
|
require('configs.treesitter')
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
-- {
|
||||||
"williamboman/mason-lspconfig.nvim",
|
-- "williamboman/mason-lspconfig.nvim",
|
||||||
dependencies = {
|
-- dependencies = {
|
||||||
"williamboman/mason.nvim",
|
-- "williamboman/mason.nvim",
|
||||||
},
|
-- },
|
||||||
config = function()
|
-- config = function()
|
||||||
require("mason").setup()
|
-- require("mason").setup()
|
||||||
require("mason-lspconfig").setup()
|
-- require("mason-lspconfig").setup()
|
||||||
end
|
-- --
|
||||||
},
|
-- end
|
||||||
|
-- },
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
config = function()
|
config = function()
|
||||||
|
|
@ -60,7 +61,13 @@ local plugins = {
|
||||||
crust = "#000000",
|
crust = "#000000",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
custom_highlights = {},
|
custom_highlights = function(C)
|
||||||
|
return {
|
||||||
|
HopNextKey = { bg = C.text, fg = C.base, style = { "bold", "underline" } },
|
||||||
|
HopNextKey1 = { bg = C.text, fg = C.base, style = { "bold" } },
|
||||||
|
HopNextKey2 = { bg = C.text, fg = C.base, style = { "bold", "italic" } },
|
||||||
|
}
|
||||||
|
end,
|
||||||
integrations = {
|
integrations = {
|
||||||
cmp = true,
|
cmp = true,
|
||||||
gitsigns = true,
|
gitsigns = true,
|
||||||
|
|
@ -72,6 +79,7 @@ local plugins = {
|
||||||
illuminate = false,
|
illuminate = false,
|
||||||
-- noice = true,
|
-- noice = true,
|
||||||
notify = true,
|
notify = true,
|
||||||
|
flash = true,
|
||||||
telescope = {
|
telescope = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
style = "nvchad"
|
style = "nvchad"
|
||||||
|
|
@ -80,6 +88,9 @@ local plugins = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
enable_ui = true, -- enable nvim-dap-ui
|
enable_ui = true, -- enable nvim-dap-ui
|
||||||
},
|
},
|
||||||
|
indent_blankline = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
native_lsp = {
|
native_lsp = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
virtual_text = {
|
virtual_text = {
|
||||||
|
|
@ -136,7 +147,16 @@ local plugins = {
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
"hrsh7th/cmp-path",
|
"hrsh7th/cmp-path",
|
||||||
|
|
||||||
"L3MON4D3/LuaSnip",
|
{
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
dependencies = {
|
||||||
|
"rafamadriz/friendly-snippets",
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
end
|
||||||
|
|
||||||
|
},
|
||||||
'saadparwaiz1/cmp_luasnip'
|
'saadparwaiz1/cmp_luasnip'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -306,7 +326,16 @@ local plugins = {
|
||||||
)
|
)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ "lukas-reineke/indent-blankline.nvim" },
|
{
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
main = "ibl",
|
||||||
|
opts = {
|
||||||
|
scope = {
|
||||||
|
show_start = false,
|
||||||
|
show_end = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'michaelb/sniprun',
|
'michaelb/sniprun',
|
||||||
-- run = 'sh ./install.sh',
|
-- run = 'sh ./install.sh',
|
||||||
|
|
@ -390,7 +419,18 @@ local plugins = {
|
||||||
render = "minimal",
|
render = "minimal",
|
||||||
stages = "static",
|
stages = "static",
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"ray-x/lsp_signature.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'smoka7/hop.nvim',
|
||||||
|
version = "*",
|
||||||
|
opts = {
|
||||||
|
uppercase_labels = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return plugins
|
return plugins
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue