init
This commit is contained in:
commit
6eae514dab
15 changed files with 500 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
result
|
||||
*.AppImage
|
||||
15
config.nix
Normal file
15
config.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./plugins/options.nix
|
||||
./plugins/theme.nix
|
||||
./plugins/completion.nix
|
||||
./plugins/lsp.nix
|
||||
./plugins/formatter.nix
|
||||
./plugins/statusline.nix
|
||||
./plugins/git.nix
|
||||
./plugins/ui.nix
|
||||
./plugins/navigation.nix
|
||||
./plugins/editing.nix
|
||||
./plugins/keymaps.nix
|
||||
];
|
||||
}
|
||||
142
flake.lock
generated
Normal file
142
flake.lock
generated
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1751685974,
|
||||
"narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1",
|
||||
"revCount": 92,
|
||||
"type": "git",
|
||||
"url": "https://git.lix.systems/lix-project/flake-compat.git"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.lix.systems/lix-project/flake-compat.git"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"nvf",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1769996383,
|
||||
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"mnw": {
|
||||
"locked": {
|
||||
"lastModified": 1770419553,
|
||||
"narHash": "sha256-b1XqsH7AtVf2dXmq2iyRr2NC1yG7skY7Z6N2MpWHlK4=",
|
||||
"owner": "Gerg-L",
|
||||
"repo": "mnw",
|
||||
"rev": "2aaffa8030d0b262176146adbb6b0e6374ce2957",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Gerg-L",
|
||||
"repo": "mnw",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"ndg": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nvf",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1768214250,
|
||||
"narHash": "sha256-hnBZDQWUxJV3KbtvyGW5BKLO/fAwydrxm5WHCWMQTbw=",
|
||||
"owner": "feel-co",
|
||||
"repo": "ndg",
|
||||
"rev": "a6bd3c1ce2668d096e4fdaaa03ad7f03ba1fbca8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "feel-co",
|
||||
"ref": "refs/tags/v2.6.0",
|
||||
"repo": "ndg",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1773821835,
|
||||
"narHash": "sha256-TJ3lSQtW0E2JrznGVm8hOQGVpXjJyXY2guAxku2O9A4=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b40629efe5d6ec48dd1efba650c797ddbd39ace0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvf": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-parts": "flake-parts",
|
||||
"mnw": "mnw",
|
||||
"ndg": "ndg",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1774134539,
|
||||
"narHash": "sha256-VTbmIpAP4OlM76uwUUezfewBUsrfWk2l3H2QaTY6QLc=",
|
||||
"owner": "notashelf",
|
||||
"repo": "nvf",
|
||||
"rev": "85ca579065a079ee9ee603339668c7c16b61c4f7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "notashelf",
|
||||
"repo": "nvf",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nvf": "nvf"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
32
flake.nix
Normal file
32
flake.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
description = "Antoine's neovim config";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nvf.url = "github:notashelf/nvf";
|
||||
nvf.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
nvf,
|
||||
...
|
||||
}: let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
neovim = (nvf.lib.neovimConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [./config.nix];
|
||||
}).neovim;
|
||||
in {
|
||||
packages.${system}.default = pkgs.symlinkJoin {
|
||||
name = "nvim";
|
||||
paths = [neovim];
|
||||
nativeBuildInputs = [pkgs.makeWrapper];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/nvim \
|
||||
--prefix PATH : ${pkgs.lib.makeBinPath [pkgs.git pkgs.fzf]}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
29
plugins/completion.nix
Normal file
29
plugins/completion.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{...}: {
|
||||
vim = {
|
||||
autocomplete.nvim-cmp = {
|
||||
enable = true;
|
||||
mappings = {
|
||||
complete = "<C-Space>";
|
||||
close = "<C-e>";
|
||||
scrollDocsUp = "<C-b>";
|
||||
scrollDocsDown = "<C-f>";
|
||||
confirm = "<CR>";
|
||||
next = "<C-j>";
|
||||
previous = "<C-k>";
|
||||
};
|
||||
};
|
||||
|
||||
snippets.luasnip.enable = true;
|
||||
|
||||
luaConfigRC.luasnip-keymaps = ''
|
||||
vim.keymap.set({"i", "s"}, "<C-l>", function()
|
||||
local ls = require("luasnip")
|
||||
if ls.expand_or_jumpable() then ls.expand_or_jump() end
|
||||
end, {silent = true})
|
||||
vim.keymap.set({"i", "s"}, "<C-h>", function()
|
||||
local ls = require("luasnip")
|
||||
if ls.jumpable(-1) then ls.jump(-1) end
|
||||
end, {silent = true})
|
||||
'';
|
||||
};
|
||||
}
|
||||
42
plugins/editing.nix
Normal file
42
plugins/editing.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{pkgs, ...}: {
|
||||
vim = {
|
||||
autopairs.nvim-autopairs.enable = true;
|
||||
comments.comment-nvim.enable = true;
|
||||
|
||||
extraPlugins = with pkgs.vimPlugins; {
|
||||
flash-nvim = {
|
||||
package = flash-nvim;
|
||||
setup = ''require("flash").setup({})'';
|
||||
};
|
||||
trouble-nvim = {
|
||||
package = trouble-nvim;
|
||||
setup = ''require("trouble").setup({})'';
|
||||
};
|
||||
inc-rename-nvim = {
|
||||
package = inc-rename-nvim;
|
||||
setup = ''require("inc_rename").setup({})'';
|
||||
};
|
||||
dressing-nvim = {
|
||||
package = dressing-nvim;
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
# Flash
|
||||
{key = "s"; mode = ["n" "x" "o"]; lua = true; action = ''function() require("flash").jump() end''; desc = "Flash";}
|
||||
{key = "S"; mode = ["n" "x" "o"]; lua = true; action = ''function() require("flash").treesitter() end''; desc = "Flash Treesitter";}
|
||||
{key = "R"; mode = ["o" "x"]; lua = true; action = ''function() require("flash").treesitter_search() end''; desc = "Treesitter Search";}
|
||||
|
||||
# Trouble
|
||||
{key = "<leader>lD"; mode = ["n"]; lua = true; action = ''function() require("trouble").open({mode = "diagnostics"}) end''; desc = "Workspace Diagnostics";}
|
||||
{key = "<leader>ld"; mode = ["n"]; lua = true; action = ''function() require("trouble").open({mode = "diagnostics", filter = {buf = 0}}) end''; desc = "Document Diagnostics";}
|
||||
{key = "<leader>lx"; mode = ["n"]; lua = true; action = ''function() require("trouble").open({mode = "lsp_definitions"}) end''; desc = "Lsp Definitions";}
|
||||
{key = "<leader>lt"; mode = ["n"]; lua = true; action = ''function() require("trouble").open({mode = "lsp_type_definitions"}) end''; desc = "Lsp Type Definitions";}
|
||||
{key = "<leader>li"; mode = ["n"]; lua = true; action = ''function() require("trouble").open({mode = "lsp_implementations"}) end''; desc = "Lsp Implementations";}
|
||||
{key = "<leader>lr"; mode = ["n"]; lua = true; action = ''function() require("trouble").open({mode = "lsp_references"}) end''; desc = "Lsp References";}
|
||||
|
||||
# Inc-rename (expr = true to build the command string dynamically)
|
||||
{key = "<leader>ln"; mode = ["n"]; lua = true; expr = true; action = ''function() return ":IncRename " .. vim.fn.expand("<cword>") end''; desc = "LSP Rename";}
|
||||
];
|
||||
};
|
||||
}
|
||||
17
plugins/formatter.nix
Normal file
17
plugins/formatter.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{...}: {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
formatters_by_ft = {
|
||||
lua = ["stylua"];
|
||||
rust = ["rustfmt"];
|
||||
nix = ["alejandra"];
|
||||
python = ["black"];
|
||||
};
|
||||
format_on_save = {
|
||||
timeout_ms = 2000;
|
||||
lsp_format = "fallback";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
6
plugins/git.nix
Normal file
6
plugins/git.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{...}: {
|
||||
vim.git = {
|
||||
gitsigns.enable = true;
|
||||
vim-fugitive.enable = true;
|
||||
};
|
||||
}
|
||||
23
plugins/keymaps.nix
Normal file
23
plugins/keymaps.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{...}: {
|
||||
vim.keymaps = [
|
||||
# Page navigation (centered)
|
||||
{key = "<C-d>"; mode = ["n"]; action = "<C-d>zz"; desc = "Page down centered";}
|
||||
{key = "<C-u>"; mode = ["n"]; action = "<C-u>zz"; desc = "Page up centered";}
|
||||
|
||||
# Quickfix navigation
|
||||
{key = "]c"; mode = ["n"]; action = "<cmd>cnext<CR>"; desc = "Next quickfix";}
|
||||
{key = "[c"; mode = ["n"]; action = "<cmd>cprev<CR>"; desc = "Prev quickfix";}
|
||||
|
||||
# Split management
|
||||
{key = "<leader>sv"; mode = ["n"]; action = "<C-w>v"; desc = "Split vertically";}
|
||||
{key = "<leader>sh"; mode = ["n"]; action = "<C-w>s"; desc = "Split horizontally";}
|
||||
{key = "<leader>se"; mode = ["n"]; action = "<C-w>="; desc = "Equal splits";}
|
||||
{key = "<leader>sx"; mode = ["n"]; action = "<cmd>close<CR>"; desc = "Close split";}
|
||||
|
||||
# Tab management
|
||||
{key = "<leader>tx"; mode = ["n"]; action = "<cmd>tabclose<CR>"; desc = "Close tab";}
|
||||
{key = "<leader>tn"; mode = ["n"]; action = "<cmd>tabnew<CR>"; desc = "New tab";}
|
||||
{key = "<Tab>"; mode = ["n"]; action = "<cmd>tabnext<CR>"; desc = "Next tab";}
|
||||
{key = "<S-Tab>"; mode = ["n"]; action = "<cmd>tabprevious<CR>"; desc = "Prev tab";}
|
||||
];
|
||||
}
|
||||
61
plugins/lsp.nix
Normal file
61
plugins/lsp.nix
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
{...}: {
|
||||
vim = {
|
||||
lsp.enable = true;
|
||||
|
||||
languages = {
|
||||
enableFormat = true;
|
||||
enableTreesitter = true;
|
||||
enableExtraDiagnostics = true;
|
||||
|
||||
python = {
|
||||
enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["ty"];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = ["black"];
|
||||
};
|
||||
};
|
||||
|
||||
lua = {
|
||||
enable = true;
|
||||
lsp.enable = true;
|
||||
format.enable = true;
|
||||
};
|
||||
|
||||
rust = {
|
||||
enable = true;
|
||||
lsp.enable = true;
|
||||
extensions.crates-nvim.enable = true;
|
||||
format.enable = true;
|
||||
};
|
||||
|
||||
nix = {
|
||||
enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["nil"];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = ["alejandra"];
|
||||
};
|
||||
};
|
||||
|
||||
clang = {
|
||||
enable = true;
|
||||
lsp.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{key = "<leader>ls"; mode = ["n"]; action = "<cmd>FzfLua lsp_document_symbols<cr>"; desc = "Document Symbols";}
|
||||
{key = "<leader>lS"; mode = ["n"]; action = "<cmd>FzfLua lsp_live_workspace_symbols<cr>"; desc = "Workspace Symbols";}
|
||||
{key = "<leader>la"; mode = ["n"]; lua = true; action = "function() vim.lsp.buf.code_action() end"; desc = "Code Actions";}
|
||||
{key = "K"; mode = ["n"]; lua = true; action = "function() vim.lsp.buf.hover() end"; desc = "Hover Docs";}
|
||||
{key = "<leader>lR"; mode = ["n"]; action = "<cmd>LspRestart<CR>"; desc = "Restart LSP";}
|
||||
];
|
||||
};
|
||||
}
|
||||
36
plugins/navigation.nix
Normal file
36
plugins/navigation.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{...}: {
|
||||
vim = {
|
||||
fzf-lua = {
|
||||
enable = true;
|
||||
profile = "telescope";
|
||||
};
|
||||
|
||||
filetree.nvimTree = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
filters.dotfiles = false;
|
||||
git.enable = true;
|
||||
renderer.group_empty = true;
|
||||
};
|
||||
};
|
||||
|
||||
session.nvim-session-manager.enable = true;
|
||||
|
||||
keymaps = [
|
||||
# FZF-lua
|
||||
{key = "<leader>ff"; mode = ["n"]; action = "<cmd>FzfLua files<cr>"; desc = "Find Files";}
|
||||
{key = "<leader>fg"; mode = ["n"]; action = "<cmd>FzfLua live_grep<cr>"; desc = "Live Grep";}
|
||||
{key = "<leader>fb"; mode = ["n"]; action = "<cmd>FzfLua buffers<cr>"; desc = "Buffer List";}
|
||||
{key = "<leader>fh"; mode = ["n"]; action = "<cmd>FzfLua help_tags<cr>"; desc = "Help Tags";}
|
||||
{key = "<leader>fo"; mode = ["n"]; action = "<cmd>FzfLua oldfiles<cr>"; desc = "Recent Files";}
|
||||
{key = "<leader>fn"; mode = ["n"]; action = "<cmd>FzfLua notify<cr>"; desc = "Notifications";}
|
||||
|
||||
# Nvim-tree
|
||||
{key = "<leader><leader>"; mode = ["n"]; action = "<cmd>NvimTreeToggle<CR>"; desc = "File Tree";}
|
||||
{key = "<leader>e"; mode = ["n"]; action = "<cmd>NvimTreeFindFile<CR>"; desc = "File Tree (find current file)";}
|
||||
|
||||
# Sessions
|
||||
{key = "<leader>fp"; mode = ["n"]; action = "<cmd>SessionManager load_session<CR>"; desc = "Session List";}
|
||||
];
|
||||
};
|
||||
}
|
||||
28
plugins/options.nix
Normal file
28
plugins/options.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{lib, ...}: {
|
||||
vim = {
|
||||
globals.mapleader = ",";
|
||||
|
||||
lineNumberMode = "relNumber";
|
||||
hideSearchHighlight = true;
|
||||
searchCase = "smart";
|
||||
undoFile.enable = true;
|
||||
|
||||
clipboard = {
|
||||
enable = true;
|
||||
registers = "unnamedplus";
|
||||
};
|
||||
|
||||
luaConfigRC.options = lib.nvim.dag.entryAfter ["globalsScript"] ''
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.opt.splitright = true
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.laststatus = 3
|
||||
vim.opt.sessionoptions = "curdir,folds,globals,help,tabpages,terminal,winsize"
|
||||
vim.opt.timeoutlen = 300
|
||||
'';
|
||||
};
|
||||
}
|
||||
18
plugins/statusline.nix
Normal file
18
plugins/statusline.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{pkgs, ...}: {
|
||||
vim.extraPlugins.lualine-nvim = {
|
||||
package = pkgs.vimPlugins.lualine-nvim;
|
||||
setup = ''
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = "catppuccin",
|
||||
globalstatus = true,
|
||||
section_separators = {
|
||||
left = string.char(0xEE, 0x82, 0xB4),
|
||||
right = string.char(0xEE, 0x82, 0xB6),
|
||||
},
|
||||
component_separators = { left = "|", right = "|" },
|
||||
},
|
||||
})
|
||||
'';
|
||||
};
|
||||
}
|
||||
8
plugins/theme.nix
Normal file
8
plugins/theme.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{...}: {
|
||||
vim.theme = {
|
||||
enable = true;
|
||||
name = "catppuccin";
|
||||
style = "mocha";
|
||||
transparent = true;
|
||||
};
|
||||
}
|
||||
41
plugins/ui.nix
Normal file
41
plugins/ui.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{...}: {
|
||||
vim = {
|
||||
visuals.indent-blankline.enable = true;
|
||||
|
||||
mini = {
|
||||
icons.enable = true;
|
||||
surround.enable = true;
|
||||
};
|
||||
|
||||
luaConfigRC.mini-icons-mock = ''
|
||||
require("mini.icons").mock_nvim_web_devicons()
|
||||
'';
|
||||
|
||||
binds.whichKey = {
|
||||
enable = true;
|
||||
setupOpts.delay = 300;
|
||||
};
|
||||
|
||||
ui.noice = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
lsp.override = {
|
||||
"vim.lsp.util.convert_input_to_markdown_lines" = true;
|
||||
"vim.lsp.util.stylize_markdown" = true;
|
||||
};
|
||||
presets = {
|
||||
lsp_doc_border = true;
|
||||
bottom_search = true;
|
||||
long_message_to_split = true;
|
||||
inc_rename = true;
|
||||
};
|
||||
messages.enabled = false;
|
||||
};
|
||||
};
|
||||
|
||||
dashboard.alpha = {
|
||||
enable = true;
|
||||
theme = "dashboard";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue