Compare commits
24 Commits
a52c4bf561
...
main
Author | SHA1 | Date | |
---|---|---|---|
4471eb541c
|
|||
9ab548b69b
|
|||
59f670d673
|
|||
a35efc9fcf
|
|||
c9fc72c20c
|
|||
291ab46489
|
|||
f6fc4b0ef5
|
|||
b475e6c80f
|
|||
c02781e3bf
|
|||
aca3a6f5b6
|
|||
314be14e73
|
|||
efa9e8e862
|
|||
4274260c41
|
|||
f7338eef07
|
|||
47b22128a8
|
|||
9bf093ee26
|
|||
3781583882
|
|||
3815c4fc54
|
|||
1f39139f1d
|
|||
1d59bfc4cb
|
|||
03192ef86a
|
|||
fd61b53dbd
|
|||
e047151a72
|
|||
989f9163c0
|
@@ -1,50 +1,48 @@
|
||||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
||||
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "31f2a2657b6261724313281fe0d8ba6f43f4a4fa" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "d600d3922c1d001422689319a8f915136bb64e1e" },
|
||||
"LuaSnip": { "branch": "master", "commit": "de10d8414235b0a8cabfeba60d07c24304e71f5c" },
|
||||
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "4d5858bd4c471c895060e1b9f3575f1551184dc5" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "15bb33cdb47e85278e168cad11acb1b6fa9c6488" },
|
||||
"lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "86fe39534b7da729a1ac56c0466e76f2c663dc42" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
|
||||
"luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" },
|
||||
"luvit-meta": { "branch": "main", "commit": "1df30b60b1b4aecfebc785aa98943db6c6989716" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
||||
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
||||
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
|
||||
"mini.nvim": { "branch": "main", "commit": "a8b1d74f45dadf3554c0eed784c6ccd8ade67883" },
|
||||
"neorg": { "branch": "main", "commit": "35da593c55d78086a3203ee3e6d749fafe2e4e73" },
|
||||
"mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" },
|
||||
"mini.nvim": { "branch": "main", "commit": "0ffc2af38b3c5293076317b138635d6d7c80a40f" },
|
||||
"neorg": { "branch": "main", "commit": "790b0444c0c654131a722817dc893332e06c72b9" },
|
||||
"neorg-interim-ls": { "branch": "main", "commit": "52bdf8a8cd246a9205756449776aa057bd593d61" },
|
||||
"neorg-telescope": { "branch": "main", "commit": "7fb6ca6a632c3c095601d379a664c0c1f802dc6c" },
|
||||
"nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||
"nvim-dap": { "branch": "master", "commit": "7aade9e99bef5f0735cf966e715b3ce45515d786" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "a56f4b9dde5daf3d4c7bb50cf78ab609537f2259" },
|
||||
"nvim-dap": { "branch": "master", "commit": "968f89f8aac11b6bdbfc942c71d3436658c1435f" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "408cf07b97535825cca6f1afa908d98348712ba6" },
|
||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "205e3369bc83d8cb83f7409c36120e24611f8c5c" },
|
||||
"oil.nvim": { "branch": "master", "commit": "302bbaceeafc690e6419e0c8296e804d60cb9446" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
|
||||
"oil.nvim": { "branch": "master", "commit": "07f80ad645895af849a597d1cac897059d89b686" },
|
||||
"pathlib.nvim": { "branch": "main", "commit": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"rose-pine": { "branch": "main", "commit": "96ff3993a67356ee85d1cdab9be652cdc1c5d1ac" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"rose-pine": { "branch": "main", "commit": "72a04c4065345b51b56aed4859ea1d884f734097" },
|
||||
"tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"typst.vim": { "branch": "main", "commit": "8ce752f1ba1277046429cb469c17ff2e1abc718f" },
|
||||
"undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" },
|
||||
"vim-pandoc-syntax": { "branch": "master", "commit": "23ec97521148d1866bc05bbc50d7758ed0a4d84e" },
|
||||
"vim-rhubarb": { "branch": "master", "commit": "386daa2e9d98e23e27ad089afcbe5c5a903e488d" },
|
||||
"typst-preview.nvim": { "branch": "master", "commit": "dea4525d5420b7c32eebda7de15a6beb9d6574fa" },
|
||||
"typst.vim": { "branch": "main", "commit": "323539709e29a537ff39dfce6c05f175a8921504" },
|
||||
"undotree": { "branch": "master", "commit": "28f2f54a34baff90ea6f4a735ef1813ad875c743" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
|
||||
"vim-pandoc-syntax": { "branch": "master", "commit": "ea3fc415784bdcbae7f0093b80070ca4ff9e44c8" },
|
||||
"vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
"vim-speeddating": { "branch": "master", "commit": "c17eb01ebf5aaf766c53bab1f6592710e5ffb796" },
|
||||
"vimtex": { "branch": "master", "commit": "237671ff5852e30f1ad47a572d55a9c2e2dbe91d" },
|
||||
"vimtex": { "branch": "master", "commit": "dc90feacb86f7b85b0b791d8073eefc769a23725" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||
}
|
||||
|
@@ -56,8 +56,7 @@ return {
|
||||
},
|
||||
disabledRules = {
|
||||
fr = { "APOS_TYP", "FRENCH_WHITESPACE", "CHANGE", "ISSUE", },
|
||||
en = { "DASH_RULE", "TWO_HYPHENS", "CHANGE", "ISSUE", "CHECK",
|
||||
"ACTUALLY", "CONSISTENT", },
|
||||
en = { "DASH_RULE", "TWO_HYPHENS", "CHANGE", "ISSUE", "CHECK", "ACTUALLY", "CONSISTENT", "EN_CONSISTENT_APOS", },
|
||||
},
|
||||
dictionary = {
|
||||
fr = { "CryptPad", "Chouhartem",
|
||||
|
@@ -63,7 +63,7 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "typst" },
|
||||
group = typstgroup,
|
||||
callback = function()
|
||||
vim.keymap.set('', '<LocalLeader>mp', ':TypstWatch<CR>', { noremap = true, silent = true, desc = "[M]ake [P]review" })
|
||||
vim.keymap.set('', '<LocalLeader>mp', ':TypstPreview<CR>', { noremap = true, silent = true, desc = "[M]ake [P]review" })
|
||||
vim.o.spell = true
|
||||
spell_keymap()
|
||||
vim.o.spelllang = "fr,en"
|
||||
@@ -81,3 +81,12 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||
vim.o.spelllang = "en"
|
||||
end,
|
||||
})
|
||||
|
||||
-- disable LSP for password-store
|
||||
vim.api.nvim_create_autocmd({"BufEnter", "BufRead" }, {
|
||||
pattern = "/dev/shm/pass*",
|
||||
group = vim.api.nvim_create_augroup('DisableLsp', {}),
|
||||
callback = function ()
|
||||
vim.lsp.stop_client(vim.lsp.get_clients())
|
||||
end
|
||||
})
|
||||
|
@@ -1,5 +1,3 @@
|
||||
-- See `:help cmp`
|
||||
local cmp = require 'cmp'
|
||||
local luasnip = require 'luasnip'
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
require('luasnip.loaders.from_lua').lazy_load()
|
||||
@@ -9,67 +7,3 @@ luasnip.config.setup {
|
||||
enable_autosnippets = true,
|
||||
}
|
||||
luasnip.filetype_extend("jjdescription", { "gitcommit" })
|
||||
|
||||
local has_words_before = function()
|
||||
unpack = unpack or table.unpack
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,noinsert',
|
||||
autocomplete = false,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete {},
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
['<C-e>'] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close() }),
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
if #cmp.get_entries() == 1 then
|
||||
cmp.confirm({ select = true })
|
||||
else
|
||||
cmp.select_next_item()
|
||||
end
|
||||
elseif luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
if #cmp.get_entries() == 1 then
|
||||
cmp.confirm({ select = true })
|
||||
end
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'lazydev',
|
||||
group_index = 0 },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'path' },
|
||||
},
|
||||
}
|
||||
|
146
lua/lsp.lua
146
lua/lsp.lua
@@ -35,6 +35,10 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
||||
nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||
nmap('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
||||
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
nmap('<leader>dd', function()
|
||||
local new_config = not vim.diagnostic.config().virtual_lines
|
||||
vim.diagnostic.config({ virtual_lines = new_config })
|
||||
end, '[D]iagnostic toggle virtual lines')
|
||||
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
|
||||
-- See `:help K` for why this keymap
|
||||
@@ -60,20 +64,22 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
||||
require('which-key').add {
|
||||
-- { "<leader>c", group = "[C]ode" },
|
||||
-- { "<leader>c_", hidden = true },
|
||||
{ "<leader>d", group = "[D]ocument" },
|
||||
{ "<leader>d_", hidden = true },
|
||||
{ "<leader>g", group = "[G]it" },
|
||||
{ "<leader>g_", hidden = true },
|
||||
{ "<leader>h", group = "Git [H]unk" },
|
||||
{ "<leader>h_", hidden = true },
|
||||
{ "<leader>r", group = "[R]ename" },
|
||||
{ "<leader>r_", hidden = true },
|
||||
{ "<leader>s", group = "[S]earch" },
|
||||
{ "<leader>s_", hidden = true },
|
||||
{ "<leader>t", group = "[T]oggle" },
|
||||
{ "<leader>t_", hidden = true },
|
||||
{ "<leader>w", group = "[W]orkspace" },
|
||||
{ "<leader>w_", hidden = true },
|
||||
{ "<leader>d", group = "[D]ocument / [D]iagnostic/ [D]ebug" },
|
||||
{ "<leader>d_", hidden = true },
|
||||
{ "<leader>ds", group = "[D]ebug [S]tep" },
|
||||
{ "<leader>ds_", hidden = true },
|
||||
{ "<leader>g", group = "[G]it" },
|
||||
{ "<leader>g_", hidden = true },
|
||||
{ "<leader>h", group = "Git [H]unk" },
|
||||
{ "<leader>h_", hidden = true },
|
||||
{ "<leader>r", group = "[R]ename" },
|
||||
{ "<leader>r_", hidden = true },
|
||||
{ "<leader>s", group = "[S]earch" },
|
||||
{ "<leader>s_", hidden = true },
|
||||
{ "<leader>t", group = "[T]oggle" },
|
||||
{ "<leader>t_", hidden = true },
|
||||
{ "<leader>w", group = "[W]orkspace" },
|
||||
{ "<leader>w_", hidden = true },
|
||||
}
|
||||
-- register which-key VISUAL mode
|
||||
-- required for visual <leader>hs (hunk stage) to work
|
||||
@@ -82,63 +88,49 @@ require('which-key').add {
|
||||
{ "<leader>h", desc = "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
|
||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||
--
|
||||
-- Add any additional override configuration in the following tables. They will be passed to
|
||||
-- the `settings` field of the server config. You must look up that documentation yourself.
|
||||
--
|
||||
-- If you want to override the default filetypes that your language server will attach to you can
|
||||
-- define the property 'filetypes' to the map in question.
|
||||
local servers = {
|
||||
clangd = {},
|
||||
bashls = {},
|
||||
-- gopls = {},
|
||||
pyright = {},
|
||||
-- rust_analyzer = {},
|
||||
ts_ls = {},
|
||||
eslint = {},
|
||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
||||
texlab = {},
|
||||
tinymist = {},
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
workspace = { checkThirdParty = false },
|
||||
telemetry = { enable = false },
|
||||
-- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||
-- diagnostics = { disable = { 'missing-fields' } },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
-- capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
|
||||
-- Ensure the servers above are installed
|
||||
local mason_lspconfig = require 'mason-lspconfig'
|
||||
-- [[ DAP ]]
|
||||
|
||||
mason_lspconfig.setup {
|
||||
ensure_installed = vim.tbl_keys(servers),
|
||||
automatic_installation = true,
|
||||
}
|
||||
local setup_dap = function()
|
||||
local dap = require('dap');
|
||||
local ui = require('dapui');
|
||||
ui.setup();
|
||||
require("nvim-dap-virtual-text").setup();
|
||||
|
||||
mason_lspconfig.setup_handlers {
|
||||
function(server_name)
|
||||
require('lspconfig')[server_name].setup {
|
||||
capabilities = capabilities,
|
||||
settings = servers[server_name],
|
||||
filetypes = (servers[server_name] or {}).filetypes,
|
||||
}
|
||||
end,
|
||||
}
|
||||
vim.keymap.set("n", "<Leader>b", dap.toggle_breakpoint, { desc = "Debug [B]reakpoint", silent = true });
|
||||
vim.keymap.set("n", "<Leader>dr", dap.run_to_cursor, { desc = "[D]ebug [R]un to cursor" });
|
||||
vim.keymap.set("n", "<Leader>de", function()
|
||||
ui.eval(nil, { enter = true })
|
||||
end, { desc = "[D]ebug [E]val under cursor", silent = true });
|
||||
|
||||
-- TODO: add some DAP configs to test
|
||||
|
||||
vim.keymap.set("n", "<Leader>dc", dap.continue, { desc = "[D]ebug [C]ontinue", silent = true })
|
||||
vim.keymap.set("n", "<Leader>dsi", dap.step_into, { desc = "[D]ebug [S]tep [I]nto", silent = true })
|
||||
vim.keymap.set("n", "<Leader>dso", dap.step_over, { desc = "[D]ebug [S]tep [O]ver", silent = true })
|
||||
vim.keymap.set("n", "<Leader>dsu", dap.step_out, { desc = "[D]ebug [S]tep o[U]t", silent = true })
|
||||
vim.keymap.set("n", "<Leader>dsb", dap.step_back, { desc = "[D]ebug [S]tep [B]ack", silent = true })
|
||||
vim.keymap.set("n", "<Leader>dr", dap.restart, { desc = "[D]ebug [R]estart", silent = true })
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
ui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
ui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
ui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
ui.close()
|
||||
end
|
||||
end
|
||||
|
||||
setup_dap()
|
||||
|
||||
-- [[ System LSPs ]]
|
||||
local setup_godot_dap = function()
|
||||
local dap = require("dap")
|
||||
|
||||
@@ -162,5 +154,23 @@ end
|
||||
|
||||
setup_godot_dap()
|
||||
|
||||
vim.diagnostic.config({ virtual_text = true })
|
||||
vim.lsp.enable({ "ltex_ls_plus", "rust-analyzer", "gdscript" })
|
||||
-- [[ lsp configurations ]]
|
||||
vim.lsp.config("lua_ls", {
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = { checkThirdParty = false },
|
||||
telemetry = { enable = false },
|
||||
-- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||
-- diagnostics = { disable = { 'missing-fields' } },
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
vim.diagnostic.config({ virtual_lines = true })
|
||||
vim.lsp.enable({
|
||||
-- managed in lsp directory
|
||||
"ltex_ls_plus", "rust-analyzer", "gdscript",
|
||||
-- managed by lsp-config
|
||||
"tinymist", "texlab", "clangd", "pyright", "ts_ls", "eslint", "lua_ls", "bashls", "jsonls"
|
||||
})
|
||||
|
@@ -34,8 +34,8 @@ for i = 0, 9 do
|
||||
keymap('n', 'z' .. i, ':set fdl=' .. i .. '<CR>', { noremap = true, silent = false })
|
||||
end
|
||||
-- tab for folds management
|
||||
keymap('n', '<Tab>', 'za', {noremap= true, silent = true, desc = 'Toggle open folds'})
|
||||
keymap('n', '<S-Tab>', 'zA', {noremap= true, silent = true, desc = 'Toggle open all folds'})
|
||||
keymap('n', '<Tab>', 'za', { noremap = true, silent = true, desc = 'Toggle open folds' })
|
||||
keymap('n', '<S-Tab>', 'zA', { noremap = true, silent = true, desc = 'Toggle open all folds' })
|
||||
|
||||
-- in :terminal esc exits edit mode
|
||||
keymap('t', '<Esc>', '<C-\\><C-n>', { noremap = true, silent = true })
|
||||
@@ -66,6 +66,9 @@ keymap({ 'n', 'v' }, '<C-l>', ':set hlsearch!<CR>', { silent = true, noremap = t
|
||||
-- Undotree
|
||||
keymap('n', 'U', vim.cmd.UndotreeToggle, { desc = "[U]ndotree toggle", silent = true, noremap = true })
|
||||
|
||||
-- [[ Paste ]]
|
||||
keymap('i', '<C-S-v>', '<C-r>+', { noremap = true, silent = true, desc = 'Paste from "+' })
|
||||
|
||||
-- [[ Some standard behaviour changes ]]
|
||||
-- Y is mapped to y$, remap to yg_
|
||||
keymap('n', 'Y', 'yg_', { noremap = true, silent = true, desc = '[Y]ank the line' })
|
||||
|
@@ -29,46 +29,92 @@ require('lazy').setup({
|
||||
-- LSP Configuration & Plugins
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
-- Automatically install LSPs to stdpath for neovim
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
|
||||
-- Useful status updates for LSP
|
||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
},
|
||||
},
|
||||
-- LSP-signature
|
||||
{
|
||||
"ray-x/lsp_signature.nvim",
|
||||
event = "InsertEnter",
|
||||
opts = {
|
||||
bind = true,
|
||||
handler_opts = {
|
||||
border = "rounded"
|
||||
}
|
||||
},
|
||||
config = function(_, opts) require 'lsp_signature'.setup(opts) end
|
||||
},
|
||||
|
||||
-- DAP: Debug Adapter Protocol
|
||||
'mfussenegger/nvim-dap',
|
||||
{
|
||||
'mfussenegger/nvim-dap',
|
||||
dependencies = {
|
||||
'rcarriga/nvim-dap-ui',
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
-- Autocompletion
|
||||
'hrsh7th/nvim-cmp',
|
||||
-- [[ Autocompletion ]]
|
||||
'saghen/blink.cmp',
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = {
|
||||
-- Snippet Engine & its associated nvim-cmp source
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
|
||||
-- Adds LSP completion capabilities
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-path',
|
||||
|
||||
-- Adds a number of user-friendly snippets
|
||||
'rafamadriz/friendly-snippets',
|
||||
'L3MON4D3/LuaSnip',
|
||||
},
|
||||
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = '1.*',
|
||||
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
|
||||
-- build = 'cargo build --release',
|
||||
-- If you use nix, you can build from source using latest nightly rust with:
|
||||
-- build = 'nix run .#build-plugin',
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
|
||||
-- 'super-tab' for mappings similar to vscode (tab to accept)
|
||||
-- 'enter' for enter to accept
|
||||
-- 'none' for no mappings
|
||||
--
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = 'default' },
|
||||
|
||||
appearance = {
|
||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- Adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = 'mono'
|
||||
},
|
||||
|
||||
snippets = { preset = 'luasnip' },
|
||||
|
||||
signature = { enabled = true },
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = {
|
||||
documentation = { auto_show = true },
|
||||
list = {
|
||||
selection = {
|
||||
preselect = true,
|
||||
auto_insert = false,
|
||||
},
|
||||
},
|
||||
-- menu = { auto_show = false },
|
||||
},
|
||||
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer', },
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = {
|
||||
implementation = "prefer_rust_with_warning",
|
||||
}
|
||||
},
|
||||
opts_extend = { "sources.default" }
|
||||
},
|
||||
|
||||
-- Useful plugin to show you pending keybinds.
|
||||
@@ -180,6 +226,7 @@ require('lazy').setup({
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x',
|
||||
commit = 'b4da76be54691e854d3e0e02c36b0245f945c2c7',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||
@@ -263,7 +310,7 @@ require('lazy').setup({
|
||||
},
|
||||
{
|
||||
"nvim-neorg/neorg",
|
||||
dependencies = { "luarocks.nvim", { "nvim-lua/plenary.nvim" }, { "nvim-neorg/neorg-telescope" } },
|
||||
dependencies = { "luarocks.nvim", { "nvim-lua/plenary.nvim" }, { "nvim-neorg/neorg-telescope" }, "benlubas/neorg-interim-ls" },
|
||||
lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
|
||||
-- version = "*", -- Pin Neorg to the latest stable release
|
||||
config = function()
|
||||
@@ -273,7 +320,7 @@ require('lazy').setup({
|
||||
["core.keybinds"] = {},
|
||||
["core.completion"] = {
|
||||
config = {
|
||||
engine = "nvim-cmp",
|
||||
engine = { module_name = "external.lsp-completion" }
|
||||
},
|
||||
},
|
||||
["core.concealer"] = {
|
||||
@@ -322,6 +369,16 @@ require('lazy').setup({
|
||||
ft = 'typst',
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
'chomosuke/typst-preview.nvim',
|
||||
lazy = false, -- or ft = 'typst'
|
||||
version = '1.*',
|
||||
opts = {
|
||||
dependencies_bin = {
|
||||
['tinymist'] = 'tinymist'
|
||||
}
|
||||
}, -- lazy.nvim will implicitly calls `setup {}`
|
||||
},
|
||||
-- oil.nvim
|
||||
{
|
||||
'stevearc/oil.nvim',
|
||||
|
16
readme.md
16
readme.md
@@ -25,8 +25,18 @@ export NVIM_APPNAME="$HOME/.config/kicknvim"
|
||||
|
||||
## LSP dependencies
|
||||
|
||||
This configuration requires some LSP servers to be installed on your machine
|
||||
(usually because they are unavailable in `mason`). These packages are:
|
||||
This configuration requires some LSP servers to be installed on your machine.
|
||||
These packages are:
|
||||
|
||||
- `rust-analyzer`
|
||||
- `bash-language-server`
|
||||
- `clangd`
|
||||
- `eslint-language-server`
|
||||
- `godot` (optional)
|
||||
- `json-language-server`
|
||||
- `ltex-ls-plus`
|
||||
- `lua-language-server`
|
||||
- `pyright`
|
||||
- `rust-analyzer`
|
||||
- `texlab`
|
||||
- `tinymist`
|
||||
- `typescript-language-server`
|
||||
|
Reference in New Issue
Block a user