Hypnosis |
---|
|
Autosuggestion is a psychological technique related to the placebo effect, developed by apothecaryÉmile Coué at the beginning of the 20th century. It is a form of self-induced suggestion in which individuals guide their own thoughts, feelings, or behavior. The technique is often used in self-hypnosis.
Typological distinctions[edit]
Émile Coué identified two very different types of self-suggestion:
- intentional, 'reflective autosuggestion': made by deliberate and conscious effort, and
- unintentional, 'spontaneous auto-suggestion': which is a 'natural phenomenon of our mental life … which takes place without conscious effort [and has its effect] with an intensity proportional to the keenness of [our] attention'.[1]
Dec 10, 2019 Installing ZSH shell for linux distros. Install zsh with your package manager; sudo apt install zsh. Make your default shell. Chsh -s $(which zsh) 3. Guild wars 2 nude mods. To accept the autosuggestion, hit right arrow or Control-F. If the autosuggestion is not what you want, just ignore it. Zsh basically supports the same syntax as. Installing Zsh is made incredibly easy by using a package manager. To install Zsh on Ubuntu run the following in your standard terminal (Ctrl + Alt + T): sudo apt-get install zsh. Then, verify it has installed correctly: zsh -version. Next we want to set it to our default shell: chsh -s $(which zsh). Set ZSHAUTOSUGGESTBUFFERMAXSIZE to an integer value to disable autosuggestion for large buffers. The default is unset, which means that autosuggestion will be tried for any buffer size. Recommended value is 20. This can be useful when pasting large amount of text in the terminal, to avoid triggering autosuggestion for strings that are too long.
In relation to Coué's group of 'spontaneous auto-suggestions', his student Charles Baudouin (1920, p. 41) made three further useful distinctions, based upon the sources from which they came:
- 'Instances belonging to the representative domain
(sensations, mental images, dreams, visions, memories, opinions, and all intellectual phenomena).' - 'Instances belonging to the affective domain
(joy or sorrow, emotions, sentiments, tendencies, passions).' - 'Instances belonging to the active or motor domain
(actions, volitions, desires, gestures, movements at the periphery or in the interior of the body, functional or organic modifications).'
Émile Coué[edit]
Émile Coué, who had both B.A. and B.Sc. degrees before he was 21, graduated top of his class (with First Class Honours) with a degree in pharmacology from the prestigious Collège Sainte-Barbe in Paris in 1882.[2] Having spent an additional six months as an intern at the Necker-Enfants Malades Hospital in Paris, he returned to Troyes, where he worked as an apothecary from 1882 to 1910.[3]
'Hypnosis' à la Ambroise-Auguste Liébeault and Hippolyte Bernheim[edit]
In 1885, his investigations of hypnotism and the power of the imagination began with Ambroise-Auguste Liébeault and Hippolyte Bernheim, two leading exponents of 'hypnosis',[4] of Nancy, with whom he studied in 1885 and 1886 (having taken leave from his business in Troyes). Following this training, 'he dabbled with ‘hypnosis’ in Troyes in 1886, but soon discovered that their Liébeault's techniques were hopeless, and abandoned ‘hypnosis’ altogether'.[5]
Hypnotism à la James Braid and Xenophon LaMotte Sage[edit]
In 1901, Coué sent to the United States for a free book, Hypnotism as It is (i.e., Sage, 1900a),[6] which purported to disclose 'secrets [of the] science that brings business and social success' and 'the hidden mysteries of personal magnetism, hypnotism, magnetic healing, etc.'. Deeply impressed by its contents, he purchased the French language version of the associated correspondence course (i.e., Sage, 1900b, and 1900c),[7] created by stage hypnotist extraordinaire, 'Professor Xenophon LaMotte Sage, A.M., Ph.D., LL.D., of Rochester, New York' (who had been admitted into the prestigious Medico-Legal Society of New York in 1899).
In real life, Xenophon LaMotte Sage was none other than Ewing Virgil Neal (1868-1949), the multi-millionaire, calligrapher, hypnotist, publisher, advertising/marketing pioneer (he launched the career of Carl R. Byoir), pharmaceutical manufacturer, parfumier, international businessman, confidant of Mussolini, Commandatore of the Order of the Crown of Italy, Officer of the Legion of Honour, and fugitive from justice, who moved to France in the 1920s.[8]
Sage's course supplied the missing piece of the puzzle — namely, Braid-style hypnotic inductions — the solution for which had, up to that time, eluded Coué:
- 'Coué immediately recognised that the course’s Braid-style of hypnotism was ideal for mental therapeutics. He undertook an intense study, and was soon skilled enough to offer hypnotism alongside his pharmaceutical enterprise. In the context of Liébeault’s ‘hypnosis’, Braid’s hypnotism, and Coué’s (later) discoveries about autosuggestion, one must recognise the substantially different orientations of Liébeault’s 'suggestive therapeutics', which concentrated on imposing the coercive power of the operator’s suggestion, and Braid’s 'psycho-physiology', which concentrated on activating the transformative power of the subject’s mind.'[9][10]
Although he had abandoned Liébeault's 'hypnosis' in 1886, he adopted Braid's hypnotism in 1901; and, in fact, in addition to, and (often) separate from, his auto-suggestive practices, Coué actively used Braid's hypnotism for the rest of his professional life.[11]
Suggestion and Auto-suggestion[edit]
Coué was so deeply impressed by Bernheim's concept of “suggestive therapeutics” — in effect, 'an imperfect re-branding of the ‘dominant idea’ theory that Braid had appropriated from Thomas Brown'[5][12] — that, on his return to Troyes from his (1886-1886) interlude with Liébeault and Bernheim, he made a practice of reassuring his clients by praising each remedy's efficacy. He noticed that, in specific cases, he could increase a medicine's efficacy by praising its effectiveness. He realized that, when compared with those to whom he said nothing, those to whom he praised the medicine had a noticeable improvement (this is suggestive of what would later be identified as a 'placebo response').
- 'Around 1903, Coué recommended a new patent medicine, based on its promotional material, which effected an unexpected and immediate cure (Baudouin, 1920, p.90; Shrout, 1985, p.36). Coué (the chemist) found “[by subsequent] chemical analysis in his laboratory [that there was] nothing in the medicine which by the remotest stretch of the imagination accounted for the results” (Shrout, ibid.). Coué (the hypnotist) concluded that it was cure by suggestion; but, rather than Coué having cured him, the man had cured himself by continuously telling himself the same thing that Coué had told him.'[13]
The birth of 'Conscious Autosuggestion'[edit]
Coué discovered that subjects could not be hypnotized against their will and, more importantly, that the effects of hypnotic suggestion waned when the subjects regained consciousness.[citation needed] He thus eventually developed the Coué method, and released his first book, Self-Mastery Through Conscious Autosuggestion (published in 1920 in England and two years later in the United States). He described autosuggestion itself as:
. an instrument that we possess at birth, and with which we play unconsciously all our life, as a baby plays with its rattle. Minecraft kill aura settings. It is however a dangerous instrument; it can wound or even kill you if you handle it imprudently and unconsciously. It can on the contrary save your life when you know how to employ it consciously.[14]
Although Coué never doubted pharmaceutical medicine, and still advocated its application, he also came to believe that one's mental state could positively affect, and even amplify, the pharmaceutical action of medication. He observed that those patients who used his mantra-like conscious suggestion, 'Every day, in every way, I'm getting better and better', (French: Tous les jours, à tous points de vue, je vais de mieux en mieux; lit. 'Every day, from all points of view, I'm getting better and better') — in his view, replacing their 'thought of illness' with a new 'thought of cure', could augment their pharmaceutical regimen in an efficacious way.
Conceptual difference from Autogenic Training[edit]
By contrast with the conceptualization driving Coué's auto-suggestive self-administration procedure — namely, that constant repetition creates a situation in which 'a particular idea saturates the microcognitive environment of 'the mind'…', which, then, in its turn, 'is converted into a corresponding ideomotor, ideosensory, or ideoaffective action, by the ideodynamic principle of action', 'which then, in its turn, generates the response'[15][16] — the primary target of the entirely different self-administration procedure developed by Johannes Heinrich Schultz, known as Autogenic Training, was to affect the autonomic nervous system, rather than (as Coué's did) to affect 'the mind'.
The Coué method[edit]
Continuously, unjustly, and mistakenly trivialised as just a hand-clasp, someunwarranted optimism, and a ‘mantra’, Coué’s method evolved over several
decades of meticulous observation, theoretical speculation, in-the-field testing,
incremental adjustment, and step-by-step transformation.
It tentatively began (c.1901) with very directive one-to-one hypnotic inter-
ventions, based upon the approaches and techniques that Coué had acquired
from an American correspondence course.
As his theoretical knowledge, clinical experience, understanding of
suggestion and autosuggestion, and hypnotic skills expanded, it gradually
developed into its final subject-centred version—an intricate complex of
(group) education, (group) hypnotherapy, (group) ego-strengthening, and
(group) training in self-suggested pain control; and, following instruction in
performing the prescribed self-administration ritual, the twice daily intentional
and deliberate (individual) application of its unique formula, 'Every day, in
every way, I’m getting better and better'.
Yeates (2016c), p.55.decades of meticulous observation, theoretical speculation, in-the-field testing,
incremental adjustment, and step-by-step transformation.
It tentatively began (c.1901) with very directive one-to-one hypnotic inter-
ventions, based upon the approaches and techniques that Coué had acquired
from an American correspondence course.
As his theoretical knowledge, clinical experience, understanding of
suggestion and autosuggestion, and hypnotic skills expanded, it gradually
developed into its final subject-centred version—an intricate complex of
(group) education, (group) hypnotherapy, (group) ego-strengthening, and
(group) training in self-suggested pain control; and, following instruction in
performing the prescribed self-administration ritual, the twice daily intentional
and deliberate (individual) application of its unique formula, 'Every day, in
every way, I’m getting better and better'.
The Coué method centers on a routine repetition of this particular expression according to a specified ritual, in a given physical state, and in the absence of any sort of allied mental imagery, at the beginning and at the end of each day. Coué maintained that curing some of our troubles requires a change in our subconscious/unconscious thought, which can only be achieved by using our imagination. Although stressing that he was not primarily a healer but one who taught others to heal themselves, Coué claimed to have affected organic changes through autosuggestion.[17]
Underlying principles[edit]
Coué thus developed a method which relied on the belief that any idea exclusively occupying the mind turns into reality,[18] although only to the extent that the idea is within the realm of possibility. For instance, a person without hands will not be able to make them grow back. However, if a person firmly believes that his or her asthma is disappearing, then this may actually happen, as far as the body is actually able to physically overcome or control the illness. On the other hand, thinking negatively about the illness (e.g. 'I am not feeling well') will encourage both mind and body to accept this thought.[citation needed]
Willpower[edit]
Coué observed that the main obstacle to autosuggestion was willpower. For the method to work, the patient must refrain from making any independent judgment, meaning that he must not let his will impose its own views on positive ideas. Everything must thus be done to ensure that the positive 'autosuggestive' idea is consciously accepted by the patient, otherwise one may end up getting the opposite effect of what is desired.[19]
Coué noted that young children always applied his method perfectly, as they lacked the willpower that remained present among adults. When he instructed a child by saying 'clasp your hands' and then 'you can't pull them apart' the child would thus immediately follow his instructions and be unable to unclasp their hands.[citation needed]
Self-conflict[edit]
Coué believed a patient's problems were likely to increase if his willpower and imagination opposed each other, something Coué referred to as 'self-conflict.'[citation needed] As the conflict intensifies, so does the problem i.e., the more the patient consciously wants to sleep, the more he becomes awake. The patient must thus abandon his willpower and instead put more focus on his imaginative power in order to fully succeed with his cure.
Effectiveness[edit]
With his method, which Coué called 'un truc,'[20] patients of all sorts would come to visit him. The list of ailments included kidney problems, diabetes, memory loss, stammering, weakness, atrophy and all sorts of physical and mental illnesses.[citation needed] According to one of his journal entries (1916), he apparently cured a patient of a uterusprolapse as well as 'violent pains in the head' (migraine).[21]
Evidence[edit]
Advocates of autosuggestion appeal to brief case histories published by Émile Coué describing his use of autohypnosis to cure, for example, enteritis and paralysis from spinal cord injury.[22][unreliable source?]
Autogenic training[edit]
Autogenic training is an autosuggestion-centered relaxation technique influenced by the Coué method. In 1932, German psychiatrist Johannes Schultz developed and published on autogenic training. Unlike autosuggestion, autogenic training has been proven in clinical trials and, along with other relaxation techniques, such as progressive relaxation and meditation, has replaced autosuggestion in therapy. The co-author of Schultz's multi-volume tome on autogenic training, Wolfgang Luthe, was a firm believer that autogenic training was a powerful approach that should only be offered to patients by qualified professionals. Its effectiveness has been confirmed in several studies.[23][24]
See also[edit]
Footnotes[edit]
- ^Baudouin (1920), pp.33-34.
- ^Yeates (2016a), pp.6-7.
- ^See Yeates, 2016a, 2016b, and 2016c.
- ^As distinct from Braid's hypnotism, Liébeault and Bernheim's hypnosis 'used a laborious, monotonous, 'sleep, sleep, sleep' hypnotic induction — thus, his inappropriate, misleading, and ambiguous term ‘hypnosis’ — to produce [what Bernheim called] a “charme” (‘spellbound’) state' (Yeates, 2016a, pp.11-12).
- ^ abYeates, 2016a, p.12.
- ^Given that Coué could read Latin and was fluent in both German and English meant that an English language book presented no difficulty.
- ^It is significant that the career of the French parapsychologistMichel Moine also began with Sage's course.
- ^See Conroy (2014), passim.
- ^Yeates (2016a), p.13.
- ^For more on Braid's overarching conceptualization, 'psycho-physiology' — 'the whole of [those] phenomena which result from the reciprocal actions of mind and matter upon each other' — see Braid (1855), p.855.
- ^Baudouin (1920), pp.257-258; Orton (1955), p.48; Yeates (2016a, 2016b, 2016c).
- ^For more on Brown and 'dominant ideas', see Yeates (2016b), pp.30-35.
- ^Yeates (2016c), p.63.
- ^Coué, E: 'Self Mastery Through Conscious Autosuggestion', page 19, 1922
- ^Yeates (2016b), pp.39,40.
- ^In 1853,Daniel Noble suggested that Carpenter's 'ideo-motor', restricted to motion alone, was far to too narrow a term, and he advocated the adoption of the term 'ideodynamic' on the basis that the term 'was applicable to a wider range of phenomena' (Noble, 1853, p.71; 1854, p.642). Carpenter and Braid immediately agreed with their friend and colleague, Noble; and from that time, Braid, who had earlier spoken of a 'mono-ideo-motor principle of action', continuously spoke of a 'mono-ideo-dynamic principle of action' being responsible for the generation of hypnotic phenomena (e.g., Braid, 1855, p.852).
- ^'Émile Coué.' Encyclopædia Britannica. 2008. Encyclopædia Britannica Online. 26 Dec. 2008 [1]
- ^Daitch, Carolyn; Lorberbaum, Lissah (1 December 2012). Anxious in Love: How to Manage Your Anxiety, Reduce Conflict, and Reconnect with Your Partner. New Harbinger Publications. ISBN9781608822331 – via Google Books.
- ^Brooks, C.H., 'The practice of autosuggestion', p62, 1922
- ^Coué, E: 'How to Practice Suggestion and Autosuggestion' page 45. 'un truc ou procédé mécanique' ('a trick, or mechanical process'). Note that when Coué referred to his 'trick', he was speaking of the mechanism, or 'the secret', that was responsible for the approach's success (as in, say, 'the trick to the hook shot is …'), he was not speaking of deceiving his subject.
- ^Wallechinsky, David. 'Emile Coue (1857-1926) French Healer.' The People's Almanac. 2nd Ed. 1975.
- ^Self Mastery Through Conscious Autosuggestion:Emile Coue. Psychomaster.com. Retrieved on 2013-07-28.
- ^Stetter F, Kupper S (March 2002). 'Autogenic training: a meta-analysis of clinical outcome studies'. Applied Psychophysiology and Biofeedback. 27 (1): 45–98. doi:10.1023/A:1014576505223. PMID12001885.
- ^Ikezuki M, Miyauchi Y, Yamaguchi H, Koshikawa F (February 2002). '[Development of Autogenic Training Clinical Effectiveness Scale (ATCES)]'. Shinrigaku Kenkyu. 72 (6): 475–81. doi:10.4992/jjpsy.72.475. PMID11977841.
References[edit]
- Carpenter, W.B., 'On the Influence of Suggestion in Modifying and directing Muscular Movement, independently of Volition', Royal Institution of Great Britain, (Proceedings), 1852, (12 March 1852), pp. 147–153.
- Conroy, M.S. (2014). The Cosmetics Baron You've Never Heard Of: E. Virgil Neal and Tokalon (Third, Revised Edition). Englewood, CO: Altus History LLC. ISBN978-0982631423
- Coué, E. (1922b). Self Mastery Through Conscious Autosuggestion. New York, NY: American Library Service. (A complete translation, by unknown translator, of Coué (1922a).)
- Coué, E. (1922c). Self Mastery Through Conscious Autosuggestion. New York, NY: Malkan Publishing Company. (A partial translation of Coué (1922a) by Archibald S. Van Orden).
- Coué, E. (1923). My Method: Including American Impressions. Garden City, NY: Doubleday, Page & Company.
- Coué, E., & Orton, J.L. (1924). Conscious Auto-Suggestion. London: T. Fisher Unwin Limited.
- Guillemain, H. (2010), La Méthode Coué: Histoire d'une Pratique de Guérison au XXe Siècle (‘The Coué Method: History of a Twentieth Century Healing Practice’). Paris: Seuil.
- Noble, D., Elements of Psychological Medicine: An Introduction to the Practical Study of Insanity Adapted for Students and Junior Practitioners, John Churchill, (London), 1853.
- Orton, J.L., Hypnotism Made Practical (Tenth Edition), Thorsons Publishers Limited, (London) 1955.
- Rapp, D. (1987). “Better and Better—”: Couéism as a Psychological Craze of the Twenties in England. Studies in Popular Culture,10(2), 17-36.
- X. LaM. (1900a). Hypnotism as It is: A Book for Everybody (Sixth Edition), New York State Publishing Company, (Rochester), 1900.[permanent dead link]
- Sage, X. LaM. (1900b). Un Cours Par Correspondance Sur Le Magnétisme Personnel, Hypnotisme, Mesmérisme, Calmánt Magnétique, Thérapeutiques Suggestives, Psycho-Thérapeutique, Etc, Etc. par X. LaMotte Sage, A.M., Ph.D., LL.D. (Edition Revisée), New York Institute of Science, (Rochester), 1900.
- Sage, X. LaM. (1900c). Cours Supérieur Traitant du Magnétisme Personnel, de l’Hypnotisme, de la Thérapeutique Suggestive, et de la Guérison pour le Magnétisme, par X. LaMotte Sage, A.M., Ph.D., LL.D., New York Institute of Science, (Rochester), 1900.
- Shrout, R.N., Modern Scientific Hypnosis: From Ancient Mystery to Contemporary Science, (Wellingborough), Thorsons, 1985.
- Westphal, C., & Laxenaire, M. (2012). Émile Coué: Amuseur ou Précurseur? (‘Émile Coué: Entertainer or Forerunner’), Annales Médico-Psychologiques, Revue Psychiatrique, 170(1), pp. 36–38. doi=10.1016/j.amp.2011.12.001
- Yankauer, A., The Therapeutic Mantra of Emile Coué, Perspectives in Biology and Medicine, Vol.42, No.4, (Summer 1999), pp. 489–495. doi=10.1353/pbm.1999.0012
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Autosuggestion&oldid=966132046'
Zsh is a powerful shell that operates as both an interactive shell and as a scripting language interpreter. While being compatible with the POSIX sh (not by default, only if issuing
emulate sh
), it offers advantages such as improved tab completion and globbing.The Zsh FAQ offers more reasons to use Zsh.
- 1Installation
- 3Configure Zsh
- 3.4Key bindings
- 3.5Prompts
- 3.5.1Prompt themes
- 3.5.2Customized prompt
- 4Tips and tricks
- 4.2Restore terminal settings after a program exits abnormally
- 4.3Remembering recent directories
- 4.5Persistent rehash
- 4.8xterm title
- 5Third-party extensions
Installation
Before starting, users may want to see what shell is currently being used:
Install the zsh package. For additional completion definitions, install the zsh-completions package as well.
Initial configuration
Make sure that Zsh has been installed correctly by running the following in a terminal:
You should now see zsh-newuser-install, which will walk you through some basic configuration. If you want to skip this, press
q
. If you did not see it, you can invoke it manually with:Note: Make sure your terminal's size is at least 72×15 otherwise zsh-newuser-install will not run.
Making Zsh your default shell
Change your shell to
/usr/bin/zsh
. See Command-line shell#Changing your default shell.Tip: If replacing bash, users may want to move some code from
~/.bashrc
to ~/.zshrc
(e.g. the prompt and the aliases) and from ~/.bash_profile
to ~/.zprofile
(e.g. the code that starts the X Window System).Startup/Shutdown files
Tip:- See A User's Guide to the Z-Shell for explanation on interactive and login shells, and what to put in your startup files.
- You could consider implementing a standard path for your Zsh configuration files.
- If
$ZDOTDIR
is not set,$HOME
is used instead. - If option
RCS
is unset in any of the files, no configuration files will be read after that file. - If option
GLOBAL_RCS
is unset in any of the files, no global configuration files (/etc/zsh/*
) will be read after that file.
When starting, Zsh will read commands from the following files in this order by default, provided they exist.
/etc/zsh/zshenv
Used for setting environment variables for all users; it should not contain commands that produce output or assume the shell is attached to a TTY. When this file exists it will always be read, this cannot be overridden.$ZDOTDIR/.zshenv
Used for setting user's environment variables; it should not contain commands that produce output or assume the shell is attached to a TTY. When this file exists it will always be read./etc/zsh/zprofile
Used for executing commands at start for all users, will be read when starting as a login shell. Please note that on Arch Linux, by default it contains one line which source the/etc/profile
. See warning below before wanting to remove that!/etc/profile
This file should be sourced by all POSIX sh-compatible shells upon login: it sets up$PATH
and other environment variables and application-specific (/etc/profile.d/*.sh
) settings upon login.
$ZDOTDIR/.zprofile
Used for executing user's commands at start, will be read when starting as a login shell. Typically used to autostart graphical sessions and to set session-wide environment variables./etc/zsh/zshrc
Used for setting interactive shell configuration and executing commands for all users, will be read when starting as an interactive shell.$ZDOTDIR/.zshrc
Used for setting user's interactive shell configuration and executing commands, will be read when starting as an interactive shell./etc/zsh/zlogin
Used for executing commands for all users at ending of initial progress, will be read when starting as a login shell.$ZDOTDIR/.zlogin
Used for executing user's commands at ending of initial progress, will be read when starting as a login shell. Typically used to autostart command line utilities. Should not be used to autostart graphical sessions, as at this point the session might contain configuration meant only for an interactive shell.$ZDOTDIR/.zlogout
Used for executing commands when a login shellexits./etc/zsh/zlogout
Used for executing commands for all users when a login shellexits.
See the graphic representation.
Note:$HOME/.profile
is not a part of the Zsh startup files and is not sourced by Zsh unless Zsh is invoked assh
orksh
and started as a login shell. For more details about the sh and ksh compatibility modes refer to zsh(1) § COMPATIBILITY.- The paths used in Arch's zsh package are different from the default ones used in the man pages (FS#48992).
Warning: Do not remove the default one line in
/etc/zsh/zprofile
, otherwise it will break the integrity of other packages which provide some scripts in /etc/profile.d/
.Configure Zsh
Although Zsh is usable out of the box, it is almost certainly not set up the way most users would like to use it. But due to the sheer amount of customization available in Zsh, configuring Zsh can be a daunting and time-consuming experience.
Simple .zshrc
Included below is a sample configuration file. It provides a decent set of default options as well as giving examples of many ways that Zsh can be customized. In order to use this configuration save it as a file named
.zshrc
.Tip: Apply the changes without needing to logout and then back in by running
source ~/.zshrc
.Here is a simple
.zshrc
:Configuring $PATH
Zsh ties the
PATH
variable to a path
array. They are automatically synchronized. This allows us to easily manipulate PATH
by simply modifying the array. See A User's Guide to the Z-Shell for details.The line
typeset -U PATH path
, where the -U
stands for unique, instructs the shell to discard duplicates from both $PATH
and $path
:Command completion
Perhaps the most compelling feature of Zsh is its advanced autocompletion abilities. At the very least, enable autocompletion in
.zshrc
. To enable autocompletion, add the following to your ~/.zshrc
:The above configuration includes ssh/scp/sftp hostnames completion but in order for this feature to work, users must not enable ssh's hostname hashing (i.e. option
HashKnownHosts
in ssh client configuration).For autocompletion with an arrow-key driven interface, add the following to:
To activate the menu, press
Tab
twice.For autocompletion of command line switches for aliases, add the following to:
For enabling autocompletion of privileged environments in privileged commands (e.g. if you complete a command starting with sudo, completion scripts will also try to determine your completions with sudo), include:
Warning: This will let Zsh completion scripts run commands with sudo privileges. You should not enable this if you use untrusted autocompletion scripts.
Note: This special kind of context-aware completion is only available for a small number of commands.
Key bindings
Zsh does not use readline, instead it uses its own and more powerful Zsh Line Editor (ZLE). It does not read
/etc/inputrc
or ~/.inputrc
. Read A closer look at the zsh line editor and creating custom widgets for an introduction to ZLE configuration.ZLE has an Emacs mode and a vi mode. If one of the
VISUAL
or EDITOR
environment variables contain the string vi
then vi mode will be used; otherwise, it will default to Emacs mode. Set the mode explicitly with bindkey -e
or bindkey -v
respectively for Emacs mode or vi mode.Key bindings are assigned by mapping an escape sequence matching a keypress to a ZLE widget. The available widgets, with descriptions of their actions and their default keybindings, are listed in zshzle(1) § STANDARD WIDGETS and zshcontrib(1) § ZLE FUNCTIONS.
The recommended way to set key bindings in Zsh is by using string capabilities from terminfo(5). For example[1][2]:
History search
You need to set up the
key
Bulk sms sender 2.8 full crack. array and make sure that ZLE enters application mode to use the following instructions; see #Key bindings.To enable history search add these lines to
.zshrc
file:By doing this, only the past commands matching the current line up to the current cursor position will be shown when
Up
or Down
keys are pressed.Shift, Alt, Ctrl and Meta modifiers
xterm-compatible terminals can use extended key-definitions from user_caps(5). Those are combinations of
Shift
, Alt
, Ctrl
and Meta
together with Up
, Down
, Left
, Right
, PageUp
, PageDown
, Home
, End
or Del
. Refer to the zkbd source for a list of recommended names for the modifier keys and key combinations.For example, for
Ctrl+Left
to move to the beginning of the previous word and Ctrl+Right
to move to the beginning of the next word:Prompts
Zsh offers the options of using a prompt theme or, for users who are dissatisfied with the themes (or want to expand their usefulness), the possibility to build a custom prompt.
Prompt themes
Prompt themes are a quick and easy way to set up a colored prompt in Zsh. See zshcontrib(1) § PROMPT THEMES for more information about them.
To use a theme, make sure that prompt theme system is set to autoload in
.zshrc
. This can be done by adding these lines to:Available prompt themes are listed by running the command:
For example, to use the
walters
theme, enter:To preview all available themes, use this command:
Manually installing prompt themes
It is possible to install themes manually, without external configuration manager tools. For a local installation, first create a folder and add it to the
fpath
array, eg:Now create a symbolic link of your theme file in this folder:
If instead you wish to install a theme globally, do:
Now you should be able to activate it using:
If everything works, you can edit your
.zshrc
accordingly.Customized prompt
This article or section needs expansion.
Reason: Add a simple colorless
PROMPT
example. (Discuss in Talk:Zsh#)Additionally to a primary left-sided prompt
PS1
(PROMPT
, prompt
) that is common to all shells, Zsh also supports a right-sided prompt RPS1
(RPROMPT
). These two variables are the ones you will want to set to a custom value.Other special purpose prompts, such as
PS2
(PROMPT2
), PS3
(PROMPT3
), PS4
(PROMPT4
), RPS1
(RPROMPT
), RPS2
(RPROMPT2
) and SPROMPT
, are explained in zshparam(1) § PARAMETERS USED BY THE SHELL.All prompts can be customized with prompt escapes. The available prompt escapes are listed in zshmisc(1) § EXPANSION OF PROMPT SEQUENCES.
Colors
Zsh sets colors differently than Bash, you do not need to use convoluted ANSI escape sequences or terminal capabilities from terminfo(5). Zsh provides convenient prompt escapes to set the foreground color, background color and other visual effects; see zshmisc(1) § Visual effects for a list of them and their descriptions.
Colors can be specified using a decimal integer, the name of one of the eight most widely-supported colors or as a # followed by an RGB triplet in hexadecimal format. See the description of fg=colour in zshzle(1) § CHARACTER HIGHLIGHTING for more details.
Most terminals support the following colors by name:
Name | Number |
---|---|
black | 0 |
red | 1 |
green | 2 |
yellow | 3 |
blue | 4 |
magenta | 5 |
cyan | 6 |
white | 7 |
Color numbers 0–255 for terminal emulators compatible with xterm 256 colors can be found in the xterm-256color chart.
With a correctly set TERM environment variable, the terminal's supported maximum number of colors can be found from the terminfo(5) database using
Note:echoti colors
. In the case of 24-bit colors, also check the COLORTERM environment variable with print $COLORTERM
. If it returns 24bit
or truecolor
then your terminal supports 16777216 (224) colors even if terminfo shows a smaller number.- The colors 0–15 may differ between terminal emulators and their used color schemes.
- Many terminal emulators display bold with a brighter color.
- Prompt escapes can be tested with command
print -P 'prompt escapes'
, for example: - If you use 24-bit colors, you might want to load the
zsh/nearcolor
module in terminals that do not support them. E.g.: See zshmodules(1) § THE ZSH/NEARCOLOR MODULE for details about thezsh/nearcolor
module.
Example
This article or section needs expansion.
Reason: Add an example using a color from the 16–255 range and one with 24-bit color. (Discuss in Talk:Zsh#)
This is an example of a two-sided prompt:
And here is how it will be displayed:
Sample .zshrc files
- To get the same setup as the monthly ISO releases (which use Zsh by default), install grml-zsh-config. It includes the many tweaks and advanced optimizations from grml.
- https://github.com/MrElendig/dotfiles-alice/blob/master/.zshrc - basic setup, with dynamic prompt and window title/hardinfo.
- https://github.com/slashbeast/conf-mgmt/blob/master/roles/home_files/files/DOTzshrc - zshrc with multiple features, be sure to check out comments into it. Notable features: confirm function to ensure that user want to run poweroff, reboot or hibernate, support for GIT in prompt (done without vcsinfo), tab completion with menu, printing current executed command into window's title bar and more.
See dotfiles#User repositories for more.
Tips and tricks
Autostart X at login
See xinit#Autostart X at login.
Restore terminal settings after a program exits abnormally
Many programs change the terminal state, and often do not restore terminal settings on exiting abnormally (e.g. when crashing or encountering SIGINT).
This can typically be solved by executing reset(1):
The following sections describe ways to avoid the need to manually reset the terminal. Airport utility for mac os high sierra.
The ttyctl command
The ttyctl command can be used to 'freeze/unfreeze' the terminal. To freeze the interactive shell on launch, use the following:
Resetting the terminal with escape sequences
Alternate linedrawing character set can screw up the terminal in a way which ttyctl cannot prevent.
A simple solution is to output the escape sequences that reset the terminal from the
precmd
hook function, so that they are executed every time before the prompt is drawn. For example, using the escape sequencee[0me(Be)0017e[?5le7e[0;0re8
:To test if it works, run:
Remembering recent directories
Dirstack
Zsh can be configured to remember the DIRSTACKSIZE last visited folders. This can then be used to cd them very quickly. You need to add some lines to your configuration file:
Now use
to print the dirstack. Use
cd -<NUM>
to go back to a visited folder. Use autocompletion after the dash. This proves very handy if using the autocompletion menu.Note: This will not work if you have more than one zsh session open, and attempt to
cd
, due to a conflict in both sessions writing to the same file.cdr
Rules of og card game. cdr allows you to change the working directory to a previous working directory from a list maintained automatically. It stores all entries in files that are maintained across sessions and (by default) between terminal emulators in the current session.
See zshcontrib(1) § REMEMBERING RECENT DIRECTORIES for setup instructions.
Help command
Unlike Bash, Zsh does not enable a built in
help
command, instead it provides run-help
. By default run-help
is an alias to man
, it can be either executed manually by prepending it to a command or it can be invoked for the currently typed command with the keyboard shortcuts Alt+h
or Esc
h
.Since by default it is just an alias to man, it will only work on external commands. To improve its functionality, so that it works on shell builtins and other shell features, you need to use the
run-help
function. See zshcontrib(1) for more information on the run-help
and its assistant functions.First load the
run-help
function and then remove the existing run-help
alias. For convenience help
can be aliased to run-help
. For example, add following to your zshrc
:Assistant functions have to be enabled separately:
Zsh Autosuggestion Color
For example,
run-help git commit
command will now open the man pagegit-commit(1) instead of git(1).Persistent rehash
Typically, compinit will not automatically find new executables in the
$PATH
. For example, after you install a new package, the files in /usr/bin/
would not be immediately or automatically included in the completion. Thus, to have these new executables included, one would run:This 'rehash' can be set to happen automatically.[3] Simply include the following in your
zshrc
:On-demand rehash
As above, however pacman can be configured with hooks to automatically request a
rehash
, which does not incur the performance penalty of constant rehashing as above. To enable this, create the /etc/pacman.d/hooks
directory, and a /var/cache/zsh
directory, then create a hook file:This keeps the modification date of the file
/var/cache/zsh/pacman
consistent with the last time a package was installed, upgraded or removed. Then, zsh
must be coaxed into rehashing its own command cache when it goes out of date, by adding to your ~/.zshrc
:If the
precmd
hook is triggered before /var/cache/zsh/pacman
is updated, completion may not work until a new prompt is initiated. Running an empty command, e.g. pressing enter
, should be sufficient.Alternative on-demand rehash using SIGUSR1
As above, however the hook file looks like this:
Warning: This sends SIGUSR1 to all running
zsh
instances. Note that the default behavior for SIGUSR1 is terminate so when you first configure this all running zsh
instances of all users (including login shells) will terminate if they have not sourced the trap below.The function trap above can be replaced with a list trap
trap 'rehash' USR1
. See zshmisc(1) § Trap Functions for differences between types of traps.This method will instantly
rehash
all zsh
instances, removing the need to press enter to trigger precmd
.Bind key to ncurses application
Bind a ncurses application to a keystroke, but it will not accept interaction. Use
BUFFER
variable to make it work. The following example lets users open ncmpcpp using Alt+
:An alternate method, that will keep everything you entered in the line before calling application:
File manager key binds
Key binds like those used in graphic file managers may come handy. The first comes back in directory history (
Alt+Left
), the second let the user go to the parent directory (Alt+Up
). They also display the directory content.xterm title
If your terminal emulator supports it, you can set its title from Zsh. This allows dynamically changing the title to display relevant information about the shell state, for example showing the user name and current directory or the currently executing command.
The xterm title is set with the xterm escape sequence
e]2;
a
. For example:will set the title to
A simple way to have a dynamic title is to set the title in the
precmd
and preexec
hook functions. See zshmisc(1) § Hook Functions for a list of available hook functions and their descriptions.By using
Tip:print -P
you can additionally take advantage of Zsh's prompt escapes.- Title printing can be split up in multiple commands as long as they are sequential.
- GNU Screen sends the xterm title to the hardstatus (
%h
). If you want to use Screen's string escapes (e.g. for colors) you should set the hardstatus with thee_
e
escape sequence. Otherwise, if string escapes are used ine]2;
a
, the terminal emulator will get a garbled title due to it being incapable of interpreting Screen's string escapes.
- Do not use the
-P
option ofprint
when printing variables to prevent them from being parsed as prompt escapes. - Use the
q
parameter expansion flag when printing variables to prevent them from being parsed as escape sequences.
Terminal emulator tab title
Some terminal emulators and multiplexers support setting the title of the tab. The escape sequences depend on the terminal:
Terminal | Escape sequences | Description |
---|---|---|
GNU Screen | ek e | Screen's window title (%t ). |
Konsole | e]30; a | Konsole's tab title. |
Shell environment detection
See a repository about shell environment detection for tests to detect the shell environment. This includes login/interactive shell, Xorg session, TTY and SSH session.
/dev/tcp equivalent: ztcp
Use the
zsh/net/tcp
module:You can now establish TCP connections:
Shortcut to exit shell on partial command line
By default,
Ctrl+d
will not close your shell if the command line is filled, this fixes it:Third-party extensions
Configuration frameworks
Feature Request: Fish-like Autocompletion And Autosuggestion .
- oh-my-zsh — A popular, community-driven framework for managing your Zsh configuration. It comes bundled with a ton of helpful functions, helpers, plugins, themes.
- https://github.com/robbyrussell/oh-my-zsh || oh-my-zsh-gitAUR
- Prezto — A configuration framework for Zsh. It comes with modules, enriching the command line interface environment with sane defaults, aliases, functions, auto completion, and prompt themes.
- https://github.com/sorin-ionescu/prezto || prezto-gitAUR
- ZIM — A configuration framework with blazing speed and modular extensions. Zim is very easy to customize, and comes with a rich set of modules and features without compromising on speed or functionality.
- https://github.com/zimfw/zimfw || zsh-zim-gitAUR
Plugin managers
- Antibody — A performance-focused plugin manager similar to Antigen.
- https://github.com/getantibody/antibody || antibodyAUR
- zinit (previously 'zplugin') — Flexible Zsh plugin manager with clean fpath, reports, completion management, turbo mode
- https://github.com/zdharma/zinit || zsh-zplugin-gitAUR
- Antigen — A plugin manager for Zsh, inspired by oh-my-zsh and vundle. ABANDONED
- https://github.com/zsh-users/antigen || antigen-gitAUR
- zgen — A lightweight and simple plugin manager for Zsh. ABANDONED
- https://github.com/tarjoilija/zgen || zgen-gitAUR
- zplug — A next-generation plugin manager for Zsh. ABANDONED
- https://github.com/zplug/zplug || zplugAUR
Fish-like syntax highlighting and autosuggestions
Fish provides very powerful shell syntax highlighting and autosuggestions. To use both in Zsh, you can install zsh-syntax-highlighting, zsh-autosuggestions, and finally source one or both of the provided scripts from your zshrc:
The 'command not found' handler
pkgfile includes a Zsh script file that provides a
command_not_found_handler
function that will automatically search the official repositories, when entering an unrecognized command.You need to source the script to enable it. For example:
Note: The pkgfile database may need to be updated before this will work. See pkgfile#Installation for details.
Uninstallation
Change the default shell before removing the zsh package.
Warning: Failure to follow the below procedure may result in users no longer having access to a working shell.
Run following command:
Use it for every user with zsh set as their login shell (including root if needed). When completed, the zsh package can be removed.
Alternatively, change the default shell back to Bash by editing
/etc/passwd
as root.Warning: It is strongly recommended to use vipw(8) when editing
/etc/passwd
as it helps prevent invalid entries and/or syntax errors.For example, change the following:
To this:
See also
- The Z Shell Manual (different format available here)
- zsh-lovers(1) (available as zsh-lovers package)
Retrieved from 'https://wiki.archlinux.org/index.php?title=Zsh&oldid=632301'