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

Re: About insert-last-word and "command args | less"



On Oct 14,  1:56pm, Vincent Lefevre wrote:
} 
} I often do something like
} 
}   svn log file | m
} 
} (where m is an alias for less). But when I use insert-last-word, I get
} the "m" instead of "file". Is there a way to ignore the one-character
} words?

Use smart-insert-last-word.

autoload -U smart-insert-last-word
zle -N insert-last-word smart-insert-last-word
zstyle :insert-last-word match '*[[:alnum:]]*[[:alnum:]]*'

That example says that a word must contain at least two alphanumeric
characters, so neither 'm' nor '|' qualifies and "file" is inserted.



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