170 lines
5.6 KiB
Nix
170 lines
5.6 KiB
Nix
{ pkgs, lib, ... }:
|
|
let
|
|
nixvim = import (builtins.fetchGit {
|
|
url = "https://github.com/nix-community/nixvim";
|
|
ref = "nixos-23.05";
|
|
});
|
|
vim-shot-f = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
|
pname = "vim-shot-f";
|
|
version = "2016-02-05";
|
|
src = pkgs.fetchFromGitHub {
|
|
owner = "deris";
|
|
repo = "vim-shot-f";
|
|
rev = "eea71d2a1038aa87fe175de9150b39dc155e5e7f";
|
|
sha256 = "iAPvIs/lhW+w5kFTZKaY97D/kfCGtqKrJVFvZ8cHu+c=";
|
|
};
|
|
meta.homepage = "https://github.com/deris/vim-shot-f";
|
|
};
|
|
quick-scope = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
|
pname = "quick-scope";
|
|
version = "2.6.1";
|
|
src = pkgs.fetchFromGitHub {
|
|
owner = "deris";
|
|
repo = "quick-scope";
|
|
rev = "2.6.1";
|
|
sha256 = "iAPvIs/lhW+w5kFTZKaY97D/kfCGtqKrJVFvZ8cHu+c=";
|
|
};
|
|
meta.homepage = "https://github.com/unblevable/quick-scope";
|
|
};
|
|
in
|
|
{
|
|
imports = [
|
|
nixvim.homeManagerModules.nixvim
|
|
];
|
|
|
|
programs.nixvim = {
|
|
enable = true;
|
|
colorschemes.base16 = {
|
|
# FIXME Dynamic... or use stylix
|
|
enable = true;
|
|
colorscheme = "solarized-light";
|
|
|
|
};
|
|
plugins = {
|
|
# Catches attention when cursor changed position
|
|
# TODO Unmapped, do I still want to use it?
|
|
specs = {
|
|
enable = true;
|
|
min_jump = 5;
|
|
};
|
|
|
|
# Tabline
|
|
barbar.enable = true;
|
|
|
|
# Go to whatever
|
|
telescope = {
|
|
enable = true;
|
|
# FIXME Crashes nvim on startup, complaining about some keymap
|
|
# keymaps = {
|
|
# gF = "find_files";
|
|
# gf = "git_files";
|
|
# gB = "buffers";
|
|
# gl = "current_buffer_fuzzy_find";
|
|
# gL = "live_grep";
|
|
# gT = "tags";
|
|
# gt = "treesitter";
|
|
# gm = "marks";
|
|
# gh = "oldfiles";
|
|
# gH = "command_history";
|
|
# gS = "search_history";
|
|
# gC = "commands";
|
|
# gr = "lsp_references";
|
|
# ga = "lsp_code_actions";
|
|
# ge = "lsp_document_diagnostics";
|
|
# gE = "lsp_workspace_diagnostics";
|
|
# gd = "lsp_definitions";
|
|
# gs = "lsp_document_symbols";
|
|
# };
|
|
defaults = {
|
|
vimgrep_arguments = [
|
|
"${pkgs.ripgrep}/bin/rg"
|
|
"--color=never"
|
|
"--no-heading"
|
|
"--with-filename"
|
|
"--line-number"
|
|
"--column"
|
|
"--smart-case"
|
|
];
|
|
};
|
|
extensions.fzf-native = {
|
|
enable = true;
|
|
caseMode = "smart_case";
|
|
fuzzy = true;
|
|
overrideFileSorter = true;
|
|
overrideGenericSorter = true;
|
|
};
|
|
};
|
|
|
|
# Surrounding pairs
|
|
surround.enable = true; # Change surrounding pairs (e.g. brackets, quotes)
|
|
};
|
|
extraPlugins = with pkgs.vimPlugins; [
|
|
nvim-scrollview # Scroll bar
|
|
|
|
# Status line
|
|
feline-nvim # Customizable status line.
|
|
# TODO Abandonned. Maybe use lualine?
|
|
|
|
# Search/replace
|
|
vim-abolish # Regex for words, with case in mind
|
|
vim-easy-align # Aligning lines around a certain character
|
|
|
|
# Surrounding pairs
|
|
targets-vim # Better interaction with surrounding pairs
|
|
|
|
# f/F mode
|
|
vim-shot-f # Highlight relevant characters for f/F/t/T modes
|
|
quick-scope # Highlight relevant characters for f/F modes one per word but always
|
|
# FIXME Doesn't work here, :QuickScopeToggle doesn't even work
|
|
|
|
# Registers
|
|
registers-nvim # Show register content when pressing "
|
|
# TODO Doesn't work. Didn't work on Arch either
|
|
|
|
# Tags
|
|
vim-gutentags # Generate tags
|
|
symbols-outline-nvim # Show a symbol panel on the right
|
|
# TODO Fails on startup. Same on Arch. Config issue?
|
|
];
|
|
extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [
|
|
./vim/feline.lua
|
|
./vim/symbols-outline-nvim.lua
|
|
];
|
|
extraConfigVim = ''
|
|
" vim-gutentags
|
|
let g:gutentags_cache_dir = expand('~/.cache/nvim/tags')
|
|
'';
|
|
autoCmd = [
|
|
# vim-easy-align: Align Markdown tables
|
|
{ event = "FileType markdown"; command = "vmap <Bar> :EasyAlign*<Bar><Enter>"; }
|
|
];
|
|
|
|
# 23.11: Use keymaps, seems better
|
|
maps = {
|
|
# barbar
|
|
normal."<C-H>" = { action = "<Cmd>BufferPrevious<CR>"; silent = true; };
|
|
normal."<C-L>" = { action = "<Cmd>BufferNext<CR>"; silent = true; };
|
|
# TODO https://www.reddit.com/r/neovim/comments/mbj8m5/how_to_setup_ctrlshiftkey_mappings_in_neovim_and/
|
|
normal."<Space><C-H>" = { action = "<Cmd>BufferMovePrevious<CR>"; silent = true; };
|
|
normal."<Space><C-L>" = { action = "<Cmd>BufferMoveNext<CR>"; silent = true; };
|
|
# TODO gotos don't work
|
|
normal."<C-1>" = { action = "<Cmd>BufferGoto 1<CR>"; silent = true; };
|
|
normal."<C-2>" = { action = "<Cmd>BufferGoto 2<CR>"; silent = true; };
|
|
normal."<C-3>" = { action = "<Cmd>BufferGoto 3<CR>"; silent = true; };
|
|
normal."<C-4>" = { action = "<Cmd>BufferGoto 4<CR>"; silent = true; };
|
|
normal."<C-5>" = { action = "<Cmd>BufferGoto 5<CR>"; silent = true; };
|
|
normal."<C-6>" = { action = "<Cmd>BufferGoto 6<CR>"; silent = true; };
|
|
normal."<C-7>" = { action = "<Cmd>BufferGoto 7<CR>"; silent = true; };
|
|
normal."<C-8>" = { action = "<Cmd>BufferGoto 8<CR>"; silent = true; };
|
|
normal."<C-9>" = { action = "<Cmd>BufferGoto 9<CR>"; silent = true; };
|
|
normal."<C-0>" = { action = "<Cmd>BufferLast<CR>"; silent = true; };
|
|
normal."gb" = { action = "<Cmd>BufferPick<CR>"; silent = true; };
|
|
# TODO Other useful options?
|
|
|
|
# symbols-outline-nvim
|
|
normal."<Space>s" = { action = "<Cmd>SymbolsOutline<CR>"; silent = true; };
|
|
|
|
};
|
|
};
|
|
}
|