From e195bf81534d650041fb5d0ffaac72aee23c08fa Mon Sep 17 00:00:00 2001 From: Eduardo Cueto-Mendoza Date: Fri, 17 Jan 2025 16:01:47 +0000 Subject: [PATCH] Using a more posix shell --- .config/alacritty/alacritty.toml | 2 +- .config/alacritty/themes/tokyo_night.toml | 29 ++ .../themes/tokyo_night_enhanced.toml | 30 ++ .../alacritty/themes/tokyo_night_storm.toml | 29 ++ .config/alacritty/themes/xterm.toml | 28 ++ .config/fish/config.fish | 352 ++++++------------ .../lua/user/plugins/29_tmux-navigator.lua | 18 + .config/sway/config | 3 +- .config/waybar/config.jsonc | 26 +- .stow-local-ignore | 2 + .tmux.conf | 53 --- .zshrc | 184 +++++++++ 12 files changed, 452 insertions(+), 304 deletions(-) create mode 100644 .config/alacritty/themes/tokyo_night.toml create mode 100644 .config/alacritty/themes/tokyo_night_enhanced.toml create mode 100644 .config/alacritty/themes/tokyo_night_storm.toml create mode 100644 .config/alacritty/themes/xterm.toml create mode 100644 .config/nvim/lua/user/plugins/29_tmux-navigator.lua delete mode 100755 .tmux.conf create mode 100644 .zshrc diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 2d4f30b..213b037 100755 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -2,7 +2,7 @@ live_config_reload = true import = [ - "~/.config/alacritty/themes/Homebrew.toml" + "~/.config/alacritty/themes/tokyo_night_enhanced.toml" ] [cursor.style] diff --git a/.config/alacritty/themes/tokyo_night.toml b/.config/alacritty/themes/tokyo_night.toml new file mode 100644 index 0000000..0642a90 --- /dev/null +++ b/.config/alacritty/themes/tokyo_night.toml @@ -0,0 +1,29 @@ +# Colors (Tokyo Night) +# Source https//github.com/zatchheems/tokyo-night-alacritty-theme + +# Default colors +[colors.primary] +background = '#1a1b26' +foreground = '#a9b1d6' + +# Normal colors +[colors.normal] +black = '#32344a' +red = '#f7768e' +green = '#9ece6a' +yellow = '#e0af68' +blue = '#7aa2f7' +magenta = '#ad8ee6' +cyan = '#449dab' +white = '#787c99' + +# Bright colors +[colors.bright] +black = '#444b6a' +red = '#ff7a93' +green = '#b9f27c' +yellow = '#ff9e64' +blue = '#7da6ff' +magenta = '#bb9af7' +cyan = '#0db9d7' +white = '#acb0d0' diff --git a/.config/alacritty/themes/tokyo_night_enhanced.toml b/.config/alacritty/themes/tokyo_night_enhanced.toml new file mode 100644 index 0000000..90ba82b --- /dev/null +++ b/.config/alacritty/themes/tokyo_night_enhanced.toml @@ -0,0 +1,30 @@ +[colors.primary] +background = "#08080b" +foreground = "#787c99" + +[colors.cursor] +cursor = "#787c99" + +[colors.selection] +text = "CellForeground" +background = "#515c7e" + +[colors.normal] +black = "#363b54" +red = "#f7768e" +green = "#41a6b5" +yellow = "#e0af68" +blue = "#7aa2f7" +magenta = "#bb9af7" +cyan = "#7dcfff" +white = "#787c99" + +[colors.bright] +black = "#363b54" +red = "#f7768e" +green = "#41a6b5" +yellow = "#e0af68" +blue = "#7aa2f7" +magenta = "#bb9af7" +cyan = "#7dcfff" +white = "#787c99" diff --git a/.config/alacritty/themes/tokyo_night_storm.toml b/.config/alacritty/themes/tokyo_night_storm.toml new file mode 100644 index 0000000..992f1d3 --- /dev/null +++ b/.config/alacritty/themes/tokyo_night_storm.toml @@ -0,0 +1,29 @@ +# Colors (Tokyo Night Storm variant) +# Source https//github.com/zatchheems/tokyo-night-alacritty-theme + +# Default colors +[colors.primary] +background = '#24283b' +foreground = '#a9b1d6' + +# Normal colors +[colors.normal] +black = '#32344a' +red = '#f7768e' +green = '#9ece6a' +yellow = '#e0af68' +blue = '#7aa2f7' +magenta = '#ad8ee6' +cyan = '#449dab' +white = '#9699a8' + +# Bright colors +[colors.bright] +black = '#444b6a' +red = '#ff7a93' +green = '#b9f27c' +yellow = '#ff9e64' +blue = '#7da6ff' +magenta = '#bb9af7' +cyan = '#0db9d7' +white = '#acb0d0' diff --git a/.config/alacritty/themes/xterm.toml b/.config/alacritty/themes/xterm.toml new file mode 100644 index 0000000..47fd62c --- /dev/null +++ b/.config/alacritty/themes/xterm.toml @@ -0,0 +1,28 @@ +# XTerm's default colors + +# Default colors +[colors.primary] +background = '#000000' +foreground = '#ffffff' + +# Normal colors +[colors.normal] +black = '#000000' +red = '#cd0000' +green = '#00cd00' +yellow = '#cdcd00' +blue = '#0000ee' +magenta = '#cd00cd' +cyan = '#00cdcd' +white = '#e5e5e5' + +# Bright colors +[colors.bright] +black = '#7f7f7f' +red = '#ff0000' +green = '#00ff00' +yellow = '#ffff00' +blue = '#5c5cff' +magenta = '#ff00ff' +cyan = '#00ffff' +white = '#ffffff' diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 8efa62f..2495a7a 100755 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,237 +1,119 @@ -switch (uname) - case FreeBSD NetBSD DragonFly - echo Hi Beastie! - case Linux - #echo Hi Tux! - fish_vi_key_bindings - set ID (id -u) - # Start tmux - if not set -q TMUX; and [ $ID != 0 ] - echo "Setting tmux" - #set -g TMUX tmux new-session -d -s base - #eval $TMUX - #tmux attach-session -d -t base - eval tmux - end - - # PATH - # Local PATH - fish_add_path -a $HOME/.local/bin - - # Mason PATH - fish_add_path -a $HOME/.local/share/nvim/mason/bin - - # sbin PATH - fish_add_path -a /sbin - fish_add_path -a /usr/sbin - - # Rust - fish_add_path -a /usr/local/share/cargo/bin - - # Android - fish_add_path -a /usr/share/android-tools - - # rocm - fish_add_path -a /opt/rocm/bin - - # Java - #fish_add_path -a /usr/local/jdk-21/bin - - # Ltex-LS - #fish_add_path -a /usr/local/share/ltex-ls-16.0.0/bin - - # pyenv - set -x PYENV_ROOT /usr/share/pyenv - fish_add_path -a $PYENV_ROOT/bin - pyenv init - fish | source - status --is-interactive; and pyenv virtualenv-init - | source - - # Zig - fish_add_path -a /usr/share/zig - - - - # VARIABLES - # For Torch - set -gx HSA_OVERRIDE_GFX_VERSION '10.3.0' - - # bat - set -x BAT_THEME 'tokyonight_night' - - # Rust - set -gx CARGO_HOME '/usr/local/share/cargo' - - # ssh and gpg - set -x GPG_TTY (tty) - set -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket) - gpgconf --launch gpg-agent - gpg-connect-agent updatestartuptty /bye > /dev/null - - # Editor - set -gx EDITOR 'nvim' - - # Manpager - #set -gx PAGER 'nvim +Man!' - - # Term for ssh - #set -gx TERM 'xterm-256color' - - # fzf - set -x FZF_CTRL_T_OPTS "--preview 'bat -n --color=always --line-range :500 {}'" - set -x FZF_ALT_C_OPTS "--preview 'eza --tree --color=always {} | head 200'" - - - # ALIAS - # convinience - alias doas="sudo" - - # Neovim - alias vi="nvim" - alias vim="nvim" - - # cat - alias cat="bat" - - # ls - alias ls="eza --color=always --long --git --icons=always --group" - - # mutt - #alias mutt='neomutt' - - # rsync - alias rsync='rsync -h -v -r -P -p -t --stats' - - # wget folder - alias wget_f='wget -r -np -R "index.html*"' - - # btop - alias top='btop' - - # fzf - fzf --fish | source - - # git signed - function git --wraps git - switch $argv[1] - case commit - /usr/bin/git commit -S - case tag - /usr/bin/git tag -S - case '*' - /usr/bin/git $argv - end - end - - - case Darwin - #echo Hi Hexley! - fish_vi_key_bindings - set ID (id -u) - ## Start tmux - #if not set -q TMUX; and [ $ID != 0 ] - # echo "Setting tmux" - # set -g TMUX tmux new-session -d -s base - # eval $TMUX - # tmux attach-session -d -t base - #end - - # PATH - # Homebrew - fish_add_path -a /opt/homebrew/bin - fish_add_path -a /opt/homebrew/sbin - - # Local PATH - fish_add_path -a $HOME/.local/bin - - # Mason PATH - fish_add_path -a $HOME/.local/share/nvim/mason/bin - - # Java - fish_add_path -a /opt/homebrew/Cellar/openjdk/23.0.1/bin - - # Ruby - fish_add_path -a /opt/homebrew/opt/ruby/bin - fish_add_path -a /opt/homebrew/lib/ruby/gems/3.4.0/bin - - # Zig - fish_add_path -a /opt/zig - - # pyenv - set -x PYENV_ROOT "$HOME/.pyenv" - fish_add_path -a $PYENV_ROOT/bin - pyenv init - | source - status --is-interactive; and pyenv virtualenv-init - | source - - # VARIABLES - if [ $ID != 0 ] - # ssh and gpg - set -x GPG_TTY (tty) - set -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket) - gpgconf --launch gpg-agent - gpg-connect-agent updatestartuptty /bye > /dev/null - end - - # Editor - set -x EDITOR 'nvim' - - # Manpager - set -x PAGER 'nvim +Man!' - - # Term for ssh - #export TERM='xterm-256color' - - # Homebrew - set -x HOMEBREW_NO_AUTO_UPDATE 1 - set -x HOMEBREW_NO_ENV_HINTS 1 - - # DBUS for zathura - #export DBUS_LAUNCHD_SESSION_BUS_SOCKET=/tmp/(id -u) - #export DBUS_SESSION_BUS_ADDRESS='unix:path='$DBUS_LAUNCHD_SESSION_BUS_SOCKET - #if pgrep -x dbus-daemon &> /dev/null - # printf (_ "%sdbus-daemon%s is running\n") (set_color red) (set_color normal) - #else - # #echo "dbus-daemon is not running" - # dbus-daemon --fork --session --address=$DBUS_SESSION_BUS_ADDRESS - #end - - - # ALIAS - # convinience - alias doas='sudo' - - # ls - alias ls='colorls' - - # neovim - alias vi='nvim' - alias vim='nvim' - - # mutt - #alias mutt='neomutt' - - # rsync - alias rsync='rsync -h -v -r -P -p -t --stats' - - # wget folder - alias wget_f='wget -r -np -R "index.html*"' - - # btop - alias top='btop' - - # git signed - function git --wraps git - switch $argv[1] - case commit - /usr/bin/git commit -S - case tag - /usr/bin/git tag -S - case '*' - /usr/bin/git $argv - end - end - - - case '*' - echo Hi, stranger! +#echo Hi Tux! +fish_vi_key_bindings +set ID (id -u) +# Start tmux +if not set -q TMUX; and [ $ID != 0 ] + echo "Setting tmux" + #set -g TMUX tmux new-session -d -s base + #eval $TMUX + #tmux attach-session -d -t base + eval tmux end +# PATH +# Local PATH +fish_add_path -a $HOME/.local/bin + +# Mason PATH +fish_add_path -a $HOME/.local/share/nvim/mason/bin + +# sbin PATH +fish_add_path -a /sbin +fish_add_path -a /usr/sbin + +# Rust +fish_add_path -a /usr/local/share/cargo/bin + +# Android +fish_add_path -a /usr/share/android-tools + +# rocm +fish_add_path -a /opt/rocm/bin + +# Java +#fish_add_path -a /usr/local/jdk-21/bin + +# Ltex-LS +#fish_add_path -a /usr/local/share/ltex-ls-16.0.0/bin + +# pyenv +set -x PYENV_ROOT /usr/share/pyenv +fish_add_path -a $PYENV_ROOT/bin +pyenv init - fish | source +status --is-interactive; and pyenv virtualenv-init - | source + +# Zig +fish_add_path -a /usr/share/zig + + + +# VARIABLES +# For Torch +set -gx HSA_OVERRIDE_GFX_VERSION '10.3.0' + +# bat +set -x BAT_THEME 'tokyonight_night' + +# Rust +set -gx CARGO_HOME '/usr/local/share/cargo' + +# ssh and gpg +set -x GPG_TTY (tty) +set -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket) +gpgconf --launch gpg-agent +gpg-connect-agent updatestartuptty /bye > /dev/null + +# Editor +set -gx EDITOR 'nvim' + +# Manpager +#set -gx PAGER 'nvim +Man!' + +# Term for ssh +#set -gx TERM 'xterm-256color' + +# fzf +set -x FZF_CTRL_T_OPTS "--preview 'bat -n --color=always --line-range :500 {}'" +set -x FZF_ALT_C_OPTS "--preview 'eza --tree --color=always {} | head 200'" + + +# ALIAS +# convinience +alias doas="sudo" + +# Neovim +alias vi="nvim" +alias vim="nvim" + +# cat +alias cat="bat" + +# ls +alias ls="eza --color=always --long --git --icons=always --group" + +# mutt +#alias mutt='neomutt' + +# rsync +alias rsync='rsync -h -v -r -P -p -t --stats' + +# wget folder +alias wget_f='wget -r -np -R "index.html*"' + +# btop +alias top='btop' + +# fzf +fzf --fish | source + +# git signed +function git --wraps git + switch $argv[1] + case commit + /usr/bin/git commit -S + case tag + /usr/bin/git tag -S + case '*' + /usr/bin/git $argv + end +end diff --git a/.config/nvim/lua/user/plugins/29_tmux-navigator.lua b/.config/nvim/lua/user/plugins/29_tmux-navigator.lua new file mode 100644 index 0000000..cee53d3 --- /dev/null +++ b/.config/nvim/lua/user/plugins/29_tmux-navigator.lua @@ -0,0 +1,18 @@ +return { + "christoomey/vim-tmux-navigator", + cmd = { + "TmuxNavigateLeft", + "TmuxNavigateDown", + "TmuxNavigateUp", + "TmuxNavigateRight", + "TmuxNavigatePrevious", + "TmuxNavigatorProcessList", + }, + keys = { + { "", "TmuxNavigateLeft" }, + { "", "TmuxNavigateDown" }, + { "", "TmuxNavigateUp" }, + { "", "TmuxNavigateRight" }, + { "", "TmuxNavigatePrevious" }, + }, +} diff --git a/.config/sway/config b/.config/sway/config index adb9be9..a47dcf6 100755 --- a/.config/sway/config +++ b/.config/sway/config @@ -30,8 +30,7 @@ set $right l set $waybar_position top # Your preferred terminal emulator -#set $term alacritty #--config-file ~/.config/alacritty/alacritty.yml -set $term ghostty +set $term alacritty -e tmux # Your preferred application launcher # Note: pass the final command to swaymsg so that the resulting window can be opened diff --git a/.config/waybar/config.jsonc b/.config/waybar/config.jsonc index 1ebdbbe..c0b13e6 100755 --- a/.config/waybar/config.jsonc +++ b/.config/waybar/config.jsonc @@ -60,9 +60,9 @@ "warning": 30, "critical": 15 }, - "format-charging": " {capacity}%", + "format-charging": "󰂄 {capacity}%", "format": "{icon} {capacity}%", - "format-icons": ["", "", "", "", "", ""], + "format-icons": ["󰁻", "󰁽", "󰁿", "󰂀", "󰂁", "󰂂"], "tooltip": true //"bat": "BAT0" }, @@ -85,7 +85,7 @@ "cpu": { "interval": 5, - "format": "﬙ {usage}%", + "format": " {usage}%", "states": { "warning": 70, "critical": 90 @@ -95,7 +95,7 @@ "memory": { "interval": 5, - "format": " {}%", + "format": " {}%", "states": { "warning": 70, "critical": 90 @@ -106,8 +106,8 @@ "network": { "interval": 5, "format-wifi": " ", - "format-ethernet": "", - "format-disconnected": "睊", + "format-ethernet": "󰈁", + "format-disconnected": "󰈂", "tooltip-format": "{ifname} ({essid}): {ipaddr}", "on-click": "swaymsg exec \\$term_float nmtui" }, @@ -127,7 +127,7 @@ "backlight": { "format": "{icon} {percent}%", - "format-icons": ["", "", ""], + "format-icons": ["󰌵", "󱉕", "󱉓"], "on-scroll-up": "light -A 1", "on-scroll-down": "light -U 1" }, @@ -135,13 +135,13 @@ "pulseaudio": { "scroll-step": 5, "format": "{icon} {volume}%{format_source}", - "format-muted": "婢 {format_source}", + "format-muted": " {format_source}", "format-source": "", - "format-source-muted": " ", + "format-source-muted": "󰟎", "format-icons": { - "headphone": "", - "headset": "", - "default": ["奄", "奔", "墳"] + "headphone": "", + "headset": "", + "default": ["", "i", ""] }, "tooltip-format": "{icon} {volume}% {format_source}", "on-click": "swaymsg exec \\$pulseaudio" @@ -171,7 +171,7 @@ //}, "custom/menu": { - "format": "", + "format": "", "on-click": "swaymsg exec \\$menu", "tooltip": false }, diff --git a/.stow-local-ignore b/.stow-local-ignore index 8555d7c..ab163b9 100755 --- a/.stow-local-ignore +++ b/.stow-local-ignore @@ -9,3 +9,5 @@ \.gnupg/reader_0.status \.ssh/known_hosts* \.ssh/authorized_keys +LICENCE +README.md diff --git a/.tmux.conf b/.tmux.conf deleted file mode 100755 index 587b000..0000000 --- a/.tmux.conf +++ /dev/null @@ -1,53 +0,0 @@ -# Neovim required -set-option -g focus-events on -set-option -a terminal-features 'alacritty:RGB' - -#set -g default-terminal "screen-256color" -set-window-option -g mode-keys vi - -# Copy as in vim -bind-key -T copy-mode-vi 'v' send -X begin-selection -bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel - -# remap prefix from 'C-b' to 'C-a' -unbind C-b -set-option -g prefix C-a -bind-key C-a send-prefix - -# split panes using v and f -bind v split-window -h -bind f split-window -v -unbind '"' -unbind % - -# reload config file (change file location to your the tmux.conf you want to use) -bind r source-file ~/.tmux.conf - -# vi-like keybindings -setw -g mode-keys vi -bind h select-pane -L -bind j select-pane -D -bind k select-pane -U -bind l select-pane -R - -bind-key -T copy-mode-vi 'v' send -X begin-selection -bind-key -T copy-mode-vi 'y' send -X copy-selection - -# zenburn theme -#setw -g clock-mode-colour colour117 -#setw -g mode-attr bold -#setw -g mode-fg colour117 -#setw -g mode-bg colour238 -#set -g status-bg colour235 -#set -g status-fg colour248 -#setw -g window-status-current-fg colour223 -#setw -g window-status-current-bg colour237 -#setw -g window-status-current-attr bold -#set -g message-attr bold -#set -g message-fg colour117 -#set -g message-bg colour235 - -# fancy status line: user@host, date, time -set-option -g status-right "#(whoami)@#(hostname -s) #[fg=colour187,bold]%a %Y-%m-%d %H:%M" -set -g status-right-length 50 -set -g status-left-length 20 diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..fde0067 --- /dev/null +++ b/.zshrc @@ -0,0 +1,184 @@ +# Setup zinit home and startup +ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" +[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)" +[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" + +# source zinit +source "${ZINIT_HOME}/zinit.zsh" + +# Add in zsh plugins +zinit light zsh-users/zsh-syntax-highlighting +zinit light zsh-users/zsh-completions +zinit light zsh-users/zsh-autosuggestions +#zinit light Aloxaf/fzf-tab +zinit light junegunn/fzf-git.sh + +# Load completions +autoload -U compinit && compinit + +# My configurations +# Colors +autoload -U colors && colors + +# Prompt +PROMPT="%(!.%F{red}%n.%F{green}%n)%{$reset_color%}@%F{magenta}%m %F{blue}%(5~|%-2~/…/%2~|%4~) %(?.%F{green}.%F{red})%(?..[%?] )%{$reset_color%}%(!.%F{red}%#.%F{green}%#)%{$reset_color%} " + +# keybindings +bindkey -v +bindkey "^p" history-search-backward +bindkey "^n" history-search-forward +bindkey -r "^G^B" fzf-git-branches-widget +bindkey -r "^G^E" fzf-git-each_ref-widget +bindkey -r "^G^F" fzf-git-files-widget +bindkey -r "^G^H" fzf-git-hashes-widget +bindkey -r "^G^L" fzf-git-lreflogs-widget +bindkey -r "^G^R" fzf-git-remotes-widget +bindkey -r "^G^S" fzf-git-stashes-widget +bindkey -r "^G^T" fzf-git-tags-widget +bindkey -r "^G^W" fzf-git-worktrees-widget +bindkey -r "^Gb" fzf-git-branches-widget +bindkey -r "^Ge" fzf-git-each_ref-widget +bindkey -r "^Gf" fzf-git-files-widget +bindkey -r "^Gh" fzf-git-hashes-widget +bindkey -r "^Gl" fzf-git-lreflogs-widget +bindkey -r "^Gr" fzf-git-remotes-widget +bindkey -r "^Gs" fzf-git-stashes-widget +bindkey -r "^Gt" fzf-git-tags-widget +bindkey "^[w" fzf-git-worktrees-widget +bindkey "^[b" fzf-git-branches-widget +bindkey "^[e" fzf-git-each_ref-widget +bindkey "^[f" fzf-git-files-widget +bindkey "^[h" fzf-git-hashes-widget +bindkey "^[l" fzf-git-lreflogs-widget +bindkey "^[r" fzf-git-remotes-widget +bindkey "^[s" fzf-git-stashes-widget +bindkey "^[t" fzf-git-tags-widget +bindkey "^[w" fzf-git-worktrees-widget + + +# History +HISTSIZE=5000 +HISTFILE=~/.zsh_history +SAVEHIST=$HISTSIZE +HISTDUP=erase +setopt appendhistory +setopt sharehistory +setopt hist_ignore_space +setopt hist_ignore_all_dups +setopt hist_save_no_dups +setopt hist_ignore_dups +setopt hist_find_no_dups + +# Copmletion styling +zstyle ":completion:*" matcher-list "m:{a-z}={A-Za-z}" +zstyle ":completion:*" list-colors "${(s.:.)LS_COLORS}" +## disable sort when completing `git checkout` +#zstyle ":completion:*:git-checkout:*" sort false +## set descriptions format to enable group support +## NOTE: don"t use escape sequences (like "%F{red}%d%f") here, fzf-tab will ignore them +#zstyle ":completion:*:descriptions" format "[%d]" +## set list-colors to enable filename colorizing +#zstyle ":completion:*" list-colors ${(s.:.)LS_COLORS} +## force zsh not to show completion menu, which allows fzf-tab to capture the unambiguous prefix +#zstyle ":completion:*" menu no +## preview directory"s content with eza when completing cd +#zstyle ":fzf-tab:complete:cd:*" fzf-preview "eza -1 --color=always $realpath" +## custom fzf flags +## NOTE: fzf-tab does not follow FZF_DEFAULT_OPTS by default +#zstyle ":fzf-tab:*" fzf-flags --color=fg:1,fg+:2 --bind=tab:accept +## To make fzf-tab follow FZF_DEFAULT_OPTS. +## NOTE: This may lead to unexpected behavior since some flags break this plugin. See Aloxaf/fzf-tab#455. +#zstyle ":fzf-tab:*" use-fzf-default-opts yes +## switch group using `<` and `>` +#zstyle ":fzf-tab:*" switch-group "<" ">" +#zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup + +# VARIABLES +# For Torch +export HSA_OVERRIDE_GFX_VERSION="10.3.0" + +# bat +export BAT_THEME="tokyonight_night" + +# Rust +export CARGO_HOME="/usr/local/share/cargo" + +# ssh and gpg +export GPG_TTY=$(tty) +export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) +gpgconf --launch gpg-agent +gpg-connect-agent updatestartuptty /bye > /dev/null + +# Editor +export EDITOR="nvim" + +# Manpager +#export PAGER="nvim +Man!" + +# Term for ssh +#export TERM="xterm-256color" + +# fzf +export FZF_DEFAULT_COMMAND="fd --hidden --strip-cwd-prefix --exclude .git" +export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" +export FZF_DEFAULT_COMMAND="fd --type=d --hidden --strip-cwd-prefix --exclude .git" +export FZF_CTRL_T_OPTS="--preview 'bat -n --color=always --line-range :500 {}'" +export FZF_ALT_C_OPTS="--preview 'eza --tree --color=always {} | head -200'" + +_fzf_compgen_path() { + fd --hidden --exclude .git . "$1" +} + +_fzf_compgen_dir() { + fd --type=d --hidden --exclude .git . "$1" +} + +_fzf_comprun() { + local command=$1 + shift + case "$command" in + cd) fzf --preview "eza --tree --color=always {} | head -200" "$@" ;; + export|unset) fzf --preview "eval 'echo \$' {}" "$@" ;; + ssh) fzf --preview "dig {}" "$@" ;; + *) fzf --preview "bat -n --color=always --line-range :500 {}" "$@" ;; + esac +} + +# ALIAS +# convinience +alias doas="sudo" + +# Neovim +alias vi="nvim" +alias vim="nvim" + +# cat +alias cat="bat" + +# ls +alias ls="eza --color=always --long --git --icons=always --group" + +# cd +alias cd="z" + +# mutt +#alias mutt='neomutt' + +# rsync +alias rsync="rsync -h -v -r -P -p -t --stats" + +# wget folder +alias wget_f="wget -r -np -R 'index.html*'" + +# btop +alias top="btop" + +# Shell integrations +# The fuck +eval $(thefuck --alias) + +#zoxide +eval "$(zoxide init zsh)" + +# fzf +eval "$(fzf --zsh)"