@@ -45,7 +45,6 @@ _tldr() {
45
45
zle -N _tldr
46
46
47
47
# custom keybindings for fast directory exploration
48
- bindkey -s " ^[l" " ls -al^J" # alt-l shortcut to listing a directory
49
48
bindkey -s " ^[r" " ranger^J" # alt-r shortcut to file explorer
50
49
# custom keybinding for tldr help on the current command
51
50
bindkey " ^[H" _tldr
@@ -100,20 +99,6 @@ if (( $+commands[kitty] )); then
100
99
alias d=" kitty +kitten diff"
101
100
fi
102
101
103
- # if we have todo.sh installed
104
- # let's add some handy aliases
105
- # https://github.com/todotxt/todo.txt-cli/wiki/Tips-and-Tricks
106
- if (( $+ commands[todo.sh] )) ; then
107
- export TODOTXT_DEFAULT_ACTION=ls
108
- export TODO_ACTIONS_DIR=$HOME /.config/todo/actions.d
109
- alias t=' todo.sh'
110
- fi
111
-
112
- # attempt to open up with emacs in daemon mode
113
- # fallback to emacs if it's not running
114
- # https://www.emacswiki.org/emacs/EmacsAsDaemon
115
- # alias todo="emacsclient --alternate-editor emacs $HOME/TODO.org"
116
-
117
102
# fbr - checkout branch specified or provide a list of all git branches
118
103
# including remotes for selection
119
104
#
@@ -163,3 +148,38 @@ if (( $+commands[thefuck] )); then
163
148
fi
164
149
165
150
151
+ # Define the function to traverse the directory stack
152
+ function fzf_cd_stack() {
153
+ local dir
154
+ dir=$( dirs -v | fzf --height 40% --reverse --prompt=" Dir Stack> " ) && zle -I
155
+ if [[ -n $dir ]]; then
156
+ # Extract the directory path and change to it
157
+ local target_dir
158
+ target_dir=$( echo $dir | awk ' {print $2}' )
159
+ eval " cd $target_dir "
160
+ fi
161
+ zle reset-prompt
162
+ }
163
+
164
+ # zle -N fzf_cd_stack_widget fzf_cd_stack
165
+
166
+ # Bind the widget to Ctrl+G
167
+ # bindkey '^G' fzf_cd_stack_widget
168
+
169
+ fasd-fzf-cd-editor () {
170
+ item=" $( fasd -Rl " $1 " | fzf -1 -0 --no-sort +m) "
171
+ if [[ -d ${item} ]]; then
172
+ cd " ${item} "
173
+ elif [[ -f ${item} ]]; then
174
+ ($EDITOR " ${item} " < /dev/tty)
175
+ else
176
+ return 1
177
+ fi
178
+ zle accept-line
179
+ }
180
+
181
+ # zle -N fasd-fzf-cd-editor
182
+
183
+ # Bind the widget to Ctrl+E
184
+ # bindkey '^e' fasd-fzf-cd-editor
185
+
0 commit comments