diff options
-rw-r--r-- | .config/zsh/.zshenv | 5 | ||||
-rw-r--r-- | .config/zsh/.zshrc | 38 | ||||
-rw-r--r-- | .zshenv | 2 | ||||
-rw-r--r-- | README.md | 15 |
4 files changed, 57 insertions, 3 deletions
diff --git a/.config/zsh/.zshenv b/.config/zsh/.zshenv new file mode 100644 index 0000000..77603e5 --- /dev/null +++ b/.config/zsh/.zshenv @@ -0,0 +1,5 @@ +export EDITOR='vim' + +if [[ $INTELLIJ -eq 1 ]]; then + export PATH=/usr/local/bin:/usr/bin:$PATH +fi diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc new file mode 100644 index 0000000..b5b37ce --- /dev/null +++ b/.config/zsh/.zshrc @@ -0,0 +1,38 @@ +# magic cd +setopt autocd +export CDPATH=".:$HOME:$HOME/devil:$HOME/src" + +# vi mode +bindkey -v +# make backspace and delete behave like vim +bindkey -M viins '^?' backward-delete-char +bindkey -M viins '^H' backward-delete-char +bindkey -M viins '^[[3~' delete-char +# display block cursor in normal mode +function zle-keymap-select zle-line-init zle-line-finish { + case $KEYMAP in + vicmd) echo -ne "\e[2 q";; + viins|main) echo -ne "\e[6 q";; + esac + zle reset-prompt + zle -R +} +zle -N zle-keymap-select +zle -N zle-line-init +zle -N zle-line-finish + +# aliases +alias cls=clear +alias config='git --git-dir=$HOME/.dotfiles --work-tree=$HOME' +alias ls='ls --color=auto' +alias ll='ls -l --almost-all --no-group --human-readable' + +# collapse spaces into tabs in-place +# spacetotab <FILE> [WIDTH=4] +function spacetotab () { + unexpand --tabs=${2:-4} --first-only "$1" > "$1.tmp" + mv "$1.tmp" "$1" +} + +# display a fortune when opening an interactive terminal +tty -s && fortune $HOME/fortunes 2>/dev/null ||: diff --git a/.zshenv b/.zshenv new file mode 100644 index 0000000..4c8b590 --- /dev/null +++ b/.zshenv @@ -0,0 +1,2 @@ +export ZDOTDIR=$HOME/.config/zsh +. $ZDOTDIR/.zshenv diff --git a/README.md b/README.md index d800f9b..ee03343 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,10 @@ config config --local status.showUntrackedFiles no ## Other new machine setup +### installed programs +* vim +* zsh (remember to `chsh -s $(which zsh)`) + ### sshd config ```bash echo <<END @@ -32,10 +36,15 @@ END >> /etc/ssh/sshd_config ``` ### todo -* zsh, and rewrite our existing zsh config +* zsh plugins + * probably antigen for the plugin manager + * antigen use oh-my-zsh && antigen bundle git * p10k - * zsh-history-substring-search - * zsh-autosuggestions + * zsh-users/zsh-history-substring-search (probably not when zsh already has ctrl+r) + * zsh-users/zsh-autosuggestions (maybe) + * zsh-users/zsh-syntax-highlighting + * zsh-users/zsh-completions + * knu/zsh-manydots-magic * fortune * firefox lockwise * autoupdates |