config/shell: Fix shell startup speed & return code
This commit is contained in:
parent
a3a72400b0
commit
07d59bacd8
|
@ -1,4 +1,4 @@
|
||||||
which pacman >/dev/null || return
|
which pacman >/dev/null || return 0
|
||||||
|
|
||||||
# Arch aliases
|
# Arch aliases
|
||||||
alias pac='sudo pacman'
|
alias pac='sudo pacman'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
which apt >/dev/null || return
|
which apt >/dev/null || return 0
|
||||||
|
|
||||||
addalternative() {
|
addalternative() {
|
||||||
sudo update-alternatives --install /usr/bin/$1 $1 "$(which "$1$2")" 1
|
sudo update-alternatives --install /usr/bin/$1 $1 "$(which "$1$2")" 1
|
||||||
|
|
|
@ -24,7 +24,7 @@ edconf() {
|
||||||
touch "$conf_cache"
|
touch "$conf_cache"
|
||||||
# | xargs file | grep text | cut -d':' -f1 # this filters out non-text files, but it's ridiculously slow
|
# | xargs file | grep text | cut -d':' -f1 # this filters out non-text files, but it's ridiculously slow
|
||||||
sel="$({ cat "$conf_cache"; test -f "$conf_extra" && cat "$conf_extra"; fd --type file --size -1m --hidden --exact-depth 1 . ~; fd --type file --size -1m --max-depth 3 . --full-path "$XDG_CONFIG_HOME" /etc } | dedup | fzf -1 -0 --tiebreak=end,length --preview 'bat --color=always --style=numbers --line-range :200 {}' --query="$1" --history "$conf_cache_dir/searches")"
|
sel="$({ cat "$conf_cache"; test -f "$conf_extra" && cat "$conf_extra"; fd --type file --size -1m --hidden --exact-depth 1 . ~; fd --type file --size -1m --max-depth 3 . --full-path "$XDG_CONFIG_HOME" /etc } | dedup | fzf -1 -0 --tiebreak=end,length --preview 'bat --color=always --style=numbers --line-range :200 {}' --query="$1" --history "$conf_cache_dir/searches")"
|
||||||
test "$sel" && ((echo "$sel" | cat - "$conf_cache" | head -9 >"$conf_tmp" && mv "$conf_tmp" "$conf_cache") & editright "$sel")
|
test "$sel" && ((echo "$sel" | cat - "$conf_cache" | head -30 >"$conf_tmp" && mv "$conf_tmp" "$conf_cache") & editright "$sel")
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG_SHELL_FUNCTIONS="${BASH_SOURCE[0]:-${(%):-%x}}"
|
CONFIG_SHELL_FUNCTIONS="${BASH_SOURCE[0]:-${(%):-%x}}"
|
||||||
|
@ -100,12 +100,13 @@ rpl() {
|
||||||
}"
|
}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Recover stray swap files from neovim
|
# Recover stray swap files from neovim
|
||||||
alias vrec="ls $XDG_DATA_HOME/nvim/swap | sed 's/\%/\//g' | sed 's|\(.*\)\..*|\1|' | head -1 | xargs -r nvim"
|
alias vrec="ls $XDG_DATA_HOME/nvim/swap | sed 's/\%/\//g' | sed 's|\(.*\)\..*|\1|' | head -1 | xargs -r nvim"
|
||||||
alias vrecd="ls $XDG_DATA_HOME/nvim/swap | head -1 | xargs -r rm"
|
alias vrecd="ls $XDG_DATA_HOME/nvim/swap | head -1 | xargs -r rm"
|
||||||
|
|
||||||
# Applications
|
# Applications
|
||||||
alias dict="(builtin cd $(dirname $(locate -n 2 /dict.txt)) && rlwrap perl dictcc-helper.pl)"
|
alias dict="(builtin cd $XDG_DATA_HOME/dictcc && rlwrap perl dictcc-helper.pl)"
|
||||||
alias startMinecraftServer='curl https://ipinfo.io/ip | xclip -sel clip && cd ~/daten/games/sharedgames/minecraft/server && java -jar forge-1.12.2-14.23.5.2768-universal.jar -mx 8G'
|
alias startMinecraftServer='curl https://ipinfo.io/ip | xclip -sel clip && cd ~/daten/games/sharedgames/minecraft/server && java -jar forge-1.12.2-14.23.5.2768-universal.jar -mx 8G'
|
||||||
|
|
||||||
test -d $HOME/.dropbox && dropbox_path="$(cat $HOME/.dropbox/info.json | grep -Po '"'"path"'"\s*:\s*"\K([^"]*)')"
|
test -d $HOME/.dropbox && dropbox_path="$(cat $HOME/.dropbox/info.json | grep -Po '"'"path"'"\s*:\s*"\K([^"]*)')"
|
||||||
|
|
Loading…
Reference in New Issue