{"id":2030,"date":"2022-05-20T05:49:44","date_gmt":"2022-05-20T00:19:44","guid":{"rendered":"https:\/\/smarttech101.com\/?p=2030"},"modified":"2022-11-12T02:04:51","modified_gmt":"2022-11-11T20:34:51","slug":"zsh-highlighting-autosuggestion-themes-binding-alias-fzf","status":"publish","type":"post","link":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/","title":{"rendered":"zsh: highlighting, autosuggestion, themes, binding, alias, fzf"},"content":{"rendered":"\n<p>Zsh (or <code>z-shell<\/code>), like <code>bash<\/code>, is a POSIX compliant shell. Therefore, most of the bash commands are applicable in z-shell as well. However, bash does not provide features like autosuggestion, and syntax highlighting among other modern features. On the other hand, <code>fish<\/code> shell provides these features out of the box but <code>fish<\/code> is not POSIX compliant. So, our best solution is this shell.<\/p>\n\n\n\n<p><strong>Note: I recommend you to follow this article from top to bottom to minimize the problems.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Table of Contents<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"#installation_and_make_zsh_default_shell\">Installation and make zsh default shell<\/a><\/li><li><a href=\"#basic_configuration\">Basic Configuration<\/a><ul><li><a href=\"#zsh_history\">Zsh History<\/a><\/li><li><a href=\"#set_options_for_glob_correction_beep_autocd\">Set options for glob, correction, beep, autocd<\/a><\/li><li><a href=\"#tabcompletion\">tab-completion<\/a><\/li><\/ul><\/li><li><a href=\"#addons_and_plugins\">Add-ons and plug-ins<\/a><ul><li><a href=\"#fzftab\">fzf-tab<\/a><\/li><li><a href=\"#additional_completion_definitions_zshcompletions\">Additional completion definitions (zsh-completions)<\/a><\/li><li><a href=\"#fish_like_autosuggestions_using_zshautosuggestions\">Fish like autosuggestions using zsh-autosuggestions<\/a><\/li><li><a href=\"#fish_like_syntax_highlighting_using_zshsyntaxhighlighting\">Fish like syntax highlighting using &#8216;zsh-syntax-highlighting&#8217;<\/a><\/li><\/ul><\/li><li><a href=\"#powerlevel10k_theme\">Powerlevel10k Theme<\/a><\/li><li><a href=\"#key_bindings\">Key bindings<\/a><ul><li><a href=\"#vimkeybindings\">Vim-keybindings<\/a><\/li><li><a href=\"#emacs_keybindings\">Emacs Keybindings<\/a><\/li><li><a href=\"#change_the_keybindings\">Change the keybindings<\/a><\/li><li><a href=\"#edit_line_in_vim_with_alte\">Edit line in vim with alt-e<\/a><\/li><li><a href=\"#fzf_for_history_directory_and_file_navigation\">Fzf for history, directory, and file navigation<\/a><\/li><\/ul><\/li><li><a href=\"#title_of_your_terminal\">Title of your terminal<\/a><\/li><li><a href=\"#zsh_aliases\">Zsh aliases<\/a><\/li><li><a href=\"#pywal_support_to_change_color\">Pywal support (to change color)<\/a><\/li><li><a href=\"#Thatsall\">That&#8217;s all<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"installation_and_make_zsh_default_shell\">Installation and make zsh default shell<\/h2>\n\n\n\n<p>Debian, Ubuntu, and Kali Linux<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install zsh<\/code><\/pre>\n\n\n\n<p>Alpine<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apk add zsh<\/code><\/pre>\n\n\n\n<p>Arch Linux<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pacman -S zsh<\/code><\/pre>\n\n\n\n<p>CentOS<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install zsh<\/code><\/pre>\n\n\n\n<p>Fedora<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dnf install zsh<\/code><\/pre>\n\n\n\n<p>macOS:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo port install zsh<\/code><\/pre>\n\n\n\n<p>Or with Homebrew<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install zsh<\/code><\/pre>\n\n\n\n<p>Raspbian<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install zsh<\/code><\/pre>\n\n\n\n<p>To make it the default shell, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ sudo chsh -s $(which zsh)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"basic_configuration\">Basic Configuration<\/h2>\n\n\n\n<p>When you start <code>Z shell<\/code> for the first time, you will get the following prompt:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"668\" height=\"477\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/zsh-new-user.webp?resize=668%2C477&#038;ssl=1\" alt=\"First Zsh Prompt\" class=\"wp-image-2031\"\/><figcaption>First Zsh Prompt<\/figcaption><\/figure>\n\n\n\n<p>Press <code>0<\/code> to create an empty file <code>~\/.zshrc<\/code> as suggested. This will be your configuration file. We will be populating it with our values.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"zsh_history\">Zsh History<\/h3>\n\n\n\n<p>Put the following three lines in the <code>.zshrc<\/code> file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>HISTFILE=\"${XDG_DATA_HOME:-$HOME\/.local\/share}\/zsh\/history\"\nHISTSIZE=1000000\nSAVEHIST=1000000<\/code><\/pre>\n\n\n\n<p>Here,<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Now, all commands you type in the terminal will be stored in the given location.<\/li><li>The above size may seem very big, but the file size hardly goes beyond 10-20 MB.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"set_options_for_glob_correction_beep_autocd\">Set options for glob, correction, beep, autocd<\/h3>\n\n\n\n<p>Now, now you can set the following option(s) using the <code>setopt<\/code> command in <code>~\/.zshrc<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>setopt appendhistory autocd extendedglob notify correctall nomatch globdots<\/code><\/pre>\n\n\n\n<p>Where,<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>appendhistory<\/code> make sure that Arrow keys bring your history.<\/li><li>extendedglob sets glob-related options.<\/li><li><code>autocd<\/code> means to change into a directory say <code>~\/Music<\/code>, you just need to type the name of the directory only and hit Enter instead of whole <code>cd ~\/Music<\/code>.<\/li><li><code>correctall<\/code> asks you to correct the mistyped words (n for no, y for yes, a for all, e for exit):<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ cta ~\/.profil\nzsh: correct 'cta' to 'cat' &#91;nyae]? y\nzsh: correct '~\/.profil' to '~\/.profile' &#91;nyae]?<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><code>globdots<\/code>: include hidden files in tab completion.<\/li><\/ul>\n\n\n\n<p>Turn off the beef sound on errors. By default, it is on:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>unsetopt beep<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"tabcompletion\">tab-completion<\/h3>\n\n\n\n<p>Now, to enable the tab completion, put the following commands in your <code>~\/.zshrc<\/code> file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>zstyle :compinstall filename \"${ZDOTDIR:-$HOME}\/.zshrc\"\n\nautoload -Uz compinit\ncompinit<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"addons_and_plugins\">Add-ons and plug-ins<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"fzftab\">fzf-tab<\/h3>\n\n\n\n<p><a href=\"https:\/\/github.com\/Aloxaf\/fzf-tab\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">fzf-tab<\/a> replaces z shell&#8217;s default completion selection menu with fzf.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1085\" height=\"633\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/fzf-tab.jpg?resize=1085%2C633&#038;ssl=1\" alt=\"fzf-tab\" class=\"wp-image-2032\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/fzf-tab.jpg?w=1085&amp;ssl=1 1085w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/fzf-tab.jpg?resize=768%2C448&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption>fzf-tab<\/figcaption><\/figure>\n\n\n\n<p>Take a look at this <a href=\"https:\/\/asciinema.org\/a\/293849\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">video<\/a> to understand its importance. <strong>You don&#8217;t have to remember anything now<\/strong>.<\/p>\n\n\n\n<p>To enable it just download it using git:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ git clone https:\/\/github.com\/Aloxaf\/fzf-tab<\/code><\/pre>\n\n\n\n<p>And now source the main file into <code>~\/.zshrc<\/code> by putting the following command into it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91; ! -f ~\/fzf-tab\/fzf-tab.plugin.zsh ] || source ~\/fzf-tab\/fzf-tab.plugin.zsh<\/code><\/pre>\n\n\n\n<p><strong>Note:<\/strong> Please note that you should put the above command after the <code>compinit<\/code>, but before plugins that will wrap widgets, such as <code>zsh-autosuggestions<\/code> or <code>fast-syntax-highlighting<\/code>!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"additional_completion_definitions_zshcompletions\">Additional completion definitions (zsh-completions)<\/h3>\n\n\n\n<p>For this, we will use <code>zsh-completions<\/code>.<\/p>\n\n\n\n<p>According to the <a href=\"https:\/\/github.com\/zsh-users\/zsh-completions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-completions website<\/a>, it &#8220;aims at gathering\/developing new completion scripts that are not available in Zsh yet&#8221;.<\/p>\n\n\n\n<p><strong>Installation using official repositories<\/strong>: It is available in most of the official repositories of your distributions. Install from there and you are done. Nothing to do anymore.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>System<\/th><th>Package<\/th><\/tr><\/thead><tbody><tr><td>Debian \/ Ubuntu<\/td><td><a href=\"https:\/\/software.opensuse.org\/download.html?project=shells%3Azsh-users%3Azsh-completions&amp;package=zsh-completions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-completions OBS repository<\/a><\/td><\/tr><tr><td>Fedora \/ CentOS \/ RHEL \/ Scientific Linux<\/td><td><a href=\"https:\/\/software.opensuse.org\/download.html?project=shells%3Azsh-users%3Azsh-completions&amp;package=zsh-completions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-completions OBS repository<\/a><\/td><\/tr><tr><td>OpenSUSE \/ SLE<\/td><td><a href=\"https:\/\/software.opensuse.org\/download.html?project=shells%3Azsh-users%3Azsh-completions&amp;package=zsh-completions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-completions OBS repository<\/a><\/td><\/tr><tr><td>Arch Linux \/ Manjaro \/ Antergos \/ Hyperbola<\/td><td><a href=\"https:\/\/www.archlinux.org\/packages\/zsh-completions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-completions<\/a>,&nbsp;<a href=\"https:\/\/aur.archlinux.org\/packages\/zsh-completions-git\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-completions-git<\/a><\/td><\/tr><tr><td>Gentoo \/ Funtoo<\/td><td><a href=\"http:\/\/packages.gentoo.org\/package\/app-shells\/zsh-completions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">app-shells\/zsh-completions<\/a><\/td><\/tr><tr><td>NixOS<\/td><td><a href=\"https:\/\/github.com\/NixOS\/nixpkgs\/blob\/master\/pkgs\/shells\/zsh\/zsh-completions\/default.nix\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-completions<\/a><\/td><\/tr><tr><td>Void Linux<\/td><td><a href=\"https:\/\/github.com\/void-linux\/void-packages\/blob\/master\/srcpkgs\/zsh-completions\/template\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-completions<\/a><\/td><\/tr><tr><td>Slackware<\/td><td><a href=\"https:\/\/slackbuilds.org\/repository\/14.2\/system\/zsh-completions\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Slackbuilds<\/a><\/td><\/tr><tr><td>macOS<\/td><td><a href=\"https:\/\/github.com\/Homebrew\/homebrew-core\/blob\/master\/Formula\/zsh-completions.rb\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">homebrew<\/a>,&nbsp;<a href=\"https:\/\/github.com\/macports\/macports-ports\/blob\/master\/sysutils\/zsh-completions\/Portfile\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">MacPorts<\/a><\/td><\/tr><tr><td>NetBSD<\/td><td><a href=\"http:\/\/ftp.netbsd.org\/pub\/pkgsrc\/current\/pkgsrc\/shells\/zsh-completions\/README.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">pkgsrc<\/a><\/td><\/tr><tr><td>FreeBSD<\/td><td><a href=\"https:\/\/www.freshports.org\/shells\/zsh-completions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">shells\/zsh-completions<\/a><\/td><\/tr><\/tbody><\/table><figcaption>Source: <a href=\"https:\/\/github.com\/zsh-users\/zsh-completions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-completions<\/a><\/figcaption><\/figure>\n\n\n\n<p><strong>Manual Installation<\/strong>:<\/p>\n\n\n\n<p><strong>Step 1<\/strong>: Download the repository:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/zsh-users\/zsh-completions.git<\/code><\/pre>\n\n\n\n<p><strong>Step 2<\/strong>: Now, put the following into your <code>~\/.zshrc<\/code> file. It will add zsh-completions&#8217; directory into <code>fpath<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fpath=(~\/zsh-completions\/src $fpath)<\/code><\/pre>\n\n\n\n<p><strong>Step 3:<\/strong> Now, force rebuild <code>zcompdump<\/code> using the following command on your terminal (don&#8217;t put it into the <code>~\/.zshrc<\/code>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rm -f ~\/.zcompdump; compinit<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"fish_like_autosuggestions_using_zshautosuggestions\">Fish like autosuggestions using zsh-autosuggestions<\/h3>\n\n\n\n<p><strong>Step 1:<\/strong> Download <code>zsh-autosuggestions<\/code><\/p>\n\n\n\n<p><strong>From Official Repositories<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>System<\/th><th>Package<\/th><\/tr><\/thead><tbody><tr><td>Debian \/ Ubuntu<\/td><td><a href=\"https:\/\/software.opensuse.org\/download.html?project=shells%3Azsh-users%3Azsh-autosuggestions&amp;package=zsh-autosuggestions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-autosuggestions OBS repository<\/a><\/td><\/tr><tr><td>Fedora \/ CentOS \/ RHEL \/ Scientific Linux<\/td><td><a href=\"https:\/\/software.opensuse.org\/download.html?project=shells%3Azsh-users%3Azsh-autosuggestions&amp;package=zsh-autosuggestions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-autosuggestions OBS repository<\/a><\/td><\/tr><tr><td>OpenSUSE \/ SLE<\/td><td><a href=\"https:\/\/software.opensuse.org\/download.html?project=shells%3Azsh-users%3Azsh-autosuggestions&amp;package=zsh-autosuggestions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-autosuggestions OBS repository<\/a><\/td><\/tr><tr><td>Arch Linux \/ Manjaro \/ Antergos \/ Hyperbola<\/td><td><a href=\"https:\/\/www.archlinux.org\/packages\/zsh-autosuggestions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-autosuggestions<\/a>,&nbsp;<a href=\"https:\/\/aur.archlinux.org\/packages\/zsh-autosuggestions-git\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-autosuggestions-git<\/a><\/td><\/tr><tr><td>NixOS<\/td><td><a href=\"https:\/\/github.com\/NixOS\/nixpkgs\/blob\/master\/pkgs\/shells\/zsh\/zsh-autosuggestions\/default.nix\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-autosuggestions<\/a><\/td><\/tr><tr><td>Void Linux<\/td><td><a href=\"https:\/\/github.com\/void-linux\/void-packages\/blob\/master\/srcpkgs\/zsh-autosuggestions\/template\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-autosuggestions<\/a><\/td><\/tr><tr><td>Mac OS<\/td><td><a href=\"https:\/\/github.com\/Homebrew\/homebrew-core\/blob\/master\/Formula\/zsh-autosuggestions.rb\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">homebrew<\/a><\/td><\/tr><tr><td>NetBSD<\/td><td><a href=\"http:\/\/ftp.netbsd.org\/pub\/pkgsrc\/current\/pkgsrc\/shells\/zsh-autosuggestions\/README.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">pkgsrc<\/a><\/td><\/tr><\/tbody><\/table><figcaption>Source: <a href=\"https:\/\/github.com\/zsh-users\/zsh-autosuggestions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-autosuggestions<\/a><\/figcaption><\/figure>\n\n\n\n<p><strong>Manual<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/zsh-users\/zsh-autosuggestions<\/code><\/pre>\n\n\n\n<p><strong>Step 2<\/strong>: Source the main file into your <code>~\/.zshrc<\/code>:<\/p>\n\n\n\n<p>If you have downloaded it from your official repositories, put the following command into your <code>~\/.zshrc<\/code> :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91; ! -f \/usr\/share\/zsh\/plugins\/zsh-autosuggestions\/zsh-autosuggestions.zsh ] || source \/usr\/share\/zsh\/plugins\/zsh-autosuggestions\/zsh-autosuggestions.zsh<\/code><\/pre>\n\n\n\n<p>And if you have downloaded it manually, put the following instead:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91; ! -f ~\/zsh-autosuggestions\/zsh-autosuggestions.zsh ] || source ~\/zsh-autosuggestions\/zsh-autosuggestions.zsh<\/code><\/pre>\n\n\n\n<p><strong>Step 3:<\/strong> configuration of zsh-autosuggestions<\/p>\n\n\n\n<p>Put the following into <code>~\/.zshrc<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ZSH_AUTOSUGGEST_STRATEGY=(history completion)<\/code><\/pre>\n\n\n\n<p>Now, you will be suggested first from the history, and if that is not available then tab-completion. Please note that the tab-completion based suggestion requires a zsh-module called <code>zpty<\/code>. Most of the distributions already install it when you install zsh. You can make sure it using the locate command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ locate zpty\n\/usr\/lib\/zsh\/5.8.1\/zsh\/zpty.so\n\/usr\/share\/zsh\/5.8.1\/help\/zpty\n\/usr\/share\/zsh\/functions\/Completion\/Zsh\/_zpty<\/code><\/pre>\n\n\n\n<p><a href=\"https:\/\/github.com\/zsh-users\/zsh-autosuggestions\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-autosuggestions<\/a> says that there is one more option &#8211; <code>match_prev_cmd<\/code> which is:-<br>For example, suppose your history has the following entries:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>pwd<\/code><\/li><li><code>ls foo<\/code><\/li><li><code>ls bar<\/code><\/li><li><code>pwd<\/code><\/li><\/ul>\n\n\n\n<p>Given the history list above, when you type <code>ls<\/code>, the suggestion will be <code>ls foo<\/code> rather than <code>ls bar<\/code> because your most recently executed command (<code>pwd<\/code>) was previously followed by &#8216;ls foo&#8217;.<\/p>\n\n\n\n<p>Step 3: Start a new terminal session.<\/p>\n\n\n\n<p><strong>Result<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1051\" height=\"652\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/zsh-autosuggestions.jpg?resize=1051%2C652&#038;ssl=1\" alt=\"zsh-autosuggestions\" class=\"wp-image-2035\" srcset=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/zsh-autosuggestions.jpg?w=1051&amp;ssl=1 1051w, https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/zsh-autosuggestions.jpg?resize=768%2C476&amp;ssl=1 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><figcaption>zsh-autosuggestions<\/figcaption><\/figure>\n\n\n\n<p>In the above example, as soon as I type <code>nmcli de<\/code>, it suggests <code>nmcli device wifi disconnect MiA3<\/code> from my history. But when I type something new like <code>mpv --ab<\/code> which I had never executed in the past, it will use &#8216;tab-completion&#8217; and suggest the nearest one <code>--ab-loop-a=<\/code>.<\/p>\n\n\n\n<p>Later, in this article, I will help you set up some keybindings related to autosuggestions (<code>autosuggest-accept<\/code>, and <code>autosuggest-execute<\/code>).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"fish_like_syntax_highlighting_using_zshsyntaxhighlighting\">Fish like syntax highlighting using &#8216;zsh-syntax-highlighting&#8217;<\/h3>\n\n\n\n<p>Install the package <strong>zsh-syntax-highlighting<\/strong> using your official repository:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Arch Linux:&nbsp;<a href=\"https:\/\/www.archlinux.org\/packages\/zsh-syntax-highlighting\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">community\/zsh-syntax-highlighting<\/a>&nbsp;\/&nbsp;<a href=\"https:\/\/aur.archlinux.org\/packages\/zsh-syntax-highlighting-git\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">AUR\/zsh-syntax-highlighting-git<\/a><\/li><li>Debian:&nbsp;<code>zsh-syntax-highlighting<\/code>&nbsp;package&nbsp;<a href=\"https:\/\/packages.debian.org\/zsh-syntax-highlighting\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">in&nbsp;<code>stretch<\/code><\/a>&nbsp;(or in&nbsp;<a href=\"https:\/\/software.opensuse.org\/download.html?project=shells%3Azsh-users%3Azsh-syntax-highlighting&amp;package=zsh-syntax-highlighting\" rel=\"nofollow\">OBS <\/a><a href=\"https:\/\/software.opensuse.org\/download.html?project=shells%3Azsh-users%3Azsh-syntax-highlighting&amp;package=zsh-syntax-highlighting\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">re<\/a><a href=\"https:\/\/software.opensuse.org\/download.html?project=shells%3Azsh-users%3Azsh-syntax-highlighting&amp;package=zsh-syntax-highlighting\" rel=\"nofollow\">pository<\/a>)<\/li><li>Fedora:&nbsp;<a href=\"https:\/\/bodhi.fedoraproject.org\/updates\/?packages=zsh-syntax-highlighting\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">zsh-syntax-highlighting package<\/a>&nbsp;in Fedora 24+ (or in&nbsp;<a href=\"https:\/\/software.opensuse.org\/download.html?project=shells%3Azsh-users%3Azsh-syntax-highlighting&amp;package=zsh-syntax-highlighting\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">OBS repository<\/a>)<\/li><li>FreeBSD:&nbsp;<code>pkg install zsh-syntax-highlighting<\/code>&nbsp;(port name:&nbsp;<a href=\"http:\/\/www.freshports.org\/textproc\/zsh-syntax-highlighting\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><code>shells\/zsh-syntax-highlighting<\/code><\/a>)<\/li><li>Gentoo:&nbsp;<a href=\"https:\/\/packages.gentoo.org\/packages\/app-shells\/zsh-syntax-highlighting\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">app-shells\/zsh-syntax-highlighting<\/a><\/li><li>Mac OS X \/ Homebrew:&nbsp;<a href=\"https:\/\/github.com\/Homebrew\/homebrew-core\/blob\/master\/Formula\/zsh-syntax-highlighting.rb\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">brew install zsh-syntax-highlighting<\/a><\/li><li>NetBSD:&nbsp;<code>pkg_add zsh-syntax-highlighting<\/code>&nbsp;(port name:&nbsp;<a href=\"http:\/\/cvsweb.netbsd.org\/bsdweb.cgi\/pkgsrc\/shells\/zsh-syntax-highlighting\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><code>shells\/zsh-syntax-highlighting<\/code><\/a>)<\/li><li>OpenBSD:&nbsp;<code>pkg_add zsh-syntax-highlighting<\/code>&nbsp;(port name:&nbsp;<a href=\"https:\/\/cvsweb.openbsd.org\/ports\/shells\/zsh-syntax-highlighting\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><code>shells\/zsh-syntax-highlighting<\/code><\/a>)<\/li><li>openSUSE \/ SLE:&nbsp;<code>zsh-syntax-highlighting<\/code>&nbsp;package in&nbsp;<a href=\"https:\/\/software.opensuse.org\/download.html?project=shells%3Azsh-users%3Azsh-syntax-highlighting&amp;package=zsh-syntax-highlighting\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">OBS repository<\/a><\/li><li>RHEL \/ CentOS \/ Scientific Linux:&nbsp;<code>zsh-syntax-highlighting<\/code>&nbsp;package in&nbsp;<a href=\"https:\/\/software.opensuse.org\/download.html?project=shells%3Azsh-users%3Azsh-syntax-highlighting&amp;package=zsh-syntax-highlighting\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">OBS repository<\/a><\/li><li>Ubuntu:&nbsp;<code>zsh-syntax-highlighting<\/code>&nbsp;package&nbsp;<a href=\"https:\/\/launchpad.net\/ubuntu\/+source\/zsh-syntax-highlighting\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">in Xenial<\/a>&nbsp;(or in&nbsp;<a href=\"https:\/\/software.opensuse.org\/download.html?project=shells%3Azsh-users%3Azsh-syntax-highlighting&amp;package=zsh-syntax-highlighting\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">OBS repository<\/a>)<\/li><li>Void Linux:&nbsp;<code>zsh-syntax-highlighting package<\/code>&nbsp;<a href=\"https:\/\/github.com\/void-linux\/void-packages\/tree\/master\/srcpkgs\/zsh-syntax-highlighting\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">in XBPS<\/a><\/li><\/ul>\n\n\n\n<p>Or, you can install it manually using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/zsh-users\/zsh-syntax-highlighting.git<\/code><\/pre>\n\n\n\n<p>Now, if you have installed it from your official repository, source it into your <code>~\/.zshrc<\/code> using the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91; ! -f \/usr\/share\/zsh\/plugins\/zsh-syntax-highlighting\/zsh-syntax-highlighting.zsh ] || source \/usr\/share\/zsh\/plugins\/zsh-syntax-highlighting\/zsh-syntax-highlighting.zsh<\/code><\/pre>\n\n\n\n<p>Or, if you have it installed it manually using the <code>git clone...<\/code> method, source the following file instead:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>source ~\/zsh-syntax-highlighting\/zsh-syntax-highlighting.zsh<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"powerlevel10k_theme\">Powerlevel10k Theme<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"765\" height=\"516\" src=\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/powerlevel10k.png?resize=765%2C516&#038;ssl=1\" alt=\"Powerlevel10k theme in zsh\" class=\"wp-image-2036\"\/><figcaption>Powerlevel10k theme<\/figcaption><\/figure>\n\n\n\n<p>Step 1: Installation<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone --depth=1 https:\/\/github.com\/romkatv\/powerlevel10k.git ~\/powerlevel10k\necho 'source ~\/powerlevel10k\/powerlevel10k.zsh-theme' &gt;&gt;~\/.zshrc<\/code><\/pre>\n\n\n\n<p>And also install one of the <a href=\"https:\/\/github.com\/ryanoasis\/nerd-fonts\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Nerd Fonts<\/a>.<\/p>\n\n\n\n<p>Step 2: Configuration<\/p>\n\n\n\n<p>Restart your terminal session. Now, the powerline&#8217;s configuration wizard will set up your configurations by asking you a few questions. If the wizard does not start, just execute the command <code>p10k configure<\/code>.<\/p>\n\n\n\n<p><strong>After executing the above command, you will notice two files sourced at the top as well as the bottom. Now, all of your commands will go between these two files.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"key_bindings\">Key bindings<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"vimkeybindings\">Vim-keybindings<\/h3>\n\n\n\n<p>To choose <strong>vim keybindings<\/strong>, use the <code>bindkey -v<\/code> in the <code>~\/.zshrc<\/code>. Now, when you press the Escape button, you will reach the vim mode, after which you can use the keys h and l to move left and right in the current line, and j and k for up and down in history.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"emacs_keybindings\">Emacs Keybindings<\/h3>\n\n\n\n<p>Personally, I prefer<strong> emacs key bindings<\/strong> because that is supported by many other software and packages (ranger&#8217;s console, fzf, dmenu, and many more). For this, put the following into the <code>~\/.zshrc<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bindkey -e<\/code><\/pre>\n\n\n\n<p>At the same time, emacs mode also provides a few extra widgets such as <code>beginning-of-line<\/code> and <code>end-of-line<\/code> that you can bind with other keys.<\/p>\n\n\n\n<p>Now, you can open a new terminal session and execute the command <code>bindkey<\/code> to get a list of all key-bindings at that moment:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~$ bindkey\n\"^@\" set-mark-command\n\"^A\" beginning-of-line\n\"^B\" backward-char\n\"^D\" delete-char-or-list\n\"^E\" autosuggest-accept\n\"^F\" forward-char\n\"^G\" \"ranger_for_cd^J\"\n\"^H\" backward-delete-char\n\"^I\" fzf-completion\n\"^J\" accept-line\n\"^K\" kill-line\n\"^L\" clear-screen\n\"^M\" accept-line\n\"^N\" history-search-forward\n\"^O\" accept-line-and-down-history\n...\n...<\/code><\/pre>\n\n\n\n<p>Where, <code>^A<\/code> means &#8216;Ctrl-A&#8217;, <code>^[A<\/code> means <code>Alt-A<\/code>. Use the command <code>cat -v<\/code> to find the name of other keys.<\/p>\n\n\n\n<p>Please note that <code>^A<\/code> and <code>^a<\/code> both are the same.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"change_the_keybindings\">Change the keybindings<\/h3>\n\n\n\n<p>To change the default bindings, just put the new key-combo in front of the widget and then prepend it with <code>bindkey<\/code>. For example, personally, I, have modified the default keybindings using the following commands in my <code>~\/.zshrc<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bindkey '^&#91;&#91;8~' end-of-line # end key;\nbindkey '^&#91;&#91;7~' beginning-of-line # Home key\nbindkey \"^&#91;n\" down-line-or-history\nbindkey \"^&#91;p\" up-line-or-history\nbindkey \"^N\" history-search-forward # or you can bind it to the down key \"^&#91;&#91;B\"\nbindkey \"^P\" history-search-backward # or you can bind it to Up key \"^&#91;&#91;A\"\n# autosuggest keybindings\nbindkey '^X' autosuggest-execute\nbindkey '^E' autosuggest-accept<\/code><\/pre>\n\n\n\n<p>The above bindings for <code>history-search-forward<\/code> and <code>history-search-backward<\/code> will take you forward and backward without omitting what you have typed on the terminal. For example, suppose, you executed the following commands in your terminal <strong>one by one<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo 1\necho 2\necho 3\nls<\/code><\/pre>\n\n\n\n<p>And now, when you type <code>echo<\/code> and press the key for <code>history-search-backward<\/code>, you will move from <code>echo 3<\/code> to <code>echo 2<\/code> and then <code>echo 1<\/code> as expected. On the other hand, <code>up-line-or-history<\/code> will omit the <code>echo<\/code> commands, and move you to <code>ls<\/code> and then <code>echo 3<\/code> and so on.<\/p>\n\n\n\n<p>Here, are the keybindings I use very often:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Ctrl-F, End, Ctrl-E &#8211; autosuggest-accept\/end-of-line<\/li><li>Home, Ctrl-A &#8211; beginning-of-line<\/li><li>Ctrl-X &#8211; autosuggest-execute<\/li><li>Enter &#8211; execute whatever you have typed<\/li><li>Ctrl-F and Ctrl-B &#8211; forward and backward char<\/li><li>Alt F and Alt B &#8211; forward and backward word<\/li><li>Ctrl-a Home<\/li><li>Ctrl-b Left<\/li><li>Ctrl-c Escape<\/li><li>Ctrl-d Delete<\/li><li>Ctrl-f Right<\/li><li>Ctrl-h Backspace<\/li><li>Ctrl-m Return<\/li><li>Alt-p Up<\/li><li>Alt-n Down<\/li><li>Ctrl-n History Next without omitting your typed words<\/li><li>Ctrl-p previous history without omitting your typed words<\/li><li>Ctrl-w Delete word left<\/li><li>Ctrl-e, End, Ctrl-f: autosuggest-accept<\/li><li>Ctrl-x: autosuggest-execute<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"edit_line_in_vim_with_alte\">Edit line in vim with alt-e<\/h3>\n\n\n\n<p>Put the following in your <code>~\/.zshrc<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>autoload edit-command-line; zle -N edit-command-line\nbindkey '^&#91;e' edit-command-line<\/code><\/pre>\n\n\n\n<p>Now, whatever you have typed, after pressing alt-e, will be opened in your separate text editor vim. Now, you can edit your text in that editor.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"fzf_for_history_directory_and_file_navigation\">Fzf for history, directory, and file navigation<\/h3>\n\n\n\n<p>Install <code>fzf<\/code> package using your package manager. Now, put the following commands in your <code>~\/.zshrc<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91; -f \/usr\/share\/fzf\/key-bindings.zsh ] &amp;&amp; source \/usr\/share\/fzf\/key-bindings.zsh\n&#91; -f \/usr\/share\/fzf\/completion.zsh ] &amp;&amp; source \/usr\/share\/fzf\/completion.zsh<\/code><\/pre>\n\n\n\n<p><strong>Note: <\/strong>please make sure that the above files <code>key-bindings<\/code> and <code>completion.zsh<\/code> exist at the given location. You can use the <code>locate<\/code> command for that purpose.<\/p>\n\n\n\n<p>Now, use<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>ctrl t: target files in the current directory<\/li><li>ctrl r: recent commands from history<\/li><li>alt c: alternate the cd (directory) into the given directory.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"title_of_your_terminal\">Title of your terminal<\/h2>\n\n\n\n<p>To change the title to the <code>$USER@$HOME:pwd<\/code>, put the following lines into your <code>~\/.zshrc<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function precmd () {\n    print -Pn -- '\\e]2;%n@%m %~\\a'\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"zsh_aliases\">Zsh aliases<\/h2>\n\n\n\n<p>Here, is my favorite aliases. Put\/modify them in your <code>~\/.zshrc<\/code> if you like them:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>alias mv=\"mv -iv\"\nalias rm=\"rm -ivr\"\nalias trash=\"gio trash\"\nalias trash_restore='gio trash --restore \"$(gio trash --list | fzf | cut -f 1)\"'\nalias cp=\"cp -ivr\"\nalias nv=\"nvim\"\nalias vi=\"nvim\"\nalias nf=\"neofetch\"\nalias l=\"ls --color=auto --group-directories-first -AF\"\nalias ls=\"ls --color=auto\"\nalias archwiki=\"wiki-search\"\nalias bc='bc --quiet &lt;(echo \"scale=5;print\\\"scale=5\\n\\\"\")'\nalias xo='xdg-open'\nalias lc='lolcat'\nalias di='dictionary.py'\nalias grep='grep --color=auto'\nalias rsync_progress='rsync --archive --acls --xattrs --hard-links --verbose --progress'\nlolbanner ()\n{\n    echo\n    figlet -f $XDG_DATA_HOME\/figlet-fonts\/3d.flf $* | lolcat\n    echo\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"pywal_support_to_change_color\">Pywal support (to change color)<\/h2>\n\n\n\n<p>If you don&#8217;t use <code>pywal<\/code>, skip this portion. Otherwise, put the following in your <code>~\/.zshrc<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(cat ~\/.cache\/wal\/sequences &amp;)\nclear #find better way to remove the ugly output of above commands\n# source colors.sh file to fix fzf colors and ls command's colors\nsource ~\/.cache\/wal\/colors.sh\n# Ls color is ugly. Modify it using\neval \"$(dircolors -p | perl -pe 's\/^((CAP|S&#91;ET]|O&#91;TR]|M|E)\\w+).*\/$1 00\/' | dircolors -)\"<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Thatsall\">That&#8217;s all<\/h2>\n\n\n\n<p>That was all folks. The above settings have enabled me <strong>not to remember much of the shell commands<\/strong> since I can recall my past executed commands using fzf&#8217;s history. The above settings also <strong>reduce typos<\/strong> thanks to autosuggestion and fzf-tab plugins. As you can see I did not use any special framework like <code>Oh my zsh<\/code>, because they, in my opinion, bring unnecessary complexities. <\/p>\n\n\n\n<p>After configuring the z-shell, you will need to set up your terminal and one of the best terminals is &#8211; urxvt. Therefore, I will recommend you to have a look at this article &#8211; <a href=\"https:\/\/smarttech101.com\/urxvt-installation-color-scheme-fonts-resize-etc\/\" target=\"_blank\" rel=\"noreferrer noopener\">URxvt: Installation, Color Scheme, Fonts, Resize, etc.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Configure zsh &#8211; syntax highlighting, autosuggestion, themes, key bindings, alias, fzf, title and many more.<\/p>\n","protected":false},"author":2,"featured_media":2043,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[17],"tags":[18],"class_list":["post-2030","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-command-line-tools","tag-command-line-tools"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>zsh: highlighting, autosuggestion, themes, binding, alias, fzf | SmartTech101<\/title>\n<meta name=\"description\" content=\"Configure zsh - syntax highlighting, autosuggestion, themes, key bindings, alias, fzf, title and many more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"zsh: highlighting, autosuggestion, themes, binding, alias, fzf | SmartTech101\" \/>\n<meta property=\"og:description\" content=\"Configure zsh - syntax highlighting, autosuggestion, themes, key bindings, alias, fzf, title and many more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/\" \/>\n<meta property=\"og:site_name\" content=\"SmartTech101\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-20T00:19:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-11T20:34:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/smarttech101.com\/wp-content\/uploads\/2022\/05\/ZSH-Configuration.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ajay\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ajay_yadav\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ajay\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/\"},\"author\":{\"name\":\"Ajay\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\"},\"headline\":\"zsh: highlighting, autosuggestion, themes, binding, alias, fzf\",\"datePublished\":\"2022-05-20T00:19:44+00:00\",\"dateModified\":\"2022-11-11T20:34:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/\"},\"wordCount\":1699,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/ZSH-Configuration.jpg?fit=1280%2C720&ssl=1\",\"keywords\":[\"Command Line Tools\"],\"articleSection\":[\"Command Line Tools\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/\",\"url\":\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/\",\"name\":\"zsh: highlighting, autosuggestion, themes, binding, alias, fzf | SmartTech101\",\"isPartOf\":{\"@id\":\"https:\/\/smarttech101.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/ZSH-Configuration.jpg?fit=1280%2C720&ssl=1\",\"datePublished\":\"2022-05-20T00:19:44+00:00\",\"dateModified\":\"2022-11-11T20:34:51+00:00\",\"description\":\"Configure zsh - syntax highlighting, autosuggestion, themes, key bindings, alias, fzf, title and many more.\",\"breadcrumb\":{\"@id\":\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/ZSH-Configuration.jpg?fit=1280%2C720&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/ZSH-Configuration.jpg?fit=1280%2C720&ssl=1\",\"width\":1280,\"height\":720,\"caption\":\"zsh configuration - theme, plugins - fzf, fzf-tab-completion, autosuggestion, syntax highlighting\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/smarttech101.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"zsh: highlighting, autosuggestion, themes, binding, alias, fzf\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/smarttech101.com\/#website\",\"url\":\"https:\/\/smarttech101.com\/\",\"name\":\"SmartTech101\",\"description\":\"Do Everything in Linux\",\"publisher\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/smarttech101.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633\",\"name\":\"Ajay Yadav\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1\",\"width\":180,\"height\":60,\"caption\":\"Ajay Yadav\"},\"logo\":{\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334\",\"name\":\"Ajay\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/smarttech101.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g\",\"caption\":\"Ajay\"},\"sameAs\":[\"https:\/\/x.com\/ajay_yadav\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"zsh: highlighting, autosuggestion, themes, binding, alias, fzf | SmartTech101","description":"Configure zsh - syntax highlighting, autosuggestion, themes, key bindings, alias, fzf, title and many more.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/","og_locale":"en_US","og_type":"article","og_title":"zsh: highlighting, autosuggestion, themes, binding, alias, fzf | SmartTech101","og_description":"Configure zsh - syntax highlighting, autosuggestion, themes, key bindings, alias, fzf, title and many more.","og_url":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/","og_site_name":"SmartTech101","article_published_time":"2022-05-20T00:19:44+00:00","article_modified_time":"2022-11-11T20:34:51+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/smarttech101.com\/wp-content\/uploads\/2022\/05\/ZSH-Configuration.jpg","type":"image\/jpeg"}],"author":"Ajay","twitter_card":"summary_large_image","twitter_creator":"@ajay_yadav","twitter_misc":{"Written by":"Ajay","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#article","isPartOf":{"@id":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/"},"author":{"name":"Ajay","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334"},"headline":"zsh: highlighting, autosuggestion, themes, binding, alias, fzf","datePublished":"2022-05-20T00:19:44+00:00","dateModified":"2022-11-11T20:34:51+00:00","mainEntityOfPage":{"@id":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/"},"wordCount":1699,"commentCount":2,"publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"image":{"@id":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/ZSH-Configuration.jpg?fit=1280%2C720&ssl=1","keywords":["Command Line Tools"],"articleSection":["Command Line Tools"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/","url":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/","name":"zsh: highlighting, autosuggestion, themes, binding, alias, fzf | SmartTech101","isPartOf":{"@id":"https:\/\/smarttech101.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#primaryimage"},"image":{"@id":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/ZSH-Configuration.jpg?fit=1280%2C720&ssl=1","datePublished":"2022-05-20T00:19:44+00:00","dateModified":"2022-11-11T20:34:51+00:00","description":"Configure zsh - syntax highlighting, autosuggestion, themes, key bindings, alias, fzf, title and many more.","breadcrumb":{"@id":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#primaryimage","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/ZSH-Configuration.jpg?fit=1280%2C720&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/ZSH-Configuration.jpg?fit=1280%2C720&ssl=1","width":1280,"height":720,"caption":"zsh configuration - theme, plugins - fzf, fzf-tab-completion, autosuggestion, syntax highlighting"},{"@type":"BreadcrumbList","@id":"https:\/\/smarttech101.com\/zsh-highlighting-autosuggestion-themes-binding-alias-fzf\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/smarttech101.com\/"},{"@type":"ListItem","position":2,"name":"zsh: highlighting, autosuggestion, themes, binding, alias, fzf"}]},{"@type":"WebSite","@id":"https:\/\/smarttech101.com\/#website","url":"https:\/\/smarttech101.com\/","name":"SmartTech101","description":"Do Everything in Linux","publisher":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/smarttech101.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/e8d5aebc510d698e11e9df6291381633","name":"Ajay Yadav","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","contentUrl":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/09\/cropped-ST101_logo.png?fit=180%2C60&ssl=1","width":180,"height":60,"caption":"Ajay Yadav"},"logo":{"@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/"}},{"@type":"Person","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/2edfee738a82f9c963210f8cdb438334","name":"Ajay","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/smarttech101.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6eea348caae2173954765a7cdf6cd107?s=96&d=mm&r=g","caption":"Ajay"},"sameAs":["https:\/\/x.com\/ajay_yadav"]}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/smarttech101.com\/wp-content\/uploads\/2022\/05\/ZSH-Configuration.jpg?fit=1280%2C720&ssl=1","_links":{"self":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2030"}],"collection":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/comments?post=2030"}],"version-history":[{"count":5,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2030\/revisions"}],"predecessor-version":[{"id":2240,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/posts\/2030\/revisions\/2240"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media\/2043"}],"wp:attachment":[{"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/media?parent=2030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/categories?post=2030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smarttech101.com\/wp-json\/wp\/v2\/tags?post=2030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}