feat(home): move nvf config to homes and use home-manager modules

This commit is contained in:
Mohammad Rafiq 2025-06-14 18:52:44 +08:00
parent af7226d30e
commit 1a3ff4b92a
No known key found for this signature in database
21 changed files with 40 additions and 50 deletions

View file

@ -0,0 +1,31 @@
{ lib }:
{
blink-cmp = {
enable = true;
friendly-snippets.enable = true;
sourcePlugins = {
ripgrep.enable = true;
spell.enable = true;
};
setupOpts = {
completion.documentation.auto_show_delay_ms = 0;
signature.enabled = true;
enabled =
lib.generators.mkLuaInline
# lua
''
--- Disable completion for markdown
function()
return not vim.tbl_contains({"markdown"}, vim.bo.filetype)
and vim.bo.buftype ~= "prompt"
and vim.b.completion ~= false
end
'';
cmdline = {
enabled = true;
sources = null;
completion.menu.auto_show = false;
};
};
};
}

View file

@ -0,0 +1,15 @@
{
hardtime-nvim = {
enable = true;
setupOpts = {
max_count = 1;
disabled_keys = {
"<Up>" = [ ];
"<Down>" = [ ];
"<Right>" = [ ];
"<Left>" = [ ];
};
};
};
whichKey.enable = true;
}

View file

@ -0,0 +1,2 @@
{
}

View file

@ -0,0 +1,2 @@
{
}

View file

@ -0,0 +1,23 @@
[
{
desc = "Open the file path under the cursor, making the file if it doesn't exist.";
key = "gf";
mode = "n";
action = ":cd %:p:h<CR>:e <cfile><CR>";
silent = true;
}
{
desc = "";
key = "<C-u>";
mode = "n";
action = "<C-u>zz";
silent = true;
}
{
desc = "";
key = "<C-d>";
mode = "n";
action = "<C-d>zz";
silent = true;
}
]

View file

@ -0,0 +1,29 @@
{
enableExtraDiagnostics = true;
enableFormat = true;
enableTreesitter = true;
bash.enable = true;
clang.enable = true;
csharp.enable = true;
css.enable = true;
go.enable = true;
html.enable = true;
lua.enable = true;
markdown.enable = true;
markdown.extensions.markview-nvim.enable = true;
markdown.format.type = "prettierd";
nix = {
enable = true;
format.type = "nixfmt";
lsp.server = "nil";
};
python.enable = true;
python.lsp.server = "python-lsp-server";
rust.enable = true;
rust.crates.enable = true;
ts.enable = true;
ts.extensions.ts-error-translator.enable = true;
typst.enable = true;
typst.extensions.typst-preview-nvim.enable = true;
yaml.enable = true;
}

View file

@ -0,0 +1,9 @@
{
enable = true;
formatOnSave = true;
inlayHints.enable = true;
lightbulb.enable = true;
lspkind.enable = true;
null-ls.enable = true;
otter-nvim.enable = true;
}

View file

@ -0,0 +1,5 @@
{
harpoon = {
enable = true;
};
}

View file

@ -0,0 +1,3 @@
{
todo-comments.enable = true;
}

View file

@ -0,0 +1,2 @@
{
}

View file

@ -0,0 +1,11 @@
{
scroll = 1;
autoindent = true;
backspace = "indent,eol,start";
cursorline = true;
expandtab = true;
shiftwidth = 2;
smartindent = true;
tabstop = 2;
updatetime = 0;
}

View file

@ -0,0 +1,6 @@
{
luasnip = {
enable = true;
setupOpts.enable_autosnippets = true;
};
}

View file

@ -0,0 +1,12 @@
{
lualine = {
enable = true;
refresh = {
statusline = 10;
winbar = 10;
};
activeSection = {
};
};
}

View file

@ -0,0 +1,6 @@
{
autotagHtml = true;
fold = true;
indent.disable = [ "markdown" ];
textobjects.enable = true;
}

View file

@ -0,0 +1,13 @@
{
borders = {
enable = true;
globalStyle = "rounded";
};
breadcrumbs.enable = true;
colorizer.enable = true;
illuminate.enable = true;
noice.enable = true;
noice.setupOpts.notify.enabled = false;
nvim-ufo.enable = true;
smartcolumn.enable = true;
}

View file

@ -0,0 +1,14 @@
{
ccc.enable = true;
leetcode-nvim.enable = true;
mkdir.enable = true;
motion.hop.enable = true;
yazi-nvim = {
enable = true;
mappings = {
openYazi = "<leader>tt";
openYaziDir = "<leader>TT";
};
setupOpts.open_for_directories = true;
};
}

View file

@ -0,0 +1,8 @@
{
indent-blankline.enable = true;
fidget-nvim.enable = true;
fidget-nvim.setupOpts.notification.override_vim_notify = true;
nvim-cursorline.enable = true;
nvim-web-devicons.enable = true;
rainbow-delimiters.enable = true;
}

View file

@ -0,0 +1,38 @@
{ lib, pkgs, ... }:
let
inherit (lib) singleton;
in
{
home.sessionVariables.EDITOR = "nvim";
persistDirs = singleton ".local/share/nvf";
programs.nvf.enable = true;
programs.nvf.settings.vim = {
startPlugins = [ pkgs.pantheon.snippets ];
hideSearchHighlight = true;
syntaxHighlighting = true;
telescope.enable = true;
searchCase = "ignore";
undoFile.enable = true;
fzf-lua.enable = true;
git.enable = true;
git.gitsigns.enable = false;
autopairs.nvim-autopairs.enable = true;
autocomplete = import ./_nvf/autocomplete.nix { inherit lib; };
binds = import ./_nvf/binds.nix;
clipboard = import ./_nvf/clipboard.nix;
diagnostics = import ./_nvf/diagnostics.nix;
keymaps = import ./_nvf/keymaps.nix;
languages = import ./_nvf/languages.nix;
lsp = import ./_nvf/lsp.nix;
navigation = import ./_nvf/navigation.nix;
notes = import ./_nvf/notes.nix;
options = import ./_nvf/options.nix;
notify = import ./_nvf/notify.nix;
snippets = import ./_nvf/snippets.nix;
statusline = import ./_nvf/statusline.nix;
treesitter = import ./_nvf/treesitter.nix;
ui = import ./_nvf/ui.nix;
utility = import ./_nvf/utility.nix;
visuals = import ./_nvf/visuals.nix;
};
}

View file

@ -6,7 +6,7 @@
...
}:
let
inherit (lib) optional;
inherit (lib) singleton optional;
inherit (inputs) import-tree;
mkEmailAccount = address: {
inherit address;
@ -26,7 +26,7 @@ let
};
in
{
imports = optional osConfig.desktop.enable (import-tree ./desktop);
imports = (optional osConfig.desktop.enable (import-tree ./desktop)) ++ singleton (import-tree ./cli);
config = {
accounts = {
@ -46,7 +46,6 @@ in
screensaver.enable = true;
screensaver.timeout = "100";
screensaver.command = "cbonsai -S -w 0.1 -L 40 -M 2 -b 2";
editor = "nvf";
file-browser = "yazi";
multiplexer = "zellij";
fetch = "hyfetch";