I see this autocomplete into directory ("mario/bin" in your case) only happens, if there is one folder in it. When fzf is active, then Enter will autocomplete only one level of dir, the current one, but it will also end the fzf selection and go back to the shell line. Not sure why it will autocomplete one more level into a directory. I was not aware of this issue and tested it first time. EDIT: I am currently not sure if this Ctrl+w is something that is supported out of the box or if this is a feature caused by another plugin I use: "jeffreytse/zsh-vi-mode" So I am not exactly sure what the problem with this issue is. If I press / and autocomplete a wrong part and go back to the line, then Ctrl+w will remove that last word. Thanks for reading.Īre these issues you have after trying out?īecause for me Ctrl+w works to delete last word before fzf or even when fzf is active. I don't know how easy these would be to solve or if I should open a issue on github, but with these two things fixed this would pretty much be perfect. But I don't want to cd into bin, just into mario. I type cd /Gam and press / and it autocompletes to /Games/, then I type mar and press / and it autocompletes to cd /Games/mario/bin/. Instead I have to cancel out of fzf press ctrl+w, and go into fzf again. It would be ideal if I could just ctrl+w (pretty standard for deleting the last word) and retype. If the directory I'm tab-autocompleting contains only one directory, then it will autocomplete directly into that subdirectory.įor issue 1, let's say I want to go into /Games/mario/ but I accidentally press / on a different suggestion like /Gamma/. If I make a mistake in one instance of a directory I have to cancel out of the CD and delete. I have a few issues tho and I'm curious what you think: Hi, I just landed here cause this plugin seems to be what I've been looking for. Zstyle ':fzf-tab:complete:cd:*' fzf-preview 'lsd -1 $realpath' # zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls -1 -color=always $realpath' # preview directory's content with exa when completing cd # set list-colors to enable filename colorizing Zstyle ':completion:*:descriptions' format '' # set descriptions format to enable group support Zstyle ':completion:*:git-checkout:*' sort false # disable sort when completing `git checkout` Here my settings for the plugin (notice I use lsd, so you would need to replace that line with ls most likely): # Settings for Plugin fzf-tab It will even list the content of the directory, as seen in the screenshot. This is not a dedicated cd tool by itself, but using fzf as a selection menu when using tab for autocompletion on ZSH. # add a folder to the list automatically. # Don't forget to enable "setopt auto_pushd", so that each "cd" command will # If an argument was given, then filter list by regex and jump directly to # If no argument is given, list visited directories. Hopefully it works, because I had some trouble to make it work. The filter is in regex format using grep -E. # `pushd`, `popd` and `dirs -v` to use the stack.Įdit: Here is a function, which works same as above, but if an argument was given then it will filter list and jump automatically to matching first entry from dirs list. # Automatically add directory to stack when using `cd`. It makes more sense with the auto_pushd option enabled in the ".zshrc" (I think this works in Bash too). I don't use a specific cd tool, but here is an alias I created for ZSH (someone helped me out with this one, but don't remember who): # Show list of current directories and switch by choosing a number.Īlias cdd='dirs -v & read index & let "index=$index+0" & cd ~"$index" & let "index=$index+1" & popd -q +"$index"'
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |