Skip to main content 41q.ru

Zsh

листая FAQ нашёл интересные функции, которые хотелось бы прокопать.

multi-line commands editable as a single buffer (even files!),
variable editing (vared),
command buffer stack,
print text straight into the buffer for immediate editing (print -z),

zle - Z-Shell Line Editor

Multi-line editing

4.6.1: Multi-line editing

Можно нажать клавишу ESC, а затем Return - и печатная каретка перенесется на следующую строчку

code snippet start

  % print This is line one<ESC><RET>
  print This is line two

code snippet end

Стрелочками можно вернуться на строку выше.

Порядок чтения файлов инициализации

FILES:

  1. $ZDOTDIR/.zshenv
  2. $ZDOTDIR/.zprofile
  3. $ZDOTDIR/.zshrc
  4. $ZDOTDIR/.zlogin
  5. $ZDOTDIR/.zlogout
  6. ${TMPPREFIX}***   (default is /tmp/zsh*)
  7. /etc/zshenv
  8. /etc/zprofile
  9. /etc/zshrc
  10. /etc/zlogin
  11. /etc/zlogout    (installation-specific - /etc is the default)

If ZDOTDIR is unset, HOME is used instead.

Commands are then read from $ZDOTDIR/.zshenv.

If the shell is a login shell, commands are read from /etc/zprofile and then $ZDOTDIR/.zprofile.

Then, if the shell is interactive, commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc.

Finally, if the shell is a login shell, /etc/zlogin and $ZDOTDIR/.zlogin are read.