From e38981769bca49b1ea44527aab8116bb43b9266e Mon Sep 17 00:00:00 2001 From: Gabriel Date: Fri, 2 Sep 2022 17:07:30 +0200 Subject: [PATCH] zsh --- modules/neovim.nix | 72 ++++++++++----------- modules/zsh.nix | 80 ++++++++++++++++++++++++ monosodium-glutamate-g/configuration.nix | 2 + potatobook-g/configuration.nix | 2 + 4 files changed, 120 insertions(+), 36 deletions(-) create mode 100644 modules/zsh.nix diff --git a/modules/neovim.nix b/modules/neovim.nix index 431b830..2c72156 100644 --- a/modules/neovim.nix +++ b/modules/neovim.nix @@ -12,43 +12,43 @@ in with lib; { ]; programs.neovim = { enable = true; - viAlias = true; - vimAlias = true; - vimdiffAlias = 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 - vim-pug - coc-rust-analyzer - coc-git - coc-fzf - coc-css - coc-yaml - coc-json - coc-html - coc-emmet - coc-vimlsp - coc-tsserver - { - plugin = gruvbox-nvim; - config = "colorscheme gruvbox"; - } - { - plugin = nerdtree; - config = "nmap :NERDTreeToggle"; - } - { - plugin = nerdcommenter; - config = '' - vmap ++ NERDCommenterToggle - nmap ++ NERDCommenterToggle - ''; - } - ]; + plugins = with pkgs.vimPlugins; [ + nerdtree-git-plugin + ctrlp-vim + vim-nerdtree-syntax-highlight + vim-devicons + vim-nix + vim-pug + coc-rust-analyzer + coc-git + coc-fzf + coc-css + coc-yaml + coc-json + coc-html + coc-emmet + coc-vimlsp + coc-tsserver + { + plugin = gruvbox-nvim; + config = "colorscheme gruvbox"; + } + { + plugin = nerdtree; + config = "nmap :NERDTreeToggle"; + } + { + plugin = nerdcommenter; + config = '' + vmap ++ NERDCommenterToggle + nmap ++ NERDCommenterToggle + ''; + } + ]; # }}} # Coc {{{ coc = { diff --git a/modules/zsh.nix b/modules/zsh.nix new file mode 100644 index 0000000..6a1970f --- /dev/null +++ b/modules/zsh.nix @@ -0,0 +1,80 @@ +{ config, lib, pkgs, ... }: + +let cfg = config.jade.zsh; +in with lib; { + options.jade.zsh = { + enable = mkEnableOption "Enable zsh"; + }; + config = mkIf cfg.enable { + home-manager.users.jade = { pkgs,... } : { + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableSyntaxHighlighting = true; + autocd = true; + defaultKeymap = "viins"; + dotDir = ".config/zsh"; + dirHashes = { + repos = "$HOME/Documents/repos"; + nixc = "$HOME/nix-configs"; + }; + history = { + extended = true; + save = 100000; + size = 100000; + }; + shellAliases = { + sudo = "sudo "; + + termsize = "echo \"width: $(tput cols)\nheight: $(tput lines)\""; + batstate = "echo \"Charge state: $(cat /sys/class/power_supply/BAT0/capacity)%\""; + clear = "clear;neofetch"; + bdin = "betterdiscordctl install && killall Discord && Discord & disown"; + upg = "paru -Syu --skipreview --noconfirm && flatpak upgrade && rustup upgrade"; + + grepo = "cd $HOME/Documents/repos && ls"; + gdot = "cd $HOME/dotfiles && ls"; + vgdot = "cd $HOME/dotfiles && v"; + + slol = "while true;do \\clear;sl --help | lolcat;done;"; + + # localhost.run + lhr = "ssh -R 80:localhost:8080 nokey@localhost.run"; + sshrpi = "ssh jade@192.168.178.111"; + + # cargo + cr = "cargo run"; + cb = "cargo build"; + cf = "cargo fmt"; + cfx = "cargo fix"; + cl = "cargo clippy"; + cbr = "cargo build --release"; + + # fucking around +  = "nvim"; + }; + oh-my-zsh = { + enable = true; + plugins = [ + "git" "sudo" "colored-man-pages" "zsh-interactive-cd" "branch" + "colorize" "command-not-found" "common-aliases" "rsync" "rust" + "thefuck" + ]; + theme = "fox"; + }; + initExtra = '' + # file endings + alias -s {pdf,PDF}="evince" + alias -s {jpg,JPG,png,PNG}="kitty +kitten icat" + alias -s {ods,ODS,odt,ODT,odp,ODP,doc,DOC,docx,DOCX,xls,XLS,xlsx,XLSX,xlsm,XLSM,ppt,PPT,pptx,PPTX,csv,CSV}='libreoffice' + alias -s {html,HTML}="librewolf" + alias -s {mp4,MP4,mov,MOV,mkv,MKV}='vlc' + alias -s {zip,ZIP,war,WAR}="unzip -l" + alias -s {jar,JAR}="java -jar" + alias -s gz="tar -tf" + alias -s {tgz,TGZ}="tar -tf" + ''; + }; + }; + }; +} diff --git a/monosodium-glutamate-g/configuration.nix b/monosodium-glutamate-g/configuration.nix index 92d356e..9bc7358 100644 --- a/monosodium-glutamate-g/configuration.nix +++ b/monosodium-glutamate-g/configuration.nix @@ -14,6 +14,7 @@ desktop.compositing = true; terminal.enable = true; neovim.enable = true; + zsh.enable = true; }; # monitor control @@ -61,3 +62,4 @@ } + diff --git a/potatobook-g/configuration.nix b/potatobook-g/configuration.nix index 0db1b55..ffad5bc 100644 --- a/potatobook-g/configuration.nix +++ b/potatobook-g/configuration.nix @@ -23,6 +23,7 @@ desktop.compositing = true; terminal.enable = true; neovim.enable = true; + zsh.enable = true; }; fileSystems = { @@ -101,3 +102,4 @@ system.stateVersion = "22.11"; # Did you read the comment? } +