Suppose I did some time ago cd /path/to/foo/bar
and then evince file.pdf
. Now if I want to open file.pdf
again I have also to do both steps again (using history). However I would do it in a single step. I.e. I want that not evince file.pdf
is written to .zsh_history
but evince /path/to/foo/bar/file.pdf
. How can I achieve this for example by modifying my .zshrc
? evince
is only an example. It should work with any command.
Should I have any drawbacks in mind with this new behavior?
N.B: Currently I am using z
vor cd
history and fzf
for general history.
echo test $var
orecho test.txt $(echo ..)
from within /bin? Should it change it to/bin/echo /bin/test /bin/$var
(what if$var
contains an absolute path),/bin/echo /bin/test.txt /
(what if/bin
is a symlink to/usr/bin
, should that be/usr
instead for..
)?ls -l --time-style long-iso ls
,make CFLAGS=-g file.c install
,man zsh
,rsync foo bar:baz
,env ls
..., how is zsh to know which of the arguments are relative paths to files that should be made absolute? That would require knowing (and parsing the same way they do) the full syntax of all the commands available on the system. If you think about it just a few minutes, you'll see it's not realistic.