1
0
mirror of https://github.com/bertptrs/vimconfig.git synced 2025-12-25 20:40:32 +01:00

Remember recently visited directories.

This commit is contained in:
2020-02-09 19:07:02 +01:00
parent 445f1afc83
commit 491580840a
3 changed files with 21 additions and 2 deletions

3
.gitignore vendored
View File

@@ -3,6 +3,9 @@
# vim netrwhist exists and I don't know what it does
vim/.vim/.netrwhist
# zsh's recent dirs shouldn't be versioned
zsh/.config/zsh/.chpwd-recent-dirs
# Ignore the installation of services for now.
systemd/.config/systemd/user/default.target.wants
systemd/.config/systemd/user/timers.target.wants

View File

@@ -75,6 +75,9 @@ alias wget="wget --hsts-file=\"$XDG_CACHE_HOME/wget-hsts\""
alias makej="make -j$(nproc)"
alias sdc='sudo docker-compose'
# Ensure we can make cheap copies on btrfs
alias cp='cp --reflink=auto'
if (( $+commands[thefuck] ))
then
alias fuck='$(thefuck $(fc -ln -1))'
@@ -211,6 +214,13 @@ SAVEHIST=$HISTSIZE
setopt autocd # Automatically cd to dirs typed
setopt notify
#####################
# Directory history #
#####################
autoload -Uz chpwd_recent_dirs cdr add-zsh-hook
add-zsh-hook chpwd chpwd_recent_dirs
######################################
# Application-specific configuration #
######################################

View File

@@ -6,6 +6,9 @@ autoload -U colors && colors
# Initialize VCS prompt configuration
autoload -Uz vcs_info
# And the hooks system
autoload -Uz add-zsh-hook
zstyle ':vcs_info:*' enable git svn
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' check-for-staged-changes true
@@ -74,20 +77,23 @@ function prompt_rprompt() {
echo "${(j::)rprompt}"
}
function precmd () {
function prompt_precmd () {
# Set window title to username@machine: pwd
print -Pn "\e]0;%n@%m: %2~\a"
# Load VCS info
vcs_info
}
function preexec () {
function prompt_preexec () {
# Set window title to command about to be executed.
if [[ -n $1 ]]; then
print -Pn "\e]0;$1\a"
fi
}
add-zsh-hook precmd prompt_precmd
add-zsh-hook preexec prompt_preexec
PS1="$(prompt_ps1)"
RPROMPT="$(prompt_rprompt)"