big changes on neovim
This commit is contained in:
parent
cddb6edde7
commit
6d492f07ba
26 changed files with 242 additions and 291 deletions
|
|
@ -40,3 +40,17 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||
vim.b.vimtex_syntax_enabled = 0
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
pcall(vim.treesitter.start)
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
pcall(vim.keymap.del, "n", "<leader>l")
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,44 +0,0 @@
|
|||
return { -- Autoformat
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>f",
|
||||
function()
|
||||
require("conform").format({ async = true, lsp_format = "fallback" })
|
||||
end,
|
||||
mode = "",
|
||||
desc = "[F]ormat buffer",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
notify_on_error = false,
|
||||
format_on_save = function(bufnr)
|
||||
-- Disable "format_on_save lsp_fallback" for languages that don't
|
||||
-- have a well standardized coding style. You can add additional
|
||||
-- languages here or re-enable it for the disabled ones.
|
||||
local disable_filetypes = { c = true, cpp = true }
|
||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||
return nil
|
||||
else
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_format = "fallback",
|
||||
}
|
||||
end
|
||||
end,
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
-- Conform can also run multiple formatters sequentially
|
||||
python = { "isort", "black" },
|
||||
--
|
||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 2000,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"hat0uma/csvview.nvim",
|
||||
---@module "csvview"
|
||||
---@type CsvView.Options
|
||||
opts = {
|
||||
parser = { comments = { "#", "//" } },
|
||||
keymaps = {
|
||||
-- Text objects for selecting fields
|
||||
textobject_field_inner = { "if", mode = { "o", "x" } },
|
||||
textobject_field_outer = { "af", mode = { "o", "x" } },
|
||||
-- Excel-like navigation:
|
||||
-- Use <Tab> and <S-Tab> to move horizontally between fields.
|
||||
-- Use <Enter> and <S-Enter> to move vertically between rows and place the cursor at the end of the field.
|
||||
-- Note: In terminals, you may need to enable CSI-u mode to use <S-Tab> and <S-Enter>.
|
||||
jump_next_field_end = { "<Tab>", mode = { "n", "v" } },
|
||||
jump_prev_field_end = { "<S-Tab>", mode = { "n", "v" } },
|
||||
jump_next_row = { "<Enter>", mode = { "n", "v" } },
|
||||
jump_prev_row = { "<S-Enter>", mode = { "n", "v" } },
|
||||
},
|
||||
},
|
||||
cmd = { "CsvViewEnable", "CsvViewDisable", "CsvViewToggle" },
|
||||
},
|
||||
}
|
||||
30
dotfiles/nvim/lua/neoconf/lazy/lsp.lua
Normal file
30
dotfiles/nvim/lua/neoconf/lazy/lsp.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
-- lua_ls avec tes settings perso
|
||||
vim.lsp.config("lua_ls", {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { "vim" } },
|
||||
workspace = { library = vim.api.nvim_get_runtime_file("", true) },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- active tous les serveurs ; leurs configs viennent des
|
||||
-- fichiers lsp/*.lua fournis par nvim-lspconfig (chargé ici)
|
||||
vim.lsp.enable({
|
||||
"lua_ls",
|
||||
"texlab",
|
||||
"marksman",
|
||||
"pyright",
|
||||
"bashls",
|
||||
"clangd",
|
||||
"cssls",
|
||||
"jsonls",
|
||||
"html",
|
||||
"ts_ls",
|
||||
"vimls",
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
@ -2,10 +2,11 @@
|
|||
return {
|
||||
"OXY2DEV/markview.nvim",
|
||||
lazy = false,
|
||||
preview = {
|
||||
icon_provider = "internal",
|
||||
},
|
||||
opts = {
|
||||
preview = {
|
||||
icon_provider = "internal",
|
||||
},
|
||||
|
||||
modes = { "n", "i" },
|
||||
latex = {
|
||||
enable = true,
|
||||
|
|
@ -1,34 +1,5 @@
|
|||
return {
|
||||
{
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"clangd",
|
||||
"texlab",
|
||||
"lua_ls",
|
||||
"vimls",
|
||||
"marksman",
|
||||
"pyright",
|
||||
"bashls",
|
||||
"cssls",
|
||||
"jsonls",
|
||||
"jdtls",
|
||||
"ts_ls",
|
||||
"html",
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
{ "mason-org/mason.nvim", opts = {} },
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
},
|
||||
{
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"black",
|
||||
"isort",
|
||||
},
|
||||
},
|
||||
},
|
||||
{ "mason-org/mason.nvim", enabled = false },
|
||||
{ "mason-org/mason-lspconfig.nvim", enabled = false },
|
||||
{ "WhoIsSethDaniel/mason-tool-installer.nvim", enabled = false },
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
opts = {
|
||||
options = {
|
||||
section_separators = { left = "", right = "" },
|
||||
component_separators = { left = "", right = "" },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { {
|
||||
"mode",
|
||||
fmt = function(str)
|
||||
return str:upper()
|
||||
end,
|
||||
} },
|
||||
lualine_b = { "branch", "diff" },
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "diagnostics" },
|
||||
lualine_y = { "filetype" },
|
||||
lualine_z = { "progress", "location" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,10 +1,17 @@
|
|||
return {
|
||||
-- Configure le style de tokyonight
|
||||
{
|
||||
"Tsuzat/NeoSolarized.nvim",
|
||||
lazy = false, -- make sure we load this during startup if it is your main colorscheme
|
||||
priority = 1000, -- make sure to load this before all the other start plugins
|
||||
config = function()
|
||||
vim.cmd([[ colorscheme NeoSolarized ]])
|
||||
end,
|
||||
"folke/tokyonight.nvim",
|
||||
opts = {
|
||||
style = "night", -- "night" (dark), "storm", "moon", "day"
|
||||
},
|
||||
},
|
||||
|
||||
-- Dit à LazyVim d'utiliser ce colorscheme
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "tokyonight-night",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,39 +1,27 @@
|
|||
return {
|
||||
{ -- Highlight, edit, and navigate code
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"c++",
|
||||
"matlab",
|
||||
"regex",
|
||||
"octave",
|
||||
"yaml",
|
||||
"python",
|
||||
"latex",
|
||||
"typst",
|
||||
"zsh",
|
||||
"markdown_inline",
|
||||
"typst",
|
||||
"comment",
|
||||
"bash",
|
||||
"c",
|
||||
"html",
|
||||
"lua",
|
||||
"markdown",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
},
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
|
||||
-- If you are experiencing weird indenting issues, add the language to
|
||||
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
|
||||
additional_vim_regex_highlighting = { "ruby", "markdown" },
|
||||
},
|
||||
indent = { enable = true, disable = { "ruby, markdown" } },
|
||||
},
|
||||
},
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "main",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter").setup({})
|
||||
require("nvim-treesitter").install({
|
||||
"cpp",
|
||||
"matlab",
|
||||
"regex",
|
||||
"yaml",
|
||||
"python",
|
||||
"latex",
|
||||
"typst",
|
||||
"markdown_inline",
|
||||
"comment",
|
||||
"bash",
|
||||
"c",
|
||||
"html",
|
||||
"lua",
|
||||
"markdown",
|
||||
"nix",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"B1gum/Tungsten",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope.nvim", -- Optional
|
||||
"folke/which-key.nvim", -- Optional
|
||||
},
|
||||
build = "./scripts/install_python_deps.sh", -- This automates the packaging!
|
||||
opts = {
|
||||
backend = "python",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -10,6 +10,7 @@ return {
|
|||
vim.g.vimtex_format_enabled = 1
|
||||
vim.g.vimtex_imaps_enabled = 0
|
||||
vim.g.vimtex_complete_enabled = 0
|
||||
vim.g.vimtex_syntax_enabled = 0
|
||||
vim.g.vimtex_compiler_latexmk = {
|
||||
aux_dir = vim.fn.expand("~/.aux-tex/"),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
-- (~/.config/nvim/lua/neoconf/lazy_init.lua)
|
||||
-- lazy is the package manager used for this nvim config
|
||||
--
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
|
|
@ -8,14 +6,20 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
|||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
"--branch=stable",
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- leaders AVANT lazy.setup (exigé par LazyVim)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = ","
|
||||
|
||||
require("lazy").setup({
|
||||
spec = "neoconf.lazy",
|
||||
spec = {
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
{ import = "neoconf.lazy" },
|
||||
},
|
||||
change_detection = { notify = false },
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,15 +1,3 @@
|
|||
vim.lsp.config("lua_ls", {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { "vim" } },
|
||||
workspace = { library = vim.api.nvim_get_runtime_file("", true) },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Enable servers (mason-lspconfig handles this automatically for installed ones)
|
||||
-- vim.lsp.enable("lua_ls")
|
||||
|
||||
-- diagnostic
|
||||
vim.diagnostic.config({
|
||||
virtual_text = {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,4 @@
|
|||
-- treesitter
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "<filetype>" },
|
||||
callback = function()
|
||||
vim.treesitter.start()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.wo[0][0].foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
vim.wo[0][0].foldmethod = "expr"
|
||||
|
||||
|
|
|
|||
|
|
@ -63,3 +63,13 @@ vim.api.nvim_create_user_command("OctaveRun", function()
|
|||
vim.cmd("write")
|
||||
vim.cmd('!octave -qf "%:p"')
|
||||
end, {})
|
||||
|
||||
-- set vimtex main to current file
|
||||
local function vimtex_set_main()
|
||||
vim.b.vimtex_main = vim.fn.expand("%:p")
|
||||
vim.b.vimtex = nil
|
||||
vim.fn["vimtex#init"]()
|
||||
print("VimTeX main → " .. vim.b.vimtex_main)
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<leader>lm", vimtex_set_main, { desc = "VimTeX: set main to current file" })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue