nix/home-manager/common/software/cli/nixvim.nix

114 lines
3.5 KiB
Nix
Raw Normal View History

2024-02-08 11:40:29 +01:00
{ inputs, pkgs, config, lib, theme, ... }: {
2024-02-08 03:17:11 +01:00
imports = [
inputs.nixvim.homeManagerModules.nixvim
2024-02-08 12:55:26 +01:00
] ++ lib.optional (builtins.isString theme) ../../../../stylix/${theme}/home-manager/nixvim.nix;
2024-02-08 03:17:11 +01:00
programs.nixvim = {
enable = true;
2024-02-08 05:49:29 +01:00
viAlias = true;
vimAlias = true;
2024-02-08 06:23:38 +01:00
globals.mapleader = " ";
globals.maplocalleader = " ";
2024-02-08 06:23:59 +01:00
2024-02-08 03:17:11 +01:00
options = {
number = true;
shiftwidth = 2;
2024-02-08 06:26:53 +01:00
# Indent wrapped text.
breakindent = true;
colorcolumn = "100";
2024-02-08 12:54:42 +01:00
showmode = false;
2024-02-08 03:17:11 +01:00
};
2024-02-08 03:42:16 +01:00
plugins = {
2024-02-08 12:43:21 +01:00
treesitter.enable = true;
lualine.enable = true;
2024-02-08 12:55:16 +01:00
luasnip.enable = true;
2024-02-08 12:43:21 +01:00
nix.enable = true;
nix-develop.enable = true;
bufferline.enable = true;
which-key.enable = true;
intellitab.enable = true;
2024-02-08 12:55:16 +01:00
illuminate.enable = true;
2024-02-08 12:43:21 +01:00
neo-tree.enable = true;
gitsigns.enable = true;
toggleterm.enable = true;
rainbow-delimiters.enable = true;
2024-02-08 06:06:13 +01:00
telescope = {
enable = true;
2024-02-08 06:32:46 +01:00
extensions.fzf-native.enable = true;
keymaps = {
"<leader><leader>" = {
action = "find_files";
desc = "Search files by name";
};
2024-02-08 11:40:29 +01:00
"<leader>s" = {
2024-02-08 06:32:46 +01:00
action = "live_grep";
2024-02-08 12:08:01 +01:00
desc = "Search by live grep";
2024-02-08 06:32:46 +01:00
};
2024-02-08 11:40:29 +01:00
"<leader>b" = {
2024-02-08 06:32:46 +01:00
action = "buffers";
2024-02-08 12:08:01 +01:00
desc = "Search open [B]uffers by file name";
2024-02-08 06:32:46 +01:00
};
2024-02-08 11:40:29 +01:00
"<leader>h" = {
2024-02-08 06:32:46 +01:00
action = "help_tags";
2024-02-08 12:08:01 +01:00
desc = "Search [H]elp";
2024-02-08 06:32:46 +01:00
};
2024-02-08 11:40:29 +01:00
"<leader>w" = {
2024-02-08 06:32:46 +01:00
action = "grep_string";
2024-02-08 12:08:01 +01:00
desc = "Search for [W]ord under cursor";
2024-02-08 06:32:46 +01:00
};
2024-02-08 11:40:29 +01:00
"<leader>g" = {
2024-02-08 06:32:46 +01:00
action = "buffers";
2024-02-08 12:08:01 +01:00
desc = "Search [G]it files";
2024-02-08 06:32:46 +01:00
};
2024-02-08 11:40:29 +01:00
"<leader>r" = {
2024-02-08 06:32:46 +01:00
action = "oldfiles";
2024-02-08 12:08:01 +01:00
desc = "Search [R]ecently opened files by name";
2024-02-08 06:32:46 +01:00
};
2024-02-08 06:06:13 +01:00
};
};
2024-02-08 03:42:16 +01:00
lsp = {
enable = true;
servers = {
2024-02-08 03:44:30 +01:00
rust-analyzer = {
enable = true;
installCargo = true;
installRustc = true;
};
2024-02-08 04:04:30 +01:00
nixd.enable = true;
pylsp.enable = true;
html.enable = true;
cssls.enable = true;
bashls.enable = true;
2024-02-08 03:42:16 +01:00
};
};
2024-02-08 12:51:55 +01:00
2024-02-08 03:42:16 +01:00
nvim-cmp = {
enable = true;
autoEnableSources = true;
sources = [
{ name = "nvim_lsp"; }
{ name = "path"; }
{ name = "buffer"; }
];
};
};
2024-02-08 04:20:38 +01:00
2024-02-08 03:17:11 +01:00
colorschemes = {
2024-02-08 06:06:13 +01:00
tokyonight.enable = true;
gruvbox.enable = true;
oxocarbon.enable = true;
nord.enable = true;
catppuccin.enable = true;
kanagawa.enable = true;
dracula.enable = true;
2024-02-08 04:18:12 +01:00
2024-02-08 03:17:11 +01:00
};
2024-02-08 03:24:24 +01:00
extraPlugins = with pkgs.vimPlugins; [
2024-02-08 03:17:11 +01:00
everforest
];
};
2024-02-08 11:08:43 +01:00
}