Ambdós costats versió prèvia Revisió prèvia Següent revisió | Revisió prèvia |
linux:zsh:start [23/03/2020 15:17] – [mirar] mate | linux:zsh:start [07/11/2023 05:35] (actual) – [+ características] mate |
---|
* [[linux:zsh:install]] | * [[linux:zsh:install]] |
* [[http://zsh.sourceforge.net/]] | * [[http://zsh.sourceforge.net/]] |
| * introducción: |
| * [[https://linuxconfig.org/learn-the-basics-of-the-zsh-shell]] |
| * [[http://reasoniamhere.com/2014/01/11/outrageously-useful-tips-to-master-your-z-shell/]] |
| |
== + características | == + características |
* [[linux:zsh:zmv]] | * [[linux:zsh:zmv]] |
* [[linux:zsh:modules]] | * [[linux:zsh:modules]] |
| * [[linux:zsh:prompt]] |
| |
== curiosidades | == curiosidades |
| * **src**: recarga entorno (plugin) |
* **take** : función crea directorio(s) y te lleva dentro | * **take** : función crea directorio(s) y te lleva dentro |
* **zsh_stats** : función de comandos más usados | * **zsh_stats** : función de comandos más usados |
name="John Doe" | name="John Doe" |
echo $name # john doe</code> | echo $name # john doe</code> |
| * **ESC,Q**: [[http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#index-push_002dline|push-line]] -> guarda la línea en curso en buffer, permite ejecutar otro comando y la reestablece |
| * [[https://unix.stackexchange.com/questions/74184/how-to-save-current-command-on-zsh]] |
| * [[http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#index-push_002dinput|push-input]]: versión multilínea, sin keybinding |
| * ZSH Line Editor: zle, bindkey, vared |
| * **zshaddhistory**: controlar por función (hook) que comandos se guardan o no |
| * [[https://unix.stackexchange.com/questions/312528/zsh-history-comment-out-dangerous-commands]] |
| * [[https://superuser.com/questions/352788/how-to-prevent-a-command-in-the-zshell-from-being-saved-into-history]] |
| * [[https://unix.stackexchange.com/questions/6094/is-there-any-way-to-keep-a-command-from-being-added-to-your-history]] |
| * [[http://zsh.sourceforge.net/Doc/Release/Options.html#History]] |
| * [[https://medium.com/@prasincs/hiding-secret-keys-from-shell-history-part-1-5875eb5556cc]] |
| * ''export HISTORY_IGNORE="(ls|cat|AWS|SECRET)"'' |
| * afectaría a la sugerencia de comandos recientes mientras trabajas? -> si |
| |
| === peculiaridades |
| * read (input variable) |
| * <code bash>read -r "option?Quina opció vols" # retorna en option el resultat</code> |
| * <code bash>vared -p 'What would you like to do?: ' -c tmp</code> |
| * ''-q'': espera resposta y/n |
| * ''-A'': array? -> [[https://stackoverflow.com/questions/36453146/why-does-read-a-fail-in-zsh]] |
| * <code bash>() { |
| local compcontext='yn:yes or no:(y n)' |
| vared -cp 'erasing all directories (y/n) ? ' ans |
| }</code> |
| |
== mirar | == mirar |
* <del>[[https://code.joejag.com/2014/why-zsh.html]]</del> | * <del>[[https://code.joejag.com/2014/why-zsh.html]]</del> √ |
* <del>[[https://github.com/sorin-ionescu/prezto]]</del> | * <del>[[https://github.com/sorin-ionescu/prezto]]</del> √ |
* [[http://grml.org/zsh/zsh-lovers.html]] √ | * [[http://grml.org/zsh/zsh-lovers.html]] √ |
* [[http://www.bash2zsh.com/zsh_refcard/refcard.pdf]] √ | * [[http://www.bash2zsh.com/zsh_refcard/refcard.pdf]] √ |
* copiar fichero a clipboard | |
* [[https://github.com/robbyrussell/oh-my-zsh/blob/master/lib/clipboard.zsh]] | |
* [[https://linuxconfig.org/learn-the-basics-of-the-zsh-shell]] | |
* [[http://reasoniamhere.com/2014/01/11/outrageously-useful-tips-to-master-your-z-shell/]] | |
| |
=== cheatsheet | === cheatsheet |
| |
== tools | == tools |
* ''~/.oh-my-zsh/tools/theme_chooser.sh'' | * shell state options: uso de %%%%% para ciertas funciones en el prompt |
* shell state options: uso de %%%%% para ciertas funciones en el shell | |
* [[http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html]] | * [[http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html]] |
* [[https://books.google.es/books?id=UZOZAgAAQBAJ&lpg=PT55&ots=koSY_E_6Px&dq=zsh%20%25k%20script&hl=ca&pg=PT48#v=onepage&q=%25k&f=false]] | * [[https://wiki.archlinux.org/index.php/Zsh_(Espa%C3%B1ol)]] |