shell: tidy up shell configs
This commit is contained in:
@@ -40,21 +40,6 @@ __prompt_command() {
|
|||||||
# ============================== vi-Mode
|
# ============================== vi-Mode
|
||||||
set -o vi
|
set -o vi
|
||||||
|
|
||||||
# ============================== fzf
|
|
||||||
export FZF_DEFAULT_OPTS='
|
|
||||||
--layout=reverse
|
|
||||||
--color=fg:#5c6a72,bg:#FDF6E3,hl:#8da101
|
|
||||||
--color=fg+:#5c6a72,bg+:#eee8d5,hl+:#8da101
|
|
||||||
--color=info:#5c6a72,prompt:#5c6a72,pointer:#5c6a72
|
|
||||||
--color=marker:#5c6a72,spinner:#5c6a72,header:#5c6a72'
|
|
||||||
|
|
||||||
if [[ -d ~/.vim/plugged/fzf ]]; then
|
|
||||||
[[ -x $(which fzf 2> /dev/null) ]] || export PATH=$PATH:$HOME/.vim/plugged/fzf/bin
|
|
||||||
source ~/.vim/plugged/fzf/shell/completion.bash
|
|
||||||
source ~/.vim/plugged/fzf/shell/key-bindings.bash
|
|
||||||
bind '"":"fzf-file-widget\n"'
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ============================== Source other definitions
|
# ============================== Source other definitions
|
||||||
[ -f ~/.shellrc.local ] && source ~/.shellrc.local
|
|
||||||
[ -f ~/.shellrc.alias ] && source ~/.shellrc.alias
|
[ -f ~/.shellrc.alias ] && source ~/.shellrc.alias
|
||||||
|
[ -f ~/.shellrc.local ] && source ~/.shellrc.local
|
||||||
|
|||||||
@@ -1,42 +1,56 @@
|
|||||||
|
# fzf
|
||||||
|
export FZF_DEFAULT_OPTS='
|
||||||
|
--layout=reverse
|
||||||
|
--color=fg:#5c6a72,bg:#FDF6E3,hl:#8da101
|
||||||
|
--color=fg+:#5c6a72,bg+:#eee8d5,hl+:#8da101
|
||||||
|
--color=info:#5c6a72,prompt:#5c6a72,pointer:#5c6a72
|
||||||
|
--color=marker:#5c6a72,spinner:#5c6a72,header:#5c6a72'
|
||||||
|
|
||||||
|
if [[ -d ~/.vim/plugged/fzf ]]; then
|
||||||
|
[[ -x $(which fzf 2> /dev/null) ]] || export PATH=$PATH:$HOME/.vim/plugged/fzf/bin
|
||||||
|
if [[ "$SHELL" =~ "bash$" ]]; then
|
||||||
|
source ~/.vim/plugged/fzf/shell/completion.bash
|
||||||
|
source ~/.vim/plugged/fzf/shell/key-bindings.bash
|
||||||
|
fi
|
||||||
|
if [[ "$SHELL" =~ "zsh$" ]]; then
|
||||||
|
source ~/.vim/plugged/fzf/shell/completion.zsh
|
||||||
|
source ~/.vim/plugged/fzf/shell/key-bindings.zsh
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# zsh specific
|
# zsh specific
|
||||||
if [[ "$SHELL" =~ "zsh$" ]]; then
|
if [[ "$SHELL" =~ "zsh$" ]]; then
|
||||||
alias -g G='| rg -i'
|
alias -g G='| rg -i'
|
||||||
alias -g L='| less'
|
alias -g L='| less'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# general
|
# alpabetically sorted
|
||||||
alias c='clear'
|
alias c='clear'
|
||||||
alias cr='cargo run'
|
|
||||||
alias cb='cargo build'
|
alias cb='cargo build'
|
||||||
alias t='tmux a || tmux'
|
alias cdt='mkdir /tmp/$(cat /proc/sys/kernel/random/uuid); cd $_'
|
||||||
alias o='xdg-open' # to change a mime use: `xdg-mime default APPLICATION HANDLE`
|
alias cp='cp -i'
|
||||||
alias v='vim'
|
alias cpu='watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo"'
|
||||||
|
alias cr='cargo run'
|
||||||
alias d='docker'
|
alias d='docker'
|
||||||
alias dc='docker compose'
|
alias dc='docker compose'
|
||||||
|
alias fixagent='eval $(tmux show-env -s | grep "^SSH_")'
|
||||||
alias g='git'
|
alias g='git'
|
||||||
alias gg='git grep $1'
|
alias gg='git grep'
|
||||||
alias tex='nix-shell ~/.dots/tex.nix'
|
|
||||||
alias texmk="latexmk -xelatex -shell-escape"
|
|
||||||
alias mktex=texmk
|
|
||||||
alias lg="lazygit"
|
|
||||||
|
|
||||||
alias cdt='mkdir /tmp/$(cat /proc/sys/kernel/random/uuid); cd $_'
|
|
||||||
|
|
||||||
alias l='ls -lFh --color'
|
alias l='ls -lFh --color'
|
||||||
alias la='ls -lAFh --color'
|
alias la='ls -lAFh --color'
|
||||||
alias ll='ls -l --color'
|
alias ll='ls -l --color'
|
||||||
|
alias mktex="latexmk -xelatex -shell-escape"
|
||||||
alias rm='rm -i'
|
|
||||||
alias cp='cp -i'
|
|
||||||
alias mv='mv -i'
|
alias mv='mv -i'
|
||||||
|
|
||||||
alias gg='git grep'
|
|
||||||
|
|
||||||
alias truecolor='curl -s https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh | bash'
|
|
||||||
alias nssh='SSH_AUTH_SOCK= ssh'
|
alias nssh='SSH_AUTH_SOCK= ssh'
|
||||||
alias cpu='watch -n.1 "grep \"^[c]pu MHz\" /proc/cpuinfo"'
|
alias o='xdg-open' # to change a mime use: `xdg-mime default APPLICATION HANDLE`
|
||||||
alias fixagent='eval $(tmux show-env -s | grep "^SSH_")'
|
alias rm='rm -i'
|
||||||
alias whatsmyip='curl https://ipinfo.io/ip ; echo'
|
alias t='tmux a || tmux'
|
||||||
|
alias texmk="latexmk -xelatex -shell-escape"
|
||||||
|
alias texsh='nix-shell ~/.dots/tex.nix'
|
||||||
|
alias truecolor='curl -s https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh | bash'
|
||||||
|
alias v='vim'
|
||||||
|
alias whatsmyip='curl https://ipinfo.io/ip; echo'
|
||||||
|
|
||||||
# nmcli
|
# nmcli
|
||||||
alias con='nmcli con'
|
alias con='nmcli con'
|
||||||
@@ -77,7 +91,7 @@ ocr() {
|
|||||||
# echo 'Invalid option'
|
# echo 'Invalid option'
|
||||||
# fi
|
# fi
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
# power() {
|
# power() {
|
||||||
# location='/sys/firmware/acpi/platform_profile'
|
# location='/sys/firmware/acpi/platform_profile'
|
||||||
# if [ -z $1 ]; then
|
# if [ -z $1 ]; then
|
||||||
|
|||||||
@@ -84,20 +84,6 @@ RPS2=$RPS1
|
|||||||
# Enable backspace to delete in vi-mode
|
# Enable backspace to delete in vi-mode
|
||||||
bindkey -v '^?' backward-delete-char
|
bindkey -v '^?' backward-delete-char
|
||||||
|
|
||||||
# ============================== fzf
|
|
||||||
export FZF_DEFAULT_OPTS='
|
|
||||||
--layout=reverse
|
|
||||||
--color=fg:#5c6a72,bg:#FDF6E3,hl:#8da101
|
|
||||||
--color=fg+:#5c6a72,bg+:#eee8d5,hl+:#8da101
|
|
||||||
--color=info:#5c6a72,prompt:#5c6a72,pointer:#5c6a72
|
|
||||||
--color=marker:#5c6a72,spinner:#5c6a72,header:#5c6a72'
|
|
||||||
|
|
||||||
if [[ -d ~/.vim/plugged/fzf ]]; then
|
|
||||||
[[ -x $(which fzf 2> /dev/null) ]] || export PATH=$PATH:$HOME/.vim/plugged/fzf/bin
|
|
||||||
source ~/.vim/plugged/fzf/shell/completion.zsh
|
|
||||||
source ~/.vim/plugged/fzf/shell/key-bindings.zsh
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ============================== Fancy Hacks
|
# ============================== Fancy Hacks
|
||||||
# Always use C-z for bg and fg
|
# Always use C-z for bg and fg
|
||||||
fancy-ctrl-z () {
|
fancy-ctrl-z () {
|
||||||
@@ -113,8 +99,6 @@ zle -N fancy-ctrl-z
|
|||||||
bindkey '^Z' fancy-ctrl-z
|
bindkey '^Z' fancy-ctrl-z
|
||||||
|
|
||||||
# ============================== Source other definitions
|
# ============================== Source other definitions
|
||||||
[ -f ~/.shellrc.local ] && source ~/.shellrc.local
|
|
||||||
[ -f ~/.shellrc.alias ] && source ~/.shellrc.alias
|
[ -f ~/.shellrc.alias ] && source ~/.shellrc.alias
|
||||||
|
[ -f ~/.shellrc.local ] && source ~/.shellrc.local
|
||||||
# nix
|
|
||||||
if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi
|
if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi
|
||||||
|
|||||||
Reference in New Issue
Block a user