Open files FAST from zsh | or bash if thats your thing
source link: https://dev.to/waylonwalker/fuzzy-file-editor-from-zsh-3kl7
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Open files FAST from zsh | or bash if thats your thing
I am often in a set of tmux splits flying back and forth, accidentally close my editor, so when I come back to that split and hit my keybinds to edit files I enter them into zsh rather than into nvim like I intended. Today I am going to
sand off that rough edge and get as similar behavior to nvim as I can with a couple of aliases.
Make sure you check out the YouTube video to see all of my improvements.
what's an alias
If you have never heard of an alias before it's essentially a shortcut to a given command. You can pass additional flags to the underlying command and they will get passed in. Most of the time they are just shorter versions of commands that you run often or even like in this case a common muscle memory typo that occurs for you.
My new alias's for fuzzy editing files from zsh
Here are the new aliases that I came up with to smooth out my workflow. These give me a similar feel to how these keys work in neovim but from zsh.
# fuzzy select file to edit
alias p='nvim `fzf --preview="bat --color always {}"`'
# give me the same syntax as edit while in neovim
alias :e='nvim '
Enter fullscreen mode
Exit fullscreen mode
Follow the YouTube channel or the rss
feed to stay up to date.
Related links
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK