feat(home): move nvf config to homes and use home-manager modules
This commit is contained in:
parent
af7226d30e
commit
1a3ff4b92a
21 changed files with 40 additions and 50 deletions
31
homes/x86_64-linux/rafiq/cli/editor/_nvf/autocomplete.nix
Normal file
31
homes/x86_64-linux/rafiq/cli/editor/_nvf/autocomplete.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
15
homes/x86_64-linux/rafiq/cli/editor/_nvf/binds.nix
Normal file
15
homes/x86_64-linux/rafiq/cli/editor/_nvf/binds.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
hardtime-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
max_count = 1;
|
||||
disabled_keys = {
|
||||
"<Up>" = [ ];
|
||||
"<Down>" = [ ];
|
||||
"<Right>" = [ ];
|
||||
"<Left>" = [ ];
|
||||
};
|
||||
};
|
||||
};
|
||||
whichKey.enable = true;
|
||||
}
|
2
homes/x86_64-linux/rafiq/cli/editor/_nvf/clipboard.nix
Normal file
2
homes/x86_64-linux/rafiq/cli/editor/_nvf/clipboard.nix
Normal file
|
@ -0,0 +1,2 @@
|
|||
{
|
||||
}
|
2
homes/x86_64-linux/rafiq/cli/editor/_nvf/diagnostics.nix
Normal file
2
homes/x86_64-linux/rafiq/cli/editor/_nvf/diagnostics.nix
Normal file
|
@ -0,0 +1,2 @@
|
|||
{
|
||||
}
|
23
homes/x86_64-linux/rafiq/cli/editor/_nvf/keymaps.nix
Normal file
23
homes/x86_64-linux/rafiq/cli/editor/_nvf/keymaps.nix
Normal 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;
|
||||
}
|
||||
]
|
29
homes/x86_64-linux/rafiq/cli/editor/_nvf/languages.nix
Normal file
29
homes/x86_64-linux/rafiq/cli/editor/_nvf/languages.nix
Normal 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;
|
||||
}
|
9
homes/x86_64-linux/rafiq/cli/editor/_nvf/lsp.nix
Normal file
9
homes/x86_64-linux/rafiq/cli/editor/_nvf/lsp.nix
Normal 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;
|
||||
}
|
5
homes/x86_64-linux/rafiq/cli/editor/_nvf/navigation.nix
Normal file
5
homes/x86_64-linux/rafiq/cli/editor/_nvf/navigation.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
harpoon = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
3
homes/x86_64-linux/rafiq/cli/editor/_nvf/notes.nix
Normal file
3
homes/x86_64-linux/rafiq/cli/editor/_nvf/notes.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
todo-comments.enable = true;
|
||||
}
|
2
homes/x86_64-linux/rafiq/cli/editor/_nvf/notify.nix
Normal file
2
homes/x86_64-linux/rafiq/cli/editor/_nvf/notify.nix
Normal file
|
@ -0,0 +1,2 @@
|
|||
{
|
||||
}
|
11
homes/x86_64-linux/rafiq/cli/editor/_nvf/options.nix
Normal file
11
homes/x86_64-linux/rafiq/cli/editor/_nvf/options.nix
Normal 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;
|
||||
}
|
6
homes/x86_64-linux/rafiq/cli/editor/_nvf/snippets.nix
Normal file
6
homes/x86_64-linux/rafiq/cli/editor/_nvf/snippets.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
luasnip = {
|
||||
enable = true;
|
||||
setupOpts.enable_autosnippets = true;
|
||||
};
|
||||
}
|
12
homes/x86_64-linux/rafiq/cli/editor/_nvf/statusline.nix
Normal file
12
homes/x86_64-linux/rafiq/cli/editor/_nvf/statusline.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
lualine = {
|
||||
enable = true;
|
||||
refresh = {
|
||||
statusline = 10;
|
||||
winbar = 10;
|
||||
};
|
||||
activeSection = {
|
||||
|
||||
};
|
||||
};
|
||||
}
|
6
homes/x86_64-linux/rafiq/cli/editor/_nvf/treesitter.nix
Normal file
6
homes/x86_64-linux/rafiq/cli/editor/_nvf/treesitter.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
autotagHtml = true;
|
||||
fold = true;
|
||||
indent.disable = [ "markdown" ];
|
||||
textobjects.enable = true;
|
||||
}
|
13
homes/x86_64-linux/rafiq/cli/editor/_nvf/ui.nix
Normal file
13
homes/x86_64-linux/rafiq/cli/editor/_nvf/ui.nix
Normal 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;
|
||||
}
|
14
homes/x86_64-linux/rafiq/cli/editor/_nvf/utility.nix
Normal file
14
homes/x86_64-linux/rafiq/cli/editor/_nvf/utility.nix
Normal 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;
|
||||
};
|
||||
}
|
8
homes/x86_64-linux/rafiq/cli/editor/_nvf/visuals.nix
Normal file
8
homes/x86_64-linux/rafiq/cli/editor/_nvf/visuals.nix
Normal 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;
|
||||
}
|
38
homes/x86_64-linux/rafiq/cli/editor/default.nix
Normal file
38
homes/x86_64-linux/rafiq/cli/editor/default.nix
Normal 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;
|
||||
};
|
||||
}
|
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue