Add neovim config

This commit is contained in:
2025-08-22 21:50:24 -04:00
parent 26c8b24004
commit 33808a120c
3 changed files with 555 additions and 0 deletions

249
config.nix Normal file
View File

@@ -0,0 +1,249 @@
{ pkgs, inputs, ... }:
{
colorschemes.tokyonight.enable = true;
opts = {
number = true;
relativenumber = true;
# Show whitespace
list = true;
listchars.__raw = "{ tab = '» ', trail = '·', nbsp = '', lead = '·'}";
# Start scrolling when the cursor is X lines away from edge
scrolloff = 10;
ignorecase = true;
smartcase = true;
cindent = true;
signcolumn = "yes";
};
clipboard.providers.wl-copy.enable = true;
clipboard.providers.xclip.enable = true;
plugins = {
dashboard = {
enable = true;
settings = {
theme = "hyper";
config = {
header = [
" "
" "
" "
" "
" "
" "
""
];
};
};
};
telescope = {
enable = true;
keymaps = {
"<C-f>" = "live_grep";
"<C-p>" = "git_files";
"<C-o>" = "find_files";
};
extensions = {
fzf-native = {
enable = true;
settings = {
fuzzy = true;
override_file_sorter = true;
override_generic_sorter = true;
};
};
};
};
# Needed for telescope
web-devicons.enable = true;
lualine = {
enable = true;
settings = {
options = {
component_separators = "|";
section_separators = "";
globalstatus = true;
};
};
};
neo-tree = {
enable = true;
closeIfLastWindow = true;
filesystem = {
filteredItems = {
visible = true;
hideDotfiles = false;
hideGitignored = false;
};
};
};
neogit.enable = true;
tiny-inline-diagnostic = {
enable = true;
settings = {
options = {
show_source.enabled = true;
settings.auto_start = true;
};
};
};
coq-nvim = {
enable = true;
installArtifacts = true;
settings.auto_start = "shut-up";
luaConfig.post = ''
vim.g.coq_settings = {
keymap = { jump_to_mark = "" },
}
'';
};
nvim-autopairs.enable = true;
comment.enable = true;
sleuth.enable = true;
rustaceanvim.enable = true;
mkdnflow = {
enable = true;
mappings = {
MkdnEnter = {
key = "<CR>";
modes = [ "n" "v" "i" ];
};
};
};
lsp = {
enable = true;
keymaps.diagnostic = {
"<leader>j" = "goto_next";
"<leader>k" = "goto_prev";
};
servers = {
typos_lsp.enable = true;
markdown_oxide.enable = true;
ltex.enable = true;
};
};
};
extraPlugins = [
(pkgs.vimUtils.buildVimPlugin {
name = "hml";
src = inputs.hml;
})
(pkgs.vimUtils.buildVimPlugin {
name = "typst-preview";
src = inputs.typst-preview;
})
];
extraConfigLua = ''
require("hml").setup()
require("typst-preview").setup()
'';
extraPackages = with pkgs; [
# Telescope
ripgrep
# typst-preview
typst
poppler-utils # (pdfinfo)
];
keymaps = [
{
action = "<Cmd>Dashboard<CR>";
key = "<leader>d";
}
{
action = "<Cmd>Neotree toggle right<CR>";
key = "<leader>f";
}
{
action = "<Cmd>sp<CR><Cmd>wincmd j<CR><Cmd>term<CR>15<C-w>-i";
key = "<leader>t";
}
{
# Exit terminal mode
action = "<C-\\><C-n>";
key = "<C-e>";
mode = [ "t" ];
}
{
action = "<Cmd>vsplit<CR>";
key = "<leader>v";
}
{
action = "<Cmd>split<CR>";
key = "<leader>h";
}
{
action = "<Cmd>tabnew<CR>";
key = "<leader>n";
}
{
action = "<Cmd>tabn<CR>";
key = "<C-]>";
}
{
action = "<Cmd>tabp<CR>";
key = "<C-[>";
}
{
action = "<Cmd>lua require(\"typst-preview\").start()<CR>";
key = "<C-m>s";
}
{
action = "<Cmd>lua require(\"typst-preview\").stop()<CR>";
key = "<C-m>q";
}
{
action = "<Cmd>lua require(\"typst-preview\").prev_page()<CR>";
key = "<C-m>k";
}
{
action = "<Cmd>lua require(\"typst-preview\").next_page()<CR>";
key = "<C-m>j";
}
] ++ (
builtins.concatMap (k: [
{
action = "<Cmd>wincmd ${k}<CR>";
key = "<C-${k}>";
}
{
action = "<C-\\><C-n><Cmd>wincmd ${k} <CR>";
key = "<C-${k}>";
mode = [ "t" ];
}
]) ["h" "j" "k" "l"]
);
}

239
flake.lock generated Normal file
View File

@@ -0,0 +1,239 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1754487366,
"narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"hml": {
"flake": false,
"locked": {
"lastModified": 1732174350,
"narHash": "sha256-IdsYy0K4Q1qTpUwhf97bS2vGDHB+MBjZILy1MyVlIiE=",
"owner": "mawkler",
"repo": "hml.nvim",
"rev": "54b4d0a4d800f79310443f9a26d54023daeb9e7c",
"type": "github"
},
"original": {
"owner": "mawkler",
"repo": "hml.nvim",
"type": "github"
}
},
"ixx": {
"inputs": {
"flake-utils": [
"nixvim",
"nuschtosSearch",
"flake-utils"
],
"nixpkgs": [
"nixvim",
"nuschtosSearch",
"nixpkgs"
]
},
"locked": {
"lastModified": 1754860581,
"narHash": "sha256-EM0IE63OHxXCOpDHXaTyHIOk2cNvMCGPqLt/IdtVxgk=",
"owner": "NuschtOS",
"repo": "ixx",
"rev": "babfe85a876162c4acc9ab6fb4483df88fa1f281",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"ref": "v0.1.1",
"repo": "ixx",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1755704039,
"narHash": "sha256-gKlP0LbyJ3qX0KObfIWcp5nbuHSb5EHwIvU6UcNBg2A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9cb344e96d5b6918e94e1bca2d9f3ea1e9615545",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": [
"nixpkgs"
],
"nuschtosSearch": "nuschtosSearch",
"systems": "systems_3"
},
"locked": {
"lastModified": 1755900473,
"narHash": "sha256-UxpKQvD3dTT4/ueJBDccmHeHfnuUD+864Mzu8GPJZig=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "18a1b5126f917fbcd65397b9ee429387fdbd51a6",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils_2",
"ixx": "ixx",
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1755555503,
"narHash": "sha256-WiOO7GUOsJ4/DoMy2IC5InnqRDSo2U11la48vCCIjjY=",
"owner": "NuschtOS",
"repo": "search",
"rev": "6f3efef888b92e6520f10eae15b86ff537e1d2ea",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"hml": "hml",
"nixpkgs": "nixpkgs",
"nixvim": "nixvim",
"typst-preview": "typst-preview"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"typst-preview": {
"flake": false,
"locked": {
"lastModified": 1755810917,
"narHash": "sha256-hE5HPsuskOSqJ1KYp9/eCL5K90fRhMBe6t+skr+wyrI=",
"owner": "al-kot",
"repo": "typst-preview.nvim",
"rev": "8759307163ef59698ff443e3784ad6a7af4ea484",
"type": "github"
},
"original": {
"owner": "al-kot",
"repo": "typst-preview.nvim",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

67
flake.nix Normal file
View File

@@ -0,0 +1,67 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
flake-utils.url = "github:numtide/flake-utils";
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
hml = {
url = "github:mawkler/hml.nvim";
flake = false;
};
typst-preview = {
url = "github:al-kot/typst-preview.nvim";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, nixvim, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
nixvimLib = nixvim.lib.${system};
nixvimModule = import ./config.nix;
nvim = nixvim.legacyPackages.${system}.makeNixvimWithModule {
module = nixvimModule;
extraSpecialArgs = {
inherit inputs;
};
};
in
{
checks.default = nixvimLib.check.mkTestDerivationFromNixvimModule {
module = nixvimModule;
};
packages.default = nvim;
packages.neovide = pkgs.stdenv.mkDerivation {
name = "neovide";
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
cat > $out/bin/neovide <<EOF
#!${pkgs.runtimeShell}
${pkgs.neovide}/bin/neovide --neovim-bin ${nvim}/bin/nvim "\$@"
EOF
chmod +x $out/bin/neovide
'';
};
}
);
}