From 92bc3d7f212447e12bfc52a3c09e236e308af87e Mon Sep 17 00:00:00 2001 From: crater2150 Date: Tue, 13 Dec 2022 16:45:40 +0100 Subject: [PATCH 1/3] Add shome shortcuts --- aliases/functions | 2 ++ dirs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/aliases/functions b/aliases/functions index 9b434b2..b45f081 100644 --- a/aliases/functions +++ b/aliases/functions @@ -258,6 +258,8 @@ alias -g T="| tail" alias -g XS='$(xclip -o -selection primary)' alias -g XC='$(xclip -o -selection clipboard)' +alias -g GITROOT='$(git rev-parse --show-toplevel)' + alias -s log=vimpager #}}} diff --git a/dirs b/dirs index 7816c9b..97e62f7 100755 --- a/dirs +++ b/dirs @@ -1 +1,3 @@ m=/run/media/$USER/ +j=${XDG_DATA_HOME}/jails +rc=${j}/webapp-rocketchat/Downloads From 45678c7037a3c1f297fc0295aa72b0549fd058b8 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Tue, 13 Dec 2022 17:43:38 +0100 Subject: [PATCH 2/3] Migrate from zplug to zim --- .zimrc | 15 +++++++++++++++ bindings.zsh | 19 +++++++++++++++++++ .../highlight-config.plugin.zsh | 2 ++ zshrc | 16 +++++++++++++++- 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .zimrc diff --git a/.zimrc b/.zimrc new file mode 100644 index 0000000..c10e6d7 --- /dev/null +++ b/.zimrc @@ -0,0 +1,15 @@ +zmodule jreese/zsh-titles + +zmodule crater2150-zsh/fzf-widgets +zmodule crater2150-zsh/conf +zmodule crater2150-zsh/chroma-z + +zmodule $ZDOTDIR/plugins/tmpsrc +zmodule $ZDOTDIR/plugins/pyenv + +zmodule $ZDOTDIR/plugins/highlight-config +zmodule zsh-users/zsh-syntax-highlighting + +zmodule ohmyzsh/ohmyzsh --root plugins/ng + +zmodule urbainvaes/fzf-marks diff --git a/bindings.zsh b/bindings.zsh index 441fd6c..5e7bdee 100644 --- a/bindings.zsh +++ b/bindings.zsh @@ -92,3 +92,22 @@ fi zle-venv() { zle push-line; BUFFER="venv"; zle accept-line } zle -N zle-venv bindkey "\ev" zle-venv + +# Map widgets to key +bindkey "\ec" fzf-change-directory +bindkey "^r" fzf-insert-history +bindkey "^xf" fzf-insert-files +bindkey "^xd" fzf-insert-directory +bindkey "^xn" fzf-insert-named-directory + +# Start fzf in a tmux pane +FZF_WIDGET_TMUX=1 + +# use fd for finding directories and files +FZF_CHANGE_DIR_FIND_COMMAND="fd -t d" +FZF_INSERT_DIR_COMMAND="fd -t d" +FZF_INSERT_FILES_COMMAND="fd -t f" +FZF_EDIT_FILES_COMMAND="fd -t f" + +# modify history command to remove duplicates +FZF_HISTORY_COMMAND="fc -l 1 | sed s/ *[0-9]* //g | awk !seen[\$0]++" diff --git a/plugins/highlight-config/highlight-config.plugin.zsh b/plugins/highlight-config/highlight-config.plugin.zsh index de7bf31..dec3ff9 100644 --- a/plugins/highlight-config/highlight-config.plugin.zsh +++ b/plugins/highlight-config/highlight-config.plugin.zsh @@ -1,3 +1,5 @@ +typeset -gA ZSH_HIGHLIGHT_STYLES + ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern) if [[ "`tput colors`" == "256" ]] || [[ "`tput colors`" == "88" ]] ; then diff --git a/zshrc b/zshrc index 93832b6..f7b0042 100644 --- a/zshrc +++ b/zshrc @@ -1,3 +1,5 @@ +typeset -U path + HISTFILE=~/.histfile HISTSIZE=100000 SAVEHIST=100000 @@ -57,7 +59,19 @@ function(){ . $(zdotfile completion.zsh) -source $(zdotfile zplug.zsh) + +ZIM_HOME=${XDG_CACHE_HOME:-$HOME/.cache}/zim +if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then + curl -fsSL --create-dirs -o ${ZIM_HOME}/zimfw.zsh \ + https://github.com/zimfw/zimfw/releases/latest/download/zimfw.zsh +fi +if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZDOTDIR:-${HOME}}/.zimrc ]]; then + source ${ZIM_HOME}/zimfw.zsh init -q +fi +source ${ZIM_HOME}/init.zsh + + +#source $(zdotfile zplug.zsh) . $(zdotfile bindings.zsh) From e18474d56b42ae1220bebe928243cba56109d2f1 Mon Sep 17 00:00:00 2001 From: crater2150 Date: Fri, 13 Jan 2023 11:38:12 +0100 Subject: [PATCH 3/3] Fix quoting in fzf-widget settings, switch to active fork --- .zimrc | 2 +- bindings.zsh | 6 +----- zplug | 1 - zshrc | 3 +-- 4 files changed, 3 insertions(+), 9 deletions(-) delete mode 160000 zplug diff --git a/.zimrc b/.zimrc index c10e6d7..f2db05f 100644 --- a/.zimrc +++ b/.zimrc @@ -1,6 +1,6 @@ zmodule jreese/zsh-titles -zmodule crater2150-zsh/fzf-widgets +zmodule SmartFinn/fzf-widgets zmodule crater2150-zsh/conf zmodule crater2150-zsh/chroma-z diff --git a/bindings.zsh b/bindings.zsh index 5e7bdee..aea5cd8 100644 --- a/bindings.zsh +++ b/bindings.zsh @@ -100,14 +100,10 @@ bindkey "^xf" fzf-insert-files bindkey "^xd" fzf-insert-directory bindkey "^xn" fzf-insert-named-directory -# Start fzf in a tmux pane -FZF_WIDGET_TMUX=1 - -# use fd for finding directories and files FZF_CHANGE_DIR_FIND_COMMAND="fd -t d" FZF_INSERT_DIR_COMMAND="fd -t d" FZF_INSERT_FILES_COMMAND="fd -t f" FZF_EDIT_FILES_COMMAND="fd -t f" # modify history command to remove duplicates -FZF_HISTORY_COMMAND="fc -l 1 | sed s/ *[0-9]* //g | awk !seen[\$0]++" +FZF_HISTORY_COMMAND="fc -l 1 | sed 's/ *[0-9]* //g' | awk '!seen[\$0]++'" diff --git a/zplug b/zplug deleted file mode 160000 index 18cfcd4..0000000 --- a/zplug +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 18cfcd4f761eceaf2ca63a291d11782d0f8b590e diff --git a/zshrc b/zshrc index f7b0042..7fdbe9a 100644 --- a/zshrc +++ b/zshrc @@ -57,8 +57,6 @@ function(){ try-source $(zdotfile dirs) } -. $(zdotfile completion.zsh) - ZIM_HOME=${XDG_CACHE_HOME:-$HOME/.cache}/zim if [[ ! -e ${ZIM_HOME}/zimfw.zsh ]]; then @@ -71,6 +69,7 @@ fi source ${ZIM_HOME}/init.zsh +. $(zdotfile completion.zsh) #source $(zdotfile zplug.zsh) . $(zdotfile bindings.zsh)