Hot answers tagged

2

zsh is working as expected (see man zshbuiltins): . File searches $path to find File unless there is a / in the name; while source is almost the same as ., except that it searches the working directory first. I don't know how . .zshrc worked previously, unless there was a bug in an earlier release of zsh. You can: alias .=source; link ~/.zshrc to a ...


2

With zmv Zsh has zmv, which offers a very simple interface to renaming (or copying) files: autoload zmv zmv '(*).bak' '$1' Every pair of parentheses captures a group, which can then be accessed with $1, $2, and so on. Here are some more examples. Another way to do it with zmv is to use the -W option, which works for simple rename tasks: zmv -W '*.bak' ...


1

In a terminal, control@ and controlspace are almost always the same: the control modifier tells the terminal to strip off bits above the low-order 5. The code for @ is 0x40, and that for space is 0x20. The low-order bits would be 0x1f — and those bits are zero in @ and space. So both produce an ASCII NUL (0).


1

@lumbic's answer worked for me only with a few changes: setopt share_history up-line-or-local-history() { zle set-local-history 1 zle up-line-or-history zle set-local-history 0 } zle -N up-line-or-local-history down-line-or-local-history() { zle set-local-history 1 zle down-line-or-history zle set-local-history 0 } zle -N ...


1

If you look at the help for it (run-help r), you’ll see it listed at the bottom of the help for fc. It is quoted as: Same as fc -e - But you won’t find the -e option directly described there. One can expect that it refers to the editor. A later reference to ename states: If ename is `-', no editor is invoked. When editing is complete, the edited ...


1

When the preexec function is called, zle is already finished and hence, zle widgets can't be used any more. So, you have to intercept the pressing of the ENTER key before zle terminates. By default ENTER is bound to accept-line, but this might depend on other tricks you already use; $ bindkey | grep '\^M' "^M" accept-line We now write a new widget we ...



Only top voted, non community-wiki answers of a minimum length are eligible