Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Problem with user function





On 2024-02-23 09:49, Duke Normandin wrote:
.zshrc:92: defining function based on alias `ls'
.zshrc:92: parse error near `()'

nls() {ls --group-directories-first -c --color ~/notes/${1} }

You'll be getting better answers shortly, but for now:

You can't have an alias like that inside a function.  Somewhere oh-my-zsh has aliased 'ls' so you've either got to change that alias or do this:
nls() {/usr/bin/ls --group-directories-first -c --color ~/notes/${1} }

... so that the shell knows to use the binary command.



Messages sorted by: Reverse Date, Date, Thread, Author