mirror of
https://github.com/alrayyes/dotfiles/
synced 2023-11-14 15:56:30 +00:00
Replace zsh with fish
This commit is contained in:
parent
9e1bf10151
commit
61fd643c08
62
README.org
62
README.org
@ -8,14 +8,14 @@
|
||||
- [[#maintainers][Maintainers]]
|
||||
- [[#prerequisites][Prerequisites]]
|
||||
- [[#configured-applications][Configured Applications]]
|
||||
- [[#zsh][Zsh]]
|
||||
- [[#theme][Theme]]
|
||||
- [[#plugin-manager][Plugin Manager]]
|
||||
- [[#plugins][Plugins]]
|
||||
- [[#fish][Fish]]
|
||||
- [[#theme][Theme]]
|
||||
- [[#package-manager][Package Manager]]
|
||||
- [[#packages][Packages]]
|
||||
- [[#neovim][Neovim]]
|
||||
- [[#theme-1][Theme]]
|
||||
- [[#plugin-manager-1][Plugin Manager]]
|
||||
- [[#plugins-1][Plugins]]
|
||||
- [[#plugin-manager][Plugin Manager]]
|
||||
- [[#plugins][Plugins]]
|
||||
- [[#general][General]]
|
||||
- [[#programming][Programming]]
|
||||
- [[#ui][UI]]
|
||||
@ -31,17 +31,25 @@ A repository of my personal configuration files.
|
||||
+ [[https://github.com/alrayyes][@alrayyes]]
|
||||
|
||||
* Prerequisites
|
||||
- [[https://brave.com/][brave]]
|
||||
- [[https://github.com/baskerville/bspwm][bspwm]]
|
||||
- [[https://the.exa.website/][exa]]
|
||||
- [[https://github.com/junegunn/fzf][fzf]]
|
||||
- [[https://git-scm.com/][git]]
|
||||
- [[http://www.gnu.org/software/stow/][stow]]
|
||||
- [[https://www.python.org/][Python]]
|
||||
- [[https://fishshell.com/][fish]]
|
||||
- [[https://github.com/baskerville/sxhkd][sxhkd]]
|
||||
- [[https://github.com/freedesktop/xcompmgr][xcompmgr]]
|
||||
- [[https://github.com/stoeckmann/xwallpaper][xwallpaper]]
|
||||
|
||||
* Configured Applications
|
||||
- [[https://github.com/alacritty/][alacritty]]
|
||||
- [[https://brave.com/][brave]]
|
||||
- [[https://github.com/baskerville/bspwm][bspwm]]
|
||||
- [[https://github.com/hlissner/doom-emacs][Doom Emacs]]
|
||||
- [[https://dunst-project.org/][dunst]]
|
||||
- [[https://the.exa.website/][exa]]
|
||||
- [[https://firejail.wordpress.com/][firejail]]
|
||||
- [[https://fishshell.com/][fish]]
|
||||
- [[https://git-scm.com/][git]]
|
||||
- [[https://gnupg.org/][gnupg]]
|
||||
- [[https://www.gtk.org/][gtk]]
|
||||
@ -54,32 +62,20 @@ A repository of my personal configuration files.
|
||||
- [[https://tmux.github.io/][tmux]]
|
||||
- [[https://vifm.info/][vifm]]
|
||||
- [[https://weechat.org/][weechat]]
|
||||
- [[https://github.com/freedesktop/xcompmgr][xcompmgr]]
|
||||
- [[https://github.com/stoeckmann/xwallpaper][xwallpaper]]
|
||||
|
||||
* Zsh
|
||||
** Theme
|
||||
- [[https://github.com/denysdovhan/spaceship-prompt][spaceship zsh]]
|
||||
** Plugin Manager
|
||||
- [[https://github.com/zplug/zplug][zplug]]
|
||||
** Plugins
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/archlinux][archlinux]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/composer][composer]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/docker][docker]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/docker-compose][docker-compose]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/extract][extract]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/fzf][fzf]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git][git]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/gitignore][gitignore]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/pass][pass]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/ripgrep][ripgrep]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/rsync][rsync]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/sudo][sudo]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/systemd][systemd]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/tmux][tmux]]
|
||||
- [[https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/vi-mode][vi-mode]]
|
||||
- [[https://github.com/zsh-users/zsh-autosuggestions][zsh-autosuggestions]]
|
||||
- [[https://github.com/zsh-users/zsh-syntax-highlighting][zsh-syntax-highlighting]]
|
||||
* Fish
|
||||
*** Theme
|
||||
- [[https://github.com/oh-my-fish/theme-bobthefish][bobthefish]]
|
||||
*** Package Manager
|
||||
- [[https://github.com/oh-my-fish/oh-my-fish][oh-my-fish]]
|
||||
*** Packages
|
||||
- [[https://github.com/patrickf3139/Colored-Man-Pages][colored-man-pages]]
|
||||
- [[https://github.com/oh-my-fish/plugin-extract][extract]]
|
||||
- [[https://github.com/jethrokuan/fzf][fzf]]
|
||||
- [[https://github.com/oh-my-fish/plugin-gi][gi]]
|
||||
- [[https://github.com/oh-my-fish/plugin-git-flow][git-flow]]
|
||||
- [[https://github.com/oh-my-fish/plugin-sudope.git][sudope]]
|
||||
- [[https://github.com/oh-my-fish/plugin-wttr][wttr]]
|
||||
|
||||
* Neovim
|
||||
** Theme
|
||||
|
@ -320,7 +320,7 @@ background_opacity: 0.8
|
||||
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
|
||||
|
||||
# When set to `true`, selected text will be copied to the primary clipboard.
|
||||
#save_to_clipboard: false
|
||||
save_to_clipboard: true
|
||||
|
||||
# Allow terminal applications to change Alacritty's window title.
|
||||
#dynamic_title: true
|
||||
|
@ -1,38 +1,37 @@
|
||||
#! /bin/sh
|
||||
#!/usr/bin/env fish
|
||||
|
||||
sxhkd &
|
||||
|
||||
# Set screen orientation if second monitor is connected
|
||||
SCREENCOUNT=$(xrandr | grep -c "\*")
|
||||
set SCREENCOUNT (xrandr | grep -c "\*")
|
||||
|
||||
# If multi screen add special mode for monitor so it supports 1440p over HDMI
|
||||
if [ "$SCREENCOUNT" -eq 2 ]; then
|
||||
bspc monitor DP-1 -d 2 3 4 5 6 7 8 9 10
|
||||
bspc monitor HDMI-2 -d 1
|
||||
if [ -f "$HOME/.local/bin/screen_desktop" ]; then
|
||||
screen_desktop
|
||||
fi
|
||||
if [ -f "$HOME/.local/bin/polybar-desktop" ]; then
|
||||
polybar-desktop
|
||||
fi
|
||||
if [ "$SCREENCOUNT" -eq 2 ]
|
||||
bspc monitor DP-1 -d 2 3 4 5 6 7 8 9 10
|
||||
bspc monitor HDMI-2 -d 1
|
||||
if [ -f "$HOME/.local/bin/screen_desktop" ]
|
||||
screen_desktop
|
||||
end
|
||||
if [ -f "$HOME/.local/bin/polybar-desktop" ]
|
||||
polybar-desktop
|
||||
end
|
||||
else
|
||||
bspc monitor -d 1 2 3 4 5 6 7 8 9 0
|
||||
if [ -f "$HOME/.local/bin/screen" ]; then
|
||||
screen
|
||||
fi
|
||||
if [ -f "$HOME/.local/bin/polybar-laptop" ]; then
|
||||
polybar laptop-top &
|
||||
polybar laptop-bottom &
|
||||
fi
|
||||
fi
|
||||
bspc monitor -d 1 2 3 4 5 6 7 8 9 0
|
||||
if [ -f "$HOME/.local/bin/screen" ]
|
||||
screen
|
||||
end
|
||||
if [ -f "$HOME/.local/bin/polybar-laptop" ]
|
||||
polybar-laptop
|
||||
end
|
||||
end
|
||||
|
||||
xcompmgr &
|
||||
|
||||
if [ -e ~/.cache/wall1.png ] && [ -e ~/.cache/wall2.png ]; then
|
||||
xwallpaper --output HDMI-2 --zoom ~/.cache/wall2.png --output DP-1 --zoom ~/.cache/wall1.png &
|
||||
elif [ -e ~/.cache/wall1.png ]; then
|
||||
xwallpaper --output eDP1 --zoom ~/.cache/wall1.png &
|
||||
fi
|
||||
if [ -e ~/.cache/wall1.png ] && [ -e ~/.cache/wall2.png ]
|
||||
xwallpaper --output HDMI-2 --zoom ~/.cache/wall2.png --output DP-1 --zoom ~/.cache/wall1.png &
|
||||
else if [ -e ~/.cache/wall1.png ]
|
||||
xwallpaper --output eDP1 --zoom ~/.cache/wall1.png &
|
||||
end
|
||||
|
||||
# switch off microphones
|
||||
amixer -c 2 set Mic nocap
|
||||
@ -52,15 +51,15 @@ alacritty --class Spt,Spt -e spt &
|
||||
xss-lock -n ~/.local/bin/lock -- ~/.local/bin/lock &
|
||||
xautolock -time 10 -locker ~/.local/bin/lock &
|
||||
|
||||
if [ -e /usr/bin/brave ]; then
|
||||
brave &
|
||||
if [ -e /usr/bin/brave ]
|
||||
brave &
|
||||
else
|
||||
if [ -e /usr/bin/firefox ]; then
|
||||
firefox &
|
||||
elif [ -e /usr/bin/iceweasel ]; then
|
||||
iceweasel &
|
||||
fi
|
||||
fi
|
||||
if [ -e /usr/bin/firefox ]
|
||||
firefox &
|
||||
else if [ -e /usr/bin/iceweasel ]
|
||||
iceweasel &
|
||||
end
|
||||
end
|
||||
|
||||
bspc config border_width 2
|
||||
bspc config window_gap 12
|
||||
|
@ -1,14 +1,4 @@
|
||||
setxkbmap -option caps:escape
|
||||
|
||||
[[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources
|
||||
|
||||
# Enable numberlock
|
||||
if [ -x /usr/bin/numlockx ]; then
|
||||
/usr/bin/numlockx on
|
||||
fi
|
||||
|
||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||
export AWT_TOOLKIT=MToolkit
|
||||
wmname LG3D
|
||||
xrdb -merge -I$HOME ~/.Xresources
|
||||
|
||||
exec bspwm
|
||||
|
107
fish/.config/omf/init.fish
Normal file
107
fish/.config/omf/init.fish
Normal file
@ -0,0 +1,107 @@
|
||||
# Start X at login
|
||||
if status is-login
|
||||
if test -z "$DISPLAY" -a $XDG_VTNR = 1
|
||||
set -g -x SXHKD_SHELL '/usr/bin/sh'
|
||||
|
||||
# Enable numberlock
|
||||
if [ -x "/usr/bin/numlockx" ]
|
||||
/usr/bin/numlockx on
|
||||
end
|
||||
|
||||
exec startx -- -keeptty
|
||||
end
|
||||
end
|
||||
|
||||
function fish_greeting
|
||||
neofetch
|
||||
end
|
||||
|
||||
function path_if_exists
|
||||
if [ -d "$argv" ]
|
||||
set PATH $PATH "$argv"
|
||||
end
|
||||
end
|
||||
|
||||
# Add paths
|
||||
path_if_exists ~/.config/yarn/global/node_modules/.bin
|
||||
path_if_exists ~/.local/bin
|
||||
path_if_exists ~/.emacs.d/bin
|
||||
|
||||
# Set GPG TTY
|
||||
set GPG_TTY (tty)
|
||||
|
||||
# Set default browser
|
||||
if [ -e "/usr/bin/brave" ]
|
||||
set -g BROWSER "brave"
|
||||
else
|
||||
if [ -e "/usr/bin/firefox" ]
|
||||
set -g BROWSER "firefox"
|
||||
else if [ -e "/usr/bin/iceweasel" ]
|
||||
set -g BROWSER "iceweasel"
|
||||
end
|
||||
end
|
||||
|
||||
# Set default terminal
|
||||
set -g TERMINAL "alacritty"
|
||||
|
||||
# pkg editor
|
||||
set -g VISUAL "nvim"
|
||||
|
||||
# editor
|
||||
set -g EDITOR "nvim"
|
||||
|
||||
# Enable password store extensions
|
||||
set -g PASSWORD_STORE_ENABLE_EXTENSIONS "true"
|
||||
|
||||
# Use alternative muhome
|
||||
set -g MU_HOME "/home/alrayyes/.cache/mu"
|
||||
|
||||
# bobthefish
|
||||
set -g theme_nerd_fonts yes
|
||||
set -g theme_color_scheme gruvbox
|
||||
|
||||
# sudope
|
||||
set -g sudope_sequence \e\e
|
||||
|
||||
# nvim alias
|
||||
alias v="nvim"
|
||||
alias sv="sudo nvim"
|
||||
|
||||
# ls alias
|
||||
alias ls="exa"
|
||||
alias l="exa -al"
|
||||
|
||||
# vifm alias
|
||||
alias vifm="vifmrun"
|
||||
|
||||
# pacman aliases
|
||||
alias pacrmorphans="sudo pacman -Rs (pacman -Qtdq)"
|
||||
alias pacrem="sudo pacman -Rns"
|
||||
alias gpoat="git push origin --all && git push origin --tags"
|
||||
|
||||
# Refresh gpg-agent tty in case user switches into an X session
|
||||
gpg-connect-agent updatestartuptty /bye >/dev/null
|
||||
|
||||
# Set fzf keybindings here for now as they don't work with stable version of omf https://github.com/jethrokuan/fzf/issues/109
|
||||
bind \co '__fzf_find_file'
|
||||
bind \cr '__fzf_reverse_isearch'
|
||||
bind \ec '__fzf_cd'
|
||||
bind \eC '__fzf_cd --hidden'
|
||||
bind \eO '__fzf_open'
|
||||
bind \eo '__fzf_open --editor'
|
||||
|
||||
if bind -M insert >/dev/null 2>/dev/null
|
||||
bind -M insert \co '__fzf_find_file'
|
||||
bind -M insert \cr '__fzf_reverse_isearch'
|
||||
bind -M insert \ec '__fzf_cd'
|
||||
bind -M insert \eC '__fzf_cd --hidden'
|
||||
bind -M insert \eO '__fzf_open'
|
||||
bind -M insert \eo '__fzf_open --editor'
|
||||
end
|
||||
|
||||
if set -q FZF_COMPLETE
|
||||
bind \t '__fzf_complete'
|
||||
if bind -M insert >/dev/null 2>/dev/null
|
||||
bind -M insert \t '__fzf_complete'
|
||||
end
|
||||
end
|
100
install
100
install
@ -1,52 +1,78 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/usr/bin/env fish
|
||||
|
||||
# We need the environment to be able to symlink files accordingly
|
||||
case "$1" in
|
||||
desktop)
|
||||
EXTENSION="desktop"
|
||||
;;
|
||||
thinkpad)
|
||||
EXTENSION="thinkpad"
|
||||
;;
|
||||
esac
|
||||
function mkdir_if_not_exist
|
||||
if [ ! -d "$argv" ]
|
||||
echo "Creating directory $argv"
|
||||
mkdir -p "$argv"
|
||||
end
|
||||
end
|
||||
|
||||
# Create nvim config directory if it doesn't exist
|
||||
if [ ! -d ~/.config/nvim ]; then
|
||||
echo "Creating ~/.config/nvim"
|
||||
mkdir -p ~/.config/nvim
|
||||
fi
|
||||
function install_omf_package_if_not_exist
|
||||
if test (omf list | grep -c "$argv") -eq 0
|
||||
omf install "$argv"
|
||||
end
|
||||
end
|
||||
|
||||
for d in $(find -- */ -maxdepth 0 -type d | cut -f1 -d '/'); do
|
||||
echo "Linking $d..."
|
||||
(stow -t "$HOME" "$d")
|
||||
done
|
||||
# Create directories that need to exist
|
||||
mkdir_if_not_exist ~/.cache/mpd
|
||||
mkdir_if_not_exist ~/.config/alacritty
|
||||
mkdir_if_not_exist ~/.config/nvim
|
||||
mkdir_if_not_exist ~/.config/fish
|
||||
mkdir_if_not_exist ~/.config/omf
|
||||
mkdir_if_not_exist ~/.config/mpd
|
||||
mkdir_if_not_exist ~/.weechat
|
||||
|
||||
for d in (find -- */ -maxdepth 0 -type d | cut -f1 -d '/')
|
||||
echo "Linking $d..."
|
||||
stow -t "$HOME" "$d"
|
||||
end
|
||||
|
||||
# Refresh xgd
|
||||
update-desktop-database ~/.local/share/applications/
|
||||
xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol
|
||||
if test (grep -c 'x-scheme-handler/org-protocol=org-protocol.desktop' ~/.config/mimeapps.list) -eq 0
|
||||
echo "Refreshing xgd to handle org-protocol"
|
||||
update-desktop-database ~/.local/share/applications/
|
||||
xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol
|
||||
end
|
||||
|
||||
# Install zplug if it doesn't exist yet
|
||||
if [ ! -d ~/.zplug ]; then
|
||||
echo "Installing zplug"
|
||||
curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh
|
||||
fi
|
||||
# Install oh-my-fish if it isn't installed
|
||||
if [ ! -d ~/.local/share/omf ]
|
||||
curl -L https://get.oh-my.fish | fish
|
||||
end
|
||||
|
||||
# Install oh-my-fish plugins
|
||||
install_omf_package_if_not_exist bobthefish
|
||||
install_omf_package_if_not_exist colored-man-pages
|
||||
install_omf_package_if_not_exist extract
|
||||
install_omf_package_if_not_exist fzf
|
||||
install_omf_package_if_not_exist gi
|
||||
install_omf_package_if_not_exist git-flow
|
||||
install_omf_package_if_not_exist sudope
|
||||
install_omf_package_if_not_exist wttr
|
||||
|
||||
# Install vim plugins & requirements
|
||||
if [ ! "$(pip list --user | grep 'pynvim' | wc -l)" -ge 1 ]; then
|
||||
pip install --user pynvim
|
||||
fi
|
||||
if test (pip list --user | grep -c 'pynvim') -ne 1
|
||||
pip install --user pynvim
|
||||
end
|
||||
|
||||
# Install plug package manager if it doesn't exist
|
||||
if [ ! -d ~/.config/nvim/plugged ]; then
|
||||
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
|
||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
fi
|
||||
if [ ! -d ~/.config/nvim/plugged ]
|
||||
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
|
||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||
end
|
||||
|
||||
# Install Neovim plugins
|
||||
nvim +PlugInstall +qall
|
||||
|
||||
# Setup broot if not done already
|
||||
if [ ! -d ~/.local/share/broot ]
|
||||
broot --install
|
||||
end
|
||||
|
||||
# Update fish completions (auto generated from man pages)
|
||||
fish_update_completions
|
||||
|
||||
# Notify user to manually symlink files
|
||||
if [ ! -z "$EXTENSION" ]; then
|
||||
echo "\n\nDon't forget to symlink these files:\n\n"
|
||||
find ~ \( -type l -o -type f \) -name "*.$EXTENSION" -exec ls -al {} \;
|
||||
fi
|
||||
if [ -n "$argv[1]" ]
|
||||
printf "\n\nDon't forget to symlink these files:\n\n"
|
||||
find ~ \( -type l -o -type f \) -name "*.$argv[1]" -exec ls -al {} \;
|
||||
end
|
||||
|
@ -1,10 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env fish
|
||||
|
||||
# Terminate already running bar instances
|
||||
killall -q polybar
|
||||
|
||||
# Wait until the processes have been shut down
|
||||
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||
while pgrep -u $UID -x polybar >/dev/null
|
||||
sleep 1
|
||||
end
|
||||
|
||||
# Launch bar1 and bar2
|
||||
polybar monitor1 &
|
||||
|
@ -1,10 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env fish
|
||||
|
||||
# Terminate already running bar instances
|
||||
killall -q polybar
|
||||
|
||||
# Wait until the processes have been shut down
|
||||
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||
while pgrep -u $UID -x polybar >/dev/null
|
||||
sleep 1
|
||||
end
|
||||
|
||||
# Launch bar1 and bar2
|
||||
polybar laptop-top &
|
||||
|
@ -64,7 +64,7 @@ shift + XF86Eject
|
||||
|
||||
# terminal emulator
|
||||
super + Return
|
||||
$TERMINAL
|
||||
alacritty
|
||||
|
||||
# program launcher
|
||||
super + @space
|
||||
|
@ -12,7 +12,7 @@ set -g @themepack 'powerline/double/magenta'
|
||||
set -g @resurrect-strategy-nvim 'session'
|
||||
|
||||
# Set zsh as default command so profile etc is properly loaded
|
||||
set-option -g default-command zsh
|
||||
set-option -g default-command fish
|
||||
|
||||
# Other examples:
|
||||
# set -g @plugin 'github_username/plugin_name'
|
||||
|
@ -1,3 +0,0 @@
|
||||
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
|
||||
exec startx
|
||||
fi
|
57
zsh/.zshenv
57
zsh/.zshenv
@ -1,57 +0,0 @@
|
||||
path_if_exists() {
|
||||
if [[ -d $1 ]]; then
|
||||
export PATH="$1:$PATH"
|
||||
fi
|
||||
}
|
||||
|
||||
# Stop tmux bitching about 256 colours
|
||||
TERM="xterm-256color"
|
||||
|
||||
# PATH
|
||||
path_if_exists ~/.config/yarn/global/node_modules/.bin
|
||||
path_if_exists ~/.local/bin
|
||||
path_if_exists ~/.emacs.d/bin
|
||||
|
||||
# Set GPG TTY
|
||||
export GPG_TTY="$(tty)"
|
||||
|
||||
# Set default browser
|
||||
if [ -e "/usr/bin/brave" ]; then
|
||||
export BROWSER="brave"
|
||||
else
|
||||
if [ -e "/usr/bin/firefox" ]; then
|
||||
export BROWSER="firefox"
|
||||
elif [ -e "/usr/bin/iceweasel" ]; then
|
||||
export BROWSER="iceweasel"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set default terminal
|
||||
export TERMINAL="alacritty"
|
||||
|
||||
# pkg editor
|
||||
export VISUAL="nvim"
|
||||
|
||||
# editor
|
||||
export EDITOR="nvim"
|
||||
|
||||
# Enable password store extensions
|
||||
export PASSWORD_STORE_ENABLE_EXTENSIONS="true"
|
||||
|
||||
# This needs to be set for bspwm to see config
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
|
||||
# Save history file in proper place
|
||||
HISTFILE=~/.cache/zsh/history
|
||||
|
||||
# Use alternative muhome
|
||||
export MU_HOME="/home/alrayyes/.cache/mu"
|
||||
|
||||
# Needed to get zsh to play nice with emacs vterm
|
||||
if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
|
||||
alias clear='printf "\e]51;Evterm-clear-scrollback\e\\";tput clear'
|
||||
fi
|
||||
vterm_prompt_end() {
|
||||
printf "\e]51;A$(whoami)@$(hostname):$(pwd)\e\\"
|
||||
}
|
||||
PROMPT=$PROMPT'%{$(vterm_prompt_end)%}'
|
81
zsh/.zshrc
81
zsh/.zshrc
@ -1,81 +0,0 @@
|
||||
source_if_exists() {
|
||||
if [[ -f $1 ]]; then
|
||||
source $1
|
||||
fi
|
||||
}
|
||||
|
||||
# Check if zplug is installed
|
||||
if [[ ! -d ~/.zplug ]]; then
|
||||
git clone https://github.com/b4b4r07/zplug ~/.zplug
|
||||
fi
|
||||
source ~/.zplug/init.zsh
|
||||
|
||||
# Spaceship theme
|
||||
zplug "denysdovhan/spaceship-prompt", use:spaceship.zsh, from:github, as:theme
|
||||
|
||||
# Oh my zsh lugins
|
||||
# sudo must start after vi-mode for it to work properly
|
||||
zplug "plugins/archlinux", from:oh-my-zsh
|
||||
zplug "plugins/composer", from:oh-my-zsh
|
||||
zplug "plugins/docker", from:oh-my-zsh
|
||||
zplug "plugins/docker-compose", from:oh-my-zsh
|
||||
zplug "plugins/extract", from:oh-my-zsh
|
||||
zplug "plugins/fzf", from:oh-my-zsh
|
||||
zplug "plugins/git", from:oh-my-zsh
|
||||
zplug "plugins/gitignore", from:oh-my-zsh
|
||||
zplug "plugins/pass", from:oh-my-zsh
|
||||
zplug "plugins/ripgrep", from:oh-my-zsh
|
||||
zplug "plugins/rsync", from:oh-my-zsh
|
||||
zplug "plugins/systemd", from:oh-my-zsh
|
||||
zplug "plugins/tmux", from:oh-my-zsh
|
||||
zplug "plugins/vi-mode", from:oh-my-zsh
|
||||
zplug "plugins/sudo", from:oh-my-zsh
|
||||
zplug "plugins/yarn", from:oh-my-zsh
|
||||
zplug "zsh-users/zsh-autosuggestions", from:github, defer:3
|
||||
zplug "zsh-users/zsh-syntax-highlighting", from:github, defer:3
|
||||
|
||||
# Install packages
|
||||
if ! zplug check --verbose; then
|
||||
printf "Install zplug plugins? [y/N]: "
|
||||
if read -q; then
|
||||
echo
|
||||
zplug install
|
||||
fi
|
||||
fi
|
||||
|
||||
zplug load
|
||||
|
||||
# vim alias
|
||||
alias v="nvim"
|
||||
alias sv="sudo nvim"
|
||||
|
||||
# ls alias
|
||||
alias ls="exa"
|
||||
alias l="exa -al"
|
||||
|
||||
# vifm alias
|
||||
alias vifm="vifmrun"
|
||||
|
||||
# Use lf to switch directories and bind it to ctrl-o
|
||||
lfcd() {
|
||||
tmp="$(mktemp)"
|
||||
lf -last-dir-path="$tmp" "$@"
|
||||
if [ -f "$tmp" ]; then
|
||||
dir="$(cat "$tmp")"
|
||||
rm -f "$tmp"
|
||||
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
|
||||
fi
|
||||
}
|
||||
|
||||
bindkey -s '^o' 'lfcd\n'
|
||||
|
||||
# Set GPG TTY
|
||||
export GPG_TTY="$(tty)"
|
||||
|
||||
# Refresh gpg-agent tty in case user switches into an X session
|
||||
gpg-connect-agent updatestartuptty /bye >/dev/null
|
||||
|
||||
# Needed for broot
|
||||
source /home/alrayyes/.config/broot/launcher/bash/br
|
||||
|
||||
neofetch
|
Loading…
Reference in New Issue
Block a user