On Sun, 24 Mar 2019 18:47:46 +0800 (AWST)
David Adam <zanc...@ucc.gu.uwa.edu.au> wrote:

> On Sun, 24 Mar 2019, Manfred Lotz wrote:
> > In zsh I could exclude certain commands from being added to history
> > like follows:
> > 
> > _ignore_cmds="mycmd somecmd"
> > for c in $(echo $_ignore_cmds); do
> >       eval "alias $c=' $c'"
> > done
> > 
> > In config.fish I tried something similar:
> > 
> > 
> > set _ignore_cmds cd mplayer lrm
> > for c in $_ignore_cmds
> >       eval "alias $c=' $c'"
> > end
> > 
> > 
> > but it doesn't work.
> > 
> > Any idea what I'm doing wrong?  
> 
> Aliases in fish are just implemented as functions; you are probably
> better off using abbreviations, which are expanded in interactive
> mode before execution.
> 
> Try:
> 
> for c in $_ignore_cmds
>    abbr --add --global $c " $c"
> end
> 

Thanks, this helps.

-- 
Manfred



_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to