daniruiz / dotfiles

~/.dotfiles
https://drasite.com/dotfiles
MIT License
305 stars 74 forks source link

in 2.2 unexpected error after :w 'command' to .zshrc #4

Closed ddrt closed 4 years ago

ddrt commented 4 years ago

on macos using iterm+VIM and going through your lovely guide. I was in section 2.2 and was adding command -v <new_command> &> /dev/null && alias <...>=<...> results in a parse error

.zshrc|112 error| parse error near '&>'

This error appears when I :w and not sure how to resolve this string (fairly new to this). If this is unexpected do you have any insight as to what I did wrong?

daniruiz commented 4 years ago

Hi! command -v <new_command> &> /dev/null && alias <...>=<...> is only a template for other aliases, where <_> needs to be replaced with other strings, for example:

command -v lsd &> /dev/null && alias ls='lsd --group-dirs first'

It's a trick to create the alias only if the command is available

I have to update the guide and make some things more clear :sweat_smile: