diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-03-21 17:29:53 -0400 |
|---|---|---|
| committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-03-21 17:29:53 -0400 |
| commit | 19f764780c12c1e0ee13998e980c64acf7dc9b0e (patch) | |
| tree | 09924016790158db69e946563c9bf214e50e47bc /modules | |
| parent | e2fe74863e48c5f05b18fac38b73e7a3e0bf1375 (diff) | |
| download | home-19f764780c12c1e0ee13998e980c64acf7dc9b0e.tar.gz | |
tmux stuff
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/default.nix | 3 | ||||
| -rw-r--r-- | modules/fzf.nix | 46 | ||||
| -rw-r--r-- | modules/global.nix | 3 | ||||
| -rw-r--r-- | modules/tmux/default.nix (renamed from modules/tmux.nix) | 32 | ||||
| -rw-r--r-- | modules/zsh/default.nix | 9 |
5 files changed, 87 insertions, 6 deletions
diff --git a/modules/default.nix b/modules/default.nix index e094839..d46c392 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -4,7 +4,8 @@ ./foot.nix ./mako.nix ./neovide.nix - ./tmux.nix + ./fzf.nix + ./tmux ./zsh ./sway ./neovim diff --git a/modules/fzf.nix b/modules/fzf.nix new file mode 100644 index 0000000..7449874 --- /dev/null +++ b/modules/fzf.nix @@ -0,0 +1,46 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.modules.fzf; +in +{ + options.modules.fzf = { + enable = lib.mkEnableOption "fzf"; + }; + + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ + bat + fd + ]; + programs.fzf = { + enable = true; + enableZshIntegration = true; + colors = { + bg = "#0f0f0f"; + # "bg+" = "#0f0f0f"; + "bg+" = "#151515"; + spinner = "#8aabac"; + hl = "#8f8aac"; + header = "#8f8aac"; + info = "#aca98a"; + pointer = "#8aabac"; + marker = "red"; + fg = "#cacaca"; + "fg+" = "#8aac8b"; + }; + tmux = { + enableShellIntegration = true; + }; + defaultCommand = "fd . $HOME"; + defaultOptions = [ + "--style minimal" + "--bind ctrl-n:down,ctrl-e:up" + # "--style full" + ]; + fileWidgetOptions = [ + "--preview 'bat --style=numbers --theme base16 --line-range :500 {}'" +# "--preview 'head{}'" + ]; + }; + }; +} diff --git a/modules/global.nix b/modules/global.nix index c9fa3b6..30d39ec 100644 --- a/modules/global.nix +++ b/modules/global.nix @@ -33,6 +33,7 @@ in }; zsh.enable = true; tmux.enable = true; + fzf.enable = true; }; nixGL = lib.mkIf cfg.notNixOS { @@ -64,7 +65,7 @@ in username = "stefan"; homeDirectory = "/home/stefan"; stateVersion = "24.11"; - + shell.enableZshIntegration = true; packages = with pkgs; [ nerd-fonts.comic-shanns-mono diff --git a/modules/tmux.nix b/modules/tmux/default.nix index 5761120..dc36d8e 100644 --- a/modules/tmux.nix +++ b/modules/tmux/default.nix @@ -17,14 +17,28 @@ in baseIndex = 1; escapeTime = 0; focusEvents = true; + plugins = with pkgs.tmuxPlugins; [ + { + plugin = resurrect; + extraConfig = '' + set -g @resurrect-strategy-nvim 'session' + ''; + } + ]; extraConfig = '' - set-option -ga terminal-overrides ",xterm-256color:Tc" - set-option -g default-terminal "screen-256color" - +# set -g default-terminal "screen-256color" +# screen-256 ls colors broken, zsh fixed +# screen ls colors fixed, zsh autosuggestions broken set -g renumber-windows on + bind r source-file ~/.config/tmux/tmux.conf + bind w switch-client -T split bind t switch-client -T tab + bind f switch-client -T file + bind F switch-client -T dir + + bind d detach-client bind -T tab o choose-tree -Zw bind -T tab c kill-window # warn? @@ -32,8 +46,14 @@ in bind -T tab i next-window bind -T tab n new-window + bind -T dir o run-shell -b 'fd . $(pwd) -td | fzf --tmux | xargs --no-run-if-empty tmux split-window -h -c' + bind -T dir O run-shell -b 'fd . $(pwd) -td | fzf --tmux | xargs --no-run-if-empty tmux new-window -c' + bind -T file o run-shell -b 'fd . $(pwd) -tf | fzf --tmux | xargs --no-run-if-empty tmux split-window -h -c $(pwd) $EDITOR' + bind -T file O run-shell -b 'fd . $(pwd) -tf | fzf --tmux | xargs --no-run-if-empty tmux new-window -c $(pwd) $EDITOR' + bind -T split i split-window -h bind -T split n split-window + bind -T split w select-pane -t :.+ bind c kill-pane bind m select-pane -L @@ -41,6 +61,11 @@ in bind e select-pane -U bind i select-pane -R + bind-key -T root m if -F "#{==:#{pane_mode},tree-mode}" "send h" "send m" + bind-key -T root n if -F "#{==:#{pane_mode},tree-mode}" "send j" "send n" + bind-key -T root e if -F "#{==:#{pane_mode},tree-mode}" "send k" "send e" + bind-key -T root i if -F "#{==:#{pane_mode},tree-mode}" "send l" "send i;" + bind -T copy-mode-vi m send-keys -X cursor-left bind -T copy-mode-vi n send-keys -X cursor-down bind -T copy-mode-vi e send-keys -X cursor-up @@ -73,6 +98,7 @@ in set -g pane-border-style fg='#191919' set -g pane-active-border-style fg='#191919' + ''; }; }; diff --git a/modules/zsh/default.nix b/modules/zsh/default.nix index 3997ee2..c884333 100644 --- a/modules/zsh/default.nix +++ b/modules/zsh/default.nix @@ -46,7 +46,8 @@ in initExtra = '' source ~/.oh-my-zsh/themes/${cfg.theme}.zsh-theme setopt nobeep - export KEYTIMEOUT=1 # note, set higher if you want to use surround mode + export KEYTIMEOUT=1 +# export KEYTIMEOUT=20 # note, set higher if you want to use surround mode or any chording bindkey -M vicmd m vi-backward-char bindkey -M vicmd n vi-down-line-or-history @@ -64,7 +65,13 @@ in # vim style backspace (im a young soul) bindkey -v '^?' backward-delete-char + + bindkey '^F' fzf-cd-widget + bindkey -M vicmd / fzf-history-widget +# bindkey -M vicmd " f" fzf-cd-widget +# bindkey -M vicmd . fzf ''; }; }; } + |