From f1664ad7538ea6645d65498b9bec254695c9a296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czy=C5=BC?= Date: Sat, 20 Apr 2024 12:21:42 +0200 Subject: [PATCH] zsh dots --- home-manager/features/cli/zsh/default.nix | 36 ++++++++++++++++------- home-manager/features/tmux.nix | 18 +++++++++++- home-manager/home.nix | 5 ---- 3 files changed, 43 insertions(+), 16 deletions(-) diff --git a/home-manager/features/cli/zsh/default.nix b/home-manager/features/cli/zsh/default.nix index 311c085..1d387d5 100644 --- a/home-manager/features/cli/zsh/default.nix +++ b/home-manager/features/cli/zsh/default.nix @@ -1,6 +1,12 @@ {config, pkgs, ...}: let cli = import ../aliases.nix; in { + home.packages = with pkgs; [ + # zsh-autosuggestions + # zsh-powerlevel10k + # zsh-prezto + ]; + programs.zsh = { enable = true; enableCompletion = true; @@ -9,10 +15,14 @@ in { history.path = "${config.xdg.dataHome}/zsh/history"; shellAliases = cli.myAliases; + + syntaxHighlighting = { + enable = true; + }; initExtra = '' [[ ! -f ${./p10k.zsh} ]] || source ${./p10k.zsh} - eval "$(zoxide init zsh)" + eval "$(zoxide init --cmd cd zsh)" ''; plugins = [ { @@ -22,18 +32,24 @@ in { } ]; - zplug = { - enable = true; - plugins = [ - { name = "zsh-users/zsh-autosuggestions"; } - # { name = "romkatv/powerlevel10k"; tags = [ as:theme depth:1 ]; } - ]; - }; + # plug = { + # enable = true; + # plugins = [ + # { name = "zsh-users/zsh-autosuggestions"; } + # ]; + # }; oh-my-zsh = { enable = true; - plugins = [ "git" ]; + plugins = [ "git" "vi-mode" ]; + }; + + prezto = { + enable = true; + tmux = { + autoStartLocal = true; + autoStartRemote = true; + }; }; - }; } diff --git a/home-manager/features/tmux.nix b/home-manager/features/tmux.nix index 624d933..4838280 100644 --- a/home-manager/features/tmux.nix +++ b/home-manager/features/tmux.nix @@ -5,10 +5,26 @@ prefix = "C-Space"; keyMode = "vi"; terminal = "screen-256color"; + baseIndex = 1; plugins = with pkgs.tmuxPlugins; [ sensible vim-tmux-navigator gruvbox - ]; + yank + ]; + extraConfig = '' + # Shift Alt vim keys to switch windows + bind -n M-H previous-window + bind -n M-L next-window + + # Vim like yank + bind-key -T copy-mode-vi v send-keys -X begin-selection + bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle + bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel + + # Open panes in current directory + bind '"' split-window -v -c "#{pane_current_path}" + bind % split-window -h -c "#{pane_current_path}" + ''; }; } diff --git a/home-manager/home.nix b/home-manager/home.nix index 0c85998..8491886 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -73,11 +73,6 @@ # The home.packages option allows you to install Nix packages into your # environment. home.packages = (with pkgs; [ - # > zsh stuff < - zsh - zsh-autosuggestions - zsh-powerlevel10k - # > graphics < tuxpaint krita