Compare commits
1 Commits
main
...
fix-treesi
| Author | SHA1 | Date |
|---|---|---|
|
|
b09dc7e748 |
|
|
@ -93,7 +93,7 @@ I don't provide links for each of these plugins as they are easy to be found.
|
|||
- `vim-speeddating` to increment dates, times, etc.
|
||||
- `vim-surround` to improve surroundings management.
|
||||
- `autopairs.nvim`.
|
||||
- `mini.comment` to comment lines and blocs.
|
||||
- `Comment.nvim` to comment lines and blocs.
|
||||
- `ident-blankline.nvim` to improve readability of indentation.
|
||||
- `zen-mode.nvim` for a good zen mode.
|
||||
- `toggleterm.nvim` to quickly get a terminal. Might find a better one.
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
vim.opt.textwidth = 0
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
-- Deactivate fold for python files
|
||||
|
||||
vim.opt.foldlevel = 99
|
||||
|
||||
-- Ruff import sorting and formatting
|
||||
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = 0,
|
||||
callback = function()
|
||||
-- Tri des imports via code action Ruff
|
||||
local clients = vim.lsp.get_clients({ bufnr = 0 })
|
||||
for _, c in ipairs(clients) do
|
||||
if c.name == "ruff" then
|
||||
vim.lsp.buf.code_action({
|
||||
context = { only = { "source.organizeImports.ruff" } },
|
||||
apply = true,
|
||||
})
|
||||
break
|
||||
end
|
||||
end
|
||||
-- Formatage du code
|
||||
vim.lsp.buf.format({ async = false })
|
||||
end,
|
||||
})
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
vim.treesitter.language.register('markdown', 'qmd')
|
||||
|
||||
vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||
vim.wo[0][0].foldmethod = 'expr'
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
-- Install and configure Comment.nvim
|
||||
-- "gc" to comment visual regions/lines
|
||||
return {
|
||||
'nvim-mini/mini.comment'
|
||||
'numToStr/Comment.nvim',
|
||||
opts = {}
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ return {
|
|||
})
|
||||
|
||||
vim.lsp.config.marksman = {
|
||||
filetypes = { "markdown", "quarto", "qmd" },
|
||||
filetypes = { "markdown", "quarto" },
|
||||
root_dir = vim.fs.root(0, {
|
||||
".git",
|
||||
".marksman.toml",
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ return {
|
|||
},
|
||||
luasnip.filetype_extend("pandoc", {"markdown"}),
|
||||
luasnip.filetype_extend("quarto", {"markdown"}),
|
||||
luasnip.filetype_extend("qmd", {"markdown"}),
|
||||
}
|
||||
|
||||
-- Load snippets from ~/.config/nvim/my_snippets/
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ return {
|
|||
lazy = true,
|
||||
ft = {
|
||||
"quarto",
|
||||
"qmd",
|
||||
},
|
||||
dependencies = {
|
||||
"jmbuhr/otter.nvim",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
-- Diagnostic keymaps
|
||||
|
||||
vim.keymap.set(
|
||||
|
|
@ -21,12 +20,11 @@ return {
|
|||
"nvim-treesitter/nvim-treesitter",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
branch = "main", -- ← nécessaire aussi pour textobjects
|
||||
},
|
||||
lazy = false,
|
||||
branch = "main",
|
||||
build = ":TSUpdate",
|
||||
|
||||
-- Configure treesitter
|
||||
config = function ()
|
||||
local treesitter = require('nvim-treesitter')
|
||||
treesitter.setup()
|
||||
|
|
@ -48,7 +46,6 @@ return {
|
|||
'typescript',
|
||||
'vim',
|
||||
'vimdoc',
|
||||
'xml',
|
||||
'yaml',
|
||||
})
|
||||
|
||||
|
|
@ -71,19 +68,18 @@ return {
|
|||
'typescript',
|
||||
'vim',
|
||||
'vimdoc',
|
||||
'xml',
|
||||
'yaml',
|
||||
},
|
||||
callback = function()
|
||||
-- syntax highlighting, provided by Neovim
|
||||
pcall(vim.treesitter.start) -- ← pcall: évite l'erreur si pas de parser
|
||||
vim.treesitter.start()
|
||||
-- folds, provided by Neovim
|
||||
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||
vim.wo.foldmethod = 'expr'
|
||||
-- indentation, provided by nvim-treesitter (expérimental)
|
||||
-- indentation, provided by nvim-treesitter
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
})
|
||||
|
||||
end
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue