summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
l---------.cache/bg1
-rw-r--r--.config/zsh/.zshrc45
-rwxr-xr-x.local/bin/lmc2
-rwxr-xr-x.local/bin/setbg2
l---------.local/share/bg1
5 files changed, 29 insertions, 22 deletions
diff --git a/.cache/bg b/.cache/bg
deleted file mode 120000
index 787af6f..0000000
--- a/.cache/bg
+++ /dev/null
@@ -1 +0,0 @@
-../.config/wall.png \ No newline at end of file
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc
index 371d219..679dc93 100644
--- a/.config/zsh/.zshrc
+++ b/.config/zsh/.zshrc
@@ -1,19 +1,30 @@
# Luke's config for the Zoomer Shell
-autoload -U colors && colors
+# Enable colors and change prompt:
+autoload -U colors && colors # Load colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
+setopt autocd # Automatically cd into typed directory.
+stty stop undef # Disable ctrl-s to freeze terminal.
+
+# History in cache directory:
+HISTSIZE=10000
+SAVEHIST=10000
+HISTFILE=~/.cache/zsh/history
# Load aliases and shortcuts if existent.
[ -f "$XDG_CONFIG_HOME/shortcutrc" ] && source "$XDG_CONFIG_HOME/shortcutrc"
[ -f "$XDG_CONFIG_HOME/aliasrc" ] && source "$XDG_CONFIG_HOME/aliasrc"
+# Basic auto/tab complete:
autoload -U compinit
zstyle ':completion:*' menu select
zmodload zsh/complist
compinit
+_comp_options+=(globdots) # Include hidden files.
-# Include hidden files in autocomplete:
-_comp_options+=(globdots)
+# vi mode
+bindkey -v
+export KEYTIMEOUT=1
# Use vim keys in tab complete menu:
bindkey -M menuselect 'h' vi-backward-char
@@ -22,14 +33,11 @@ bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -v '^?' backward-delete-char
-export KEYTIMEOUT=1
-
# Change cursor shape for different vi modes.
function zle-keymap-select {
if [[ ${KEYMAP} == vicmd ]] ||
[[ $1 = 'block' ]]; then
echo -ne '\e[1 q'
-
elif [[ ${KEYMAP} == main ]] ||
[[ ${KEYMAP} == viins ]] ||
[[ ${KEYMAP} = '' ]] ||
@@ -38,17 +46,13 @@ function zle-keymap-select {
fi
}
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 -N zle-line-init
-
-# Use beam shape cursor on startup.
-echo -ne '\e[5 q'
-# Use beam shape cursor for each new prompt.
-preexec() { echo -ne '\e[5 q' ;}
+echo -ne '\e[5 q' # Use beam shape cursor on startup.
+preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
# Use lf to switch directories and bind it to ctrl-o
lfcd () {
@@ -57,15 +61,20 @@ lfcd () {
if [ -f "$tmp" ]; then
dir="$(cat "$tmp")"
rm -f "$tmp"
- if [ -d "$dir" ]; then
- if [ "$dir" != "$(pwd)" ]; then
- cd "$dir"
- fi
- fi
+ [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
fi
}
+bindkey -s '^o' 'lfcd\n'
+
+bindkey -s '^a' 'bc -l\n'
+
+bindkey -s '^f' 'cd "$(dirname "$(fzf)")"\n'
+
+bindkey '^[[P' delete-char
-bindkey -s '^o' 'lfcd\n' # zsh
+# Edit line in vim with ctrl-e:
+autoload edit-command-line; zle -N edit-command-line
+bindkey '^e' edit-command-line
# Load zsh-syntax-highlighting; should be last.
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null
diff --git a/.local/bin/lmc b/.local/bin/lmc
index 6d64b64..d431495 100755
--- a/.local/bin/lmc
+++ b/.local/bin/lmc
@@ -26,5 +26,3 @@ case "$1" in
down) down ;;
control) control ;;
esac
-
-pkill -RTMIN+10 "${STATUSBAR:?}" &
diff --git a/.local/bin/setbg b/.local/bin/setbg
index 7b07e23..8269378 100755
--- a/.local/bin/setbg
+++ b/.local/bin/setbg
@@ -7,7 +7,7 @@
# If wal is installed, also generate a colorscheme.
# Location of link to wallpaper link.
-bgloc="${XDG_CACHE_HOME:-$HOME/.cache/}/bg"
+bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg"
[ -f "$1" ] && ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..."
diff --git a/.local/share/bg b/.local/share/bg
new file mode 120000
index 0000000..6c5d299
--- /dev/null
+++ b/.local/share/bg
@@ -0,0 +1 @@
+../../.config/wall.png \ No newline at end of file