zsh configs

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
master
Tuan-Dat Tran 2024-03-17 21:17:46 +01:00
parent c24fd84b7b
commit e02fa7f43d
5 changed files with 68 additions and 48 deletions

View File

@ -16,7 +16,8 @@ alsa-utils pulseaudio pulseaudio-alsa pulseaudio-bluetooth playerctl xdotool \
pavucontrol btrfs-progs udiskie blueman acpi acpid tlp conky stow openssh xsel \ pavucontrol btrfs-progs udiskie blueman acpi acpid tlp conky stow openssh xsel \
firefox veracrypt keepassxc ranger rofi chromium delta-git tesseract-data-eng \ firefox veracrypt keepassxc ranger rofi chromium delta-git tesseract-data-eng \
neofetch xf86-video-amdgpu lib32-mesa libva-mesa-driver lxappearance mesa-vdpau \ neofetch xf86-video-amdgpu lib32-mesa libva-mesa-driver lxappearance mesa-vdpau \
lib32-libva-mesa-driver lib32-mesa-vdpau tesseract-data-eng p7zip lib32-libva-mesa-driver lib32-mesa-vdpau tesseract-data-eng p7zip pandoc-cli \
nvtop wireguard-tools nmap bind wireshark-qt iperf3 cargo-flamegraph
``` ```
## Picture ## Picture
@ -46,3 +47,24 @@ stow zsh
I'm using pcmanfm with [[Sweet - New Flavor](https://www.gnome-look.org/p/1253385/)]. I'm using pcmanfm with [[Sweet - New Flavor](https://www.gnome-look.org/p/1253385/)].
The downloaded file needs to be extracted into `~/.themes/`. The downloaded file needs to be extracted into `~/.themes/`.
The Icons are from the related icon set: [[Candy Icons](https://www.gnome-look.org/p/1305251)]. The Icons are from the related icon set: [[Candy Icons](https://www.gnome-look.org/p/1305251)].
## ohmyzsh
Plugins for ohmyzsh
### eza
```sh
git clone https://github.com/z-shell/zsh-eza ~/.oh-my-zsh/custom/plugins/zsh-eza
```
## Environment
Add
```sh
VISUAL=/usr/bin/nvim
EDITOR=/usr/bin/nvim
```
to `/etc/environment`.

View File

@ -105,8 +105,7 @@ bindsym $mod+Shift+space exec --no-startup-id python ~/.scripts/i3lock.py
bindsym $mod+Shift+s exec poweroff bindsym $mod+Shift+s exec poweroff
# start a terminal # start a terminal
bindsym $mod+space exec alacritty bindsym $mod+Return exec alacritty
bindsym $mod+Return exec alacritty -e zellij
# kill focused window # kill focused window
bindsym $mod+Shift+q kill bindsym $mod+Shift+q kill
@ -128,6 +127,14 @@ bindsym XF86AudioNext exec "playerctl next"
bindsym XF86AudioPrevious exec "playerctl previous" bindsym XF86AudioPrevious exec "playerctl previous"
bindsym XF86AudioMicMute exec "amixer set Capture toggle" bindsym XF86AudioMicMute exec "amixer set Capture toggle"
# F9-F12 on Thinkpad
bindsym XF86Display exec lxrandr
bindsym XF86Messenger exec signal-desktop
bindsym XF86Go exec dunstify -r 3 "Go"
bindsym Cancel exec dunstify -r 3 "Cancel"
bindsym XF86Favorites exec dunstify -r 3 "Favorites"
# Application Shortcuts # Application Shortcuts
bindsym $mod+b exec firefox bindsym $mod+b exec firefox
bindsym $mod+p exec firefox --private-window https://tudattr.dev bindsym $mod+p exec firefox --private-window https://tudattr.dev

View File

@ -1,8 +1,6 @@
// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true" // If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
keybinds { keybinds {
normal clear-defaults=true { normal clear-defaults=true {
// uncomment this and adjust key if using copy_on_select=false
// bind "Alt c" { Copy; }
bind "F1" {SwitchToMode "Tab"; } bind "F1" {SwitchToMode "Tab"; }
bind "F2" {SwitchToMode "Pane"; } bind "F2" {SwitchToMode "Pane"; }
bind "F5" {SwitchToMode "Session"; } bind "F5" {SwitchToMode "Session"; }
@ -22,6 +20,25 @@ keybinds {
bind "Alt -" { Resize "Decrease"; } bind "Alt -" { Resize "Decrease"; }
} }
tab {
bind "Ctrl t" { SwitchToMode "Normal"; }
bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; }
bind "h" "Left" "Up" "k" { GoToPreviousTab; }
bind "l" "Right" "Down" "j" { GoToNextTab; }
bind "n" { NewTab; SwitchToMode "Normal"; }
bind "x" { CloseTab; SwitchToMode "Normal"; }
bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; }
bind "1" { GoToTab 1; SwitchToMode "Normal"; }
bind "2" { GoToTab 2; SwitchToMode "Normal"; }
bind "3" { GoToTab 3; SwitchToMode "Normal"; }
bind "4" { GoToTab 4; SwitchToMode "Normal"; }
bind "5" { GoToTab 5; SwitchToMode "Normal"; }
bind "6" { GoToTab 6; SwitchToMode "Normal"; }
bind "7" { GoToTab 7; SwitchToMode "Normal"; }
bind "8" { GoToTab 8; SwitchToMode "Normal"; }
bind "9" { GoToTab 9; SwitchToMode "Normal"; }
bind "Tab" { ToggleTab; }
}
locked { locked {
bind "F12" { SwitchToMode "Normal"; } bind "F12" { SwitchToMode "Normal"; }
} }
@ -63,25 +80,6 @@ keybinds {
bind "k" "Up" { MovePane "Up"; } bind "k" "Up" { MovePane "Up"; }
bind "l" "Right" { MovePane "Right"; } bind "l" "Right" { MovePane "Right"; }
} }
tab {
bind "Ctrl t" { SwitchToMode "Normal"; }
bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; }
bind "h" "Left" "Up" "k" { GoToPreviousTab; }
bind "l" "Right" "Down" "j" { GoToNextTab; }
bind "n" { NewTab; SwitchToMode "Normal"; }
bind "x" { CloseTab; SwitchToMode "Normal"; }
bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; }
bind "1" { GoToTab 1; SwitchToMode "Normal"; }
bind "2" { GoToTab 2; SwitchToMode "Normal"; }
bind "3" { GoToTab 3; SwitchToMode "Normal"; }
bind "4" { GoToTab 4; SwitchToMode "Normal"; }
bind "5" { GoToTab 5; SwitchToMode "Normal"; }
bind "6" { GoToTab 6; SwitchToMode "Normal"; }
bind "7" { GoToTab 7; SwitchToMode "Normal"; }
bind "8" { GoToTab 8; SwitchToMode "Normal"; }
bind "9" { GoToTab 9; SwitchToMode "Normal"; }
bind "Tab" { ToggleTab; }
}
scroll { scroll {
bind "Ctrl s" { SwitchToMode "Normal"; } bind "Ctrl s" { SwitchToMode "Normal"; }
bind "e" { EditScrollback; SwitchToMode "Normal"; } bind "e" { EditScrollback; SwitchToMode "Normal"; }
@ -299,7 +297,7 @@ theme "tokyo-night-dark"
// Path to the default editor to use to edit pane scrollbuffer // Path to the default editor to use to edit pane scrollbuffer
// Default: $EDITOR or $VISUAL // Default: $EDITOR or $VISUAL
// //
// scrollback_editor "/usr/bin/vim" scrollback_editor "/usr/bin/nvim"
// When attaching to an existing session with other users, // When attaching to an existing session with other users,
// should the session be mirrored (true) // should the session be mirrored (true)

View File

@ -18,6 +18,7 @@ Host git.tudattr.dev
Port 2222 Port 2222
User git User git
IdentityFile /mnt/veracrypt1/git IdentityFile /mnt/veracrypt1/git
ProxyJump mii
# Homeserver # Homeserver
Host madrigal Host madrigal

View File

@ -45,31 +45,16 @@ setopt SHARE_HISTORY
# Alias # Alias
alias q="exit" alias q="exit"
alias b="byobu"
alias vim="nvim" alias vim="nvim"
alias cat="bat --pager=never" alias cat="bat --pager=never"
alias ranger='ranger --choosedir=$HOME/.rangerdir; LASTDIR=`cat $HOME/.rangerdir`; cd "$LASTDIR"' alias ranger='ranger --choosedir=$HOME/.rangerdir; LASTDIR=`cat $HOME/.rangerdir`; cd "$LASTDIR"'
alias xsel='xsel -ib' alias xsel='xsel -ib'
alias msfconsole="msfconsole -x \"db_connect metasploit@msf\""
alias ed="\emacs --daemon"
alias e="open_emacs"
alias df="df -h" alias df="df -h"
alias picpaste="xclip -selection clipboard -t image/png -o" alias picpaste="xclip -selection clipboard -t image/png -o"
alias eledger="emacsclient -nw ~/Documents/Finanzen/Ledger/MyBudget.ledger"
alias sshconfig="emacsclient -nw ~/.ssh/config"
alias econfig="emacsclient -nw ~/.doom.d/init.el"
alias wttr="curl wttr.in/Essen" alias wttr="curl wttr.in/Essen"
alias tvres="xrandr --output HDMI1 --transform 1.02,0,-20,0,1.02,-10,0,0,1"
alias defaultres="xrandr --output HDMI1 --transform 1.00,0,0,0,1.00,0,0,0,1"
alias zshconfig="emacsclient -nw ~/.zshrc; source ~/.zshrc;"
alias notify="dunstify \"ping~\"" alias notify="dunstify \"ping~\""
alias ekill="pkill emacs; pkill emacsclient; ed"
alias latexmk="latexmk -f -pdf -interaction=nonstopmode" alias latexmk="latexmk -f -pdf -interaction=nonstopmode"
alias picotik="picocom --b 115200 /dev/ttyUSB0" alias picotik="picocom --b 115200 /dev/ttyUSB0"
alias ls="eza"
## git
alias gps="git push soft --all"
alias gras="add_soft_git"
# Theme # Theme
ZSH_THEME="agnoster" ZSH_THEME="agnoster"
@ -79,17 +64,24 @@ plugins=(
git git
history history
z z
zsh-eza
) )
randpw() { < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-$1};echo;}; randpw() { < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-$1};echo;};
autoload -U +X bashcompinit && bashcompinit
if [[ -z "$ZELLIJ" ]]; then
if [[ "$ZELLIJ_AUTO_ATTACH" == "true" ]]; then
zellij attach -c
else
zellij
fi
if [[ "$ZELLIJ_AUTO_EXIT" == "true" ]]; then
exit
fi
fi
# Source # Source
source $ZSH/oh-my-zsh.sh source $ZSH/oh-my-zsh.sh
add_soft_git() { git remote add soft ssh://git.aya01:/$1 }
open_emacs() { emacsclient -c $1 & disown; };
autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /usr/bin/terraform terraform
# echo "rm -rf braincells/*"