Compare commits
86 Commits
4f45e89025
...
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
|
|||
a52c4bf561
|
|||
aa829327b5
|
|||
e934e38bd0
|
|||
031e7694a5
|
|||
44be63bc2e
|
|||
7e5c198296
|
|||
0a2c5aae5e
|
|||
3fce227c18
|
|||
14c5786b21
|
|||
2685b0f813
|
|||
62fc616ee8
|
|||
2719672e6a
|
|||
f9152e058b
|
|||
23d2b1bee8
|
|||
aefc57c0f7
|
|||
8460677953
|
|||
2cc2998907
|
|||
2a35077571
|
|||
5c17ad21d2
|
|||
3ff49b2567
|
|||
d150b64747
|
|||
82a68ba7d5
|
|||
c52171c11e
|
|||
b0f478ac92
|
|||
98f079fb81
|
|||
04a7ec0218
|
|||
85193f19fd
|
|||
0a044ca3d4
|
|||
b2881a4504
|
|||
84613d7e1f
|
|||
dd8583d064
|
|||
9af5411235
|
|||
b13cdaea9d
|
|||
6caf44226f
|
|||
a3438de2fc
|
|||
86a58e267e
|
|||
c15198b661
|
|||
0af5352a17
|
|||
3508cdd8f6
|
|||
ea672511d8
|
|||
4cdb232020
|
|||
fc034ea90f
|
|||
765e2d1a8b
|
|||
faea5c2b0c
|
|||
758f448b2f
|
|||
7783b8eb60
|
|||
623ca0a753
|
|||
2651b5944b
|
|||
983e8ff195
|
|||
ea402d4c4e
|
|||
b6dae05d63
|
|||
e86ab765d7
|
|||
49407e023c
|
|||
f29b3368bc
|
|||
631f476d35
|
|||
562187bf5a
|
|||
6df3ba48b7
|
|||
765f2c3648
|
|||
dfe5d608e2
|
|||
ba9775b108
|
|||
d0cbb36a44
|
|||
398736176c
|
3
init.lua
3
init.lua
@@ -62,6 +62,9 @@ require('complete')
|
|||||||
-- [[ Configure neorg ]]
|
-- [[ Configure neorg ]]
|
||||||
require('neorg-configure')
|
require('neorg-configure')
|
||||||
|
|
||||||
|
-- [[ Configure status line ]]
|
||||||
|
require('statusline')
|
||||||
|
|
||||||
-- Customizations
|
-- Customizations
|
||||||
require('restore-position')
|
require('restore-position')
|
||||||
require('autocommands')
|
require('autocommands')
|
||||||
|
@@ -1,47 +1,48 @@
|
|||||||
{
|
{
|
||||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||||
"LuaSnip": { "branch": "master", "commit": "48a02259693cb7bbbd1092993406773d5ce14664" },
|
"LuaSnip": { "branch": "master", "commit": "de10d8414235b0a8cabfeba60d07c24304e71f5c" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
"fidget.nvim": { "branch": "main", "commit": "4d5858bd4c471c895060e1b9f3575f1551184dc5" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||||
"fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" },
|
"gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "4daf7022f1481edf1e8fb9947df13bb07c18e89a" },
|
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" },
|
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" },
|
|
||||||
"lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" },
|
|
||||||
"lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" },
|
|
||||||
"lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" },
|
"lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
|
"lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" },
|
||||||
"luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" },
|
"luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" },
|
||||||
"luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" },
|
"luvit-meta": { "branch": "main", "commit": "1df30b60b1b4aecfebc785aa98943db6c6989716" },
|
||||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" },
|
"mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
"mini.nvim": { "branch": "main", "commit": "0ffc2af38b3c5293076317b138635d6d7c80a40f" },
|
||||||
"mini.nvim": { "branch": "main", "commit": "7b4d5d48b6b5a75009d63f8f3e4ef4819b7e8139" },
|
"neorg": { "branch": "main", "commit": "790b0444c0c654131a722817dc893332e06c72b9" },
|
||||||
"neorg": { "branch": "main", "commit": "81ee90cb2d72ac43bfadb7dd276646f34c8f85be" },
|
"neorg-interim-ls": { "branch": "main", "commit": "52bdf8a8cd246a9205756449776aa057bd593d61" },
|
||||||
"neorg-telescope": { "branch": "main", "commit": "ddb2556644cae922699a239bbb0fe16e25b084b7" },
|
"neorg-telescope": { "branch": "main", "commit": "7fb6ca6a632c3c095601d379a664c0c1f802dc6c" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" },
|
|
||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||||
"nvim-dap": { "branch": "master", "commit": "8517126e9323e346f6a99b3b594c5a940b914dcd" },
|
"nvim-dap": { "branch": "master", "commit": "968f89f8aac11b6bdbfc942c71d3436658c1435f" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "d2d153a179ed59aa7134d7ebdf4d7dcb156efa22" },
|
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
||||||
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
|
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "7646c1c12a3121562aa87fd79aace48c728ac096" },
|
"nvim-lspconfig": { "branch": "master", "commit": "408cf07b97535825cca6f1afa908d98348712ba6" },
|
||||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "3e450cd85243da99dc23ebbf14f9c70e9a0c26a4" },
|
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||||
|
"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" },
|
"pathlib.nvim": { "branch": "main", "commit": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
"rose-pine": { "branch": "main", "commit": "07a887a7bef4aacea8c7caebaf8cbf808cdc7a8e" },
|
"rose-pine": { "branch": "main", "commit": "72a04c4065345b51b56aed4859ea1d884f734097" },
|
||||||
"tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" },
|
"tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
|
"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": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||||
"typst.vim": { "branch": "main", "commit": "50e89f481102d5c9ef6990b9f8086c0c7d64bff6" },
|
"typst-preview.nvim": { "branch": "master", "commit": "dea4525d5420b7c32eebda7de15a6beb9d6574fa" },
|
||||||
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" },
|
"typst.vim": { "branch": "main", "commit": "323539709e29a537ff39dfce6c05f175a8921504" },
|
||||||
"vim-pandoc-syntax": { "branch": "master", "commit": "16939cda184ff555938cc895cc62477c172997f9" },
|
"undotree": { "branch": "master", "commit": "28f2f54a34baff90ea6f4a735ef1813ad875c743" },
|
||||||
"vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" },
|
"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-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||||
"vim-speeddating": { "branch": "master", "commit": "c17eb01ebf5aaf766c53bab1f6592710e5ffb796" },
|
"vim-speeddating": { "branch": "master", "commit": "c17eb01ebf5aaf766c53bab1f6592710e5ffb796" },
|
||||||
"vimtex": { "branch": "master", "commit": "6ee92c7ed2cdc876f499bd5561a65d04dee10d1f" },
|
"vimtex": { "branch": "master", "commit": "dc90feacb86f7b85b0b791d8073eefc769a23725" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "68e37e12913a66b60073906f5d3f14dee0de19f2" }
|
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||||
}
|
}
|
||||||
|
17
lsp/gdscript.lua
Normal file
17
lsp/gdscript.lua
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
local port = os.getenv 'GDScript_Port' or '6005'
|
||||||
|
local cmd = vim.lsp.rpc.connect('127.0.0.1', tonumber(port))
|
||||||
|
|
||||||
|
return {
|
||||||
|
default_config = {
|
||||||
|
cmd = cmd,
|
||||||
|
filetypes = { 'gd', 'gdscript', 'gdscript3' },
|
||||||
|
root_markers = { '.git', 'project.godot' },
|
||||||
|
},
|
||||||
|
docs = {
|
||||||
|
description = [[
|
||||||
|
https://github.com/godotengine/godot
|
||||||
|
|
||||||
|
Language server for GDScript, used by Godot Engine.
|
||||||
|
]],
|
||||||
|
},
|
||||||
|
}
|
69
lsp/ltex_ls_plus.lua
Normal file
69
lsp/ltex_ls_plus.lua
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
local language_id_mapping = {
|
||||||
|
bib = 'bibtex',
|
||||||
|
pandoc = 'markdown',
|
||||||
|
plaintex = 'tex',
|
||||||
|
rnoweb = 'rsweave',
|
||||||
|
rst = 'restructuredtext',
|
||||||
|
tex = 'latex',
|
||||||
|
text = 'plaintext',
|
||||||
|
norg = 'neorg',
|
||||||
|
}
|
||||||
|
|
||||||
|
local function get_language_id(_, filetype)
|
||||||
|
return language_id_mapping[filetype] or filetype
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
cmd = { 'ltex-ls-plus' },
|
||||||
|
filetypes = {
|
||||||
|
'markdown',
|
||||||
|
'pandoc',
|
||||||
|
'latex',
|
||||||
|
'text',
|
||||||
|
'norg',
|
||||||
|
'gitcommit',
|
||||||
|
'jj',
|
||||||
|
'jjdescription',
|
||||||
|
'rst',
|
||||||
|
'typst'
|
||||||
|
},
|
||||||
|
get_language_id = get_language_id,
|
||||||
|
single_file_support = true,
|
||||||
|
settings = {
|
||||||
|
ltex = {
|
||||||
|
enabled = {
|
||||||
|
'markdown',
|
||||||
|
'pandoc',
|
||||||
|
'latex',
|
||||||
|
'text',
|
||||||
|
'norg',
|
||||||
|
'gitcommit',
|
||||||
|
'jj',
|
||||||
|
'jjdescription',
|
||||||
|
'rst',
|
||||||
|
'typst'
|
||||||
|
},
|
||||||
|
language = "auto",
|
||||||
|
diagnosticSeverity = "information",
|
||||||
|
checkFrequency = "save",
|
||||||
|
sentenceCacheSize = 2000,
|
||||||
|
additionalRules = {
|
||||||
|
enablePickyRules = true,
|
||||||
|
motherTongue = "fr",
|
||||||
|
},
|
||||||
|
enabledRules = {
|
||||||
|
en = { "EN_CONSISTENT_APOS" },
|
||||||
|
},
|
||||||
|
disabledRules = {
|
||||||
|
fr = { "APOS_TYP", "FRENCH_WHITESPACE", "CHANGE", "ISSUE", },
|
||||||
|
en = { "DASH_RULE", "TWO_HYPHENS", "CHANGE", "ISSUE", "CHECK", "ACTUALLY", "CONSISTENT", "EN_CONSISTENT_APOS", },
|
||||||
|
},
|
||||||
|
dictionary = {
|
||||||
|
fr = { "CryptPad", "Chouhartem",
|
||||||
|
-- field names
|
||||||
|
"authors", "categories", "created", "updated", "title", "meta" },
|
||||||
|
en = { "CryptPad", },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
21
lsp/rust-analyzer.lua
Normal file
21
lsp/rust-analyzer.lua
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
return {
|
||||||
|
cmd = { 'rust-analyzer' },
|
||||||
|
filetypes = { 'rust' },
|
||||||
|
root_markers = { '.git', 'Cargo.toml' },
|
||||||
|
settings = {
|
||||||
|
imports = {
|
||||||
|
granularity = {
|
||||||
|
group = "module",
|
||||||
|
},
|
||||||
|
prefix = "self",
|
||||||
|
},
|
||||||
|
cargo = {
|
||||||
|
buildScripts = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
procMacro = {
|
||||||
|
enable = true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
@@ -1,5 +1,6 @@
|
|||||||
local markdown = vim.api.nvim_create_augroup("markdown", { clear = true })
|
local markdown = vim.api.nvim_create_augroup("markdown", { clear = true })
|
||||||
local spelling = vim.api.nvim_create_augroup("spelling", { clear = true })
|
local spelling = vim.api.nvim_create_augroup("spelling", { clear = true })
|
||||||
|
local spell_keymap = require('spelling').spell_keymap
|
||||||
|
|
||||||
-- Recognize .md as pandoc
|
-- Recognize .md as pandoc
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
||||||
@@ -10,8 +11,8 @@ vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
|||||||
vim.o.commentstring = '<!--%s-->'
|
vim.o.commentstring = '<!--%s-->'
|
||||||
require('luasnip').filetype_extend("pandoc", { "markdown" })
|
require('luasnip').filetype_extend("pandoc", { "markdown" })
|
||||||
vim.o.spell = true
|
vim.o.spell = true
|
||||||
require('spelling').spell_keymap()
|
spell_keymap()
|
||||||
vim.o.spelllang = 'en'
|
vim.o.spelllang = 'en,fr'
|
||||||
vim.o.formatoptions = "qj"
|
vim.o.formatoptions = "qj"
|
||||||
-- email commands: my/msy to paste the html inside the clipboard
|
-- email commands: my/msy to paste the html inside the clipboard
|
||||||
vim.keymap.set('', '<LocalLeader>msy', ':w !pandoc -f markdown+emoji -t html5 -s | wl-copy --type text/html<CR><CR>',
|
vim.keymap.set('', '<LocalLeader>msy', ':w !pandoc -f markdown+emoji -t html5 -s | wl-copy --type text/html<CR><CR>',
|
||||||
@@ -24,20 +25,11 @@ vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- French markdown files
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
|
||||||
pattern = { "*-fr.md", },
|
|
||||||
group = markdown,
|
|
||||||
callback = function()
|
|
||||||
vim.o.spelllang = 'fr'
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Spell shortcuts
|
-- Spell shortcuts
|
||||||
vim.api.nvim_create_autocmd({ "OptionSet" }, {
|
vim.api.nvim_create_autocmd({ "OptionSet" }, {
|
||||||
pattern = { "spell" },
|
pattern = { "spell" },
|
||||||
group = spelling,
|
group = spelling,
|
||||||
callback = require('spelling').spell_keymap
|
callback = spell_keymap
|
||||||
})
|
})
|
||||||
|
|
||||||
-- LaTeX configuration
|
-- LaTeX configuration
|
||||||
@@ -52,25 +44,29 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||||||
vim.g.vimtex_view_general_viewer = 'zathura'
|
vim.g.vimtex_view_general_viewer = 'zathura'
|
||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = ' '
|
||||||
-- Legacy shortcut from my vim-latexsuite days
|
-- Legacy shortcut from my vim-latexsuite days
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>ls", ":VimtexView<CR>",
|
-- FIX: doesn’t seem to work…
|
||||||
|
vim.keymap.set("n", "<Leader>ls", ":VimtexView<CR>",
|
||||||
{ noremap = true, silent = true, desc = 'View [L]atex Document' })
|
{ noremap = true, silent = true, desc = 'View [L]atex Document' })
|
||||||
|
|
||||||
vim.o.foldmethod = 'expr'
|
vim.o.foldmethod = 'expr'
|
||||||
vim.o.foldexpr = 'vimtex#fold#level(v:lnum)'
|
vim.o.foldexpr = 'vimtex#fold#level(v:lnum)'
|
||||||
vim.o.foldtext = 'vimtex#fold#text()'
|
vim.o.foldtext = 'vimtex#fold#text()'
|
||||||
vim.o.spell = true
|
vim.o.spell = true
|
||||||
require('spelling').spell_keymap()
|
spell_keymap()
|
||||||
|
vim.o.spelllang = "en,fr"
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Typst bindings
|
-- Typst bindings + spellchecking
|
||||||
local typstgroup = vim.api.nvim_create_augroup("typst", { clear = true })
|
local typstgroup = vim.api.nvim_create_augroup("typst", { clear = true })
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = { "typst" },
|
pattern = { "typst" },
|
||||||
group = typstgroup,
|
group = typstgroup,
|
||||||
callback = function()
|
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" })
|
||||||
require('spelling').spell_keymap()
|
vim.o.spell = true
|
||||||
|
spell_keymap()
|
||||||
|
vim.o.spelllang = "fr,en"
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -81,7 +77,16 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||||||
group = jjgroup,
|
group = jjgroup,
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.o.spell = true
|
vim.o.spell = true
|
||||||
|
spell_keymap()
|
||||||
vim.o.spelllang = "en"
|
vim.o.spelllang = "en"
|
||||||
require('spelling').spell_keymap()
|
|
||||||
end,
|
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'
|
local luasnip = require 'luasnip'
|
||||||
require('luasnip.loaders.from_vscode').lazy_load()
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
require('luasnip.loaders.from_lua').lazy_load()
|
require('luasnip.loaders.from_lua').lazy_load()
|
||||||
@@ -8,69 +6,4 @@ luasnip.config.setup {
|
|||||||
updateevents = "TextChanged,TextChangedI",
|
updateevents = "TextChanged,TextChangedI",
|
||||||
enable_autosnippets = true,
|
enable_autosnippets = true,
|
||||||
}
|
}
|
||||||
luasnip.filetype_extend("jj", { "gitcommit" })
|
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 = 'nvim_lsp' },
|
|
||||||
{ name = 'luasnip' },
|
|
||||||
{ name = 'path' },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
296
lua/lsp.lua
296
lua/lsp.lua
@@ -1,74 +1,85 @@
|
|||||||
|
local lspattach = vim.api.nvim_create_augroup("LspMapping", { clear = true })
|
||||||
|
|
||||||
-- This function gets run when an LSP connects to a particular buffer.
|
-- This function gets run when an LSP connects to a particular buffer.
|
||||||
local on_attach = function(_, bufnr)
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
-- NOTE: Remember that lua is a real programming language, and as such it is possible
|
group = lspattach,
|
||||||
-- to define small helper and utility functions so you don't have to repeat yourself
|
callback = function(args)
|
||||||
-- many times.
|
-- NOTE: Remember that lua is a real programming language, and as such it is possible
|
||||||
--
|
-- to define small helper and utility functions so you don't have to repeat yourself
|
||||||
-- In this case, we create a function that lets us more easily define mappings specific
|
-- many times.
|
||||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
--
|
||||||
local nmap = function(keys, func, desc)
|
-- In this case, we create a function that lets us more easily define mappings specific
|
||||||
if desc then
|
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||||
desc = 'LSP: ' .. desc
|
local nmap = function(keys, func, desc)
|
||||||
|
if desc then
|
||||||
|
desc = 'LSP: ' .. desc
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set('n', keys, func, { buffer = args.buf, silent = true, desc = desc })
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||||
end
|
nmap('<leader>c', vim.lsp.buf.code_action, '[C]ode action') -- NOTE: to see if ca is needed
|
||||||
|
nmap('<leader>f', function() -- https://stackoverflow.com/a/74303272
|
||||||
|
vim.lsp.buf.code_action({
|
||||||
|
filter = function(a)
|
||||||
|
return a.isPreferred
|
||||||
|
end,
|
||||||
|
apply = true
|
||||||
|
})
|
||||||
|
end, 'code action: [F]ix'
|
||||||
|
)
|
||||||
|
|
||||||
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||||
nmap('<leader>c', vim.lsp.buf.code_action, '[C]ode action') -- NOTE: to see if ca is needed
|
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||||
nmap('<leader>f', function() -- https://stackoverflow.com/a/74303272
|
nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||||
vim.lsp.buf.code_action({
|
nmap('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
||||||
filter = function(a)
|
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||||
return a.isPreferred
|
nmap('<leader>dd', function()
|
||||||
end,
|
local new_config = not vim.diagnostic.config().virtual_lines
|
||||||
apply = true
|
vim.diagnostic.config({ virtual_lines = new_config })
|
||||||
})
|
end, '[D]iagnostic toggle virtual lines')
|
||||||
end, 'code action: [F]ix'
|
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||||
)
|
|
||||||
|
|
||||||
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
-- See `:help K` for why this keymap
|
||||||
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||||
nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
||||||
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>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
|
||||||
|
|
||||||
-- See `:help K` for why this keymap
|
-- Lesser used LSP functionality
|
||||||
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||||
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
||||||
|
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
||||||
|
nmap('<leader>wl', function()
|
||||||
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
|
end, '[W]orkspace [L]ist Folders')
|
||||||
|
|
||||||
-- Lesser used LSP functionality
|
-- Create a command `:Format` local to the LSP buffer
|
||||||
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
vim.api.nvim_buf_create_user_command(args.buf, 'Format', function(_)
|
||||||
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
vim.lsp.buf.format()
|
||||||
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
end, { desc = 'Format current buffer with LSP' })
|
||||||
nmap('<leader>wl', function()
|
end,
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
})
|
||||||
end, '[W]orkspace [L]ist Folders')
|
|
||||||
|
|
||||||
-- Create a command `:Format` local to the LSP buffer
|
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
|
||||||
vim.lsp.buf.format()
|
|
||||||
end, { desc = 'Format current buffer with LSP' })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- document existing key chains
|
-- document existing key chains
|
||||||
require('which-key').add {
|
require('which-key').add {
|
||||||
-- { "<leader>c", group = "[C]ode" },
|
-- { "<leader>c", group = "[C]ode" },
|
||||||
-- { "<leader>c_", hidden = true },
|
-- { "<leader>c_", hidden = true },
|
||||||
{ "<leader>d", group = "[D]ocument" },
|
{ "<leader>d", group = "[D]ocument / [D]iagnostic/ [D]ebug" },
|
||||||
{ "<leader>d_", hidden = true },
|
{ "<leader>d_", hidden = true },
|
||||||
{ "<leader>g", group = "[G]it" },
|
{ "<leader>ds", group = "[D]ebug [S]tep" },
|
||||||
{ "<leader>g_", hidden = true },
|
{ "<leader>ds_", hidden = true },
|
||||||
{ "<leader>h", group = "Git [H]unk" },
|
{ "<leader>g", group = "[G]it" },
|
||||||
{ "<leader>h_", hidden = true },
|
{ "<leader>g_", hidden = true },
|
||||||
{ "<leader>r", group = "[R]ename" },
|
{ "<leader>h", group = "Git [H]unk" },
|
||||||
{ "<leader>r_", hidden = true },
|
{ "<leader>h_", hidden = true },
|
||||||
{ "<leader>s", group = "[S]earch" },
|
{ "<leader>r", group = "[R]ename" },
|
||||||
{ "<leader>s_", hidden = true },
|
{ "<leader>r_", hidden = true },
|
||||||
{ "<leader>t", group = "[T]oggle" },
|
{ "<leader>s", group = "[S]earch" },
|
||||||
{ "<leader>t_", hidden = true },
|
{ "<leader>s_", hidden = true },
|
||||||
{ "<leader>w", group = "[W]orkspace" },
|
{ "<leader>t", group = "[T]oggle" },
|
||||||
{ "<leader>w_", hidden = true },
|
{ "<leader>t_", hidden = true },
|
||||||
|
{ "<leader>w", group = "[W]orkspace" },
|
||||||
|
{ "<leader>w_", hidden = true },
|
||||||
}
|
}
|
||||||
-- register which-key VISUAL mode
|
-- register which-key VISUAL mode
|
||||||
-- required for visual <leader>hs (hunk stage) to work
|
-- required for visual <leader>hs (hunk stage) to work
|
||||||
@@ -77,125 +88,49 @@ require('which-key').add {
|
|||||||
{ "<leader>h", desc = "Git [H]unk", mode = "v" },
|
{ "<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 = {},
|
|
||||||
-- gopls = {},
|
|
||||||
pyright = {},
|
|
||||||
-- rust_analyzer = {},
|
|
||||||
ts_ls = {},
|
|
||||||
eslint = {},
|
|
||||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
|
||||||
texlab = {},
|
|
||||||
ltex = {
|
|
||||||
filetypes = {
|
|
||||||
'markdown',
|
|
||||||
'latex',
|
|
||||||
'norg',
|
|
||||||
'gitcommit',
|
|
||||||
'jj',
|
|
||||||
'rst',
|
|
||||||
'typst'
|
|
||||||
},
|
|
||||||
ltex = {
|
|
||||||
language = "auto",
|
|
||||||
diagnosticSeverity = "information",
|
|
||||||
sentenceCacheSize = 2000,
|
|
||||||
additionalRules = {
|
|
||||||
enablePickyRules = true,
|
|
||||||
motherTongue = "fr",
|
|
||||||
},
|
|
||||||
enabledRules = {
|
|
||||||
en = { "EN_CONSISTENT_APOS" },
|
|
||||||
},
|
|
||||||
disabledRules = {
|
|
||||||
fr = { "APOS_TYP", "FRENCH_WHITESPACE" },
|
|
||||||
en = { "DASH_RULE", "TWO_HYPHENS" },
|
|
||||||
},
|
|
||||||
dictionary = {
|
|
||||||
fr = { "CryptPad", "Chouhartem",
|
|
||||||
-- field names
|
|
||||||
"authors", "categories", "created", "updated", "title", "meta" },
|
|
||||||
en = { "CryptPad", },
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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
|
-- 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 = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
-- capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||||
|
|
||||||
-- Ensure the servers above are installed
|
-- [[ DAP ]]
|
||||||
local mason_lspconfig = require 'mason-lspconfig'
|
|
||||||
|
|
||||||
mason_lspconfig.setup {
|
local setup_dap = function()
|
||||||
ensure_installed = vim.tbl_keys(servers),
|
local dap = require('dap');
|
||||||
}
|
local ui = require('dapui');
|
||||||
|
ui.setup();
|
||||||
|
require("nvim-dap-virtual-text").setup();
|
||||||
|
|
||||||
mason_lspconfig.setup_handlers {
|
vim.keymap.set("n", "<Leader>b", dap.toggle_breakpoint, { desc = "Debug [B]reakpoint", silent = true });
|
||||||
function(server_name)
|
vim.keymap.set("n", "<Leader>dr", dap.run_to_cursor, { desc = "[D]ebug [R]un to cursor" });
|
||||||
require('lspconfig')[server_name].setup {
|
vim.keymap.set("n", "<Leader>de", function()
|
||||||
capabilities = capabilities,
|
ui.eval(nil, { enter = true })
|
||||||
on_attach = on_attach,
|
end, { desc = "[D]ebug [E]val under cursor", silent = true });
|
||||||
settings = servers[server_name],
|
|
||||||
filetypes = (servers[server_name] or {}).filetypes,
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- [[ System LSPs ]]
|
-- TODO: add some DAP configs to test
|
||||||
local lspconfig = require('lspconfig')
|
|
||||||
servers = {
|
|
||||||
rust_analyzer = {
|
|
||||||
["rust-analyzer"] = {
|
|
||||||
imports = {
|
|
||||||
granularity = {
|
|
||||||
group = "module",
|
|
||||||
},
|
|
||||||
prefix = "self",
|
|
||||||
},
|
|
||||||
cargo = {
|
|
||||||
buildScripts = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
procMacro = {
|
|
||||||
enable = true
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
gdscript = {},
|
|
||||||
}
|
|
||||||
|
|
||||||
for server_name, server_settings in pairs(servers) do
|
vim.keymap.set("n", "<Leader>dc", dap.continue, { desc = "[D]ebug [C]ontinue", silent = true })
|
||||||
lspconfig[server_name].setup {
|
vim.keymap.set("n", "<Leader>dsi", dap.step_into, { desc = "[D]ebug [S]tep [I]nto", silent = true })
|
||||||
capabilities = capabilities,
|
vim.keymap.set("n", "<Leader>dso", dap.step_over, { desc = "[D]ebug [S]tep [O]ver", silent = true })
|
||||||
on_attach = on_attach,
|
vim.keymap.set("n", "<Leader>dsu", dap.step_out, { desc = "[D]ebug [S]tep o[U]t", silent = true })
|
||||||
settings = server_settings,
|
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
|
end
|
||||||
|
|
||||||
|
setup_dap()
|
||||||
|
|
||||||
local setup_godot_dap = function()
|
local setup_godot_dap = function()
|
||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
|
|
||||||
@@ -218,3 +153,24 @@ local setup_godot_dap = function()
|
|||||||
end
|
end
|
||||||
|
|
||||||
setup_godot_dap()
|
setup_godot_dap()
|
||||||
|
|
||||||
|
-- [[ 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"
|
||||||
|
})
|
||||||
|
@@ -21,27 +21,57 @@ keymap('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
|||||||
keymap('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
keymap('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||||
|
|
||||||
-- Diagnostic keymaps
|
-- Diagnostic keymaps
|
||||||
keymap('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
|
|
||||||
keymap('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
|
|
||||||
keymap('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
|
keymap('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
|
||||||
keymap('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
|
keymap('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
|
||||||
|
|
||||||
keymap({ "n", "v" }, "<Leader>y", '"+y', { noremap = true, silent = true, desc = "[Y]ank to system clipboard" })
|
keymap({ "n", "v" }, "<Leader>y", '"+y', { noremap = true, silent = true, desc = "[Y]ank to system clipboard" })
|
||||||
|
keymap({ "n", "v" }, "<Leader>Y", '"+yg_', { noremap = true, silent = true, desc = "[Y]ank line to system clipboard" })
|
||||||
keymap({ "n", "v" }, "<Leader>p", '"+p', { noremap = true, silent = true, desc = "[P]ast from system clipboard" })
|
keymap({ "n", "v" }, "<Leader>p", '"+p', { noremap = true, silent = true, desc = "[P]ast from system clipboard" })
|
||||||
|
|
||||||
|
--[[ Folds ]]
|
||||||
-- z0…z9 to open folds to a certain level
|
-- z0…z9 to open folds to a certain level
|
||||||
for i = 0, 9 do
|
for i = 0, 9 do
|
||||||
keymap('n', 'z' .. i, ':set fdl=' .. i .. '<CR>', { noremap = true, silent = false })
|
keymap('n', 'z' .. i, ':set fdl=' .. i .. '<CR>', { noremap = true, silent = false })
|
||||||
end
|
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' })
|
||||||
|
|
||||||
-- in :terminal esc exits edit mode
|
-- in :terminal esc exits edit mode
|
||||||
keymap('t', '<Esc>', '<C-\\><C-n>', { noremap = true, silent = true })
|
keymap('t', '<Esc>', '<C-\\><C-n>', { noremap = true, silent = true })
|
||||||
|
|
||||||
-- Markdown scratchpads
|
-- Markdown scratchpads
|
||||||
require('which-key').add({
|
require('which-key').add({
|
||||||
{ "<leader>m", group = "[M]arkdown" },
|
{ "<leader>m", group = "[M]arkdown" },
|
||||||
{ "<leader>m_", hidden = "true" }
|
{ "<leader>m_", hidden = true },
|
||||||
|
{ "<leader>sl", group = "[S]pell[Lang]" },
|
||||||
|
{ "<leader>sl_", hidden = true },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Markdown temp files
|
||||||
keymap('n', '<leader>mn', ':e ~/tmp/scratch.md<CR>', { desc = '[M]arkdown [N]ew', noremap = true, silent = true })
|
keymap('n', '<leader>mn', ':e ~/tmp/scratch.md<CR>', { desc = '[M]arkdown [N]ew', noremap = true, silent = true })
|
||||||
keymap('n', '<leader>me', ':e ~/tmp/scratch-fr.md<CR>', { desc = '[M]arkdown new Fr[e]nch', noremap = true, silent = true })
|
keymap('n', '<leader>me', ':e ~/tmp/scratch-fr.md<CR>',
|
||||||
|
{ desc = '[M]arkdown new Fr[e]nch', noremap = true, silent = true })
|
||||||
|
|
||||||
|
-- Spellchecking
|
||||||
|
keymap('n', '<leader>st', ':set spell!<CR>', { desc = "Toggle [S]pellcheck", silent = true, noremap = true })
|
||||||
|
keymap('n', '<leader>sle', ':set spelllang=en<CR>',
|
||||||
|
{ desc = "Set [S]pell[L]ang to [E]nglish", silent = true, noremap = true })
|
||||||
|
keymap('n', '<leader>slf', ':set spelllang=fr<CR>',
|
||||||
|
{ desc = "Set [S]pell[L]ang to [F]rench", silent = true, noremap = true })
|
||||||
|
|
||||||
|
-- Toggle hlsearch
|
||||||
|
keymap({ 'n', 'v' }, '<C-l>', ':set hlsearch!<CR>', { silent = true, noremap = true })
|
||||||
|
|
||||||
|
-- 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' })
|
||||||
|
-- {>,<} preserve the selection
|
||||||
|
keymap('v', '>', '>gv', { noremap = true, silent = true })
|
||||||
|
keymap('v', '<', '<gv', { noremap = true, silent = true })
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
--vim.api.nvim_set_keymap('', 'à', '<Nop>', { noremap = true, silent = true })
|
--vim.keymap.set('', 'à', '<Nop>', { noremap = true, silent = true })
|
||||||
local neorgroup = vim.api.nvim_create_augroup("neorg", { clear = true })
|
local neorgroup = vim.api.nvim_create_augroup("neorg", { clear = true })
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||||
@@ -8,34 +8,43 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
|
|||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = ' '
|
||||||
vim.o.conceallevel = 2
|
vim.o.conceallevel = 2
|
||||||
vim.o.foldlevelstart = 99
|
vim.o.foldlevelstart = 99
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>nr", ":Neorg return<CR>",
|
vim.keymap.set("n", "<Leader>nr", ":Neorg return<CR>",
|
||||||
{ noremap = true, silent = true, desc = "[N]eorg [R]eturn" })
|
{ noremap = true, silent = true, desc = "[N]eorg [R]eturn" })
|
||||||
|
|
||||||
-- Neorg Telescope
|
-- Neorg Telescope
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>nh", "<Plug>(neorg.telescope.search_headings)",
|
vim.keymap.set("n", "<Leader>nh", "<Plug>(neorg.telescope.search_headings)",
|
||||||
{ noremap = true, silent = true, desc = "[N]eorg search [H]eading" })
|
{ noremap = true, silent = true, desc = "[N]eorg search [H]eading" })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>nb", "<Plug>(neorg.telescope.backlinks.file_backlinks)",
|
vim.keymap.set("n", "<Leader>nb", "<Plug>(neorg.telescope.backlinks.file_backlinks)",
|
||||||
{ noremap = true, silent = true, desc = "[N]eorg file [B]acklinks" })
|
{ noremap = true, silent = true, desc = "[N]eorg file [B]acklinks" })
|
||||||
vim.api.nvim_set_keymap("n", "<C-l>", "<Plug>(neorg.telescope.insert_link)",
|
vim.keymap.set("n", "<C-l>", "<Plug>(neorg.telescope.insert_link)",
|
||||||
{ noremap = true, silent = true, desc = "Neorg insert [L]ink" })
|
{ noremap = true, silent = true, desc = "Neorg insert [L]ink" })
|
||||||
-- Tasks
|
-- Tasks
|
||||||
vim.api.nvim_set_keymap("n", "<LocalLeader>td", "<Plug>(neorg.qol.todo-items.todo.task-done)",
|
vim.keymap.set("n", "<LocalLeader>td", "<Plug>(neorg.qol.todo-items.todo.task-done)",
|
||||||
{ noremap = true, silent = true, desc = "[T]ask [D]one" })
|
{ noremap = true, silent = true, desc = "[T]ask [D]one" })
|
||||||
vim.api.nvim_set_keymap("n", "<LocalLeader>tu", "<Plug>(neorg.qol.todo-items.todo.task-undone)",
|
vim.keymap.set("n", "<LocalLeader>tu", "<Plug>(neorg.qol.todo-items.todo.task-undone)",
|
||||||
{ noremap = true, silent = true, desc = "[T]ask [U]ndone" })
|
{ noremap = true, silent = true, desc = "[T]ask [U]ndone" })
|
||||||
vim.api.nvim_set_keymap("n", "<LocalLeader>tp", "<Plug>(neorg.qol.todo-items.todo.task-pending)",
|
vim.keymap.set("n", "<LocalLeader>tp", "<Plug>(neorg.qol.todo-items.todo.task-pending)",
|
||||||
{ noremap = true, silent = true, desc = "[T]ask [P]ending" })
|
{ noremap = true, silent = true, desc = "[T]ask [P]ending" })
|
||||||
vim.api.nvim_set_keymap("n", "<LocalLeader>th", "<Plug>(neorg.qol.todo-items.todo.task-on_hold)",
|
vim.keymap.set("n", "<LocalLeader>th", "<Plug>(neorg.qol.todo-items.todo.task-on_hold)",
|
||||||
{ noremap = true, silent = true, desc = "[T]ask on [H]old" })
|
{ noremap = true, silent = true, desc = "[T]ask on [H]old" })
|
||||||
vim.api.nvim_set_keymap("n", "<LocalLeader>tc", "<Plug>(neorg.qol.todo-items.todo.task-cancelled)",
|
vim.keymap.set("n", "<LocalLeader>tc", "<Plug>(neorg.qol.todo-items.todo.task-cancelled)",
|
||||||
{ noremap = true, silent = true, desc = "[T]ask on [C]ancelled" })
|
{ noremap = true, silent = true, desc = "[T]ask on [C]ancelled" })
|
||||||
vim.api.nvim_set_keymap("n", "<LocalLeader>tr", "<Plug>(neorg.qol.todo-items.todo.task-recurring)",
|
vim.keymap.set("n", "<LocalLeader>tr", "<Plug>(neorg.qol.todo-items.todo.task-recurring)",
|
||||||
{ noremap = true, silent = true, desc = "[T]ask on [R]ecurring" })
|
{ noremap = true, silent = true, desc = "[T]ask on [R]ecurring" })
|
||||||
vim.api.nvim_set_keymap("n", "<LocalLeader>ti", "<Plug>(neorg.qol.todo-items.todo.task-important)",
|
vim.keymap.set("n", "<LocalLeader>ti", "<Plug>(neorg.qol.todo-items.todo.task-important)",
|
||||||
{ noremap = true, silent = true, desc = "[T]ask on [I]mportant" })
|
{ noremap = true, silent = true, desc = "[T]ask on [I]mportant" })
|
||||||
|
vim.keymap.set("n", "gO", ":Neorg toc<CR>",
|
||||||
|
{ noremap = true, silent = true, desc = "[O]pen toc" })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local function live_grep_neorg()
|
||||||
|
local neorg_root = '~/Sync/neorg' -- TODO: get it from neorg
|
||||||
|
require('telescope.builtin').live_grep {
|
||||||
|
cwd = neorg_root,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
-- document existing key chains
|
-- document existing key chains
|
||||||
require('which-key').add {
|
require('which-key').add {
|
||||||
{ "<leader>l", group = "neorg [L]ist" },
|
{ "<leader>l", group = "neorg [L]ist" },
|
||||||
@@ -47,25 +56,29 @@ require('which-key').add {
|
|||||||
{ "<leader>ne_", hidden = true },
|
{ "<leader>ne_", hidden = true },
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>ni", ":Neorg index<CR>",
|
vim.keymap.set("n", "<Leader>ni", ":Neorg index<CR>",
|
||||||
{ noremap = true, silent = true, desc = "[N]eorg [I]ndex" })
|
{ noremap = true, silent = true, desc = "[N]eorg [I]ndex" })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>nm", ":Neorg inject-metadata<CR>",
|
vim.keymap.set("n", "<Leader>nm", ":Neorg inject-metadata<CR>",
|
||||||
{ noremap = true, silent = true, desc = "[N]eorg insert [M]etadata" })
|
{ noremap = true, silent = true, desc = "[N]eorg insert [M]etadata" })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>nj", ":Neorg journal toc open<CR>",
|
vim.keymap.set("n", "<Leader>nj", ":Neorg journal toc open<CR>",
|
||||||
{ noremap = true, silent = true, desc = "[N]eorg [J]ournal" })
|
{ noremap = true, silent = true, desc = "[N]eorg [J]ournal" })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>nt", ":Neorg journal today<CR>",
|
vim.keymap.set("n", "<Leader>nt", ":Neorg journal today<CR>",
|
||||||
{ noremap = true, silent = true, desc = "[N]eorg [T]oday" })
|
{ noremap = true, silent = true, desc = "[N]eorg [T]oday" })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>ns", ":Neorg journal tomorrow<CR>",
|
vim.keymap.set("n", "<Leader>ns", ":Neorg journal tomorrow<CR>",
|
||||||
{ noremap = true, silent = true, desc = "Neorg tomorrow" })
|
{ noremap = true, silent = true, desc = "Neorg tomorrow" })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>ny", ":Neorg journal yesterday<CR>",
|
vim.keymap.set("n", "<Leader>ny", ":Neorg journal yesterday<CR>",
|
||||||
{ noremap = true, silent = true, desc = "[N]eorg [Y]esterday" })
|
{ noremap = true, silent = true, desc = "[N]eorg [Y]esterday" })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>neo", ":e /tmp/neorg-export.md<CR>",
|
vim.keymap.set("n", "<Leader>neo", ":e /tmp/neorg-export.md<CR>",
|
||||||
{ noremap = true, silent = true, desc = "[N]eorg [E]xport [O]pen" })
|
{ noremap = true, silent = true, desc = "[N]eorg [E]xport [O]pen" })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>nee", ":Neorg export to-file /tmp/neorg-export.md<CR>",
|
vim.keymap.set("n", "<Leader>nev", ":bo vsp /tmp/neorg-export.md<CR>",
|
||||||
|
{ noremap = true, silent = true, desc = "[N]eorg [E]xport [V]ertical open" })
|
||||||
|
vim.keymap.set("n", "<Leader>nee", ":Neorg export to-file /tmp/neorg-export.md<CR>",
|
||||||
{ noremap = true, silent = true, desc = "[N]eorg [E]xport Predefined" })
|
{ noremap = true, silent = true, desc = "[N]eorg [E]xport Predefined" })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>nef", ":Neorg export to-file ",
|
vim.keymap.set("n", "<Leader>nef", ":Neorg export to-file ",
|
||||||
{ noremap = true, silent = true, desc = "[N]eorg [E]xport [F]ile" })
|
{ noremap = true, silent = true, desc = "[N]eorg [E]xport [F]ile" })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>nl", "<Plug>(neorg.telescope.find_linkable)",
|
vim.keymap.set("n", "<Leader>nl", "<Plug>(neorg.telescope.find_linkable)",
|
||||||
{ noremap = true, silent = true, desc = "[N]eorg find [L]inkable" })
|
{ noremap = true, silent = true, desc = "[N]eorg find [L]inkable" })
|
||||||
vim.api.nvim_set_keymap("n", "<Leader>nf", "<Plug>(neorg.telescope.find_norg_files)",
|
vim.keymap.set("n", "<Leader>nf", "<Plug>(neorg.telescope.find_norg_files)",
|
||||||
{ noremap = true, silent = true, desc = "[N]eorg find [F]ile" })
|
{ noremap = true, silent = true, desc = "[N]eorg find [F]ile" })
|
||||||
|
vim.keymap.set("n", "<Leader>n/", live_grep_neorg,
|
||||||
|
{ noremap = true, silent = true, desc = "[N]eorg Live Grep" })
|
||||||
|
@@ -29,46 +29,92 @@ require('lazy').setup({
|
|||||||
-- LSP Configuration & Plugins
|
-- LSP Configuration & Plugins
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Automatically install LSPs to stdpath for neovim
|
|
||||||
'williamboman/mason.nvim',
|
|
||||||
'williamboman/mason-lspconfig.nvim',
|
|
||||||
|
|
||||||
-- Useful status updates for LSP
|
-- Useful status updates for LSP
|
||||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||||
{ 'j-hui/fidget.nvim', opts = {} },
|
{ '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
|
-- DAP: Debug Adapter Protocol
|
||||||
'mfussenegger/nvim-dap',
|
{
|
||||||
|
'mfussenegger/nvim-dap',
|
||||||
|
dependencies = {
|
||||||
|
'rcarriga/nvim-dap-ui',
|
||||||
|
'theHamsta/nvim-dap-virtual-text',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
-- Autocompletion
|
-- [[ Autocompletion ]]
|
||||||
'hrsh7th/nvim-cmp',
|
'saghen/blink.cmp',
|
||||||
|
-- optional: provides snippets for the snippet source
|
||||||
dependencies = {
|
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',
|
'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.
|
-- Useful plugin to show you pending keybinds.
|
||||||
@@ -161,25 +207,8 @@ require('lazy').setup({
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
-- Set lualine as statusline
|
||||||
-- Set lualine as statusline
|
'nvim-lualine/lualine.nvim',
|
||||||
'nvim-lualine/lualine.nvim',
|
|
||||||
-- See `:help lualine.txt`
|
|
||||||
opts = {
|
|
||||||
options = {
|
|
||||||
icons_enabled = true,
|
|
||||||
theme = 'rose-pine',
|
|
||||||
component_separators = '|',
|
|
||||||
section_separators = '',
|
|
||||||
},
|
|
||||||
symbols = {
|
|
||||||
error = " ",
|
|
||||||
warn = " ",
|
|
||||||
info = " ",
|
|
||||||
hint = " ",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
-- Add indentation guides even on blank lines
|
-- Add indentation guides even on blank lines
|
||||||
@@ -197,6 +226,7 @@ require('lazy').setup({
|
|||||||
{
|
{
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
branch = '0.1.x',
|
branch = '0.1.x',
|
||||||
|
commit = 'b4da76be54691e854d3e0e02c36b0245f945c2c7',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'nvim-lua/plenary.nvim',
|
'nvim-lua/plenary.nvim',
|
||||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||||
@@ -280,9 +310,9 @@ require('lazy').setup({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-neorg/neorg",
|
"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
|
lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
|
||||||
version = "*", -- Pin Neorg to the latest stable release
|
-- version = "*", -- Pin Neorg to the latest stable release
|
||||||
config = function()
|
config = function()
|
||||||
require("neorg").setup {
|
require("neorg").setup {
|
||||||
load = {
|
load = {
|
||||||
@@ -290,7 +320,7 @@ require('lazy').setup({
|
|||||||
["core.keybinds"] = {},
|
["core.keybinds"] = {},
|
||||||
["core.completion"] = {
|
["core.completion"] = {
|
||||||
config = {
|
config = {
|
||||||
engine = "nvim-cmp",
|
engine = { module_name = "external.lsp-completion" }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["core.concealer"] = {
|
["core.concealer"] = {
|
||||||
@@ -331,11 +361,36 @@ require('lazy').setup({
|
|||||||
"iamcco/markdown-preview.nvim",
|
"iamcco/markdown-preview.nvim",
|
||||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||||
ft = { "markdown", "pandoc" },
|
ft = { "markdown", "pandoc" },
|
||||||
build = function() vim.fn["mkdp#util#install"]() end,
|
-- build = function() vim.fn["mkdp#util#install"]() end,
|
||||||
|
build = "cd app && npm install && git restore .",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'kaarmu/typst.vim',
|
'kaarmu/typst.vim',
|
||||||
ft = 'typst',
|
ft = 'typst',
|
||||||
lazy = false,
|
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',
|
||||||
|
---@module 'oil'
|
||||||
|
---@type oil.SetupOpts
|
||||||
|
opts = {},
|
||||||
|
-- Optional dependencies
|
||||||
|
dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
||||||
|
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
|
||||||
|
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||||
|
lazy = false,
|
||||||
|
},
|
||||||
|
-- undotree
|
||||||
|
'mbbill/undotree',
|
||||||
}, {})
|
}, {})
|
||||||
|
48
lua/statusline.lua
Normal file
48
lua/statusline.lua
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
-- Character, word and line counts
|
||||||
|
-- https://www.reddit.com/r/neovim/comments/1130kh5/comment/j8navg6/
|
||||||
|
local function counters()
|
||||||
|
local isVisualMode = vim.fn.mode():find("[Vv]")
|
||||||
|
if not isVisualMode then return "" end
|
||||||
|
local starts = vim.fn.line("v")
|
||||||
|
local ends = vim.fn.line(".")
|
||||||
|
local lines = starts <= ends and ends - starts + 1 or starts - ends + 1
|
||||||
|
local wordcount = vim.fn.wordcount()
|
||||||
|
return tostring(wordcount.visual_words) ..
|
||||||
|
"W " .. tostring(wordcount.visual_chars) .. "C " .. tostring(lines) .. "L"
|
||||||
|
end
|
||||||
|
|
||||||
|
-- See `:help lualine.txt`
|
||||||
|
require('lualine').setup({
|
||||||
|
options = {
|
||||||
|
icons_enabled = true,
|
||||||
|
theme = 'rose-pine',
|
||||||
|
component_separators = '|',
|
||||||
|
section_separators = '',
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_c = {
|
||||||
|
{
|
||||||
|
'filename',
|
||||||
|
path = 1,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lualine_y = {
|
||||||
|
{ counters },
|
||||||
|
'progress'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
inactive_sections = {
|
||||||
|
lualine_c = {
|
||||||
|
{
|
||||||
|
'filename',
|
||||||
|
path = 1,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
symbols = {
|
||||||
|
error = " ",
|
||||||
|
warn = " ",
|
||||||
|
info = " ",
|
||||||
|
hint = " ",
|
||||||
|
}
|
||||||
|
})
|
@@ -77,6 +77,7 @@ vim.keymap.set('n', '<leader>sG', ':LiveGrepGitRoot<cr>', { desc = '[S]earch by
|
|||||||
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
|
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
|
||||||
vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' })
|
vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' })
|
||||||
vim.keymap.set('n', '<leader>sb', require('telescope.builtin').lsp_document_symbols, { desc = '[S]earch Sym[b]bol' })
|
vim.keymap.set('n', '<leader>sb', require('telescope.builtin').lsp_document_symbols, { desc = '[S]earch Sym[b]bol' })
|
||||||
|
vim.keymap.set('n', '<leader>sB', require('telescope.builtin').lsp_workspace_symbols, { desc = '[S]earch Sym[b]bol in workspace' })
|
||||||
|
|
||||||
-- vim telescope
|
-- vim telescope
|
||||||
vim.keymap.set('n', '<leader>gc', require('telescope.builtin').git_commits, { desc = '[G]it [C]ommits' })
|
vim.keymap.set('n', '<leader>gc', require('telescope.builtin').git_commits, { desc = '[G]it [C]ommits' })
|
||||||
|
32
luasnippets/norg.lua
Normal file
32
luasnippets/norg.lua
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
local ls = require("luasnip")
|
||||||
|
local s = ls.snippet
|
||||||
|
local sn = ls.snippet_node
|
||||||
|
local t = ls.text_node
|
||||||
|
local i = ls.insert_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local d = ls.dynamic_node
|
||||||
|
local fmt = require("luasnip.extras.fmt").fmt
|
||||||
|
local fmta = require("luasnip.extras.fmt").fmta
|
||||||
|
local rep = require("luasnip.extras").rep
|
||||||
|
|
||||||
|
return {
|
||||||
|
-- Pull Request
|
||||||
|
s({
|
||||||
|
trig = "pr", dscr = "cryptpad pull request"
|
||||||
|
},
|
||||||
|
fmta("{https://github.com/cryptpad/cryptpad/pull/<>}[#<>]", {
|
||||||
|
i(1, "number"),
|
||||||
|
rep(1),
|
||||||
|
})
|
||||||
|
),
|
||||||
|
|
||||||
|
-- Issue
|
||||||
|
s({
|
||||||
|
trig = "issue", dscr = "cryptpad issue request"
|
||||||
|
},
|
||||||
|
fmta("{https://github.com/cryptpad/cryptpad/issues/<>}[#<>]", {
|
||||||
|
i(1, "number"),
|
||||||
|
rep(1),
|
||||||
|
})
|
||||||
|
),
|
||||||
|
}
|
24
readme.md
24
readme.md
@@ -7,9 +7,9 @@ consistent files inside `lua/` and personal customizations have been applied.
|
|||||||
The process to design this configuration and some thoughts can be found
|
The process to design this configuration and some thoughts can be found
|
||||||
[here](https://blog.epheme.re/software/nvim-kickstart.html).
|
[here](https://blog.epheme.re/software/nvim-kickstart.html).
|
||||||
|
|
||||||
Note that if the global principles remain true, the blog post dates from 2023,
|
Note that if the global principles remain true, the blog post dates from
|
||||||
and things may have changed a bit since then. Just use it as a reference for my
|
December 2023, and things may have changed a bit since then. Just use it as a
|
||||||
rationals.
|
reference for my rationals.
|
||||||
|
|
||||||
## Testing it
|
## Testing it
|
||||||
|
|
||||||
@@ -22,3 +22,21 @@ For instance, you can create clone this repository inside
|
|||||||
```sh
|
```sh
|
||||||
export NVIM_APPNAME="$HOME/.config/kicknvim"
|
export NVIM_APPNAME="$HOME/.config/kicknvim"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## LSP dependencies
|
||||||
|
|
||||||
|
This configuration requires some LSP servers to be installed on your machine.
|
||||||
|
These packages are:
|
||||||
|
|
||||||
|
- `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