{"id":701,"date":"2024-12-28T04:07:56","date_gmt":"2024-12-28T09:07:56","guid":{"rendered":"https:\/\/saoudrana.com\/blog\/?p=701"},"modified":"2024-12-28T04:10:19","modified_gmt":"2024-12-28T09:10:19","slug":"oh-my-zsh-and-powerlevel10k-in-macos-in-iterm-2","status":"publish","type":"post","link":"https:\/\/saoudrana.com\/blog\/2024\/12\/oh-my-zsh-and-powerlevel10k-in-macos-in-iterm-2\/","title":{"rendered":"Oh My Zsh and Powerlevel10k in macOS in iTerm 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">First of all, install iTerm2 (because it provides a much better experience with Oh My Zsh and Powerlevel10k); either download it and install it from here <a href=\"https:\/\/iterm2.com\/downloads.html\">iTerm<\/a> or use \u201c<a href=\"https:\/\/brew.sh\/\">homebrew<\/a>\u201d:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install --cask iterm2<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then, install Oh My Zsh; since I have \u201ccurl\u201d installed, I\u2019m using this command (otherwise, see the Oh My Zsh URL for alternative options):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sh -c \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/ohmyzsh\/ohmyzsh\/master\/tools\/install.sh)\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then, we install p10k:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone --depth=1 https:\/\/github.com\/romkatv\/powerlevel10k.git ${ZSH_CUSTOM:-$HOME\/.oh-my-zsh\/custom}\/themes\/powerlevel10k<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To enable it, edit \u201c~\/.zshrc\u201d and set the variable ZSH_THEME accordingly:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ZSH_THEME=\"powerlevel10k\/powerlevel10k\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, either \u201csource\u201d the .zshrc file or open a new instance of iterm2 to see the initial configuration of p10k (remember you can always reconfigure it by running \u201cp10k configure\u201d):<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Meslo fonts are recommended to have nice icon fonts, so it\u2019s best to accept the proposal to install the Meslo fonts (in macOS, you have this nice automatic procedure). Let\u2019s wait for the fonts to be downloaded.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then restart iTerm2 or open a new tab.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we start a new iterm2 instance, and we start p10k from scratch, it will prompt you with questions for checking whether we can see the font icons correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then, we can start choosing our preferred options, pick whichever ones you prefer and look best to you.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, I install two other useful plugins (to have syntax highlighting on the command line and to have suggested commands as you type based on history and completions):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/zsh-users\/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~\/.oh-my-zsh\/custom}\/plugins\/zsh-syntax-highlighting\n\ngit clone https:\/\/github.com\/zsh-users\/zsh-autosuggestions ${ZSH_CUSTOM:-~\/.oh-my-zsh\/custom}\/plugins\/zsh-autosuggestions<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The plug-ins must be enabled in the proper section of ~\/.zshrc:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>plugins=( ... exsiting plugins...\nzsh-syntax-highlighting\nzsh-autosuggestions\n)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I also like to have fzf, a general-purpose command-line fuzzy finder. This must be first installed as a program, e.g., with homebrew:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install fzf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I like to add a few more plugins and then enable the corresponding plug-in which include fzf:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>plugins=(\n  git\n  zsh-syntax-highlighting\n  zsh-autosuggestions\n  zsh-interactive-cd\n  zsh-navigation-tools\n  fzf\n) <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>First of all, install iTerm2 (because it provides a much better experience with Oh My Zsh and Powerlevel10k); either download it and install it from here iTerm or use \u201chomebrew\u201d: Then, install Oh My Zsh; since I have \u201ccurl\u201d installed, I\u2019m using this command (otherwise, see the Oh My Zsh URL for alternative options): Then, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67,87,644],"tags":[627,643,639,641,642,638,640],"class_list":["post-701","post","type-post","status-publish","format-standard","hentry","category-apple","category-computer","category-programming","tag-apple","tag-fzf","tag-iterm2","tag-macos","tag-ohmyzsh","tag-p10k","tag-powerlevel10k"],"_links":{"self":[{"href":"https:\/\/saoudrana.com\/blog\/wp-json\/wp\/v2\/posts\/701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/saoudrana.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/saoudrana.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/saoudrana.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/saoudrana.com\/blog\/wp-json\/wp\/v2\/comments?post=701"}],"version-history":[{"count":1,"href":"https:\/\/saoudrana.com\/blog\/wp-json\/wp\/v2\/posts\/701\/revisions"}],"predecessor-version":[{"id":702,"href":"https:\/\/saoudrana.com\/blog\/wp-json\/wp\/v2\/posts\/701\/revisions\/702"}],"wp:attachment":[{"href":"https:\/\/saoudrana.com\/blog\/wp-json\/wp\/v2\/media?parent=701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/saoudrana.com\/blog\/wp-json\/wp\/v2\/categories?post=701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/saoudrana.com\/blog\/wp-json\/wp\/v2\/tags?post=701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}