{ pkgs, ... }: let map = mode: key: action: { inherit mode key action; }; in { home = { sessionVariables = { EDITOR = "nvim"; }; }; imports = [ ./options.nix ./plugins.nix ]; programs.nixvim = { enable = true; globals.mapleader = " "; globals.maplocalleader = " "; viAlias = true; vimAlias = true; # Highlight and remove extra white spaces # same color as cursorline as per # https://github.com/joshdick/onedark.vim/blob/390b893d361c356ac1b00778d849815f2aa44ae4/autoload/onedark.vim highlight.ExtraWhitespace.bg = "#2C323C"; match.ExtraWhitespace = "\\s\\+$"; clipboard.providers.wl-copy.enable = true; performance = { byteCompileLua.enable = true; combinePlugins = { enable = true; standalonePlugins = [ # clashes with lualine "onedark.nvim" ]; }; }; extraLuaPackages = ps: [ ps.magick ]; extraPackages = [ pkgs.imagemagick ]; # package = pkgs.neovim-unwrapped; package = (pkgs.neovim-unwrapped.override { lua = pkgs.luajit; }).overrideAttrs (_: { version = "git"; src = pkgs.fetchFromGitHub { owner = "neovim"; repo = "neovim"; rev = "76dcc7029b200e1d85024d7ba4a34c602e730dbe"; hash = "sha256-y3LmGebXuQhLz9w1IzkDU8b464WvMvPCbIImpVvxmcI="; }; buildInputs = [ (pkgs.utf8proc.overrideAttrs (_: { version = "git"; src = pkgs.fetchFromGitHub { owner = "JuliaStrings"; repo = "utf8proc"; rev = "3de4596fbe28956855df2ecb3c11c0bbc3535838"; hash = "sha256-DNnrKLwks3hP83K56Yjh9P3cVbivzssblKIx4M/RKqw="; }; })) ] ++ pkgs.neovim-unwrapped.buildInputs ++ pkgs.neovim-unwrapped.nativeBuildInputs; }); keymaps = [ { key = ""; action = "Lspsaga rename"; } { key = "o"; action = "Lspsaga outline"; } { key = "."; action = "Lspsaga code_action"; } # { # key = "/"; # action = "lua require('spectre').open_file_search({select_word=true})"; # } (map "n" "t" "Neotree toggle") # tab for indent/dedent (map "n" "" ">>_") (map "n" "" "<<_") (map "i" "" "") (map "v" "" ">gv") (map "v" "" "