From 44a85ad4fbb67636237138d71b087c28c8ae37b9 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Thu, 1 Sep 2022 21:23:12 +0200 Subject: [PATCH] kitty and neovim --- common.nix | 2 +- modules/default.nix | 1 + modules/neovim.nix | 114 +++++++++++++++++++++++++++++++++ modules/terminal.nix | 7 +- potatobook-g/configuration.nix | 1 + 5 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 modules/neovim.nix diff --git a/common.nix b/common.nix index 7eb494e..dee7cf9 100644 --- a/common.nix +++ b/common.nix @@ -94,7 +94,7 @@ with builtins; # missing: menu-qalc picom-jonaburg environment.systemPackages = with pkgs; [ - neovim wget git neofetch pciutils pavucontrol font-manager zip unzip gnutar + wget git neofetch pciutils pavucontrol font-manager zip unzip gnutar iw btop xdotool xorg.xwininfo nodejs gparted networkmanagerapplet mailspring betterdiscordctl pulseaudioFull speedtest-cli librewolf polymc jdk8 jdk11 jdk vlc xfce.thunar xfce.tumbler diff --git a/modules/default.nix b/modules/default.nix index 1b2fbd4..a093432 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -3,5 +3,6 @@ imports = [ ./desktop.nix ./terminal.nix + ./neovim.nix ]; } diff --git a/modules/neovim.nix b/modules/neovim.nix new file mode 100644 index 0000000..b03aef6 --- /dev/null +++ b/modules/neovim.nix @@ -0,0 +1,114 @@ +{ 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 ? + " }}} + ''; + }; + }; + }; +} diff --git a/modules/terminal.nix b/modules/terminal.nix index e544f1c..0ef98ef 100644 --- a/modules/terminal.nix +++ b/modules/terminal.nix @@ -6,7 +6,7 @@ in with lib; { enable = mkEnableOption "Enable Kitty"; }; config = mkIf cfg.enable { - home-manager.users.jade = { pkgs, ...} : { + home-manager.users.jade = { pkgs,... } : { programs.kitty = { enable = true; font = { @@ -14,7 +14,8 @@ in with lib; { size = 11; }; settings = { - adjust_column_width = "75%"; + adjust_column_width = "70%"; + color0 = "#282828"; color8 = "#928374"; color1 = "#cc241d"; @@ -34,6 +35,8 @@ in with lib; { foreground = "#ebdbb2"; background = "#282828"; + + confirm_os_window_close = 0; }; }; }; diff --git a/potatobook-g/configuration.nix b/potatobook-g/configuration.nix index 68de6f6..7218b8d 100644 --- a/potatobook-g/configuration.nix +++ b/potatobook-g/configuration.nix @@ -22,6 +22,7 @@ desktop.enable = true; desktop.compositing = true; terminal.enable = true; + neovim.enable = true; }; boot.loader.systemd-boot.enable = true;