fix indents
This commit is contained in:
@@ -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,17 +26,16 @@ in
|
||||
vim = {
|
||||
clipboard =
|
||||
# On Linux, use wl-copy as you do now
|
||||
if isLinux then
|
||||
{
|
||||
enable = true;
|
||||
providers.wl-copy.enable = true;
|
||||
registers = "unnamed,unnamedplus";
|
||||
}
|
||||
else
|
||||
{
|
||||
enable = true;
|
||||
registers = "unnamed,unnamedplus";
|
||||
};
|
||||
if isLinux
|
||||
then {
|
||||
enable = true;
|
||||
providers.wl-copy.enable = true;
|
||||
registers = "unnamed,unnamedplus";
|
||||
}
|
||||
else {
|
||||
enable = true;
|
||||
registers = "unnamed,unnamedplus";
|
||||
};
|
||||
|
||||
globals = {
|
||||
mapleader = " ";
|
||||
@@ -47,23 +44,46 @@ 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)
|
||||
{
|
||||
key = "<Up>";
|
||||
mode = [ "i" ];
|
||||
mode = ["i"];
|
||||
action = "<C-o>gk";
|
||||
desc = "Visual Line Up (Insert)";
|
||||
}
|
||||
{
|
||||
key = "<Down>";
|
||||
mode = [ "i" ];
|
||||
mode = ["i"];
|
||||
action = "<C-o>gj";
|
||||
desc = "Visual Line Down (Insert)";
|
||||
}
|
||||
@@ -95,7 +115,7 @@ in
|
||||
|
||||
{
|
||||
key = "gd";
|
||||
mode = [ "n" ];
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.definition()<CR>";
|
||||
desc = "Go to definition";
|
||||
@@ -103,7 +123,7 @@ in
|
||||
# Hover info
|
||||
{
|
||||
key = "K";
|
||||
mode = [ "n" ];
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.hover()<CR>";
|
||||
desc = "Hover info";
|
||||
@@ -111,7 +131,7 @@ in
|
||||
# Format buffer (Alejandra for Nix)
|
||||
{
|
||||
key = "<leader>F";
|
||||
mode = [ "n" ];
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.format({ async = true })<CR>";
|
||||
desc = "Format buffer";
|
||||
@@ -119,7 +139,7 @@ in
|
||||
# Code actions / quickfix
|
||||
{
|
||||
key = "<leader>a";
|
||||
mode = [ "n" ];
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.code_action()<CR>";
|
||||
desc = "Code action";
|
||||
@@ -127,7 +147,7 @@ in
|
||||
# Rename symbol
|
||||
{
|
||||
key = "<leader>r";
|
||||
mode = [ "n" ];
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.lsp.buf.rename()<CR>";
|
||||
desc = "Rename symbol";
|
||||
@@ -135,21 +155,21 @@ in
|
||||
# Diagnostics
|
||||
{
|
||||
key = "<leader>e";
|
||||
mode = [ "n" ];
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.diagnostic.open_float()<CR>";
|
||||
desc = "Show diagnostic";
|
||||
}
|
||||
{
|
||||
key = "[d";
|
||||
mode = [ "n" ];
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.diagnostic.goto_prev()<CR>";
|
||||
desc = "Previous diagnostic";
|
||||
}
|
||||
{
|
||||
key = "]d";
|
||||
mode = [ "n" ];
|
||||
mode = ["n"];
|
||||
silent = true;
|
||||
action = "<cmd>lua vim.diagnostic.goto_next()<CR>";
|
||||
desc = "Next diagnostic";
|
||||
@@ -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,9 +213,11 @@ in
|
||||
|
||||
nix = {
|
||||
enable = true;
|
||||
treesitter.enable = true;
|
||||
treesitter.package = pkgs.vimPlugins.nvim-treesitter.grammarPlugins.nix;
|
||||
format = {
|
||||
enable = true;
|
||||
type = [ "alejandra" ];
|
||||
type = ["alejandra"];
|
||||
#type = "nixfmt";
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user