Linted all files

This commit is contained in:
Kristofers Solo
2022-08-01 08:26:03 +03:00
parent a7bec557b8
commit d68a56ae9a
37 changed files with 3225 additions and 3102 deletions

View File

@@ -52,15 +52,15 @@ export KEYTIMEOUT=1
# Change cursor shape for different vi modes.
function zle-keymap-select {
case $KEYMAP in
vicmd) echo -ne '\e[1 q' ;; # block
viins | main) echo -ne '\e[5 q' ;; # beam
esac
case $KEYMAP in
vicmd) echo -ne '\e[1 q' ;; # block
viins | main) echo -ne '\e[5 q' ;; # beam
esac
}
zle -N zle-keymap-select
zle-line-init() {
zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
echo -ne '\e[5 q'
zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
echo -ne '\e[5 q'
}
zle -N zle-line-init
echo -ne '\e[5 q' # Use beam shape cursor on startup.
@@ -68,22 +68,22 @@ preexec() { echo -ne '\e[5 q'; } # Use beam shape cursor for each new prompt.
# Run exa on directory change
function cd() {
new_directory="$*"
if [ $# -eq 0 ]; then
new_directory=${HOME}
fi
builtin cd "${new_directory}" && exa -a --icons --group-directories-first
new_directory="$*"
if [ $# -eq 0 ]; then
new_directory=${HOME}
fi
builtin cd "${new_directory}" && exa -a --icons --group-directories-first
}
# Use lf to switch directories and bind it to ctrl-o
function lfcd() {
tmp="$(mktemp)"
lfrun -last-dir-path="$tmp" "$@"
if [ -f "$tmp" ]; then
dir="$(bat "$tmp")"
rm -f "$tmp" >/dev/null
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
fi
tmp="$(mktemp)"
lfrun -last-dir-path="$tmp" "$@"
if [ -f "$tmp" ]; then
dir="$(bat "$tmp")"
rm -f "$tmp" >/dev/null
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
fi
}
# Navigate words with CTRL+ARROW keys