DEV Community

Cover image for Open files FAST from zsh | or bash if thats your thing
Waylon Walker
Waylon Walker

Posted on • Originally published at waylonwalker.com

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

Top comments (0)