fix indents

This commit is contained in:
2026-05-03 10:10:41 -05:00
parent 0d73aa3087
commit 4f117ac83f
+31 -13
View File
@@ -4,15 +4,13 @@
lib,
inputs,
...
}:
let
}: let
program = "nvf";
cfg = config.dots.${program};
isLinux = pkgs.stdenv.isLinux;
isDarwin = pkgs.stdenv.isDarwin;
#sec = sops.secrets;
in
{
in {
options.dots.${program} = {
enable = lib.mkEnableOption "enables ${program}";
};
@@ -28,14 +26,13 @@ in
vim = {
clipboard =
# On Linux, use wl-copy as you do now
if isLinux then
{
if isLinux
then {
enable = true;
providers.wl-copy.enable = true;
registers = "unnamed,unnamedplus";
}
else
{
else {
enable = true;
registers = "unnamed,unnamedplus";
};
@@ -47,12 +44,35 @@ in
vimAlias = true;
lsp.enable = true;
# fix indents
autocmds = [
{
enable = true;
event = ["BufEnter"];
pattern = ["*"];
command = "setlocal indentexpr=nvim_treesitter#indent()";
}
];
lsp = {
enable = true;
formatOnSave = true;
};
statusline.lualine.enable = true;
telescope.enable = true;
autocomplete.nvim-cmp.enable = true;
autopairs.nvim-autopairs.enable = true;
treesitter = {
enable = true;
grammars = pkgs.vimPlugins.nvim-treesitter.allGrammars;
indent = {
enable = true;
};
};
keymaps = [
# visual line movement (insert mode)
{
@@ -157,7 +177,6 @@ in
];
options = {
# line numbers
number = true;
numberwidth = 2;
@@ -168,10 +187,7 @@ in
shiftwidth = 2;
softtabstop = -1;
expandtab = true;
smarttab = true;
autoindent = true;
cindent = true;
smartindent = true;
# search
ignorecase = true;
@@ -197,6 +213,8 @@ in
nix = {
enable = true;
treesitter.enable = true;
treesitter.package = pkgs.vimPlugins.nvim-treesitter.grammarPlugins.nix;
format = {
enable = true;
type = ["alejandra"];