{ inputs, pkgs, lib, theme, ... }: { imports = [ ./alpha.nix ./keymaps.nix inputs.nixvim.homeManagerModules.nixvim ] ++ lib.optional (builtins.isString theme) ../../../../../stylix/themes/${theme}/home-manager/nixvim.nix; # https://github.com/nix-community/nixvim home.packages = with pkgs; [ # Linters yamllint hadolint nixfmt-rfc-style vale clj-kondo ]; # Docs: # https://nix-community.github.io/nixvim/ programs.nixvim = { enable = true; viAlias = true; vimAlias = true; globals.mapleader = " "; globals.maplocalleader = " "; opts = { number = true; wrap = false; cursorline = true; cursorcolumn = true; shiftwidth = 2; breakindent = true; colorcolumn = "100"; showmode = false; termguicolors = true; }; extraConfigLuaPost = '' vim.opt.shell = '/run/current-system/sw/bin/fish' ''; plugins = { web-devicons.enable = true; # Git related # Gutter information for git modifications gitsigns.enable = true; # git plugin for vim fugitive.enable = true; # pretty stuff # Fancify markdown et al headlines.enable = true; # Rainbow matching {} [] () 's rainbow-delimiters.enable = true; # Colorize hex colors inline nvim-colorizer.enable = true; # Fancy popups, etc for vim noice = { enable = true; 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; }; }; notify = { enable = true; topDown = true; fps = 60; stages = "slide"; }; # Nix related # Nix language syntax highlighting / file type associations nix.enable = true; # Run nix develop / shell without exiting vim nix-develop.enable = true; # Efficiency # Multicursor support multicursors.enable = true; # auto bracket completion nvim-autopairs.enable = true; # Indentation guides indent-blankline.enable = true; # Surround text blocks vim-surround.enable = true; # Automatic indent intellitab.enable = true; # Better yank yanky.enable = true; # Layout Related # winbar that uses nvim-navic in order to get LSP context from your language server. barbecue.enable = true; # tab bar like Firefox or Chrome bufferline = { enable = true; settings = { options = { hover.enabled = true; separatorStyle = "slant"; offsets = [{ filetype = "NvimTree"; text = "File Explorer"; highlight = "EcovimNvimTreeTitle"; text_align = "center"; separator = true; }]; }; }; }; # sidebar file browser nvim-tree = { enable = true; diagnostics.enable = true; tab.sync.close = true; renderer = { highlightModified = "icon"; highlightOpenedFiles = "all"; indentMarkers.enable = true; }; }; # Terminal in vim toggleterm.enable = true; # Alerts / CodeActions trouble = { enable = true; settings = { auto_close = true; # cycle_results = false; # height = 14; # win_config = { # border = "rounded"; # }; }; }; # Code Related # Parser generator tool treesitter.enable = true; # Status column with click hanlers 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 = "."; }; }; # 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"]; }; }; # Popup to show shortcuts which-key = { enable = true; settings.win.border = "rounded"; settings.spec = [ # "b" = "Manage buffers..."; { __unkeyed-1 = "b"; group = "Buffers"; icon = "󰓩 "; } # "c" = "Colorscheme..."; { __unkeyed-1 = "c"; group = "Colorschemes"; icon = "󰉦 "; } # "g" = "Git Options..."; { __unkeyed-1 = "g"; group = "Git"; icon = " "; } # "l" = "LSP Options..."; { __unkeyed-1 = "l"; group = "LSP"; icon = "" ; } # "n" = "NvimTree / Noice..."; { __unkeyed-1 = "n"; group = "NvimTree / Noice"; icon = " "; } # "t" = "Trouble..."; { __unkeyed-1 = "t"; group = "Trouble"; icon = " "; } # "T" = "ToggleTerm..."; { __unkeyed-1 = "T"; group = "ToggleTerm"; icon = " "; } # "w" = "Manage Windows..."; { __unkeyed-1 = "w"; group = "Windows"; icon = " "; } # "wo" = "Open New..."; { __unkeyed-1 = "wo"; group = "Open New..."; icon = " "; } # "wr" = "Resize..."; { __unkeyed-1 = "wr"; group = "Resize"; icon = "󰩨 "; } # "m" = "Multicursor..."; { __unkeyed-1 = "m"; group = "Milticursor"; icon = "󰇀 "; } ]; }; # Airline / Powerline alternative lualine = { enable = true; settings = { componentSeparators = { right = "«"; left = "»"; }; sectionSeparators = { right = ""; left = ""; }; }; }; telescope = { enable = true; extensions.fzf-native.enable = true; keymaps = { "" = { action = "find_files"; options.desc = "Search files by name"; }; "s" = { action = "live_grep"; options.desc = "Search by live grep"; }; "bl" = { action = "buffers"; options.desc = "[L]list open [B]uffers"; }; "h" = { action = "help_tags"; options.desc = "Search [H]elp"; }; "W" = { action = "grep_string"; options.desc = "Search for [W]ord under cursor"; }; "gs" = { action = "git_status"; options.desc = "Search [G]it [S]tatus"; }; "gl" = { action = "git_commits"; options.desc = "View [G]it [L]ogs"; }; "r" = { action = "oldfiles"; options.desc = "Search [R]ecently opened files by name"; }; "cs" = { action = "colorscheme"; options.desc = "Change [C]olor[s]cheme"; }; }; }; }; colorschemes = { tokyonight.enable = true; gruvbox.enable = true; catppuccin.enable = true; dracula.enable = true; oxocarbon.enable = true; ayu.enable = true; kanagawa.enable = true; }; extraPlugins = with pkgs.vimPlugins; [ everforest onedark-nvim rose-pine rust-vim outline-nvim ]; }; }