Files
2026-04-07 15:20:13 +02:00

78 lines
1.7 KiB
Lua

-- Usefull from other plugins
require("snacks").setup()
vim.diagnostic.config({
virtual_text = false,
signs = true,
underline = true,
update_in_insert = false,
})
require'nvim-treesitter'.setup {
ensure_installed = {
"c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "rust", "cpp", "sql"
},
sync_install = false,
auto_install = false,
ignore_install = { "javascript" },
highlight = {
enable = true,
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
additional_vim_regex_highlighting = false,
},
}
-- Use an indent of 4 for these files
vim.api.nvim_create_autocmd("FileType", {
pattern = { "tex", "scilab", "html", "js", "javascript" },
callback = function()
vim.bo.tabstop = 4
vim.bo.shiftwidth = 4
vim.bo.expandtab = false
end
})
-- nvim-dap config (python lsp)
local dap = require('dap')
dap.adapters.python = {
type = 'executable',
command = 'python',
args = { '-m', 'debugpy.adapter' },
}
dap.configurations.python = {
{
type = 'python',
request = 'launch',
name = 'Launch file',
program = '${file}',
pythonPath = function()
return vim.fn.exepath('python')
end,
},
}
-- nvim-dap-ui
local dapui = require('dapui')
dapui.setup()
dap.listeners.after.event_initialized['dapui_config'] = function()
dapui.open()
end
dap.listeners.before.event_terminated['dapui_config'] = function()
dapui.close()
end
dap.listeners.before.event_exited['dapui_config'] = function()
dapui.close()
end
-- nvim-dap virtual text
require('nvim-dap-virtual-text').setup()