From 436a86a1a4fae9963a6cb7b142a31bca9e16dbeb Mon Sep 17 00:00:00 2001 From: thek4n Date: Thu, 17 Oct 2024 10:14:25 +0300 Subject: [PATCH] zsh mappings --- .gitignore | 2 +- home/user/.config/bash/aliases | 3 +++ home/user/.config/bash/functions | 4 ++++ home/user/.config/tmux/mappings.conf | 7 ++++++- home/user/.config/zsh/mappings | 18 +++++++++++++++++- home/user/.config/zsh/options | 4 ++++ home/user/.config/zsh/zshrc.d/.gitkeep | 0 home/user/.config/zsh/zshrc.d/00_zhashd.sh | 3 +++ 8 files changed, 38 insertions(+), 3 deletions(-) delete mode 100644 home/user/.config/zsh/zshrc.d/.gitkeep create mode 100644 home/user/.config/zsh/zshrc.d/00_zhashd.sh diff --git a/.gitignore b/.gitignore index 4165084..080af1a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ home/user/.config/nvim/spell home/user/.config/bash/bashrc.d/* !home/user/.config/bash/bashrc.d/.gitkeep home/user/.config/zsh/zshrc.d/* -!home/user/.config/zsh/zshrc.d/.gitkeep +!home/user/.config/zsh/zshrc.d/00_zhashd.sh home/user/.config/zsh/.zcalc_history *.zwc diff --git a/home/user/.config/bash/aliases b/home/user/.config/bash/aliases index b20be62..1d162e6 100644 --- a/home/user/.config/bash/aliases +++ b/home/user/.config/bash/aliases @@ -40,6 +40,9 @@ alias wp='cd $WORKING_PROJECT' alias path='echo -e ${PATH//:/\\n}' +alias dh='dirs -v' +alias pd='popd' + # shorts alias c='clear' alias h='history 0' diff --git a/home/user/.config/bash/functions b/home/user/.config/bash/functions index c7b42fb..8581a14 100644 --- a/home/user/.config/bash/functions +++ b/home/user/.config/bash/functions @@ -274,4 +274,8 @@ bak() { _bak "${filename}" fi done +} + +f() { + find . -name "*${1}*" } \ No newline at end of file diff --git a/home/user/.config/tmux/mappings.conf b/home/user/.config/tmux/mappings.conf index 4aca30b..d2b6df3 100644 --- a/home/user/.config/tmux/mappings.conf +++ b/home/user/.config/tmux/mappings.conf @@ -43,7 +43,12 @@ bind-key Y { } bind t display-popup -E -h 70% -w 60% -bind c clock-mode + + + +bind c display-menu \ + calendar c "display-popup -w 33% -h 70% 'cal -y'" \ + time t "clock-mode" # Switch new session diff --git a/home/user/.config/zsh/mappings b/home/user/.config/zsh/mappings index 2619029..9883847 100644 --- a/home/user/.config/zsh/mappings +++ b/home/user/.config/zsh/mappings @@ -47,4 +47,20 @@ bindkey -M viins '^S' insert-sudo # C-s bindkey '`' autosuggest-accept bindkey '^?' backward-delete-char -bindkey '^W' backward-delete-word \ No newline at end of file +bindkey '^W' backward-delete-word + + +popdquiet() { + popd &>/dev/null + zle reset-prompt +} +zle -N popdquiet +bindkey "^P" popdquiet + + +cddotdot() { + cd .. + zle reset-prompt +} +zle -N cddotdot +bindkey "^O" cddotdot \ No newline at end of file diff --git a/home/user/.config/zsh/options b/home/user/.config/zsh/options index eebe618..d341826 100644 --- a/home/user/.config/zsh/options +++ b/home/user/.config/zsh/options @@ -7,6 +7,10 @@ setopt numericglobsort # sort filenames numerically when it makes sense setopt promptsubst # enable command substitution in prompt setopt noflowcontrol # disable C-s mapping + +DIRSTACKSIZE=8 +setopt autopushd + WORDCHARS=${WORDCHARS//\/} # Don't consider certain characters part of the word # hide EOL sign ('%') diff --git a/home/user/.config/zsh/zshrc.d/.gitkeep b/home/user/.config/zsh/zshrc.d/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/home/user/.config/zsh/zshrc.d/00_zhashd.sh b/home/user/.config/zsh/zshrc.d/00_zhashd.sh new file mode 100644 index 0000000..9421dc6 --- /dev/null +++ b/home/user/.config/zsh/zshrc.d/00_zhashd.sh @@ -0,0 +1,3 @@ +# Example: +# hash -d pa=~/code/ProcessAgent2 +# cd ~pa \ No newline at end of file