Compare commits

..

147 Commits

Author SHA1 Message Date
1f39139f1d chore(mappings): format 2025-06-21 18:06:54 +02:00
1d59bfc4cb fix(paste): add paste in neovide 2025-06-21 18:06:49 +02:00
03192ef86a fix(ltex_ls): add some ignore rules 2025-05-21 13:40:36 +02:00
fd61b53dbd feat(diagnostic): add toggle binding 2025-05-21 13:40:14 +02:00
e047151a72 chore(lazy): upgrade and fix breaking changes in major mason revision 2025-05-17 12:49:35 +02:00
989f9163c0 feat(lsp): use virtual lines 2025-05-17 12:49:12 +02:00
a52c4bf561 fix(neorg): gO to open toc 2025-05-12 10:17:20 +02:00
aa829327b5 refactor(lualine): move lualine config to a new file
- Add a function for the word counter
2025-05-06 17:06:46 +02:00
e934e38bd0 feat(lualine): add counters to lualine
- Word, character and line counters upon selection
- From https://www.reddit.com/r/neovim/comments/1130kh5/comment/j8navg6/
2025-05-06 14:06:07 +02:00
031e7694a5 fix(lsp): ltex_plus → ltex_ls_plus
- Naming conflicts with lspconfig: the `filetypes` field was overwritten
  by lspconfig.
2025-04-30 14:44:12 +02:00
44be63bc2e chore(lazy): upgrade
- For neorg
2025-04-17 11:23:33 +02:00
7e5c198296 feat(lualine): add relative path in filename
- Useful for node architecture where everything is named `inner.js`
2025-04-07 15:31:47 +02:00
0a2c5aae5e fix(lsp): align comment 2025-04-07 14:30:44 +02:00
3fce227c18 fix(lsp): add neorg markup to ltex-ls-plus 2025-04-06 09:59:25 +02:00
14c5786b21 fix(lsp): missing field for Mason setup 2025-04-03 15:42:42 +02:00
2685b0f813 fix: vim.diagnostic.goto_{next/prev} is deprecated
- {],[}d are default since nvim 0.10
	- https://neovim.io/doc/user/news-0.10.html#_new-features
2025-04-03 14:52:06 +02:00
62fc616ee8 chore(lazy): upgrade 2025-04-03 09:32:53 +02:00
2719672e6a feat(lsp/mason): add tinymist (typst lsp) 2025-04-02 09:14:11 +02:00
f9152e058b fix(cmp): lsp completion called twice 2025-04-02 08:58:25 +02:00
23d2b1bee8 fix(lsp): order LSP/DAP
- minor change
2025-04-02 08:50:42 +02:00
aefc57c0f7 fix(LSP): typo in rust-analyzer 2025-04-02 08:28:07 +02:00
8460677953 feat(lsp): Move LSP config for godot and rust for 0.11 2025-04-01 23:38:29 +02:00
2cc2998907 fix(jj): replace jj with jjdescription filetype 2025-04-01 19:01:44 +02:00
2a35077571 feat(lsp): remove on_attach 2025-04-01 19:01:35 +02:00
5c17ad21d2 feat(lsp): replace on_attach with an LspAttach rule 2025-04-01 18:57:18 +02:00
3ff49b2567 feat!(lsp): move ltex-ls-plus to neovim native LSP config
- BREAKING CHANGE: need neovim >0.11
	- https://neovim.io/doc/user/news-0.11.html#_lsp
2025-04-01 18:25:38 +02:00
d150b64747 chore(lazy): upgrade 2025-03-27 17:12:08 +01:00
82a68ba7d5 fix(plugins): markdownpreview build
- From <https://github.com/iamcco/markdown-preview.nvim/issues/704#issuecomment-2480811133>
2025-03-27 16:32:20 +01:00
c52171c11e feat(neorg): add nev to open export in vertical pane 2025-03-24 19:42:12 +01:00
b0f478ac92 feat(mapping): add tab for opening/closing folds 2025-03-23 12:58:32 +01:00
98f079fb81 refactor(mappings): move undotree mapping 2025-03-23 12:58:04 +01:00
04a7ec0218 feat(plugins): add undotree
- BREAKING CHANGE: keymap `U` to toggle undotree
2025-03-23 10:18:50 +01:00
85193f19fd fix(lazy): unpin neorg to get the latest version
- Experimental, may not stay
2025-03-22 14:59:22 +01:00
0a044ca3d4 feat(plugins): add oil.nvim
- For a trial period
2025-03-20 22:00:33 +01:00
b2881a4504 feat(ltex-lsp): Add support for plain text 2025-03-20 10:52:15 +01:00
84613d7e1f chore(lazy): upgrade 2025-03-12 12:18:22 +01:00
dd8583d064 chore(mappings): formatting 2025-03-04 20:05:11 +01:00
9af5411235 chores(lazy): upgrade 2025-03-04 12:31:20 +01:00
b13cdaea9d fix(mappings): decrease increment in visual mode
- Mistake in copy-paste the previous line
2025-02-27 11:43:27 +01:00
6caf44226f feat(lsp): Change the checkfrequency of ltex-ls-plus
- “On Save” instead of “On Edit” (which was calling languagetool too often)
2025-02-27 11:29:35 +01:00
a3438de2fc feat!(lsp): use ltex-plus instead of ltex
- BREAKING CHANGE: it is now required to install ltex-plus on the
  different machines
- Add some exceptions for `false friends` in English
2025-02-25 11:46:54 +01:00
86a58e267e feat(mappings): visual mapping for >/<
- Inspired by https://github.com/Nuclear-Squid/dotFiles/blob/master/nvim/init.lua#L169-L170
2025-02-18 22:45:47 +01:00
c15198b661 feat(mapping): add some yank mappings 2025-02-18 22:42:04 +01:00
0af5352a17 revert(autocommand): revert back to markdown autocommand trigger
- reverts b6dae05d63
- Some weird behaviour where things where detected as pandoc at random
2025-02-17 15:12:41 +01:00
3508cdd8f6 feat(snippets): add some github issues snippets for meeting notes 2025-02-17 13:51:54 +01:00
ea672511d8 chore(lazy): upgrades 2025-02-17 12:02:04 +01:00
4cdb232020 feat(mappings): add a mapping to toggle hlsearch 2025-02-16 22:03:10 +01:00
fc034ea90f fix(autocommand): activation condition for markdown 2025-02-15 12:52:18 +01:00
765e2d1a8b chores(lazy): upgrade 2025-02-14 12:43:14 +01:00
faea5c2b0c fix(autocommand): typo
- Same as previously: missing l in `spelllang`
2025-02-11 19:58:24 +01:00
758f448b2f docs(readme): typo 2025-02-11 19:56:11 +01:00
7783b8eb60 fix(autocommand): fix typo for tex autocommand
- Missing l in `spelllang`
2025-02-11 17:02:08 +01:00
623ca0a753 fix(spelling): use french + english dictionnaries by default
- Better ease of use
- May not capture everything, the shortcuts are there for that
2025-02-11 16:13:27 +01:00
2651b5944b docs(readme): precision 2025-02-11 09:47:34 +01:00
983e8ff195 chores(mappings): reformat + fix a typo 2025-02-10 17:36:30 +01:00
ea402d4c4e feat(mapping): add shortcuts for spelling 2025-02-10 17:34:54 +01:00
b6dae05d63 fix(autocommand): spelling on BufNew
- Change spelling on bufEnter and bufWinEnter that rerun commands too
  many times (even when override)
2025-02-10 17:05:51 +01:00
e86ab765d7 chore(lazy): upgrade 2025-01-29 11:39:21 +01:00
49407e023c feat(ltex): ignore some false-friend rules 2025-01-29 11:38:32 +01:00
f29b3368bc chores(lazy): upgrade 2025-01-26 10:14:59 +01:00
631f476d35 chores(lazy): upgrade 2025-01-23 16:05:10 +01:00
562187bf5a feat(telescope): add workspace symbol search 2024-12-21 23:51:25 +01:00
6df3ba48b7 feat(lsp): add bashls 2024-12-16 15:17:08 +01:00
765f2c3648 chore(lazy): update 2024-12-16 09:57:14 +01:00
dfe5d608e2 chore(lazy): update 2024-12-12 17:11:01 +01:00
ba9775b108 refactor(all): replace vim.api.nvim_set_keymap with vim.keymap.set 2024-12-11 15:55:19 +01:00
d0cbb36a44 refactor(neorg): replace vim.api.nvim_set_keymap with vim.keymap.set
`vim.keymap.set` is more lua-friendly
2024-12-11 15:50:10 +01:00
398736176c feat(neorg): Telescope live_grep in neorg working directory 2024-12-11 15:47:53 +01:00
4f45e89025 fix!(scratchpads): change scratchpad.md with scratch.md
BREAKING CHANGE: the name of scratchpads changed
2024-11-29 12:28:58 +01:00
ef2bdaf201 fix(which-key): remove neorg modes for now 2024-11-29 11:44:52 +01:00
9a940a9ba4 feat(bindings): add markdown scratchpads 2024-11-29 11:43:31 +01:00
49acc75e2a fix(ltex-lsp): forgot a rule 2024-11-13 12:04:15 +01:00
48c698c2c5 fix(lsp): option name: dictionnary → dictionary 2024-11-13 11:35:48 +01:00
26f875171f chore(lock): update 2024-11-12 11:01:56 +01:00
4775d23ed4 refactor(lazy): Move to plugins-configure for consistency 2024-11-11 11:01:41 +01:00
88cd86eb8c chores(init): cleanup 2024-11-11 10:56:57 +01:00
5bfbc64cf0 fix?(neorg): Default keybinds
- Not sure if it works…
2024-11-11 10:54:01 +01:00
f8acdeac19 refactor(neorg): scope of some bindings 2024-11-11 10:49:04 +01:00
7b8db55790 feat(neorg): completion with cmp 2024-11-11 10:38:10 +01:00
cde7f74d0b feat(neorg): add telescope search 2024-11-11 10:29:10 +01:00
74515e706b chores: lazy upgrade 2024-11-10 16:42:54 +01:00
f1a52d9dcb fix(treesitter): necessary field 2024-11-10 16:40:37 +01:00
8f04c0e04c chores(all): format 2024-11-10 15:44:21 +01:00
6851e16bcf docs(readme): small precision 2024-11-10 15:27:08 +01:00
1ba07cf703 feat(plugins): replace neodev with lazydev 2024-11-10 15:17:45 +01:00
c10feb7712 feat(jujutsu): Add support for jj description
- Snippets
- Spellchecking
- Grammar checking
2024-11-10 15:09:45 +01:00
3242adf2ed fix(general): add lockfile 2024-11-10 15:00:39 +01:00
89bb298289 fix!(mappings): remove some leftover bépo mappings
BREAKING CHANGE: gB comes back to be gb
2024-11-06 09:30:55 +01:00
6e9919da69 feat(lsp/telescope): Add sb to search lsp symbols 2024-10-29 16:46:43 +01:00
1f71c346f0 feat(lsp): add hints while passing arguments
- still in trial
2024-10-24 12:38:46 +02:00
989020e20f feat(lsp): add eslint LSP 2024-10-22 14:19:44 +02:00
d130acc11e feat!(lsp): add quickfix function 2024-10-22 14:19:19 +02:00
5a4b907f6e feat!(lsp): change code action biding from ca to a 2024-10-22 14:18:43 +02:00
7e6d4ae3c0 fix(typst/lsp): remove typst lsp support for now 2024-10-19 15:43:28 +02:00
5bb1039198 feat!(nvim-cmp): Add tab complete when there is no ambiguity
- from https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#confirm-candidate-on-tab-immediately-when-theres-only-one-completion-entry
- BREAKING CHANGE: tab behaviour has changed
2024-10-18 18:19:09 +02:00
0a73bd4259 feat!(cmp): change autocomplete behaviour
- BREAKING CHANGE: no more automatic popping droplist
- BREAKING CHANGE: <CR> to complete instead of <C-l>
2024-10-18 17:07:22 +02:00
22e70f9725 feat: add typst support 2024-10-11 10:50:29 +02:00
6a6243fd90 which-key: fix typo in hint
+ format
2024-10-11 10:50:16 +02:00
9299b58212 fix: change tsserver with ts_ls 2024-09-11 11:58:52 +02:00
3d61f9afdd fix: neorg tasks not working 2024-09-11 11:00:12 +02:00
0e6b7e2558 ugly: fix which-keys warnings 2024-07-26 17:59:48 +02:00
32371d317f <leader>my/<leader>msy: Add mimetype for wl-copy 2024-07-23 18:28:12 +02:00
9506be9938 Remove old bépo remapping
- Was *not* a good idea 🥲
2024-06-21 11:34:45 +02:00
0a027afb4d LaTeX: Remove old bépo remapping 2024-06-21 11:33:44 +02:00
5a118932f3 Add commentstring for pandoc 2024-05-24 13:22:08 +02:00
146083e981 snippets: \textheight and \textwidth in latex 2024-05-24 13:21:19 +02:00
3136772105 LSP: add rst to ltex 2024-05-24 13:20:43 +02:00
7f1702d917 Add gdscript 2024-05-19 00:49:51 +02:00
ae0e55e3d1 LaTeX snippets: add skips 2024-05-14 16:00:46 +02:00
01f8889613 LaTeX snippets: more accurate description 2024-05-14 15:58:36 +02:00
c2502fd47e Add some new snippets
- \pause
- \item
2024-05-14 15:58:09 +02:00
c62a8ebc23 snippets: add block in latex 2024-05-14 12:13:11 +02:00
fd84aebebb Add snippets for latex (frame) 2024-05-14 12:09:20 +02:00
029d95e75d disable autofolding for neorg 2024-04-18 17:08:57 +02:00
94cddafa6e neorg: dirman not working, ugly fix 2024-04-18 16:00:23 +02:00
e125c201cb treesitter: add 'norg_meta' for :neorg journal 2024-04-18 15:49:15 +02:00
55f1d17d38 readme: rephrasing 2024-04-17 09:40:25 +02:00
34c2c9e1f2 LTeX rules update 2024-04-17 09:37:01 +02:00
8ae2549f3a mappings: clean old mappings 2024-04-03 12:48:21 +02:00
74f17dbb59 neorg 8.2.0 adds the field username for metagen
- https://github.com/nvim-neorg/neorg/pull/1331
2024-03-27 00:48:02 +01:00
7415689345 Fix for neorg 8.0.0 2024-03-27 00:47:52 +01:00
f00d49600f Add neorg exports shortcuts 2024-03-25 11:31:06 +01:00
bef72fd08d ltex: more personalized configuration
TODO: add a shortcut for languages

Source: https://github.com/vigoux/ltex-ls.nvim
2024-03-19 19:15:52 +01:00
4edd7015ca Add markdown preview shortcut
+ description to other bindings
2024-03-03 10:32:24 +01:00
8cd994ba57 which-key: add neorg hints 2024-02-29 13:03:33 +01:00
0aae3870d0 Add Neorg which_key hint 2024-02-28 17:25:01 +01:00
37db36e1de From new kickstart.nvim add mini.surround (less aggressive than nvim-surround) and todo-comments 2024-02-27 14:48:02 +01:00
4f4acc74e8 plugins: Add Markdown preview
- https://github.com/iamcco/markdown-preview.nvim
- + `:format` in the lazy file
2024-02-24 21:36:58 +01:00
16626d35de Add filetypes for ltex 2024-02-15 12:17:17 +01:00
2fadfc4ad7 Actually I don’t like hls by default 2024-02-15 11:39:13 +01:00
8961867188 disable treesitter indent for js 2024-02-12 17:44:06 +01:00
d3331c03e1 Set hls to true 2024-01-31 18:05:50 +01:00
ce9a024a32 general options: add listchars back
It was in the bépo config file and is useful to detect trailing spaces
and nbsp chars.
2024-01-18 12:41:00 +01:00
22b51e96bc disable bépo mappings and adapt it to ergo-L 2024-01-16 16:09:52 +01:00
d9a7666e9e disable treesitter for latex 2024-01-03 15:32:19 +01:00
b1be29b39c Use zathura with vimtex 2024-01-03 15:32:02 +01:00
df316128cd Fix autocommand for latex 2024-01-03 15:31:45 +01:00
7b66e26511 lualine: add icons
- From https://github.com/geekingfrog/configFiles/blob/master/vim/fnl/plugins/00-eye-candy.fnl#L34-L37C67
2023-12-26 16:56:07 +01:00
0ebd500c03 readme.md: add a link to the corresponding blog post 2023-12-25 19:55:05 +01:00
25c639dff2 Add ltex for natural language LSP-style checking. 2023-12-25 17:43:39 +01:00
d0afa1066c minor: remove one empty line 2023-12-25 16:28:07 +01:00
d7244d1e6d Fix spelling calls 2023-12-25 16:09:06 +01:00
c4e6cea2bd ignore spell/ directory 2023-12-25 16:02:49 +01:00
cbde7406b3 Use spelling module for autocommand about spelling 2023-12-25 16:02:03 +01:00
761d30bb69 Add spelling module 2023-12-25 16:01:49 +01:00
c03ea41065 spell: remove some debug information 2023-12-25 15:43:56 +01:00
4e160773c4 Add description to spellcheck bindings 2023-12-25 15:43:06 +01:00
23 changed files with 809 additions and 333 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
lazy-lock.json spell/

View File

@ -1,46 +1,15 @@
--[[ --[[
-- Contains fixes for mappings created by plugins -- Contains fixes for mappings created by plugins
-- Useful because of bépo -- Useful because of bépo
-- NOTE: not in use right now
--]] --]]
-- Comments.nvim adds `gbc` command, which conflicts with `gb/gé` to move -- Comments.nvim adds `gbc` command, which conflicts with `gb/gé` to move
-- between tabs -- between tabs
if vim.fn.maparg("gbc") ~= "" then --[[ if vim.fn.maparg("gbc") ~= "" then
vim.keymap.del("n", "gbc") vim.keymap.del("n", "gbc")
vim.keymap.set('n', 'gBc', function() vim.keymap.set('n', 'gBc', function()
return vim.api.nvim_get_vvar('count') == 0 and '<Plug>(comment_toggle_blockwise_current)' return vim.api.nvim_get_vvar('count') == 0 and '<Plug>(comment_toggle_blockwise_current)'
or '<Plug>(comment_toggle_blockwise_count)' or '<Plug>(comment_toggle_blockwise_count)'
end, { expr = true, desc = 'Comment toggle current block' }) end, { expr = true, desc = 'Comment toggle current block' })
end end ]]
-- [[ vimtex ]]
-- Some BÉPO mappings for vimtex
local texgroup = vim.api.nvim_create_augroup("latex", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.tex", "*.bib", "*.cls", "*.tikz", },
group = texgroup,
callback = function()
local vimtex_remaps = {
-- c <-> t
{ mode = "n", source = "csd", target = "tsd", command = "<Plug>(vimtex-delim-change-math)" },
{ mode = "n", source = "csc", target = "lsc", command = "<Plug>(vimtex-cmd-change)" },
{ mode = "n", source = "cse", target = "lse", command = "<Plug>(vimtex-env-change)" },
{ mode = "n", source = "cs$", target = "ls$", command = "<Plug>(vimtex-env-change-math))" },
-- t <-> j
{ mode = { "x", "n" }, source = "tsD", target = "jsD", command = "<Plug>(vimtex-delim-toggle-modifier-reverse)" },
{ mode = { "x", "n" }, source = "tsd", target = "jsd", command = "<Plug>(vimtex-delim-toggle-modifier)" },
{ mode = { "x", "n" }, source = "tsf", target = "jsf", command = "<Plug>(vimtex-cmd-toggle-frac)" },
{ mode = "n", source = "tsc", target = "jsc", command = "<Plug>(vimtex-cmd-toggle-star)" },
{ mode = "n", source = "ts$", target = "js$", command = "<Plug>(vimtex-env-toggle-math)" },
{ mode = "n", source = "tse", target = "jse", command = "<Plug>(vimtex-env-toggle-star)" },
}
for _, remap in pairs(vimtex_remaps) do
if vim.fn.maparg(remap.source) ~= "" then
vim.keymap.del(remap.mode, remap.source, { buffer = true })
vim.keymap.set(remap.mode, remap.target, remap.command, { silent = true, noremap = true, buffer = true })
end
end
end,
})

View File

@ -28,7 +28,7 @@ vim.opt.rtp:prepend(lazypath)
-- --
-- You can also configure plugins after the setup call, -- You can also configure plugins after the setup call,
-- as they will be available in your neovim runtime. -- as they will be available in your neovim runtime.
require('lazy-configure') require('plugins-configure')
-- [[ Setting options ]] -- [[ Setting options ]]
require('general-options') require('general-options')
@ -62,8 +62,10 @@ require('complete')
-- [[ Configure neorg ]] -- [[ Configure neorg ]]
require('neorg-configure') require('neorg-configure')
-- [[ Configure status line ]]
require('statusline')
-- Customizations -- Customizations
require('bepo')
require('restore-position') require('restore-position')
require('autocommands') require('autocommands')

50
lazy-lock.json Normal file
View File

@ -0,0 +1,50 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "c1851d5c519611dfc451b6582961b2602e0af89b" },
"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": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "39e0d1cd44eafed5f30c372e377ab1cb1781ec9f" },
"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": "a4e3c15dfdce8783c074539b1835edae75fa63d5" },
"lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" },
"lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" },
"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": "d39a75bbce4b8aad5d627191ea915179c77c100f" },
"mason.nvim": { "branch": "main", "commit": "888d6ee499d8089a3a4be4309d239d6be1c1e6c0" },
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
"mini.nvim": { "branch": "main", "commit": "8f0969dd976e4f0cb8e2898596fa2eab18ce676b" },
"neorg": { "branch": "main", "commit": "8fdd9b2986acfb4ce310bebfc338111793862f00" },
"neorg-telescope": { "branch": "main", "commit": "7fb6ca6a632c3c095601d379a664c0c1f802dc6c" },
"nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-dap": { "branch": "master", "commit": "8df427aeba0a06c6577dc3ab82de3076964e3b8d" },
"nvim-lspconfig": { "branch": "master", "commit": "ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "b0debd5c424969b4baeabdc8f54db3036c691732" },
"oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" },
"pathlib.nvim": { "branch": "main", "commit": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"rose-pine": { "branch": "main", "commit": "491a0c77abc7ecb955c27a974091a5968232995f" },
"tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"typst.vim": { "branch": "main", "commit": "323539709e29a537ff39dfce6c05f175a8921504" },
"undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" },
"vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" },
"vim-pandoc-syntax": { "branch": "master", "commit": "ea3fc415784bdcbae7f0093b80070ca4ff9e44c8" },
"vim-rhubarb": { "branch": "master", "commit": "386daa2e9d98e23e27ad089afcbe5c5a903e488d" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
"vim-speeddating": { "branch": "master", "commit": "c17eb01ebf5aaf766c53bab1f6592710e5ffb796" },
"vimtex": { "branch": "master", "commit": "9d9f74c3ab073b70bc943279af1aa86075de632c" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
}

17
lsp/gdscript.lua Normal file
View 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
View 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
View 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
},
}
}

View File

@ -1,11 +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 keyunmap = function(mode, binding) local spell_keymap = require('spelling').spell_keymap
print(vim.inspect(vim.fn.maparg(binding, mode)))
if vim.fn.maparg(binding, mode) ~= "" then
vim.keymap.del(mode, binding)
end
end
-- Recognize .md as pandoc -- Recognize .md as pandoc
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
@ -13,59 +8,76 @@ vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
group = markdown, group = markdown,
callback = function() callback = function()
vim.o.filetype = 'pandoc' vim.o.filetype = 'pandoc'
vim.o.commentstring = '<!--%s-->'
require('luasnip').filetype_extend("pandoc", { "markdown" }) require('luasnip').filetype_extend("pandoc", { "markdown" })
vim.o.spell = true vim.o.spell = true
vim.o.spelllang = 'en' spell_keymap()
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<CR><CR>', vim.keymap.set('', '<LocalLeader>msy', ':w !pandoc -f markdown+emoji -t html5 -s | wl-copy --type text/html<CR><CR>',
{ noremap = true, silent = true }) { noremap = true, silent = true, desc = "[M]arkdown to [S]ingle page [Y]ank" })
vim.keymap.set('', '<LocalLeader>my', ':w !pandoc -f markdown+emoji --wrap=none -t html5 | wl-copy<CR><CR>', vim.keymap.set('', '<LocalLeader>my',
{ noremap = true, silent = true }) ':w !pandoc -f markdown+emoji --wrap=none -t html5 | wl-copy --type text/html<CR><CR>',
end { noremap = true, silent = true, desc = "[M]arkdown to HTML [Y]ank" })
}) vim.keymap.set('', '<LocalLeader>mp', '<Plug>MarkdownPreviewToggle',
{ noremap = true, silent = true, desc = "[M]arkdown [P]review" })
-- French markdown files
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*-fr.md", },
group = markdown,
callback = function()
vim.o.spelllang = 'fr'
end end
}) })
-- Spell shortcuts -- Spell shortcuts
vim.api.nvim_create_autocmd({ "OptionSet" }, { vim.api.nvim_create_autocmd({ "OptionSet" }, {
pattern = { "spell" }, pattern = { "spell" },
group = markdown, group = spelling,
callback = function() callback = spell_keymap
if vim.o.spell == true then
vim.keymap.set("n", "<Leader>i", "mz[s1z=`z", { noremap = true, silent = true })
vim.keymap.set("n", "à", "]s", { noremap = true, silent = true })
else
keyunmap("n", "<Leader>i")
keyunmap("n", "à")
end
end
}) })
-- LaTeX configuration -- LaTeX configuration
local texgroup = vim.api.nvim_create_augroup("latex", { clear = true }) local texgroup = vim.api.nvim_create_augroup("latex", { clear = true })
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = { "latex" }, pattern = { "latex", "tex" },
group = texgroup, group = texgroup,
callback = function() callback = function()
-- vimtex configuration -- vimtex configuration
vim.g.vimtex_view_method = 'zathura' vim.g.vimtex_view_method = '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: doesnt 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
spell_keymap()
vim.o.spelllang = "en,fr"
end,
})
-- Typst bindings + spellchecking
local typstgroup = vim.api.nvim_create_augroup("typst", { clear = true })
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.o.spell = true
spell_keymap()
vim.o.spelllang = "fr,en"
end,
})
-- Jujutsu spellchecking
local jjgroup = vim.api.nvim_create_augroup("jujustu", { clear = true })
vim.api.nvim_create_autocmd("FileType", {
pattern = { "jj" },
group = jjgroup,
callback = function()
vim.o.spell = true
spell_keymap()
vim.o.spelllang = "en"
end, end,
}) })

View File

@ -1,67 +0,0 @@
-- colorise les nbsp
-- highlight NbSp ctermbg=lightgray guibg=lightred
--hi NbSps ctermbg=lightred guibg=lightred
--match NbSps /\%xa0\|\%u202F/
-- bépo
vim.opt.listchars:append({nbsp = "·", trail = "¤", eol = ''})
vim.opt.list = true
-- {W} -> [É]
-- ——————————
-- On remappe W sur É :
-- Pour faciliter les manipulations de fenêtres, on utilise {W} comme un Ctrl+W :
local keymap = vim.keymap.set
local opts = {noremap = true, silent = true}
local map_list = {['é'] = 'w', ['É'] = 'W', ['w'] = '<C-w>'}
for key,binding in pairs(map_list) do
keymap('n', key, binding, opts)
end
-- Corollaire: on remplace les text objects aw, aW, iw et iW
-- pour effacer/remplacer un mot quand on nest pas au début (daé / laé).
local omap_list = {[''] = 'w', [''] = 'aW', [''] = 'iw', [''] = 'iW'}
for key,binding in pairs(omap_list) do
keymap('o', key, binding, opts)
end
-- [HJKL] <-> {CTSR}
-- ————————————————
map_list = {
['c'] = 'h', ['r'] = 'l', ['t'] = 'j', ['s'] = 'k', ['C'] = 'H', ['R'] = 'L', ['T'] = 'J', ['S'] = 'K', -- [HJKL] -> [CTSR]
['j'] = 't', ['J'] = 'T', ['l'] = 'c', ['L'] = 'C', ['h'] = 'r', ['H'] = 'R', ['k'] = 's', ['K'] = 'S', -- [CTSR] -> [HJKL]: J = jusqu'à, L = change, h = remplace, k = substitute
['zs'] = 'zj', ['zt'] = 'zk', -- Pour les replis
[']k'] = ']s', ['[k'] = '[s' , -- correction orthographique
}
for key, binding in pairs(map_list) do
keymap({'n', 'x'}, key, binding, opts)
end
-- Désambiguation de {g}
-- —————————————————————
-- ligne écran précédente / suivante (à l'intérieur d'une phrase)
-- onglets précédent/suivant : gé/gb, premier/dernier onglet : gÉ/gB,
-- g" = première ligne de lécran
local map_list = {['gs'] = 'gk', ['gt'] = 'gj', ['gb'] = 'gT', [''] = 'gt', ['gB'] = ':tabfirst<CR>', [''] = ':tablast<CR>', ['g"'] = 'g0', }
for key, binding in pairs(map_list) do
keymap({'n', 'x'}, key, binding, opts)
end
-- <> en direct
-- ————————————
vim.api.nvim_set_keymap('', '«', '<', {noremap = false, silent = true})
vim.api.nvim_set_keymap('', '»', '>', {noremap = false, silent = true})
-- Chiffres en accès direct
-- ————————————————————————
-- À décommenter si on souhaite les avoir
--local map_list = { ['"'] = '1', ['1'] = '"', ['«'] = '2', ['2'] = '<', ['»'] = '3', ['3'] = '>', ['('] = '4', ['4'] = '(', [')'] = '5', ['5'] = ')', ['@'] = '6', ['6'] = '@', ['+'] = '7', ['7'] = '+', ['-'] = '8', ['8'] = '-', ['/'] = '9', ['9'] = '/', ['*'] = '0', ['0'] = '*', }
--for key, binding in pairs(map_list) do
-- vim.api.nvim_set_keymap('', key, binding, { noremap = true, silent = true })
--end
-- Remaper la gestion des fenêtres
-- ———————————————————————————————
map_list = {['wt'] = '<C-w>j', ['ws'] = '<C-w>k', ['wc'] = '<C-w>h', ['wr'] = '<C-w>l', ['wd'] = '<C-w>c', ['wo'] = '<C-w>s', ['wp'] = '<C-w>o', ['w<SPACE>'] = ':split<CR>', ['w<CR>'] = ':vsplit<CR>', ['<A-w>'] = '<C-w><C-w>', }
for key, binding in pairs(map_list) do
vim.api.nvim_set_keymap('', key, binding, {noremap = true, silent = true})
end

View File

@ -2,11 +2,19 @@
local cmp = require '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()
luasnip.config.setup { luasnip.config.setup {
history = true, history = true,
updateevents = "TextChanged,TextChangedI", updateevents = "TextChanged,TextChangedI",
enable_autosnippets = true, 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 { cmp.setup {
snippet = { snippet = {
@ -16,6 +24,7 @@ cmp.setup {
}, },
completion = { completion = {
completeopt = 'menu,menuone,noinsert', completeopt = 'menu,menuone,noinsert',
autocomplete = false,
}, },
mapping = cmp.mapping.preset.insert { mapping = cmp.mapping.preset.insert {
['<C-n>'] = cmp.mapping.select_next_item(), ['<C-n>'] = cmp.mapping.select_next_item(),
@ -23,16 +32,25 @@ cmp.setup {
['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {}, ['<C-Space>'] = cmp.mapping.complete {},
['<C-l>'] = cmp.mapping.confirm { ['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,
select = true, select = true,
}, },
['<C-e>'] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close() }), ['<C-e>'] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close() }),
['<Tab>'] = cmp.mapping(function(fallback) ['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() if #cmp.get_entries() == 1 then
cmp.confirm({ select = true })
else
cmp.select_next_item()
end
elseif luasnip.expand_or_locally_jumpable() then elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump() luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
if #cmp.get_entries() == 1 then
cmp.confirm({ select = true })
end
else else
fallback() fallback()
end end
@ -48,6 +66,8 @@ cmp.setup {
end, { 'i', 's' }), end, { 'i', 's' }),
}, },
sources = { sources = {
{ name = 'lazydev',
group_index = 0 },
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'luasnip' }, { name = 'luasnip' },
{ name = 'path' }, { name = 'path' },

View File

@ -60,3 +60,7 @@ vim.o.tw = 80
vim.o.winwidth = 88 vim.o.winwidth = 88
vim.o.scrolloff = 10 vim.o.scrolloff = 10
vim.cmd "set formatoptions-=t" vim.cmd "set formatoptions-=t"
-- Make some typographic chars visible
vim.opt.listchars:append({ nbsp = "·", trail = "¤", eol = '' })
vim.o.list = true

View File

@ -1,64 +1,90 @@
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>ca', vim.lsp.buf.code_action, '[C]ode [A]ction') nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
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')
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').register { require('which-key').add {
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' }, -- { "<leader>c", group = "[C]ode" },
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, -- { "<leader>c_", hidden = true },
['<leader>g'] = { name = '[G]it', _ = 'which_key_ignore' }, { "<leader>d", group = "[D]ocument / [D]iagnostic" },
['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, { "<leader>d_", hidden = true },
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' }, { "<leader>g", group = "[G]it" },
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' }, { "<leader>g_", hidden = true },
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, { "<leader>h", group = "Git [H]unk" },
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, { "<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 -- register which-key VISUAL mode
-- required for visual <leader>hs (hunk stage) to work -- required for visual <leader>hs (hunk stage) to work
require('which-key').register({ require('which-key').add {
['<leader>'] = { name = 'VISUAL <leader>' }, { "<leader>", group = "VISUAL <leader>", mode = "v" },
['<leader>h'] = { 'Git [H]unk' }, { "<leader>h", desc = "Git [H]unk", mode = "v" },
}, { mode = 'v' }) }
-- mason-lspconfig requires that these setup functions are called in this order -- mason-lspconfig requires that these setup functions are called in this order
-- before setting up the servers. -- before setting up the servers.
@ -75,13 +101,15 @@ require('mason-lspconfig').setup()
-- define the property 'filetypes' to the map in question. -- define the property 'filetypes' to the map in question.
local servers = { local servers = {
clangd = {}, clangd = {},
bashls = {},
-- gopls = {}, -- gopls = {},
pyright = {}, pyright = {},
-- rust_analyzer = {}, -- rust_analyzer = {},
tsserver = {}, ts_ls = {},
eslint = {},
-- html = { filetypes = { 'html', 'twig', 'hbs'} }, -- html = { filetypes = { 'html', 'twig', 'hbs'} },
texlab = {}, texlab = {},
tinymist = {},
lua_ls = { lua_ls = {
Lua = { Lua = {
workspace = { checkThirdParty = false }, workspace = { checkThirdParty = false },
@ -92,9 +120,6 @@ local servers = {
}, },
} }
-- Setup neovim lua configuration
require('neodev').setup()
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers -- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
@ -104,47 +129,33 @@ local mason_lspconfig = require 'mason-lspconfig'
mason_lspconfig.setup { mason_lspconfig.setup {
ensure_installed = vim.tbl_keys(servers), ensure_installed = vim.tbl_keys(servers),
automatic_installation = true,
automatic_enable = true,
} }
mason_lspconfig.setup_handlers { -- [[ System LSPs ]]
function(server_name) local setup_godot_dap = function()
require('lspconfig')[server_name].setup { local dap = require("dap")
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
filetypes = (servers[server_name] or {}).filetypes,
}
end,
}
-- System LSPs dap.adapters.godot = {
type = "server",
host = "127.0.0.1",
port = 6006,
}
local lspconfig = require('lspconfig') dap.configurations.gdscript = {
servers = { {
rust_analyzer = { launch_game_instance = false,
["rust-analyzer"] = { launch_scene = false,
imports = { name = "Launch scene",
granularity = { project = "${workspaceFolder}",
group = "module", request = "launch",
}, type = "godot",
prefix = "self", },
},
cargo = {
buildScripts = {
enable = true,
},
},
procMacro = {
enable = true
},
}
},
}
for server_name, server_settings in pairs(servers) do
lspconfig[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = server_settings,
} }
end end
setup_godot_dap()
vim.diagnostic.config({ virtual_lines = true })
vim.lsp.enable({ "ltex_ls_plus", "rust-analyzer", "gdscript" })

View File

@ -1,7 +1,8 @@
local map_list = { local map_list = {
["w|"] = ":vsplit", ["w-"] = ":split", -- w| / w- pour créer des splits verticaux et horizontaux -- ["w|"] = ":vsplit", ["w-"] = ":split", -- w| / w- pour créer des splits verticaux et horizontaux
["gi"] = ":bprevious", ["ge"] = ":bnext", -- ["ge"] = ":bprevious", ["gn"] = ":bnext",
["W"] = ":w", ["<C-t>"] = ":tabnew", ["W"] = ":w",
["<C-t>"] = ":tabnew",
} }
local keymap = vim.keymap.set local keymap = vim.keymap.set
@ -20,18 +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
require('which-key').add({
{ "<leader>m", group = "[M]arkdown" },
{ "<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>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 })

View File

@ -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" }, {
@ -7,57 +7,78 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
callback = function() callback = function()
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
vim.o.conceallevel = 2 vim.o.conceallevel = 2
vim.api.nvim_set_keymap("n", "<Leader>nr", ":Neorg return<CR>", vim.o.foldlevelstart = 99
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
vim.keymap.set("n", "<Leader>nh", "<Plug>(neorg.telescope.search_headings)",
{ noremap = true, silent = true, desc = "[N]eorg search [H]eading" })
vim.keymap.set("n", "<Leader>nb", "<Plug>(neorg.telescope.backlinks.file_backlinks)",
{ noremap = true, silent = true, desc = "[N]eorg file [B]acklinks" })
vim.keymap.set("n", "<C-l>", "<Plug>(neorg.telescope.insert_link)",
{ noremap = true, silent = true, desc = "Neorg insert [L]ink" })
-- Tasks
vim.keymap.set("n", "<LocalLeader>td", "<Plug>(neorg.qol.todo-items.todo.task-done)",
{ noremap = true, silent = true, desc = "[T]ask [D]one" })
vim.keymap.set("n", "<LocalLeader>tu", "<Plug>(neorg.qol.todo-items.todo.task-undone)",
{ noremap = true, silent = true, desc = "[T]ask [U]ndone" })
vim.keymap.set("n", "<LocalLeader>tp", "<Plug>(neorg.qol.todo-items.todo.task-pending)",
{ noremap = true, silent = true, desc = "[T]ask [P]ending" })
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" })
vim.keymap.set("n", "<LocalLeader>tc", "<Plug>(neorg.qol.todo-items.todo.task-cancelled)",
{ noremap = true, silent = true, desc = "[T]ask on [C]ancelled" })
vim.keymap.set("n", "<LocalLeader>tr", "<Plug>(neorg.qol.todo-items.todo.task-recurring)",
{ noremap = true, silent = true, desc = "[T]ask on [R]ecurring" })
vim.keymap.set("n", "<LocalLeader>ti", "<Plug>(neorg.qol.todo-items.todo.task-important)",
{ 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,
}) })
vim.api.nvim_set_keymap("n", "<Leader>ni", ":Neorg index<CR>", local function live_grep_neorg()
{ noremap = true, silent = true, desc = "[N]eorg [I]ndex" }) local neorg_root = '~/Sync/neorg' -- TODO: get it from neorg
vim.api.nvim_set_keymap("n", "<Leader>nm", ":Neorg inject-metadata<CR>", require('telescope.builtin').live_grep {
{ noremap = true, silent = true, desc = "[N]eorg insert [M]etadata" }) cwd = neorg_root,
vim.api.nvim_set_keymap("n", "<Leader>nj", ":Neorg journal toc open<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [J]ournal" })
vim.api.nvim_set_keymap("n", "<Leader>nt", ":Neorg journal today<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [T]oday" })
vim.api.nvim_set_keymap("n", "<Leader>ns", ":Neorg journal tomorrow<CR>",
{ noremap = true, silent = true, desc = "Neorg tomorrow" })
vim.api.nvim_set_keymap("n", "<Leader>ny", ":Neorg journal yesterday<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [Y]esterday" })
local neorg = require('neorg')
neorg.setup {
load = {
["core.defaults"] = {},
["core.concealer"] = {
config = {
icon_preset = "diamond",
}
},
["core.dirman"] = {
config = {
workspaces = {
notes = "~/Sync/neorg",
},
default_workspace = "notes",
}
},
["core.export"] = {
config = {
export_dir = "<export-dir>/<language>",
},
},
["core.esupports.metagen"] = {
config = {
type = "empty",
},
},
} }
end
-- document existing key chains
require('which-key').add {
{ "<leader>l", group = "neorg [L]ist" },
{ "<leader>l_", hidden = true },
{ "<leader>t", group = "neorg [T]asks" },
{ "<leader>n", group = "[N]eorg" },
{ "<leader>n_", hidden = true },
{ "<leader>ne", group = "[N]eorg [E]xport" },
{ "<leader>ne_", hidden = true },
} }
-- Use custom name for the author field in metadata instead of the system vim.keymap.set("n", "<Leader>ni", ":Neorg index<CR>",
-- username { noremap = true, silent = true, desc = "[N]eorg [I]ndex" })
neorg.utils.get_username = function() vim.keymap.set("n", "<Leader>nm", ":Neorg inject-metadata<CR>",
return "Chouhartem" { noremap = true, silent = true, desc = "[N]eorg insert [M]etadata" })
end vim.keymap.set("n", "<Leader>nj", ":Neorg journal toc open<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [J]ournal" })
vim.keymap.set("n", "<Leader>nt", ":Neorg journal today<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [T]oday" })
vim.keymap.set("n", "<Leader>ns", ":Neorg journal tomorrow<CR>",
{ noremap = true, silent = true, desc = "Neorg tomorrow" })
vim.keymap.set("n", "<Leader>ny", ":Neorg journal yesterday<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [Y]esterday" })
vim.keymap.set("n", "<Leader>neo", ":e /tmp/neorg-export.md<CR>",
{ noremap = true, silent = true, desc = "[N]eorg [E]xport [O]pen" })
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" })
vim.keymap.set("n", "<Leader>nef", ":Neorg export to-file ",
{ noremap = true, silent = true, desc = "[N]eorg [E]xport [F]ile" })
vim.keymap.set("n", "<Leader>nl", "<Plug>(neorg.telescope.find_linkable)",
{ noremap = true, silent = true, desc = "[N]eorg find [L]inkable" })
vim.keymap.set("n", "<Leader>nf", "<Plug>(neorg.telescope.find_norg_files)",
{ 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" })

View File

@ -10,6 +10,21 @@ require('lazy').setup({
-- NOTE: This is where your plugins related to LSP can be installed. -- NOTE: This is where your plugins related to LSP can be installed.
-- The configuration is done below. Search for lspconfig to find it below. -- The configuration is done below. Search for lspconfig to find it below.
{
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
'folke/lazydev.nvim',
ft = 'lua',
opts = {
library = {
-- Load luvit types when the `vim.uv` word is found
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
},
},
},
{
'Bilal2453/luvit-meta', lazy = true
},
{ {
-- LSP Configuration & Plugins -- LSP Configuration & Plugins
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
@ -21,11 +36,23 @@ require('lazy').setup({
-- 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 = {} },
-- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim',
}, },
}, },
-- 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',
{ {
-- Autocompletion -- Autocompletion
@ -134,19 +161,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 = false,
theme = 'rose-pine',
component_separators = '|',
section_separators = '',
},
},
},
{ {
-- Add indentation guides even on blank lines -- Add indentation guides even on blank lines
@ -158,7 +174,7 @@ require('lazy').setup({
}, },
-- "gc" to comment visual regions/lines -- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} }, { 'numToStr/Comment.nvim', opts = {} },
-- Fuzzy Finder (files, lsp, etc) -- Fuzzy Finder (files, lsp, etc)
{ {
@ -190,6 +206,35 @@ require('lazy').setup({
build = ':TSUpdate', build = ':TSUpdate',
}, },
-- NOTE: New additions to kickstart.nvim
-- The following has been added in https://github.com/nvim-lua/kickstart.nvim/blob/af4fd2355f211d4d19ec08ea6d57cbea483e2ee7/init.lua
-- Highlight todo, notes, etc in comments
{ 'folke/todo-comments.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
{ -- Collection of various small independent plugins/modules
'echasnovski/mini.nvim',
config = function()
-- Better Around/Inside textobjects
--
-- Examples:
-- - va) - [V]isually select [A]round [)]parenthen
-- - yinq - [Y]ank [I]nside [N]ext [']quote
-- - ci' - [C]hange [I]nside [']quote
-- require('mini.ai').setup { n_lines = 500 }
-- Add/delete/replace surroundings (brackets, quotes, etc.)
--
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
-- - sd' - [S]urround [D]elete [']quotes
-- - sr)' - [S]urround [R]eplace [)] [']
require('mini.surround').setup()
-- ... and there is more!
-- Check out: https://github.com/echasnovski/mini.nvim
end,
},
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
-- These are some example plugins that I've included in the kickstart repository. -- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them. -- Uncomment any of the lines below to enable them.
@ -212,12 +257,83 @@ require('lazy').setup({
'vim-pandoc/vim-pandoc-syntax', 'vim-pandoc/vim-pandoc-syntax',
-- neorg -- neorg
{ {
'nvim-neorg/neorg', "vhyrro/luarocks.nvim",
build = ':Neorg sync-parsers', priority = 1000, -- We'd like this plugin to load first out of the rest
dependencies = { "nvim-lua/plenary.nvim" }, config = true, -- This automatically runs `require("luarocks-nvim").setup()`
},
{
"nvim-neorg/neorg",
dependencies = { "luarocks.nvim", { "nvim-lua/plenary.nvim" }, { "nvim-neorg/neorg-telescope" } },
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()
require("neorg").setup {
load = {
["core.defaults"] = {},
["core.keybinds"] = {},
["core.completion"] = {
config = {
engine = "nvim-cmp",
},
},
["core.concealer"] = {
config = {
icon_preset = "diamond",
}
},
["core.dirman"] = {
config = {
workspaces = {
notes = "~/Sync/neorg",
},
default_workspace = "notes",
}
},
["core.export"] = {
config = {
export_dir = "<export-dir>/<language>",
},
},
["core.esupports.metagen"] = {
config = {
author = "Chouhartem",
type = "empty",
},
},
["core.integrations.telescope"] = {},
}
}
end,
}, },
-- vim-speeddating -- vim-speeddating
'tpope/vim-speeddating', 'tpope/vim-speeddating',
-- vim-tabular -- vim-tabular
'godlygeek/tabular', 'godlygeek/tabular',
-- MarkdownPreview without yarn or npm
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown", "pandoc" },
-- build = function() vim.fn["mkdp#util#install"]() end,
build = "cd app && npm install && git restore .",
},
{
'kaarmu/typst.vim',
ft = 'typst',
lazy = false,
},
-- 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',
}, {}) }, {})

19
lua/spelling.lua Normal file
View File

@ -0,0 +1,19 @@
local keyunmap = function(mode, binding)
if vim.fn.maparg(binding, mode) ~= "" then
vim.keymap.del(mode, binding)
end
end
local M = {}
M.spell_keymap = function()
if vim.o.spell == true then
vim.keymap.set("n", "<Leader>i", "mzl[s1z=`z", { noremap = true, silent = true, desc = "f[I]x typo under cursor" })
vim.keymap.set("n", "à", "]s", { noremap = true, silent = true, desc = "Go to the next typo" })
else
keyunmap("n", "<Leader>i")
keyunmap("n", "à")
end
end
return M

48
lua/statusline.lua Normal file
View 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 = "",
}
})

View File

@ -76,9 +76,11 @@ vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc
vim.keymap.set('n', '<leader>sG', ':LiveGrepGitRoot<cr>', { desc = '[S]earch by [G]rep on Git Root' }) vim.keymap.set('n', '<leader>sG', ':LiveGrepGitRoot<cr>', { desc = '[S]earch by [G]rep on Git Root' })
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_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' })
vim.keymap.set('n', '<leader>gs', require('telescope.builtin').git_status, { desc = '[G]it [S]tatus' }) vim.keymap.set('n', '<leader>gs', require('telescope.builtin').git_status, { desc = '[G]it [S]tatus' })
vim.keymap.set({'n', 'x'}, '<leader>gB', require('telescope.builtin').git_bcommits, { desc = '[G]it [B]commits' }) vim.keymap.set({ 'n', 'x' }, '<leader>gB', require('telescope.builtin').git_bcommits, { desc = '[G]it [B]commits' })
vim.keymap.set('n', '<leader>gb', require('telescope.builtin').git_branches, { desc = '[G]it [B]ranches' }) vim.keymap.set('n', '<leader>gb', require('telescope.builtin').git_branches, { desc = '[G]it [B]ranches' })

View File

@ -3,9 +3,9 @@
vim.defer_fn(function() vim.defer_fn(function()
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter -- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' }, ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash', 'norg', 'norg_meta', 'gdscript' },
ignore_install = {'latex', 'markdown'}, ignore_install = { 'latex', 'tex', 'markdown' },
disable = {'latex', 'markdown'}, disable = { 'latex', 'tex', 'markdown' },
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false, auto_install = false,
@ -13,7 +13,10 @@ vim.defer_fn(function()
sync_install = false, sync_install = false,
highlight = { enable = true }, highlight = { enable = true },
indent = { enable = true }, indent = {
enable = true,
disable = { 'javascript' }
},
incremental_selection = { incremental_selection = {
enable = true, enable = true,
keymaps = { keymaps = {
@ -67,5 +70,6 @@ vim.defer_fn(function()
}, },
}, },
}, },
modules = {},
} }
end, 0) end, 0)

View File

@ -1,21 +1,21 @@
local options = { local options = {
plugins = { plugins = {
marks = true, -- shows a list of your marks on ' and ` marks = true, -- shows a list of your marks on ' and `
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
-- the presets plugin, adds help for a bunch of default keybindings in Neovim -- the presets plugin, adds help for a bunch of default keybindings in Neovim
-- No actual key bindings are created -- No actual key bindings are created
spelling = { spelling = {
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
suggestions = 20, -- how many suggestions should be shown in the list? suggestions = 20, -- how many suggestions should be shown in the list?
}, },
presets = { presets = {
operators = false, -- adds help for operators like d, y, ... operators = false, -- adds help for operators like d, y, ...
motions = true, -- adds help for motions motions = true, -- adds help for motions
text_objects = false, -- help for text objects triggered after entering an operator text_objects = false, -- help for text objects triggered after entering an operator
windows = true, -- default bindings on <c-w> windows = true, -- default bindings on <c-w>
nav = true, -- misc bindings to work with windows nav = true, -- misc bindings to work with windows
z = true, -- bindings for folds, spelling and others prefixed with z z = true, -- bindings for folds, spelling and others prefixed with z
g = true, -- bindings for prefixed with g g = true, -- bindings for prefixed with g
}, },
}, },
-- add operators that will trigger motion and text object completion -- add operators that will trigger motion and text object completion
@ -38,27 +38,27 @@ local options = {
}, },
popup_mappings = { popup_mappings = {
scroll_down = "<c-d>", -- binding to scroll down inside the popup scroll_down = "<c-d>", -- binding to scroll down inside the popup
scroll_up = "<c-u>", -- binding to scroll up inside the popup scroll_up = "<c-u>", -- binding to scroll up inside the popup
}, },
window = { window = {
border = "none", -- none, single, double, shadow border = "none", -- none, single, double, shadow
position = "bottom", -- bottom, top position = "bottom", -- bottom, top
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]. When between 0 and 1, will be treated as a percentage of the screen size. margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]. When between 0 and 1, will be treated as a percentage of the screen size.
padding = { 1, 2, 1, 2 }, -- extra window padding [top, right, bottom, left] padding = { 1, 2, 1, 2 }, -- extra window padding [top, right, bottom, left]
winblend = 0, -- value between 0-100 0 for fully opaque and 100 for fully transparent winblend = 0, -- value between 0-100 0 for fully opaque and 100 for fully transparent
zindex = 1000, -- positive value to position WhichKey above other floating windows. zindex = 1000, -- positive value to position WhichKey above other floating windows.
}, },
layout = { layout = {
height = { min = 4, max = 25 }, -- min and max height of the columns height = { min = 4, max = 25 }, -- min and max height of the columns
width = { min = 20, max = 50 }, -- min and max width of the columns width = { min = 20, max = 50 }, -- min and max width of the columns
spacing = 3, -- spacing between columns spacing = 3, -- spacing between columns
align = "left", -- align columns left, center or right align = "left", -- align columns left, center or right
}, },
ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "^:", "^ ", "^call ", "^lua " }, -- hide mapping boilerplate hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "^:", "^ ", "^call ", "^lua " }, -- hide mapping boilerplate
show_help = true, -- show a help message in the command line for using WhichKey show_help = true, -- show a help message in the command line for using WhichKey
show_keys = true, -- show the currently pressed key and its label as a message in the command line show_keys = true, -- show the currently pressed key and its label as a message in the command line
triggers = "auto", -- automatically setup triggers triggers = "auto", -- automatically setup triggers
-- triggers = {"<leader>"} -- or specifiy a list manually -- triggers = {"<leader>"} -- or specifiy a list manually
-- list of triggers, where WhichKey should not wait for timeoutlen and show immediately -- list of triggers, where WhichKey should not wait for timeoutlen and show immediately
triggers_nowait = { triggers_nowait = {
@ -87,4 +87,7 @@ local options = {
}, },
} }
-- XXX: temporary until upgrading the deprecated configuration above…
options = {}
return options return options

32
luasnippets/norg.lua Normal file
View 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),
})
),
}

68
luasnippets/tex.lua Normal file
View File

@ -0,0 +1,68 @@
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 {
s({ trig = "frame", dscr = "Insert a beamer frame" },
fmta(
[[
\begin{frame}{<>}
<>
\end{frame}
]],
{
i(1, "title"),
i(2, "content")
}
)
),
s({ trig = "block", dscr = "Insert a beamer block" },
fmta(
[[
\begin{block}{<>}
<>
\end{block}
]],
{
i(1, "title"),
i(2, "content")
}
)
),
s({ trig = "pp", dscr = "Insert a beamer pause" },
fmt("\\pause", {})
),
s({ trig = "ii", dscr = "Insert an item" },
fmt("\\item ", {})
),
s({ trig = "ss", dscr = "Insert a small skip" },
fmt("\\smallskip", {})
),
s({ trig = "ms", dscr = "Insert a medium skip" },
fmt("\\medskip", {})
),
s({ trig = "bs", dscr = "Insert a big skip" },
fmt("\\bigskip", {})
),
s({ trig = "tw", dscr = "Insert \\textwidth" },
fmt("\\textwidth", {})
),
s({ trig = "th", dscr = "Insert \\textheight" },
fmt("\\textheight", {})
),
}

View File

@ -1,9 +1,16 @@
In this repository lies my nvim configuration starting from In this repository lies my Neovim configuration starting from
[kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim). [kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim).
The provided `init.lua` file has then been split into (tryingly) semantically The provided `init.lua` file has then been split into (tentatively) semantically
consistent files inside `lua/` and personal customizations have been applied. consistent files inside `lua/` and personal customizations have been applied.
The process to design this configuration and some thoughts can be found
[here](https://blog.epheme.re/software/nvim-kickstart.html).
Note that if the global principles remain true, the blog post dates from
December 2023, and things may have changed a bit since then. Just use it as a
reference for my rationals.
## Testing it ## Testing it
To try it, you can use the `NVIM_APPNAME` environment variable: To try it, you can use the `NVIM_APPNAME` environment variable:
@ -15,3 +22,11 @@ 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
(usually because they are unavailable in `mason`). These packages are:
- `rust-analyzer`
- `ltex-ls-plus`