neovim new config

This commit is contained in:
afoucaultc 2026-08-19 14:54:41 +02:00
parent 763bbf5cc1
commit 315e988734
50 changed files with 739 additions and 52 deletions

BIN
conf.zip

Binary file not shown.

BIN
dotfiles/nvim.zip Normal file

Binary file not shown.

View file

@ -153,3 +153,7 @@ endsnippet
snippet quant "Quantity"
\qty{$1}{$2}
endsnippet
snippet ptm "Point médian"
\ptm
endsnippet

View file

@ -1,3 +0,0 @@
-- ~/.config/nvim/init.lua
vim.g.python3_host_prog = "/etc/profiles/per-user/afoucaultc/bin/python3"
require("neoconf")

1
dotfiles/nvim/init.lua Symbolic link
View file

@ -0,0 +1 @@
/nix/store/hhz4243ymgf24x646pxh30jm38iss4rd-home-manager-files/.config/nvim/init.lua

View file

@ -0,0 +1,3 @@
-- ~/.config/nvim/init.lua
vim.g.python3_host_prog = "/etc/profiles/per-user/afoucaultc/bin/python3"
require("neoconf")

View file

@ -1,54 +1,53 @@
{
"LazyVim": { "branch": "main", "commit": "c10948c50b18fae7f256433afdef09e432410480" },
"LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" },
"alpha-nvim": { "branch": "main", "commit": "6c6a89d5b068b5251c8bdf0dd57bb921bcfeeb09" },
"baleia.nvim": { "branch": "main", "commit": "710537ff5cd669c5a76c5f5b6a9169fd9b913d18" },
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"catppuccin": { "branch": "main", "commit": "05e8787020dcfdb937bf2ff23855ea2415b4e072" },
"conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" },
"catppuccin": { "branch": "main", "commit": "edefef779ab08ce1a4a404713e3012b0d202bd35" },
"conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" },
"csvview.nvim": { "branch": "main", "commit": "5c22774c3ecc7f8883af5d143b366e45b1f0875d" },
"debugpy.nvim": { "branch": "master", "commit": "490a0d7bfa23af8c6096bb3fbd867770b7d4a28b" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
"flash.nvim": { "branch": "main", "commit": "b6346946d10d07998efee029fb0f7a593806d0cd" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
"fzf-lua": { "branch": "main", "commit": "ed4059deb9237f7f4cc8832ffef69779ffe2e265" },
"gitsigns.nvim": { "branch": "main", "commit": "eb60cc7b94c46005237fd34170d76f3a089a90aa" },
"grug-far.nvim": { "branch": "main", "commit": "c69859c1d5427ab5fc7ed12380ab521b4e336691" },
"fzf-lua": { "branch": "main", "commit": "05e44d38de0a79c11fba5f7bf8138791b1dbdd1e" },
"gitsigns.nvim": { "branch": "main", "commit": "5be654f2232c10ddcad19c1607a67b6b4b78fc29" },
"grug-far.nvim": { "branch": "main", "commit": "11595bf747edc270bce2069d1020502ad4ae56cf" },
"image.nvim": { "branch": "master", "commit": "88351f1f7d9dbae286e671ce3690a49660dd8a5c" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" },
"lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" },
"markview.nvim": { "branch": "main", "commit": "092c0872fd2437b3b862d253910981142d2465aa" },
"markview.nvim": { "branch": "main", "commit": "5d9fc2aa6dd1c2fbdc7a68bc79b300e9967b21ff" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "47059d71b42d74b0a1e9f61c1d99d301039c3b5b" },
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
"mini.ai": { "branch": "main", "commit": "2f763720771e192bdf9d2e25bfae339930ba4231" },
"mini.ai": { "branch": "main", "commit": "25248c6aa002391936a6200f12d1466015987133" },
"mini.icons": { "branch": "main", "commit": "98faae31e9be1cc054ae63485e58ceb185efcad0" },
"mini.pairs": { "branch": "main", "commit": "b1fd9df3bb4a41c8f45778a3859ee80ef6b367e3" },
"mini.pairs": { "branch": "main", "commit": "b1c5a726921b7a8c9321e9a7a208aa0571de5810" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "ebd66767191714e008ce73b769518a763ff31bdc" },
"neogit": { "branch": "master", "commit": "6fc2fa890bd2031ed999c074daab0fb4feff20a5" },
"neogit": { "branch": "master", "commit": "37e0f22a2345bad1bffe01b31970885882f46275" },
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nui.nvim": { "branch": "main", "commit": "a25dd472316d806eb38a5dd667c2e40da5570c75" },
"nvim-dap": { "branch": "master", "commit": "9e848e09a697ee95302a3ef2dd43fd6eb709e570" },
"nvim-lint": { "branch": "master", "commit": "a219b2c9e5b4765e5c845aba119dad55806fcaf1" },
"nvim-lspconfig": { "branch": "master", "commit": "d224a1920728ba129880efc700d4a0180ac4ecbb" },
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
"nvim-treesitter-textobjects": { "branch": "main", "commit": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e" },
"nvim-lint": { "branch": "master", "commit": "5b5b794458b5ff0b17d26c9d7400faaebd00b32d" },
"nvim-lspconfig": { "branch": "master", "commit": "c8a582abc20a3121a768073df569d088cb5604b5" },
"nvim-treesitter": { "branch": "main", "commit": "074aa4422bf029908338e855d0c0f71470a971bb" },
"nvim-treesitter-textobjects": { "branch": "main", "commit": "898ee307df58f854d11cd7edd06472574d48014e" },
"nvim-ts-autotag": { "branch": "main", "commit": "88c1453db4ba7dd24131086fe51fdf74e587d275" },
"nvim-web-devicons": { "branch": "master", "commit": "dad71387de386a946b123079d0e53f23028f3abd" },
"nvim-web-devicons": { "branch": "master", "commit": "2ae6958df7ced50baac5035cec0c15799eedfbf7" },
"oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" },
"persistence.nvim": { "branch": "main", "commit": "b20b2a7887bd39c1a356980b45e03250f3dce49c" },
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
"snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" },
"telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" },
"telescope.nvim": { "branch": "master", "commit": "40aedd8a68c78a656a10a8d62d80c54af59420fb" },
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" },
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
"ts-comments.nvim": { "branch": "main", "commit": "a59d6092213447450191122c9346f309161504cb" },
"ultisnips": { "branch": "master", "commit": "62aca2a735b76d24a8fc7862f902330ac688849b" },
"vimtex": { "branch": "master", "commit": "a5949d2800c1866c878956d49c51fc8d003c6b99" },
"vimtex-follow": { "branch": "main", "commit": "dd1175f9edb76db7fa50f3ec37082b80df2b2849" },
"vimtex": { "branch": "master", "commit": "b652447a39eeb180ea103d6b39efe84e7cf74117" },
"vimtex-follow": { "branch": "main", "commit": "4f882c0fba6b4b769d1efc239e669d6b6527b5ac" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
}

View file

@ -0,0 +1 @@
/nix/store/hhz4243ymgf24x646pxh30jm38iss4rd-home-manager-files/.config/nvim/lua/conf/autocmd.lua

View file

@ -0,0 +1 @@
/nix/store/hhz4243ymgf24x646pxh30jm38iss4rd-home-manager-files/.config/nvim/lua/conf/lsp-config.lua

View file

@ -0,0 +1 @@
/nix/store/hhz4243ymgf24x646pxh30jm38iss4rd-home-manager-files/.config/nvim/lua/conf/remap.lua

View file

@ -0,0 +1 @@
/nix/store/hhz4243ymgf24x646pxh30jm38iss4rd-home-manager-files/.config/nvim/lua/conf/settings.lua

View file

@ -1,9 +0,0 @@
return {
{
"goolord/alpha-nvim",
dependencies = { "nvim-mini/mini.icons" },
config = function()
require("alpha").setup(require("alpha.themes.startify").config)
end,
},
}

View file

@ -0,0 +1 @@
/nix/store/hhz4243ymgf24x646pxh30jm38iss4rd-home-manager-files/.config/nvim/luasnippets/matlab.lua

View file

@ -0,0 +1 @@
/nix/store/hhz4243ymgf24x646pxh30jm38iss4rd-home-manager-files/.config/nvim/luasnippets/tex.lua

View file

@ -0,0 +1 @@
/nix/store/hhz4243ymgf24x646pxh30jm38iss4rd-home-manager-files/.config/nvim/queries/nix/injections.scm

View file

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

View file

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Before After
Before After

89
flake.lock generated
View file

@ -85,6 +85,27 @@
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1785627969,
"narHash": "sha256-4dtXQk/NMePegK/nWp5NSeuZKLATItOq61lpEvmXqGw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "427bf4bd9435fdf21321c8cc628c24efc14c0f7a",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"stylix",
@ -147,11 +168,11 @@
]
},
"locked": {
"lastModified": 1786719456,
"narHash": "sha256-B74DLQs/VjlqyhnnX3tguWwghqJHWSJX30TKZuAljIg=",
"lastModified": 1786929086,
"narHash": "sha256-kzpwMyT7i2fTQ41tf/WlsIHuJtf3e0leRBEPkBhUzBY=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "83b7606dcf44abe3a94b86e8bb2b3355d22e8797",
"rev": "aac4965ddb7ea2ff0f3cadd9502c7042b7aa07ba",
"type": "github"
},
"original": {
@ -223,11 +244,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1786717298,
"narHash": "sha256-asdPlqtM0AweQ5YNLad6eY4tSYW55YNr1uyayf7mOMQ=",
"lastModified": 1786867632,
"narHash": "sha256-ez+ubZlA1RtdjCB18a6zJ9M4u8qoPDy08EcnsW5M3Xw=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "2dda192987ab6815e44df0130f03d6c907b79134",
"rev": "ff17823245ab9ff7bcae6acf950bd89cba82c38c",
"type": "github"
},
"original": {
@ -267,11 +288,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1786599213,
"narHash": "sha256-yNJd40f11EzXBjSByCB7IPpeFFAdeoSKKM67dGkfFoU=",
"lastModified": 1786862985,
"narHash": "sha256-FBJRXmbGXiSUDvYEbfLYRkckayyZ6SK1UEqhCrIZ2Cs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0e251e24a4f24e036a084b6b4b2d2491af4167f4",
"rev": "e5bdc4a41d4c072fe1e3787eaa0320a384741d44",
"type": "github"
},
"original": {
@ -281,6 +302,28 @@
"type": "github"
}
},
"nixvim": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": [
"nixpkgs"
],
"systems": "systems"
},
"locked": {
"lastModified": 1787062366,
"narHash": "sha256-42RoRqxcuMB/MMLQU65StwyrPzdahxDXR3Sy58AzOMM=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "fe68d88884ac91ce1d17e955ac0ae486ff8bcdf0",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"nur": {
"inputs": {
"flake-parts": [
@ -312,6 +355,7 @@
"niri": "niri",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2",
"nixvim": "nixvim",
"stylix": "stylix",
"zen-browser": "zen-browser"
}
@ -323,13 +367,13 @@
"base16-helix": "base16-helix",
"base16-vim": "base16-vim",
"firefox-gnome-theme": "firefox-gnome-theme",
"flake-parts": "flake-parts",
"flake-parts": "flake-parts_2",
"gnome-shell": "gnome-shell",
"nixpkgs": [
"nixpkgs"
],
"nur": "nur",
"systems": "systems",
"systems": "systems_2",
"tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes",
"tinted-tmux": "tinted-tmux",
@ -350,6 +394,23 @@
}
},
"systems": {
"flake": false,
"locked": {
"lastModified": 1774449309,
"narHash": "sha256-brhZ8DmuGtzkCYHJg4HEd602amKm89Y9ytsFZ5uWD1w=",
"owner": "nix-systems",
"repo": "default",
"rev": "c29398b59d2048c4ab79345812849c9bd15e9150",
"type": "github"
},
"original": {
"owner": "nix-systems",
"ref": "future-26.11",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1774449309,
"narHash": "sha256-brhZ8DmuGtzkCYHJg4HEd602amKm89Y9ytsFZ5uWD1w=",
@ -472,11 +533,11 @@
]
},
"locked": {
"lastModified": 1786764320,
"narHash": "sha256-FO8IkyM+S1nFHPetg20r+EsLicLPuh+yy5WKqxG20JI=",
"lastModified": 1786883935,
"narHash": "sha256-GE0VmDa7cLMReaNTrzYQ3sFSPUd6ARynENviHdnnUDM=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"rev": "a19fe7e45d173d5e455771d7ecce9bbd02a9598f",
"rev": "37dc6abfa4a2c306b131f74770b1f36288d9bf2e",
"type": "github"
},
"original": {

View file

@ -29,6 +29,10 @@
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
};
# ici :
# - inputs@ capture l'ensemble des inputs dans une variable "inputs" accessible par
@ -45,6 +49,7 @@
nixos-hardware,
zen-browser,
stylix,
nixvim,
...
}:
# pour la configuration nixos-home

View file

@ -8,7 +8,7 @@ in
"inkscape/templates".source = link "${dots}/inkscape/templates";
"inkscape/palettes".source = link "${dots}/inkscape/palettes";
"rofi".source = link "${dots}/rofi";
"nvim".source = link "${dots}/nvim";
#"nvim".source = link "${dots}/nvim";
};
}

View file

@ -0,0 +1,9 @@
{ ... }:
{
programs.nixvim = {
colorschemes.tokyonight = {
enable = true;
settings.style = "night";
};
};
}

View file

@ -0,0 +1,24 @@
# fichiers lua bruts
{ ... }:
{
programs.nixvim = {
extraFiles = {
# lua
"lua/conf/settings.lua".source = ../lua/settings.lua;
"lua/conf/lsp-config.lua".source = ../lua/lsp-config.lua;
"lua/conf/remap.lua".source = ../lua/remap.lua;
"lua/conf/autocmd.lua".source = ../lua/autocmd.lua;
# snippets
"luasnippets/tex.lua".source = ../snippets/tex.lua;
"luasnippets/matlab.lua".source = ../snippets/matlab.lua;
};
extraConfigLua = ''
require("conf.settings")
require("conf.lsp-config")
require("conf.remap")
require("conf.autocmd")
require("luasnip.loaders.from_lua").load()
'';
};
}

View file

@ -0,0 +1,25 @@
# binaires nécessaires
{ pkgs, ... }:
{
programs.nixvim = {
extraPackages = with pkgs; [
# lsp
nil # nix
lua-language-server # lua
texlab # latx
python3 # python
pyright # python v2
# formatters
nixfmt-rfc-style
stylua
ruff
# tools
zathura
ripgrep
fd
octave
];
};
}

View file

@ -0,0 +1,18 @@
# plugins non implémentés dans nixvim et/ou nixpkgs
{ ... }:
{
# extraPlugins = [
# HORS NIXVIM
# pkgs.vimPlugins."<plugin name>"
# HORS NIXPKGS
#(pkgs.vimUtils.buildVimPlugin {
# name = "myPlugin";
# src = pkgs.fetchFromGitHub {
# owner = "<owner>";
# repo = "<repo>";
# rev = "<commit hash>";
# hash = "<nix NAR hash>";
# };
#})
#];
}

View file

@ -0,0 +1,10 @@
# configuration vim.g.*
{ ... }:
{
programs.nixvim = {
globals = {
mapleader = " ";
maplocalleader = ",";
};
};
}

View file

@ -0,0 +1,7 @@
{ ... }:
{
programs.nixvim = {
keymaps = [
];
};
}

View file

@ -0,0 +1,17 @@
{ ... }:
{
imports = [
../plugins/blink-cmp.nix
../plugins/conform-nvim.nix
../plugins/gitsigns.nix
../plugins/lsp.nix
../plugins/lualine.nix
../plugins/luasnip.nix
../plugins/mini.nix
../plugins/oil.nix
../plugins/telescope.nix
../plugins/treesitter.nix
../plugins/vimtex.nix
../plugins/which-key.nix
];
}

View file

@ -0,0 +1,48 @@
-- (.config/nvim/lua/neoconf/autocmd.lua)
vim.api.nvim_create_autocmd("BufWritePre", {
callback = function()
vim.lsp.buf.format({ async = false })
end,
})
local function run_curr_python_file()
-- Get file name in the current buffer
local file_name = vim.api.nvim_buf_get_name(0)
-- Get terminal codes for running python file
-- ("i" to enter insert before typing rest of the command)
local py_cmd = vim.api.nvim_replace_termcodes('ipython "' .. file_name .. '"<cr>', true, false, true)
-- Determine terminal window split and launch terminal
local percent_of_win = 0.4
local curr_win_height = vim.api.nvim_win_get_height(0) -- Current window height
local term_height = math.floor(curr_win_height * percent_of_win) -- Terminal height
vim.cmd(":below " .. term_height .. "split | term") -- Launch terminal (horizontal split)
-- Press keys to run python command on current file
vim.api.nvim_feedkeys(py_cmd, "t", false)
end
vim.keymap.set({ "n" }, "<A-r>", "", {
desc = "Run .py file via Neovim built-in terminal",
callback = run_curr_python_file,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = { "markdown", "rmd" },
callback = function()
-- Force syntaxe markdown
vim.bo.syntax = "markdown"
-- Conceal normal pour markdown
vim.wo.conceallevel = 2
-- Désactive vimtex pour ces fichiers
vim.b.vimtex_syntax_enabled = 0
end,
})
vim.api.nvim_create_autocmd("FileType", {
pattern = "*",
callback = function()
pcall(vim.treesitter.start)
end,
})

View file

@ -0,0 +1,14 @@
-- diagnostic
vim.diagnostic.config({
virtual_text = {
prefix = "", -- Icône avant le message
source = "if_many", -- Affiche la source LSP si plusieurs
format = function(diag)
return string.format("%s: %s", diag.source, diag.message)
end,
},
signs = true,
underline = true,
update_in_insert = false, -- Évite flicker en insert
severity_sort = true,
})

View file

@ -0,0 +1,60 @@
-- (.config/nvim/lua/neoconf/remap.lua)
-- leader = space
-- C = ctrl
-- clear highlights when typing esc
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
-- diagnostic keymaps
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
-- exit terminal mode (or ctrl C)
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
-- disable arrow keys
vim.keymap.set("n", "<left>", '<cmd>echo "Use h to move!!"<CR>')
vim.keymap.set("n", "<right>", '<cmd>echo "Use l to move!!"<CR>')
vim.keymap.set("n", "<up>", '<cmd>echo "Use k to move!!"<CR>')
vim.keymap.set("n", "<down>", '<cmd>echo "Use j to move!!"<CR>')
-- ctrl hjkl for moving between windows
vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "Move focus to the left window" })
vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Move focus to the right window" })
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })
-- telescope
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Telescope find files" })
vim.keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "Telescope live grep" })
vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Telescope buffers" })
vim.keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "Telescope help tags" })
-- oil
vim.keymap.set("n", "<leader>n", "<cmd>Oil<CR>", { desc = "Launch oil buffer" })
-- python
vim.keymap.set("n", "<F5>", ":w<CR>:!python3 %<CR>", { noremap = true, silent = false })
-- spell checker from fr to en
vim.keymap.set("n", "<leader>sf", function()
if vim.o.spelllang == "fr" then
vim.o.spelllang = "en"
else
vim.o.spelllang = "fr"
end
vim.o.spell = true
print("Spelllang: " .. vim.o.spelllang)
end, { desc = "Toggle spelllang FR/EN" })
-- toggle correction
vim.keymap.set("n", "<leader>sg", function()
vim.wo.spell = not vim.wo.spell
vim.notify("Spell: " .. (vim.wo.spell and "ON" or "OFF"), vim.log.levels.INFO)
end, { desc = "Toggle spell check" })
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" })

View file

@ -0,0 +1,46 @@
-- .config/nvim/lua/neoconf/settings.lua
vim.g.have_nerd_font = true
-- options
-- enable line number
vim.o.number = true
-- relative line number
vim.o.relativenumber = true
-- dont show the mode
vim.o.showmode = true
-- sync clipboard
vim.schedule(function()
vim.o.clipboard = "unnamedplus"
end)
-- enable break indent
vim.o.breakindent = true
-- indent options
vim.o.autoindent = true
vim.o.smartindent = true
vim.o.expandtab = true
-- save undo history
vim.o.undofile = true
-- case insensitive search
vim.o.ignorecase = true
vim.o.smartcase = true
-- keep signcolumn
vim.o.signcolumn = "yes"
-- config new split opening
vim.o.splitright = true
vim.o.splitbelow = true
-- whitespace char display
vim.o.list = true
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "" }
-- preview substitutions live with !
vim.o.inccommand = "split"
-- show line cursor
vim.o.cursorline = true
-- min lines above and below cursor
vim.o.scrolloff = 10
-- confirm save/confirm
vim.o.confirm = true
-- spell checking
vim.opt.spell = true
vim.opt.spelllang = "fr"
-- wrap
vim.o.wrap = true
vim.o.linebreak = true

View file

@ -0,0 +1,27 @@
{ inputs, ... }:
let
nixvim = import (
builtins.fetchGit {
url = "https://github.com/nix-community/nixvim";
}
);
in
{
imports = [
inputs.nixvim.homeModules.nixvim
./config/colorscheme.nix
./config/extrafiles.nix
./config/extrapackages.nix
./config/extraplugins.nix
./config/globals.nix
./config/keymaps.nix
./config/plugins.nix
];
programs.nixvim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
}

View file

@ -0,0 +1,19 @@
{ ... }:
{
programs.nixvim = {
plugins = {
blink-cmp = {
enable = true;
settings = {
keymap.preset = "default";
sources.default = [
"lsp"
"path"
"snippets"
"buffer"
];
};
};
};
};
}

View file

@ -0,0 +1,15 @@
{ ... }:
{
programs.nixvim = {
plugins = {
conform-nvim = {
enable = true;
settings.formatters_by_ft = {
nix = [ "nixfmt" ];
lua = [ "stylua" ];
python = [ "ruff_format" ];
};
};
};
};
}

View file

@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim = {
plugins = {
gitsigns = {
enable = true;
};
};
};
}

View file

@ -0,0 +1,19 @@
{ ... }:
{
programs.nixvim = {
plugins = {
lsp = {
enable = true;
servers = {
nil_ls.enable = true;
lua-ls = {
enable = true;
settings.Lua.diagnostics.globals = [ "vim" ];
};
texlab.enable = true;
pyright.enable = true;
};
};
};
};
}

View file

@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim = {
plugins = {
lualine = {
enable = true;
};
};
};
}

View file

@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim = {
plugins = {
luasnip = {
enable = true;
};
};
};
}

View file

@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim = {
plugins = {
mini = {
modules.ai = { };
};
};
};
}

View file

@ -0,0 +1,11 @@
{ ... }:
{
programs.nixvim = {
plugins = {
oil = {
enable = true;
settings.default_file_explorer = true;
};
};
};
}

View file

@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim = {
plugins = {
telescope = {
enable = true;
};
};
};
}

View file

@ -0,0 +1,20 @@
{ ... }:
{
programs.nixvim = {
plugins = {
treesitter = {
enable = true;
settings.ensure_installed = [
"nix"
"lua"
"python"
"latex"
"vim"
"vimdoc"
"markdown_inline"
"regex"
];
};
};
};
}

View file

@ -0,0 +1,16 @@
{ config, ... }:
{
programs.nixvim.plugins.vimtex = {
enable = true;
autoLoad = true;
settings = {
view_method = "zathura";
complete_close_brace = 1;
format_enabled = 1;
imaps_enabled = 0;
complete_enabled = 0;
syntax_enabled = 0;
compiler_latexmk.aux_dir = "${config.home.homeDirectory}/.aux-tex/";
};
};
}

View file

@ -0,0 +1,10 @@
{ ... }:
{
programs.nixvim = {
plugins = {
which-key = {
enable = true;
};
};
};
}

View file

@ -0,0 +1,11 @@
local ls = require("luasnip")
local i = ls.insert_node
local fmt = require("luasnip.extras.fmt").fmt
local line_begin = require("luasnip.extras.expand_conditions").line_begin
return {
ls.snippet(
{ trig = "plot", name = "Plot", condition = line_begin },
fmt([[plot({},{},'Color',{},'Linewidth',1.5,'MarkerSize',0,'DisplayName',"{}")]], { i(1), i(2), i(3), i(4) })
),
}

View file

@ -0,0 +1,144 @@
local ls = require("luasnip")
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
local fmt = require("luasnip.extras.fmt").fmt
local rep = require("luasnip.extras").rep
local line_begin = require("luasnip.extras.expand_conditions").line_begin
return {
-- ============== Figures ==============
s(
{ trig = "svgfig", name = "Figures from inkscape PDF+PDF_tex", condition = line_begin },
fmt(
[[
\begin{{figure}}[htbp]
\centering
\def\svgwidth{{0.99\textwidth}}
\import{{figures/{}.pdf_tex}}
\caption{{{}}}
\label{{{}}}
\end{{figure}}
]],
{ i(1), i(2), rep(1) }
)
),
s(
{ trig = "sfig", name = "Single figure", condition = line_begin },
fmt(
[[
\begin{{figure}}[htbp]
\centering
\input{{figures/{}}}
\caption{{{}}}
\label{{{}}}
\end{{figure}}
]],
{ i(1), i(2), rep(1) }
)
),
s(
{ trig = "dfig", name = "Double figures", condition = line_begin },
fmt(
[[
\begin{{figure}}
\begin{{subfigure}}{{\dfigsize}}
\centering
\includegraphics[width=\textwidth]{{figures/{}}}
\caption{{{}}}
\label{{fig:{}}}
\end{{subfigure}}
\hfill
\begin{{subfigure}}{{\dfigsize}}
\centering
\includegraphics[width=\textwidth]{{figures/{}}}
\caption{{{}}}
\label{{fig:{}}}
\end{{subfigure}}
\caption{{{}}}
\end{{figure}}
]],
{ i(2), i(1), rep(2), i(4), i(3), rep(4), i(5) }
)
),
s(
{ trig = "tab", name = "Table", condition = line_begin },
fmt(
[[
\begin{{table}}
\centering
\begin{{tabular}}{{{}}}
\hline
{} & & & \\ \hline
\end{{tabular}}
\caption{{{}}}
\label{{table:{}}}
\end{{table}}
]],
{ i(1), i(4), i(2), i(3) }
)
),
-- ============== Basics ==============
s("env", fmt("\\begin{{{}}}\n\t{}\n\\end{{{}}}", { i(1), i(2), rep(1) }, { name = "Environment" })),
-- ============== Direct env ==============
s(
{ trig = "abs", name = "Abstract", condition = line_begin },
fmt("\\begin{{abstract}}\n\t{}\n\\end{{abstract}}", { i(1) })
),
s(
{ trig = "itm", name = "Environnement itemize", condition = line_begin },
fmt("\\begin{{{}}}\n\t\\item {}\n\\end{{{}}}", { i(1, "itemize"), i(2), rep(1) })
),
s({ trig = "it", name = "Add item", condition = line_begin }, fmt("\t\\item {}", { i(1) })),
-- ============== Section ==============
s("sec", fmt("\\{}{{{}}}\\label{{sec:{}}}", { i(1), i(2), i(3) }, { name = "sections" })),
-- ============== Disp ==============
s("bold", fmt("\\textbf{{{}}}", { i(1) }, { name = "bold" })),
s("ital", fmt("\\textit{{{}}}", { i(1) }, { name = "italique" })),
s("smcap", fmt("\\textsc{{{}}}", { i(1) }, { name = "small caps" })),
s("_", fmt("_{{{}}}", { i(1) }, { name = "undertext" })),
s("^", fmt("^{{{}}}", { i(1) }, { name = "uptext" })),
-- ============== Maths ==============
s("frac", fmt("\\frac{{{}}}{{{}}}", { i(1), i(2) }, { name = "fraction" })),
s("cases", fmt("\\begin{{cases}}\n\t{}\n\\end{{cases}}", { i(1) }, { name = "cases" })),
s(
{ trig = "eq", name = "Equation", condition = line_begin },
fmt("\\begin{{equation}}\n\t{}\n\t\\label{{eq:{}}}\n\\end{{equation}}", { i(1), i(2) })
),
s(
{ trig = "param", name = "Parameters", condition = line_begin },
fmt("\\begin{{parameters}}\n\t{}\t& {}\t\n\\end{{parameters}}", { i(1), i(2) })
),
s(
{ trig = "align", name = "Align", condition = line_begin },
fmt("\\begin{{align}}\n\t{}\n\t\\label{{eq:{}}}\n\\end{{align}}", { i(1), i(2) })
),
s(
{ trig = "mat", name = "Matrix", condition = line_begin },
fmt("\\begin{{bmatrix}}\n\t{}\n\\end{{bmatrix}}", { i(1) })
),
-- ============== Citation ==============
s("ref", fmt("\\ref{{{}}}", { i(1) }, { name = "reference" })),
s("cite", fmt("\\cite{{{}}}", { i(1) }, { name = "citation" })),
-- ============== Siunitx ==============
s("num", fmt("\\num{{{}}}", { i(1) }, { name = "Number" })),
s("un", fmt("\\unit{{{}}}", { i(1) }, { name = "Unit" })),
s("quant", fmt("\\qty{{{}}}{{{}}}", { i(1), i(2) }, { name = "Quantity" })),
s("ptm", t("\\ptm")),
}

View file

@ -8,7 +8,7 @@
command = [
"swaybg"
"-i"
"${config.home.homeDirectory}/nixos-config/dotfiles/hypr/wallpaper/nix-wallpaper.png"
"${config.home.homeDirectory}/nixos-config/dotfiles/wallpaper/moebius.jpg"
];
}
];

View file

@ -3,7 +3,6 @@
home.packages = with pkgs; [
# --- Bureautique ---
libreoffice-fresh
typora
zotero
# --- Communication ---
signal-desktop
@ -29,9 +28,9 @@
# --- Fichiers
nautilus
# --- Others
hyfetch
ncpamixer
ffmpeg
fetch
fastfetch
pkg-config
mullvad-vpn

View file

@ -27,7 +27,7 @@
# --- Fichiers
nautilus
# --- Others
hyfetch
fetch
fastfetch
pkg-config
brightnessctl

View file

@ -7,7 +7,7 @@
./packages/security.nix
./packages/kitty.nix
./packages/mpv.nix
./packages/neovim.nix
./packages/neovim/neovim.nix
./packages/niri/niri.nix
./packages/nextcloud.nix
./packages/mako.nix