Compare commits

..

13 Commits
quarto ... main

Author SHA1 Message Date
iGor milhit ccecc89a42
plugins: update treesitter, replace comment.nvim
- Updates nvim-treesitter since the neovim 0.12 version, as it is
  archived.
- Replaces comment.nvim by mini.comment.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2026-06-12 14:57:29 +02:00
iGor milhit 3d690c9da1
filetype: improve csv managment
Co-Authored-by: iGor milhit <igor@milhit.ch>
2026-06-05 11:44:48 +02:00
iGor milhit a3311a1b86
filetype: support the qmd filetype for quarto
Co-Authored-by: iGor milhit <igor@milhit.ch>
2026-06-05 11:44:42 +02:00
iGor milhit 75c9a73bfd
plugins: update the treesitter configuration
- Updates the treesitter configruation according to the API
  documentation.
- Adds XML to the treesitter configuration.
- Updates the mkdnflow configuration according to the documentation.
- Forces the filetype of *.md files before mkdnflow is loaded.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2026-02-19 16:11:08 +01:00
iGor milhit f38196b573
config: remove the python virtualenv
- Removes the python virtualenv has pynvim is installed through uv and
  manages itself the virtual environment.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2026-02-18 11:21:56 +01:00
iGor milhit 47eb5c5f1d
lsp: add lsp and linter for typescript
Co-Authored-by: iGor milhit <igor@milhit.ch>
2026-02-18 11:11:53 +01:00
iGor milhit 5c9c87d0c4
config: fix the python venv path
Co-Authored-by: iGor milhit <igor@milhit.ch>
2026-02-18 11:11:53 +01:00
iGor milhit 7ed9489460
wip config: python provider
Co-Authored-by: iGor milhit <igor@milhit.ch>
2026-02-18 11:11:53 +01:00
iGor milhit 81979d0537
plugins: update some config to plugins evolution
- Reorders and simplifies the filetypes config for mkdnflow according
  to its evolution.
- Removes a tailing `s` to the nvim-treesitter config.
- Follow the last tag of Telescope.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2026-02-18 10:52:49 +01:00
iGor milhit 8c222d187d
snippets: search luasnip with telescope
- Adds a keymap to search for snippets with telescope.
- Improves the markdown snippets.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2025-12-21 09:09:47 +01:00
iGor milhit 5a4aef50cd
plugins: rewrite the LSP configuration
- Rewrites the LSP configuration to neovim v0.11+ capabilities in the
  mason.lua file.
- Adapts the completion configuration accordingly.
- Removes lsp-zero unnecessary plugin.
- Removes the nvim-lsp-file-operations plugin that I never use.
- Removes deprecated keybindings for diagnostics.
- Removes branch options when installing venv-selector.
- Updates options for JSON folding.
- Updates the README accordingly.
- I have been helped by the Kimi language model provided by the Kagi
  assistant interface.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2025-12-19 13:57:25 +01:00
iGor milhit be776d2896
documentation: improve slightly the documentation
- Improves slightly the wording of the documentation.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2025-10-03 09:16:20 +02:00
iGor milhit eb48975dc3
config: add a minimal config for Markdown
- Add a minimal configuration for Markdown demonstration, with only the
  markdown preview, has it is to demonstrate the syntax.
- Uncomment the adwaita theme in the minimal config (minit.lua).
- Set another keymap to open the nvim-tree column, has the one used till
  now is conflicting with diagnosis management.

Co-Authored-by: iGor milhit <igor@milhit.ch>
2025-08-27 10:20:20 +02:00
26 changed files with 244 additions and 443 deletions

View File

@ -10,7 +10,7 @@ tags: [neovim, editor, configuration, README]
This new configuration is written with the help of: This new configuration is written with the help of:
- [`kickstart.nvim`][4]. This is a good project to kickstart a configuration, - [`kickstart.nvim`][4]. This is a good project to kickstart a configuration,
but then it takes time to understand what it makes, how to use it, and how to but then it takes time to understand what it does, how to use it, and how to
modify it. modify it.
- *[Tutoriel : configurer Neovim comme IDE/éditeur de code à partir de - *[Tutoriel : configurer Neovim comme IDE/éditeur de code à partir de
zéro][5]*. This blog post, in French, helped me a lot to understand better my zéro][5]*. This blog post, in French, helped me a lot to understand better my
@ -25,8 +25,8 @@ This new configuration is written with the help of:
## Python provider ## Python provider
I'm using a virtual environment for the python provider, as the I'm *not* using virtual environment for the python provider, as the
[documentation][7], using `pyenv`. [documentation][7] explain, installating `pynvim` through `uv`.
## Structure ## Structure
@ -41,12 +41,12 @@ I'm using a virtual environment for the python provider, as the
## Plugins ## Plugins
I won't provide links for each of these plugins as they are easily to be found. I don't provide links for each of these plugins as they are easy to be found.
- `lazy.nvim` as plugins manager. - `lazy.nvim` as plugin manager.
- `plenary` to get lua functions used by many plugins. - `plenary` to get lua functions used by many plugins.
- Adwaita for the colorscheme. - Adwaita for the colorscheme.
- `which-key.nvim` to find out shortkeys. - `which-key.nvim` to find out keybindings.
- `nvim-tree` as file explorer. - `nvim-tree` as file explorer.
- `telescope.nvim` for the fuzzy finder interface. It has some specific - `telescope.nvim` for the fuzzy finder interface. It has some specific
dependencies: dependencies:
@ -76,11 +76,9 @@ I won't provide links for each of these plugins as they are easily to be found.
- `cmp-emoji` for emoji completion after ':'. - `cmp-emoji` for emoji completion after ':'.
- `lspkind.nvim` to add text symbols to spot the type of source completion. - `lspkind.nvim` to add text symbols to spot the type of source completion.
- Language servers: - Language servers:
- `lsp-zero.nvim` to ease LSP configuration.
- `nvim-lspconfig` to configure LSP support and completion, with - `nvim-lspconfig` to configure LSP support and completion, with
dependencies: dependencies:
- `cmp-nvim-lsp` to get LSP results in completion. - `cmp-nvim-lsp` to get LSP results in completion.
- `nvim-lsp-file-operations` to add some code actions.
- `fidget.nvim` for LSP progress message and neovim notifications. - `fidget.nvim` for LSP progress message and neovim notifications.
- `mason.nvim` with `mason-lspconfig.nvim` to install automatically the - `mason.nvim` with `mason-lspconfig.nvim` to install automatically the
needed LSP. And also with `mason-tool-installer` to extend it's package needed LSP. And also with `mason-tool-installer` to extend it's package
@ -95,7 +93,7 @@ I won't provide links for each of these plugins as they are easily to be found.
- `vim-speeddating` to increment dates, times, etc. - `vim-speeddating` to increment dates, times, etc.
- `vim-surround` to improve surroundings management. - `vim-surround` to improve surroundings management.
- `autopairs.nvim`. - `autopairs.nvim`.
- `Comment.nvim` to comment lines and blocs. - `mini.comment` to comment lines and blocs.
- `ident-blankline.nvim` to improve readability of indentation. - `ident-blankline.nvim` to improve readability of indentation.
- `zen-mode.nvim` for a good zen mode. - `zen-mode.nvim` for a good zen mode.
- `toggleterm.nvim` to quickly get a terminal. Might find a better one. - `toggleterm.nvim` to quickly get a terminal. Might find a better one.

View File

@ -0,0 +1 @@
vim.opt.textwidth = 0

View File

@ -2,7 +2,7 @@
-- Use treesitter for folding -- Use treesitter for folding
-- Disable the color column -- Disable the color column
vim.opt.foldmethod="expr" vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.opt.foldexpr="nvim_treesitter#foldexpr()" vim.wo[0][0].foldmethod = 'expr'
vim.opt.foldlevel=3 vim.opt.foldlevel=3
vim.opt.colorcolumn="" vim.opt.colorcolumn=""

View File

@ -3,4 +3,3 @@
-- See :h awa -- See :h awa
vim.opt.awa=true vim.opt.awa=true
vim.opt.foldlevel = 1

View File

@ -3,5 +3,3 @@
-- See :h awa -- See :h awa
vim.opt.awa=true vim.opt.awa=true
-- vim.opt.foldlevel = 1
-- vim.opt.conceallevel = 2

View File

@ -0,0 +1,5 @@
vim.treesitter.language.register('markdown', 'qmd')
vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.wo[0][0].foldmethod = 'expr'

View File

@ -1,2 +0,0 @@
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"

View File

@ -1,4 +1,4 @@
-- Load all module files -- Load all module files
require("core.python-provider") require("core.set-md-filetype")
require("core.keymaps") require("core.keymaps")
require("core.options") require("core.options")

View File

@ -33,7 +33,7 @@ local highlight_group = vim.api.nvim_create_augroup(
) )
vim.api.nvim_create_autocmd('TextYankPost', { vim.api.nvim_create_autocmd('TextYankPost', {
callback = function() callback = function()
vim.highlight.on_yank() vim.hl.on_yank()
end, end,
group = highlight_group, group = highlight_group,
pattern = '*', pattern = '*',

View File

@ -1,4 +0,0 @@
-- Set a virtualenv as python provider
-- https://neovim.io/doc/user/provider.html#python-virtualenv
vim.g.python3_host_prog = "/home/igor/.pyenv/versions/py-nvim3.10/bin/python"

View File

@ -0,0 +1,9 @@
-- Ensure vim-pandoc sets the filetype
-- This is a workaround to avoid that during the mkdnflow loading, neovim
-- sets the filetype to .md files to markdown
-- "Solution" provided by the Quick assistant of Kagi.
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = "*.md",
command = "set filetype=pandoc"
})

View File

@ -1,10 +0,0 @@
-- Install lsp-zero, to ease LSP support configuration
-- https://lsp-zero.netlify.app
-- https://github.com/VonHeikemen/lsp-zero.nvim/
return {
"VonHeikemen/lsp-zero.nvim",
branch = "v4.x",
lazy = true,
config = false,
}

View File

@ -6,155 +6,21 @@ return {
dependencies = { dependencies = {
-- Send LSP results to autocompletion nvim-cmp -- Send LSP results to autocompletion nvim-cmp
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
-- Adds code actions, such as smart file renaming, etc
{ "antosha417/nvim-lsp-file-operations", config = true },
-- 💫 Extensible UI for Neovim notifications and LSP progress messages -- 💫 Extensible UI for Neovim notifications and LSP progress messages
{ 'j-hui/fidget.nvim', tag = "legacy", opts = {} }, { 'j-hui/fidget.nvim', tag = "legacy", opts = {} },
}, },
config = function() config = function()
-- Import lsp-zero
local lsp_zero = require("lsp-zero")
-- Activate some functionalities when a LSP is activated to the current vim.diagnostic.config({
-- file signs = {
local lsp_attach = function(_, bufnr) text = {
local opts = { buffer = bufnr, silent = true } [vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "",
-- Keymaps [vim.diagnostic.severity.HINT] = "󰠠 ",
[vim.diagnostic.severity.INFO] = "",
opts.desc = "[LSP] Show LSP references" }
vim.keymap.set( }
"n",
"gR",
"<cmd>Telescope lsp_references<CR>",
opts
)
opts.desc = "[LSP] Go to declaration"
vim.keymap.set(
"n",
"gD",
vim.lsp.buf.declaration,
opts
)
opts.desc = "[LSP] Show LSP definitions"
vim.keymap.set(
"n",
"gd",
"<cmd>Telescope lsp_definitions<CR>",
opts
)
opts.desc = "[LSP] Show LSP implementations"
vim.keymap.set(
"n",
"gi",
"<cmd>Telescope lsp_implementations<CR>",
opts
)
opts.desc = "[LSP] Show LSP type definitions"
vim.keymap.set(
"n",
"gt",
"<cmd>Telescope lsp_type_definitions<CR>",
opts
)
opts.desc = "[LSP] Show LSP signature help"
vim.keymap.set(
"n",
"gs",
vim.lsp.buf.signature_help,
opts
)
opts.desc = "[LSP] See available code actions"
vim.keymap.set(
{ "n", "v" },
"<leader>ca",
vim.lsp.buf.code_action,
opts
)
opts.desc = "[LSP] Smart rename"
vim.keymap.set(
"n",
"<leader>rn",
vim.lsp.buf.rename,
opts
)
opts.desc = "[LSP] Show buffer diagnostics"
vim.keymap.set(
"n",
"<leader>D",
"<cmd>Telescope diagnostics bufnr=0<CR>",
opts
)
opts.desc = "[LSP] Show line diagnostics"
vim.keymap.set(
"n",
"<leader>d",
vim.diagnostic.open_float,
opts
)
opts.desc = "[LSP] Go to previous diagnostic"
vim.keymap.set("n", "[d", function()
vim.diagnostic.jump({ count = -1, float = true })
end, opts) -- jump to previous diagnostic in buffer
opts.desc = "[LSP] Go to next diagnostic"
vim.keymap.set("n", "]d", function()
vim.diagnostic.jump({ count = 1, float = true })
end, opts) -- jump to next diagnostic in buffer
opts.desc = "[LSP] Show documentation for what is under cursor"
vim.keymap.set(
"n",
"K",
vim.lsp.buf.hover,
opts
)
opts.desc = "[LSP] Format buffer"
vim.keymap.set(
{ "n", "x" },
"F",
"<cmd>lua vim.lsp.buf.format({async = true})<cr>",
opts
)
opts.desc = "[LSP] Restart LSP"
vim.keymap.set(
"n",
"<leader>rs",
":LspRestart<CR>",
opts
)
end
lsp_zero.extend_lspconfig({
-- Display diagnostic signs in the sign column
sign_text = true,
-- Attach the keymap function
lsp_attach = lsp_attach,
-- Extend the default completion capabilities by LSP suggestions
capabilities = require("cmp_nvim_lsp").default_capabilities(),
}) })
-- Use lsp_zero to configure interface
lsp_zero.ui({
float_border = "rounded",
sign_text = {
error = "",
warn = "",
hint = "󰠠 ",
info = "",
},
})
end, end,
} }

View File

@ -1,139 +1,69 @@
-- Install and configure mason.nvim which will install automatically the needed -- New LSP configuration (since neovim 0.11+)
-- LSP
return { return {
"williamboman/mason.nvim", 'mason-org/mason-lspconfig.nvim',
dependencies = { dependencies = {
"williamboman/mason-lspconfig.nvim", 'mason-org/mason.nvim',
"WhoIsSethDaniel/mason-tool-installer.nvim", 'neovim/nvim-lspconfig',
'WhoIsSethDaniel/mason-tool-installer.nvim',
}, },
config = function() config = function()
-- Import mason
local mason = require("mason")
-- Import mason-lspconfig require("mason").setup({
local mason_lspconfig = require("mason-lspconfig")
-- Import lspconfig
local lspconfig = require("lspconfig")
local util = require("lspconfig.util")
-- Import mason-tool-installer
local mason_tool_installer = require("mason-tool-installer")
-- Activate mason and set icones
mason.setup({
ui = { ui = {
icons = { icons = {
package_installed = "", package_installed = "",
package_pending = "", package_pending = "",
package_uninstalled = "", package_uninstalled = "",
}, }
}, }
}) })
mason_tool_installer.setup({ require("mason-tool-installer").setup({
ensure_installed = { ensure_installed = {
"black",
"isort",
"prettier", "prettier",
"ruff",
"stylua", "stylua",
"tree-sitter-cli", "tree-sitter-cli",
} }
}) })
mason_lspconfig.setup({ require("mason-lspconfig").setup({
-- LSP to be installed by default
-- Available LSP: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
-- LSP can be installed with :Mason
-- But installing LSP through the following list is better
ensure_installed = { ensure_installed = {
"cssls", "cssls",
"eslint",
"html", "html",
"jsonls", "jsonls",
"lua_ls", "lua_ls",
"marksman", "marksman",
"pylsp", "ts_ls",
"ty",
"ruff",
"yamlls", "yamlls",
}, },
handlers = {
-- Function called for each LSP from the ensure_installed list loaded
function(server_name)
-- Activate all LSP from the ensure_installed list with its default
-- configuration
lspconfig[server_name].setup({})
end,
-- Then, configure each LSP as needed
-- See https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
--
-- To deactivate a LSP:
-- lsp_name = require("lsp-zero").noop,
-- The LSP name before`= function()` has to be the same than after
-- `lspconfig.`
-- The first one is the mason_lspconfig key, the seconde one is the
-- lspconfig key. They are identical to the ensure_installed entries.
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#pylsp
pylsp = function()
lspconfig.pylsp.setup({
settings = {
pylsp = {
plugins = {
pyflakes = { enabled = false },
pycodestyle = {
enabled = true,
ignore = { "E501" },
},
},
},
},
}) })
end,
lua_ls = function() vim.lsp.config.marksman = {
lspconfig.lua_ls.setup({ filetypes = { "markdown", "quarto", "qmd" },
settings = { root_dir = vim.fs.root(0, {
Lua = { ".git",
diagnostics = { ".marksman.toml",
-- Force LSP to recognize global variable `vim`. "._quarto.yml"
globals = { "vim" },
disable = { "missing-fields" },
}
}
}
}) })
end, }
jsonls = function() vim.lsp.config.jsonls = {
lspconfig.jsonls.setup({
settings = { settings = {
json = { json = {
schemas = require("schemastore").json.schemas(), schemas = require('schemastore').json.schemas(),
validate = { enable = true }, validate = { enable = true },
} }
} }
}) }
end,
marksman = function() vim.lsp.config('*', {
lspconfig.marksman.setup({ capabilities = require('cmp_nvim_lsp').default_capabilities(),
setting = {
filetypes = {
"markdown",
"quarto",
},
root_dir = util.root_pattern(
'.git',
'.marksman.toml',
'_quarto.yml'
),
}
}) })
end end
},
})
end,
} }

View File

@ -23,15 +23,18 @@ return {
config = function () config = function ()
require('mkdnflow').setup({ require('mkdnflow').setup({
filetypes = { filetypes = {
md = true,
rmd = true,
qmd = true,
markdown = true, markdown = true,
pandoc = true pandoc = true,
qmd = true,
rmd = true,
}, },
perspective = { modules = {
folds = false,
foldtext = false,
},
path_resolution = {
-- Ensure that paths are relative to the current file -- Ensure that paths are relative to the current file
priority = "current" primary = "current"
}, },
links = { links = {
conceal = true, conceal = true,
@ -47,14 +50,12 @@ tags: []
--- ---
]], ]],
placeholders = { placeholders = {
before = {
date = function () date = function ()
return os.date("%Y-%m-%dT%H:%M:%S%z") return os.date("%Y-%m-%dT%H:%M:%S%z")
end, end,
id = function () id = function ()
return os.date("%Y%m%d%H%M%S") return os.date("%Y%m%d%H%M%S")
end end
},
} }
} }
}) })

View File

@ -48,14 +48,9 @@ return {
'markdown', 'markdown',
'pandoc' 'pandoc'
}, },
lazy = true, dependencies = {
},
{
"vim-pandoc/vim-pandoc-syntax", "vim-pandoc/vim-pandoc-syntax",
ft = {
'markdown',
'pandoc'
}, },
lazy = true, lazy = true,
}, }
} }

View File

@ -1,6 +1,5 @@
-- Install and configure Comment.nvim -- Install and configure Comment.nvim
-- "gc" to comment visual regions/lines -- "gc" to comment visual regions/lines
return { return {
'numToStr/Comment.nvim', 'nvim-mini/mini.comment'
opts = {}
} }

View File

@ -49,6 +49,7 @@ return {
}, },
luasnip.filetype_extend("pandoc", {"markdown"}), luasnip.filetype_extend("pandoc", {"markdown"}),
luasnip.filetype_extend("quarto", {"markdown"}), luasnip.filetype_extend("quarto", {"markdown"}),
luasnip.filetype_extend("qmd", {"markdown"}),
} }
-- Load snippets from ~/.config/nvim/my_snippets/ -- Load snippets from ~/.config/nvim/my_snippets/
@ -110,6 +111,8 @@ return {
}, },
}, },
{ name = "path" }, { name = "path" },
{ name = "ty" },
{ name = "ruff" },
{ name = "emoji" }, { name = "emoji" },
}), }),
@ -128,10 +131,14 @@ return {
nvim_lua = "[Lua]", nvim_lua = "[Lua]",
lazydev = "[Lazydev]", lazydev = "[Lazydev]",
path = "[Path]", path = "[Path]",
ty = "[Ty]",
ruff = "[Ruff]",
emoji = "[Emoji]", emoji = "[Emoji]",
}, },
}), }),
}, },
}) })
end, end,

View File

@ -19,7 +19,7 @@ return {
-- <leader>e to toggle the explorer buffer -- <leader>e to toggle the explorer buffer
vim.keymap.set( vim.keymap.set(
"n", "n",
"<leader>e", "<leader>n",
"<cmd>NvimTreeFindFileToggle<CR>", "<cmd>NvimTreeFindFileToggle<CR>",
{ desc = "[nvim-tree] Toggle the file explorer" } { desc = "[nvim-tree] Toggle the file explorer" }
) )

View File

@ -7,6 +7,7 @@ return {
lazy = true, lazy = true,
ft = { ft = {
"quarto", "quarto",
"qmd",
}, },
dependencies = { dependencies = {
"jmbuhr/otter.nvim", "jmbuhr/otter.nvim",

View File

@ -1,8 +1,7 @@
-- Install and configure Telescope -- Install and configure Telescope
-- https://github.com/nvim-telescope/telescope.nvim -- https://github.com/nvim-telescope/telescope.nvim
return { return {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim", version = '*',
branch = "0.1.x",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
-- C implementation of fzf to improve performance -- C implementation of fzf to improve performance
@ -24,7 +23,6 @@ return {
-- Configure Telescope -- Configure Telescope
config = function() config = function()
local telescope = require("telescope") local telescope = require("telescope")
local actions = require("telescope.actions")
telescope.setup({ telescope.setup({
defaults = { defaults = {
@ -131,5 +129,14 @@ return {
"<cmd>Telescope keymaps<cr>", "<cmd>Telescope keymaps<cr>",
{ desc = "[Telescope] [S]earch [K]eymaps" } { desc = "[Telescope] [S]earch [K]eymaps" }
) )
-- <leader>ss to search for keymaps
vim.keymap.set(
"n",
"<leader>ss",
"<cmd>Telescope luasnip<cr>",
{ desc = "[Telescope] [S]earch [S]nippets" }
)
end, end,
} }

View File

@ -1,19 +1,6 @@
-- Diagnostic keymaps -- Diagnostic keymaps
vim.keymap.set(
'n',
'[d',
vim.diagnostic.goto_prev,
{ desc = "[Diagnostic] Go to previous diagnostic message" }
)
vim.keymap.set(
'n',
']d',
vim.diagnostic.goto_next,
{ desc = "[Diagnostic] Go to next diagnostic message" }
)
vim.keymap.set( vim.keymap.set(
'n', 'n',
'<leader>e', '<leader>e',
@ -34,110 +21,69 @@ return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
dependencies = { dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects", "nvim-treesitter/nvim-treesitter-textobjects",
branch = "main", -- ← nécessaire aussi pour textobjects
}, },
lazy = false,
branch = "main",
build = ":TSUpdate", build = ":TSUpdate",
-- Configure treesitter
config = function() config = function()
---@diagnostic disable-next-line: missing-fields local treesitter = require('nvim-treesitter')
local config = require("nvim-treesitter.configs") treesitter.setup()
treesitter.install({
config.setup({ 'bash',
-- Enable color syntax 'css',
highlight = { 'dot',
enable = true, 'gitignore',
disable = { 'html',
"markdown" 'javascript',
}, 'json',
}, 'julia',
-- Enable better indentation management 'latex',
indent = { enable = true }, 'lua',
'mermaid',
-- Installed and configured languages 'python',
ensure_installed = { 'query',
"bash", 'r',
"css", 'typescript',
"dot", 'vim',
"gitignore", 'vimdoc',
"html", 'xml',
"javascript", 'yaml',
"json",
"julia",
"latex",
"lua",
"markdown",
"markdown_inline",
"mermaid",
"norg",
"python",
"query",
"r",
"typescript",
"vim",
"vimdoc",
"yaml",
},
-- Do not install parses synchronously
sync_install = false,
-- Do not install automatically missing parsers
auto_install = false,
-- <Ctrl-space> select the current bloc
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj
keymaps = {
-- You can use the capture groups defined in textobjects.scm
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
swap = {
enable = true,
swap_next = {
['<leader>a'] = '@parameter.inner',
},
swap_previous = {
['<leader>A'] = '@parameter.inner',
},
},
},
}) })
vim.api.nvim_create_autocmd('FileType', {
pattern = {
'bash',
'css',
'dot',
'gitignore',
'html',
'javascript',
'json',
'julia',
'latex',
'lua',
'mermaid',
'python',
'query',
'r',
'typescript',
'vim',
'vimdoc',
'xml',
'yaml',
},
callback = function()
-- syntax highlighting, provided by Neovim
pcall(vim.treesitter.start) -- ← pcall: évite l'erreur si pas de parser
-- folds, provided by Neovim
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.wo.foldmethod = 'expr'
-- indentation, provided by nvim-treesitter (expérimental)
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end, end,
})
end
} }

View File

@ -3,7 +3,7 @@
return { return {
'linux-cultist/venv-selector.nvim', 'linux-cultist/venv-selector.nvim',
branch = 'regexp', -- branch = 'regexp',
dependencies = { dependencies = {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',

55
md.lua 100644
View File

@ -0,0 +1,55 @@
-- TODO: Rewrite it accordingly to new configuration.
-- TODO: Also, make it actually minimal. 😉
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Minimal options
-- Display relative line numbers
-- Except to the active line
vim.opt.relativenumber = true
vim.opt.number = true
-- Enable mouse mode
vim.opt.mouse = 'a'
-- Install package manager
-- https://github.com/folke/lazy.nvim
-- `:help lazy.nvim.txt` for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
}
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
{
"Mofiqul/adwaita.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd('colorscheme adwaita')
end
},
{
"iamcco/markdown-preview.nvim",
ft = {
'pandoc',
'markdown',
},
lazy = true,
build = "cd app && npm install && git reset --hard",
},
})

View File

@ -34,13 +34,13 @@ vim.opt.rtp:prepend(lazypath)
require('lazy').setup({ require('lazy').setup({
-- { {
-- "Mofiqul/adwaita.nvim", "Mofiqul/adwaita.nvim",
-- lazy = false, lazy = false,
-- priority = 1000, priority = 1000,
-- config = function() config = function()
-- vim.cmd('colorscheme adwaita') vim.cmd('colorscheme adwaita')
-- end end
-- }, },
}) })

View File

@ -71,7 +71,7 @@ return {
s( s(
{ {
trig = "ie", trig = "ie",
Name = "Inc entry", Name = "[journal] Inc entry",
dscr = "Insert an Inc entry for today (heading level 2)." dscr = "Insert an Inc entry for today (heading level 2)."
}, },
fmt( fmt(
@ -97,7 +97,7 @@ return {
title: {1} title: {1}
date: {3} date: {3}
id: {4} id: {4}
tags: [{2}] tags: ["{2}"]
--- ---
]], ]],
@ -112,7 +112,7 @@ return {
s( s(
{ {
trig = "inc", trig = "inc",
name = "INC YAML frontmatter", name = "[journal] INC YAML frontmatter",
dscr = "Insert a YAML frontmatter for INC notes.\n\nIt has a datetime with the locale daylight saving time, prefilled title, author, categories and tags.\nAdjust the title manually." dscr = "Insert a YAML frontmatter for INC notes.\n\nIt has a datetime with the locale daylight saving time, prefilled title, author, categories and tags.\nAdjust the title manually."
}, },
fmt( fmt(
@ -121,7 +121,7 @@ return {
title: {1} title: {1}
date: {2} date: {2}
id: {4} id: {4}
tags: [notes, quotidien, {3}] tags: ["notes", "quotidien", "{3}"]
--- ---
]], ]],
@ -145,7 +145,7 @@ return {
title: {3} title: {3}
date: {4} date: {4}
id: {5} id: {5}
tags: [{1}] tags: ["{1}"]
séance: séance:
- type: "{2}" - type: "{2}"
données: données: