neovim config

This commit is contained in:
2023-11-20 18:40:30 +01:00
parent 206194af6a
commit 20387d6f41
5 changed files with 415 additions and 2 deletions

236
flake.lock generated
View File

@@ -18,6 +18,103 @@
"type": "github"
}
},
"beautysh": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
],
"poetry2nix": "poetry2nix",
"utils": "utils"
},
"locked": {
"lastModified": 1680308980,
"narHash": "sha256-aUEHV0jk2qIFP3jlsWYWhBbm+w/N9gzH3e4I5DcdB5s=",
"owner": "lovesegfault",
"repo": "beautysh",
"rev": "9845efc3ea3e86cc0d41465d720a47f521b2799c",
"type": "github"
},
"original": {
"owner": "lovesegfault",
"repo": "beautysh",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"nixvim",
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -54,6 +151,22 @@
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1685801374,
"narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c37ca420157f4abc31e26f436c1145f8951ff373",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1700204040,
@@ -70,11 +183,132 @@
"type": "github"
}
},
"nixvim": {
"inputs": {
"beautysh": "beautysh",
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
],
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1700392689,
"narHash": "sha256-5eHyyjJjWOORscfN6byD4wuV6qH2g0kN+N3OP8MybL4=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "c2ccb2dfabbac067193119cae4fd46d78acc03a2",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"poetry2nix": {
"inputs": {
"flake-utils": [
"nixvim",
"beautysh",
"utils"
],
"nixpkgs": [
"nixvim",
"beautysh",
"nixpkgs"
]
},
"locked": {
"lastModified": 1658665240,
"narHash": "sha256-/wkx7D7enyBPRjIkK0w7QxLQhzEkb3UxNQnjyc3FTUI=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "8b8edc85d24661d5a6d0d71d6a7011f3e699780f",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils_2",
"gitignore": "gitignore",
"nixpkgs": [
"nixvim",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1699271226,
"narHash": "sha256-8Jt1KW3xTjolD6c6OjJm9USx/jmL+VVmbooADCkdDfU=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "ea758da1a6dcde6dc36db348ed690d09b9864128",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"ags": "ags",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_2",
"nixvim": "nixvim"
}
},
"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"
}
},
"utils": {
"locked": {
"lastModified": 1678901627,
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},

View File

@@ -10,9 +10,14 @@
ags = {
url = "github:Aylur/ags";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {nixpkgs, home-manager, ags, ...}:
outputs = {nixpkgs, home-manager, ags, nixvim, ...}:
let
username = "theaninova";
system = "x86_64-linux";
@@ -36,6 +41,7 @@
modules = [
ags.homeManagerModules.default
home
nixvim.homeManagerModules.nixvim
];
};
};

20
nushell/config.nu Normal file
View File

@@ -0,0 +1,20 @@
let carapace_completer = { |spans|
carapace $spans.0 nushell $spans | from json
}
$env.config = {
show_banner: false,
completions: {
case_sensitive: false
quick: true
partial: true
algorithm: "fuzzy"
external: {
enable: true
max_results: 100
completer: $carapace_completer
}
}
}
$env.PATH = ($env.PATH | split row (char esep) | append /usr/bin/env)

View File

@@ -4,4 +4,37 @@
zsh = import ./programs/zsh.nix { inherit pkgs; };
rbw = import ./programs/bitwarden.nix;
git = import ./programs/git.nix;
nixvim = import ./programs/nixvim.nix { inherit pkgs; };
nushell = {
enable = true;
extraConfig = ''
let carapace_completer = { |spans|
carapace $spans.0 nushell $spans | from json
}
$env.config = {
show_banner: false,
completions: {
case_sensitive: false
quick: true
partial: true
algorithm: "fuzzy"
external: {
enable: true
max_results: 100
completer: $carapace_completer
}
}
}
$env.PATH = ($env.PATH | split row (char esep) | append /usr/bin/env)
$env.EDITOR = nvim
'';
};
carapace = {
enable = true;
enableNushellIntegration = true;
};
}

120
programs/nixvim.nix Normal file
View File

@@ -0,0 +1,120 @@
{ pkgs }:
{
enable = true;
options = {
number = true;
relativenumber = true;
tabstop = 2;
softtabstop = 2;
shiftwidth = 2;
expandtab = true;
smartindent = true;
scrolloff = 8;
termguicolors = true;
fillchars.eob = " ";
};
keymaps = [
{ key = "<F9>"; mode = "n"; action = "<cmd>:UndotreeToggle<CR>"; }
];
globals = {
minimap_width = 10;
minimap_auto_start = 1;
minimap_auto_start_win_enter = 1;
};
clipboard = {
register = "unnamedplus";
providers.wl-copy.enable = true;
};
extraConfigVim = ''
hi Normal guibg=NONE ctermbg=NONE
'';
colorschemes.gruvbox = {
enable = true;
trueColor = true;
bold = true;
italics = true;
undercurl = true;
underline = true;
transparentBg = true;
};
plugins = {
lualine.enable = true;
gitblame.enable = true;
fidget.enable = true;
indent-blankline = {
enable = true;
indent.char = "";
};
rainbow-delimiters.enable = true;
nvim-autopairs.enable = true;
illuminate.enable = true;
nvim-colorizer.enable = true;
undotree.enable = true;
treesitter = {
enable = true;
indent = true;
};
none-ls.enable = true;
lspsaga = {
enable = true;
};
lsp-format.enable = true;
lsp = {
enable = true;
keymaps = {
diagnostic = {
};
};
servers = {
html.enable = true;
cssls.enable = true;
svelte.enable = true;
eslint.enable = true;
tsserver.enable = true;
yamlls.enable = true;
jsonls.enable = true;
taplo.enable = true;
rust-analyzer.enable = true;
pylsp.enable = true;
nixd.enable = true;
bashls.enable = true;
};
};
nvim-cmp = {
enable = true;
mapping = {
"<F7>" = "cmp.mapping.select_next_item({behavior = cmp.SelectBehavior.Select})";
"<F5>" = "cmp.mapping.select_prev_item({behavior = cmp.SelectBehavior.Select})";
"<F6>" = "cmp.mapping.confirm({select = true})";
};
sources = [
{ name = "buffer"; }
{ name = "path"; }
{ name = "nvim_lsp"; }
{ name = "npm"; }
];
};
nix.enable = true;
};
extraPlugins = with pkgs.vimPlugins; [
minimap-vim
];
}