2024-02-16 07:39:00 +01:00
|
|
|
{ inputs, pkgs, lib, theme, ... }: {
|
2024-02-16 08:42:55 +01:00
|
|
|
imports = [
|
2024-02-19 14:21:29 +01:00
|
|
|
./alpha.nix
|
2024-04-02 11:23:07 +02:00
|
|
|
./keymaps.nix
|
2024-02-16 08:42:55 +01:00
|
|
|
inputs.nixvim.homeManagerModules.nixvim
|
2024-03-18 03:45:39 +01:00
|
|
|
] ++ lib.optional (builtins.isString theme) ../../../../../stylix/themes/${theme}/home-manager/nixvim.nix;
|
2024-08-14 01:26:41 +02:00
|
|
|
|
2024-02-16 08:42:55 +01:00
|
|
|
# https://github.com/nix-community/nixvim
|
2024-08-14 01:26:41 +02:00
|
|
|
home.packages = with pkgs; [
|
|
|
|
# Linters
|
|
|
|
yamllint
|
|
|
|
hadolint
|
|
|
|
nixfmt-rfc-style
|
2024-08-16 12:15:24 +02:00
|
|
|
vale
|
|
|
|
clj-kondo
|
2024-08-14 01:26:41 +02:00
|
|
|
];
|
2024-02-15 11:34:17 +01:00
|
|
|
|
2024-02-16 08:42:55 +01:00
|
|
|
# Docs:
|
|
|
|
# https://nix-community.github.io/nixvim/
|
|
|
|
programs.nixvim = {
|
|
|
|
enable = true;
|
|
|
|
viAlias = true;
|
|
|
|
vimAlias = true;
|
2024-02-15 02:43:27 +01:00
|
|
|
|
2024-02-16 08:42:55 +01:00
|
|
|
globals.mapleader = " ";
|
|
|
|
globals.maplocalleader = " ";
|
2024-02-15 02:43:27 +01:00
|
|
|
|
2024-06-12 12:15:32 +02:00
|
|
|
opts = {
|
2024-02-16 08:42:55 +01:00
|
|
|
number = true;
|
2024-02-18 13:41:10 +01:00
|
|
|
wrap = false;
|
2024-02-19 06:51:48 +01:00
|
|
|
cursorline = true;
|
|
|
|
cursorcolumn = true;
|
2024-02-16 08:42:55 +01:00
|
|
|
shiftwidth = 2;
|
|
|
|
breakindent = true;
|
2024-02-18 13:41:10 +01:00
|
|
|
colorcolumn = "100";
|
2024-02-16 08:42:55 +01:00
|
|
|
showmode = false;
|
2024-04-02 11:23:07 +02:00
|
|
|
termguicolors = true;
|
2024-02-16 08:42:55 +01:00
|
|
|
};
|
2024-02-16 07:39:00 +01:00
|
|
|
|
2024-04-04 14:22:50 +02:00
|
|
|
extraConfigLuaPost = ''
|
2024-06-19 12:55:40 +02:00
|
|
|
vim.opt.shell = '/run/current-system/sw/bin/fish'
|
2024-04-04 14:22:50 +02:00
|
|
|
'';
|
|
|
|
|
2024-02-16 08:42:55 +01:00
|
|
|
plugins = {
|
2024-12-03 19:29:00 +01:00
|
|
|
web-devicons.enable = true;
|
2024-04-01 05:38:00 +02:00
|
|
|
# Git related
|
|
|
|
# Gutter information for git modifications
|
|
|
|
gitsigns.enable = true;
|
|
|
|
# git plugin for vim
|
|
|
|
fugitive.enable = true;
|
|
|
|
|
|
|
|
# pretty stuff
|
2024-04-03 09:27:54 +02:00
|
|
|
# Fancify markdown et al
|
2024-06-12 12:15:32 +02:00
|
|
|
headlines.enable = true;
|
2024-04-01 05:38:00 +02:00
|
|
|
# Rainbow matching {} [] () 's
|
|
|
|
rainbow-delimiters.enable = true;
|
|
|
|
# Colorize hex colors inline
|
|
|
|
nvim-colorizer.enable = true;
|
2024-04-02 14:09:00 +02:00
|
|
|
# Fancy popups, etc for vim
|
|
|
|
noice = {
|
|
|
|
enable = true;
|
2024-12-03 19:29:00 +01:00
|
|
|
settings = {
|
|
|
|
presets = {
|
|
|
|
bottom_search = true;
|
|
|
|
command_palette = true;
|
|
|
|
long_message_to_split = false;
|
|
|
|
inc_rename = false;
|
|
|
|
lsp_doc_border = true;
|
|
|
|
};
|
|
|
|
lsp.hover.enabled = false;
|
|
|
|
popupmenu.enabled = false;
|
2024-04-03 13:41:32 +02:00
|
|
|
};
|
2024-04-02 14:09:00 +02:00
|
|
|
};
|
|
|
|
notify = {
|
|
|
|
enable = true;
|
|
|
|
topDown = true;
|
|
|
|
fps = 60;
|
|
|
|
stages = "slide";
|
|
|
|
};
|
2024-04-01 05:38:00 +02:00
|
|
|
|
|
|
|
# Nix related
|
|
|
|
# Nix language syntax highlighting / file type associations
|
|
|
|
nix.enable = true;
|
|
|
|
# Run nix develop / shell without exiting vim
|
|
|
|
nix-develop.enable = true;
|
|
|
|
|
|
|
|
# Efficiency
|
2024-02-16 11:13:19 +01:00
|
|
|
# Multicursor support
|
|
|
|
multicursors.enable = true;
|
2024-02-16 08:42:55 +01:00
|
|
|
# auto bracket completion
|
|
|
|
nvim-autopairs.enable = true;
|
2024-04-01 05:38:00 +02:00
|
|
|
# Indentation guides
|
|
|
|
indent-blankline.enable = true;
|
|
|
|
# Surround text blocks
|
2024-12-03 19:29:00 +01:00
|
|
|
vim-surround.enable = true;
|
2024-04-01 05:38:00 +02:00
|
|
|
# Automatic indent
|
|
|
|
intellitab.enable = true;
|
2024-06-30 07:09:18 +02:00
|
|
|
# Better yank
|
|
|
|
yanky.enable = true;
|
2024-04-01 05:38:00 +02:00
|
|
|
|
|
|
|
# Layout Related
|
2024-02-16 08:42:55 +01:00
|
|
|
# winbar that uses nvim-navic in order to get LSP context from your language server.
|
|
|
|
barbecue.enable = true;
|
|
|
|
# tab bar like Firefox or Chrome
|
2024-04-03 01:28:13 +02:00
|
|
|
bufferline = {
|
|
|
|
enable = true;
|
2024-12-03 19:29:00 +01:00
|
|
|
settings = {
|
|
|
|
options = {
|
|
|
|
hover.enabled = true;
|
|
|
|
separatorStyle = "slant";
|
|
|
|
offsets = [{
|
|
|
|
filetype = "NvimTree";
|
|
|
|
text = "File Explorer";
|
|
|
|
highlight = "EcovimNvimTreeTitle";
|
|
|
|
text_align = "center";
|
|
|
|
separator = true;
|
|
|
|
}];
|
|
|
|
};
|
|
|
|
};
|
2024-04-03 01:28:13 +02:00
|
|
|
};
|
|
|
|
|
2024-02-16 08:42:55 +01:00
|
|
|
# sidebar file browser
|
2024-04-03 01:28:13 +02:00
|
|
|
nvim-tree = {
|
|
|
|
enable = true;
|
|
|
|
diagnostics.enable = true;
|
2024-04-03 09:27:54 +02:00
|
|
|
tab.sync.close = true;
|
2024-04-03 01:28:13 +02:00
|
|
|
renderer = {
|
|
|
|
highlightModified = "icon";
|
|
|
|
highlightOpenedFiles = "all";
|
|
|
|
indentMarkers.enable = true;
|
|
|
|
};
|
|
|
|
};
|
2024-02-16 08:42:55 +01:00
|
|
|
# Terminal in vim
|
|
|
|
toggleterm.enable = true;
|
2024-04-01 05:38:00 +02:00
|
|
|
# Alerts / CodeActions
|
2024-04-03 01:28:13 +02:00
|
|
|
trouble = {
|
|
|
|
enable = true;
|
2024-06-12 14:27:57 +02:00
|
|
|
settings = {
|
|
|
|
auto_close = true;
|
2024-12-03 19:29:00 +01:00
|
|
|
# cycle_results = false;
|
|
|
|
# height = 14;
|
|
|
|
# win_config = {
|
|
|
|
# border = "rounded";
|
|
|
|
# };
|
2024-06-12 14:27:57 +02:00
|
|
|
};
|
2024-04-03 01:28:13 +02:00
|
|
|
};
|
2024-04-01 05:38:00 +02:00
|
|
|
|
|
|
|
# Code Related
|
|
|
|
# Parser generator tool
|
|
|
|
treesitter.enable = true;
|
2024-06-28 14:52:09 +02:00
|
|
|
# Status column with click hanlers
|
2024-06-29 07:58:04 +02:00
|
|
|
statuscol = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
bt_ignore = null;
|
|
|
|
clickhandlers = {
|
|
|
|
FoldClose = "require('statuscol.builtin').foldclose_click";
|
|
|
|
FoldOpen = "require('statuscol.builtin').foldopen_click";
|
|
|
|
FoldOther = "require('statuscol.builtin').foldother_click";
|
|
|
|
Lnum = "require('statuscol.builtin').lnum_click";
|
|
|
|
};
|
|
|
|
clickmod = "c";
|
|
|
|
ft_ignore = null;
|
|
|
|
relculright = true;
|
|
|
|
segments = [
|
|
|
|
{
|
|
|
|
click = "v:lua.ScFa";
|
|
|
|
text = [
|
|
|
|
"%C"
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
click = "v:lua.ScSa";
|
|
|
|
text = [
|
|
|
|
"%s"
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
click = "v:lua.ScLa";
|
|
|
|
condition = [
|
|
|
|
true
|
|
|
|
{
|
|
|
|
__raw = "require('statuscol.builtin').not_empty";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
text = [
|
|
|
|
{
|
|
|
|
__raw = "require('statuscol.builtin').lnumfunc";
|
|
|
|
}
|
|
|
|
" "
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
setopt = true;
|
|
|
|
thousands = ".";
|
|
|
|
};
|
|
|
|
};
|
2024-06-12 14:27:57 +02:00
|
|
|
|
2024-02-17 09:46:00 +01:00
|
|
|
# List of linters for nixvim
|
|
|
|
lint = {
|
|
|
|
enable = true;
|
|
|
|
lintersByFt = {
|
|
|
|
text = ["vale"];
|
|
|
|
json = ["jsonlint"];
|
|
|
|
markdown = ["vale"];
|
|
|
|
rst = ["vale"];
|
|
|
|
ruby = ["ruby"];
|
|
|
|
janet = ["janet"];
|
|
|
|
inko = ["inko"];
|
|
|
|
clojure = ["clj-kondo"];
|
|
|
|
dockerfile = ["hadolint"];
|
|
|
|
terraform = ["tflint"];
|
|
|
|
yaml = ["yamllint"];
|
|
|
|
nix = ["nix"];
|
|
|
|
};
|
|
|
|
};
|
2024-02-16 10:56:48 +01:00
|
|
|
|
2024-02-16 08:42:55 +01:00
|
|
|
# Popup to show shortcuts
|
|
|
|
which-key = {
|
|
|
|
enable = true;
|
2024-12-03 19:29:00 +01:00
|
|
|
settings.win.border = "rounded";
|
|
|
|
settings.spec = [
|
|
|
|
# "<leader>b" = "Manage buffers...";
|
|
|
|
{
|
|
|
|
__unkeyed-1 = "<leader>b";
|
|
|
|
group = "Buffers";
|
|
|
|
icon = " ";
|
|
|
|
}
|
|
|
|
# "<leader>c" = "Colorscheme...";
|
|
|
|
{
|
|
|
|
__unkeyed-1 = "<leader>c";
|
|
|
|
group = "Colorschemes";
|
|
|
|
icon = " ";
|
|
|
|
}
|
|
|
|
# "<leader>g" = "Git Options...";
|
|
|
|
{
|
|
|
|
__unkeyed-1 = "<leader>g";
|
|
|
|
group = "Git";
|
|
|
|
icon = " ";
|
|
|
|
}
|
|
|
|
# "<leader>l" = "LSP Options...";
|
|
|
|
{
|
|
|
|
__unkeyed-1 = "<leader>l";
|
|
|
|
group = "LSP";
|
|
|
|
icon = "" ;
|
|
|
|
}
|
|
|
|
# "<leader>n" = "NvimTree / Noice...";
|
|
|
|
{
|
|
|
|
__unkeyed-1 = "<leader>n";
|
|
|
|
group = "NvimTree / Noice";
|
|
|
|
icon = " ";
|
|
|
|
}
|
|
|
|
# "<leader>t" = "Trouble...";
|
|
|
|
{
|
|
|
|
__unkeyed-1 = "<leader>t";
|
|
|
|
group = "Trouble";
|
|
|
|
icon = " ";
|
|
|
|
}
|
|
|
|
# "<leader>T" = "ToggleTerm...";
|
|
|
|
{
|
|
|
|
__unkeyed-1 = "<leader>T";
|
|
|
|
group = "ToggleTerm";
|
|
|
|
icon = " ";
|
|
|
|
}
|
|
|
|
# "<leader>w" = "Manage Windows...";
|
|
|
|
{
|
|
|
|
__unkeyed-1 = "<leader>w";
|
|
|
|
group = "Windows";
|
|
|
|
icon = " ";
|
|
|
|
}
|
|
|
|
# "<leader>wo" = "Open New...";
|
|
|
|
{
|
|
|
|
__unkeyed-1 = "<leader>wo";
|
|
|
|
group = "Open New...";
|
|
|
|
icon = " ";
|
|
|
|
}
|
|
|
|
# "<leader>wr" = "Resize...";
|
|
|
|
{
|
|
|
|
__unkeyed-1 = "<leader>wr";
|
|
|
|
group = "Resize";
|
|
|
|
icon = " ";
|
|
|
|
}
|
|
|
|
# "<leader>m" = "Multicursor...";
|
|
|
|
{
|
|
|
|
__unkeyed-1 = "<window>m";
|
|
|
|
group = "Milticursor";
|
|
|
|
icon = " ";
|
|
|
|
}
|
|
|
|
];
|
2024-02-16 08:42:55 +01:00
|
|
|
};
|
2024-02-15 02:43:27 +01:00
|
|
|
|
2024-02-16 08:42:55 +01:00
|
|
|
# Airline / Powerline alternative
|
|
|
|
lualine = {
|
|
|
|
enable = true;
|
2024-12-03 19:29:00 +01:00
|
|
|
settings = {
|
|
|
|
componentSeparators = {
|
|
|
|
right = "«";
|
|
|
|
left = "»";
|
|
|
|
};
|
|
|
|
sectionSeparators = {
|
|
|
|
right = "";
|
|
|
|
left = "";
|
|
|
|
};
|
2024-02-19 04:17:22 +01:00
|
|
|
};
|
2024-02-16 08:42:55 +01:00
|
|
|
};
|
2024-02-15 02:43:27 +01:00
|
|
|
|
2024-02-16 08:42:55 +01:00
|
|
|
telescope = {
|
|
|
|
enable = true;
|
|
|
|
extensions.fzf-native.enable = true;
|
|
|
|
keymaps = {
|
|
|
|
"<leader><leader>" = {
|
|
|
|
action = "find_files";
|
2024-06-12 12:15:32 +02:00
|
|
|
options.desc = "Search files by name";
|
2024-02-16 08:42:55 +01:00
|
|
|
};
|
|
|
|
"<leader>s" = {
|
|
|
|
action = "live_grep";
|
2024-06-12 12:15:32 +02:00
|
|
|
options.desc = "Search by live grep";
|
2024-02-16 08:42:55 +01:00
|
|
|
};
|
|
|
|
"<leader>bl" = {
|
|
|
|
action = "buffers";
|
2024-06-12 12:15:32 +02:00
|
|
|
options.desc = "[L]list open [B]uffers";
|
2024-02-16 08:42:55 +01:00
|
|
|
};
|
|
|
|
"<leader>h" = {
|
|
|
|
action = "help_tags";
|
2024-06-12 12:15:32 +02:00
|
|
|
options.desc = "Search [H]elp";
|
2024-02-16 08:42:55 +01:00
|
|
|
};
|
|
|
|
"<leader>W" = {
|
|
|
|
action = "grep_string";
|
2024-06-12 12:15:32 +02:00
|
|
|
options.desc = "Search for [W]ord under cursor";
|
2024-02-16 08:42:55 +01:00
|
|
|
};
|
|
|
|
"<leader>gs" = {
|
|
|
|
action = "git_status";
|
2024-06-12 12:15:32 +02:00
|
|
|
options.desc = "Search [G]it [S]tatus";
|
2024-02-16 08:42:55 +01:00
|
|
|
};
|
|
|
|
"<leader>gl" = {
|
|
|
|
action = "git_commits";
|
2024-06-12 12:15:32 +02:00
|
|
|
options.desc = "View [G]it [L]ogs";
|
2024-02-16 08:42:55 +01:00
|
|
|
};
|
|
|
|
"<leader>r" = {
|
|
|
|
action = "oldfiles";
|
2024-06-12 12:15:32 +02:00
|
|
|
options.desc = "Search [R]ecently opened files by name";
|
2024-02-16 08:42:55 +01:00
|
|
|
};
|
|
|
|
"<leader>cs" = {
|
|
|
|
action = "colorscheme";
|
2024-06-12 12:15:32 +02:00
|
|
|
options.desc = "Change [C]olor[s]cheme";
|
2024-02-16 08:42:55 +01:00
|
|
|
};
|
2024-02-15 02:43:27 +01:00
|
|
|
};
|
2024-02-16 08:42:55 +01:00
|
|
|
};
|
2024-04-03 13:07:58 +02:00
|
|
|
};
|
2024-02-16 08:42:55 +01:00
|
|
|
|
|
|
|
colorschemes = {
|
|
|
|
tokyonight.enable = true;
|
|
|
|
gruvbox.enable = true;
|
|
|
|
catppuccin.enable = true;
|
|
|
|
dracula.enable = true;
|
|
|
|
oxocarbon.enable = true;
|
2024-04-02 11:23:07 +02:00
|
|
|
ayu.enable = true;
|
|
|
|
kanagawa.enable = true;
|
2024-02-15 02:43:27 +01:00
|
|
|
};
|
2024-03-30 07:27:21 +01:00
|
|
|
|
2024-02-16 08:42:55 +01:00
|
|
|
extraPlugins = with pkgs.vimPlugins; [
|
|
|
|
everforest
|
2024-04-02 11:23:07 +02:00
|
|
|
onedark-nvim
|
2024-02-16 08:42:55 +01:00
|
|
|
rose-pine
|
2024-04-04 14:22:50 +02:00
|
|
|
rust-vim
|
2024-06-12 14:27:57 +02:00
|
|
|
outline-nvim
|
2024-02-16 08:42:55 +01:00
|
|
|
];
|
|
|
|
};
|
2024-02-15 02:43:27 +01:00
|
|
|
}
|