{ config, lib, pkgs, ... }: let cfg = config.jade.neovim; in with lib; { options.jade.neovim = { enable = mkEnableOption "Enable neovim"; }; config = mkIf cfg.enable { home-manager.users.jade = { pkgs,... } : { programs.neovim = { enable = true; viAlias = true; vimAlias = true; vimdiffAlias = true; # Plugins {{{ plugins = with pkgs.vimPlugins; [ nerdtree-git-plugin ctrlp-vim vim-nerdtree-syntax-highlight vim-devicons vim-nix { plugin = gruvbox-nvim; config = "colorscheme gruvbox"; } { plugin = nerdtree; config = "nmap :NERDTreeToggle"; } { plugin = nerdcommenter; config = '' vmap ++ NERDCommenterToggle nmap ++ NERDCommenterToggle ''; } ]; # }}} # Coc {{{ #coc = { #enable = true; #}; # }}} extraConfig = '' set fdm=marker nmap H _ vmap H _ nmap L $ vmap L $ " terminal normal mode tnoremap " j/k move virtual lines (wrapped) noremap j (v:count == 0 ? 'gj' : 'j') noremap k (v:count == 0 ? 'gk' : 'k') set relativenumber set number set smarttab set cindent set tabstop=4 set shiftwidth=4 " Emacs Insert mode/command mode hotkeys {{{ " movement inoremap inoremap inoremap inoremap cnoremap cnoremap cnoremap cnoremap inoremap $ inoremap _ cnoremap $ cnoremap _ inoremap inoremap inoremap ) inoremap ( cnoremap cnoremap cnoremap ) cnoremap ( inoremap ggi inoremap > Gi cnoremap ggi cnoremap > Gi " editing inoremap inoremap db inoremap de cnoremap cnoremap db cnoremap de inoremap / inoremap ? " }}} ''; }; }; }; }