<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lana Kushnir</title>
    <description>The latest articles on DEV Community by Lana Kushnir (@lanakushnir).</description>
    <link>https://dev.to/lanakushnir</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F576054%2Fc5f550d5-6b31-47f6-8b91-8ad55eb9e56b.jpg</url>
      <title>DEV Community: Lana Kushnir</title>
      <link>https://dev.to/lanakushnir</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lanakushnir"/>
    <language>en</language>
    <item>
      <title>Automatically switching node versions |`nvm use`</title>
      <dc:creator>Lana Kushnir</dc:creator>
      <pubDate>Sun, 28 Aug 2022 19:28:00 +0000</pubDate>
      <link>https://dev.to/lanakushnir/automatically-switching-node-versions-nvm-use-3af7</link>
      <guid>https://dev.to/lanakushnir/automatically-switching-node-versions-nvm-use-3af7</guid>
      <description>&lt;p&gt;&lt;strong&gt;Issue:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;npm install&lt;/code&gt; or &lt;code&gt;npm ci&lt;/code&gt; keeps throwing a ton of errors&lt;br&gt;
Then I realize I am on a different version of node&lt;/p&gt;

&lt;p&gt;Instead of remembering about it, checking if &lt;code&gt;.nvmrc&lt;/code&gt; file exists, then switching to that node version, let &lt;code&gt;nvm use&lt;/code&gt; do it all the work for you.&lt;/p&gt;

&lt;p&gt;I use .zsh shell, so I used this script from nvm-sh#zsh &lt;a href="https://github.com/nvm-sh/nvm#zsh" rel="noopener noreferrer"&gt;docs&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
  local node_version="$(nvm version)"
  local nvmrc_path="$(nvm_find_nvmrc)"

  if [ -n "$nvmrc_path" ]; then
    local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")

    if [ "$nvmrc_node_version" = "N/A" ]; then
      nvm install
    elif [ "$nvmrc_node_version" != "$node_version" ]; then
      nvm use
    fi
  elif [ "$node_version" != "$(nvm version default)" ]; then
    echo "Reverting to nvm default version"
    nvm use default
  fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt;&lt;br&gt;
Blissss. I don't have to ever (hopefully) think about what version of node is currently used when I switch between projects. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resources:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://github.com/nvm-sh/nvm#zsh" rel="noopener noreferrer"&gt;https://github.com/nvm-sh/nvm#zsh&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nvm</category>
      <category>node</category>
      <category>nvmrc</category>
      <category>zsh</category>
    </item>
    <item>
      <title>Fix chmod permissions</title>
      <dc:creator>Lana Kushnir</dc:creator>
      <pubDate>Tue, 23 Aug 2022 11:29:59 +0000</pubDate>
      <link>https://dev.to/lanakushnir/fix-chmod-permissions-4489</link>
      <guid>https://dev.to/lanakushnir/fix-chmod-permissions-4489</guid>
      <description>&lt;p&gt;Error:&lt;br&gt;
$chmod 755 hosts&lt;br&gt;
=&amp;gt; chmod: Unable to change file mode on hosts: Operation not permitted&lt;/p&gt;

&lt;p&gt;Fix:&lt;br&gt;
$sudo chown -R $(whoami) .&lt;br&gt;
$chmod 755 hosts&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Set up Terminal on Mac 2022</title>
      <dc:creator>Lana Kushnir</dc:creator>
      <pubDate>Thu, 23 Jun 2022 02:20:56 +0000</pubDate>
      <link>https://dev.to/lanakushnir/set-up-terminal-on-mac-2022-h90</link>
      <guid>https://dev.to/lanakushnir/set-up-terminal-on-mac-2022-h90</guid>
      <description>&lt;h2&gt;
  
  
  Setting up new Terminal on Mac
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;iTerm2&lt;/li&gt;
&lt;li&gt;Homebrew&lt;/li&gt;
&lt;li&gt;Git&lt;/li&gt;
&lt;li&gt;Zsh (Z Shell) and ohmyzsh&lt;/li&gt;
&lt;li&gt;ohmyzsh Themes&lt;/li&gt;
&lt;li&gt;ohmyzsh Plugins&lt;/li&gt;
&lt;li&gt;iTerms2 Color Schemes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  1. iTerm2
&lt;/h3&gt;

&lt;p&gt;Download at &lt;a href="https://iterm2.com/downloads.html" rel="noopener noreferrer"&gt;iterm2.com/downloads&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Set out Status Bar Component Menu&lt;br&gt;
&lt;code&gt;iTerm2 &amp;gt; Preferences &amp;gt; Profiles &amp;gt; Session &amp;gt; Status bar enabled &amp;gt; Configure Status Bar&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Check out other features at &lt;a href="https://iterm2.com/features.html" rel="noopener noreferrer"&gt;iterm2.com/features&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  2. Homebrew
&lt;/h3&gt;

&lt;p&gt;Download at &lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;brew.sh&lt;/a&gt;&lt;br&gt;
or run this in terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will automatically install Developer tools if not available in your system.&lt;br&gt;
When installation is done, run the two commands from the "==&amp;gt; Next steps:" section found in output of your terminal&lt;br&gt;
&lt;code&gt;echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' &amp;gt;&amp;gt; /Users/lana/.zprofile&lt;/code&gt;&lt;br&gt;
&lt;code&gt;eval "$(/opt/homebrew/bin/brew shellenv)"&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Git
&lt;/h3&gt;

&lt;p&gt;Mac already comes with &lt;strong&gt;git&lt;/strong&gt; installed&lt;br&gt;
&lt;code&gt;git --version&lt;/code&gt;&lt;br&gt;
=&amp;gt; git version 2.30.1 (Apple Git-130)&lt;br&gt;
Get the latest version of git by installing it with Homebrew&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;git --version&lt;/code&gt;&lt;br&gt;
=&amp;gt; git version 2.36.1&lt;br&gt;
Double-check your git global configurations&lt;br&gt;
&lt;code&gt;git config --global --list&lt;/code&gt;&lt;br&gt;
If your &lt;em&gt;user.email&lt;/em&gt; and &lt;em&gt;user.name&lt;/em&gt; are not set, run the following to set your git global configurations&lt;br&gt;
&lt;code&gt;git config --global user.email "&amp;lt;youremail&amp;gt;"&lt;/code&gt;&lt;br&gt;
&lt;code&gt;git config --global user.name "&amp;lt;yourname&amp;gt;"&lt;/code&gt;&lt;br&gt;
Reference: &lt;a href="https://git-scm.com/download/mac" rel="noopener noreferrer"&gt;git-scm.com/download&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  4. zsh and ohmyzsh
&lt;/h3&gt;
&lt;h4&gt;
  
  
  zsh
&lt;/h4&gt;

&lt;p&gt;Mac already comes with &lt;strong&gt;zsh&lt;/strong&gt; installed and set as a default&lt;br&gt;
Check what shell is set as a default&lt;br&gt;
&lt;code&gt;echo $SHELL&lt;/code&gt;&lt;br&gt;
=&amp;gt; /bin/zsh&lt;br&gt;
If the return is not the above, install zsh with Homebrew&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install zsh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;zsh --version&lt;/code&gt;&lt;br&gt;
=&amp;gt; zsh 5.8.1 (x86_64-apple-darwin21.0)&lt;br&gt;
Then &lt;a href="https://support.apple.com/guide/terminal/change-the-default-shell-trml113/mac" rel="noopener noreferrer"&gt;Change the default shell in Terminal on Mac&lt;/a&gt; or run the following&lt;br&gt;
&lt;code&gt;chsh -s $(which zsh)&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  ohmyzsh
&lt;/h4&gt;

&lt;p&gt;Install &lt;strong&gt;ohmyzsh&lt;/strong&gt;, the following will run the install script from &lt;a href="https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh" rel="noopener noreferrer"&gt;Github ohmyzsh's install.sh&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reference: &lt;a href="https://ohmyz.sh/" rel="noopener noreferrer"&gt;ohmyz.sh&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  5. ohmyzsh Themes
&lt;/h3&gt;

&lt;p&gt;Pick a theme for your ohmyzsh look, and there are many available at &lt;a href="https://github.com/ohmyzsh/ohmyzsh/wiki/Themes" rel="noopener noreferrer"&gt;Github: ohmyzsh Themes wiki page&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.slant.co/topics/7553/~theme-for-oh-my-zsh" rel="noopener noreferrer"&gt;What's the best theme for Oh My Zsh?&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.reddit.com/r/zsh/comments/qilt6j/what_are_some_of_the_best_zsh_themes/" rel="noopener noreferrer"&gt;Reddit: What are some of the best Zsh themes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The most popular theme is &lt;a href="https://github.com/romkatv/powerlevel10k" rel="noopener noreferrer"&gt;PowerLevel10k&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Install &lt;a href="https://github.com/romkatv/powerlevel10k" rel="noopener noreferrer"&gt;PowerLevel10K&lt;/a&gt; theme&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;open ~/.zshrc&lt;/code&gt;&lt;br&gt;
find a line &lt;strong&gt;ZSH_THEME="&lt;/strong&gt; and update it&lt;br&gt;
&lt;code&gt;ZSH_THEME="powerlevel10k/powerlevel10k"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Change PowerLevel10k configurations&lt;br&gt;
&lt;code&gt;p10k configure&lt;/code&gt;&lt;br&gt;
Change iTerm2 font (&lt;a href="https://dev.toHow%20to%20change%20iTerm2%20font%20size?%20(oh%20my%20zsh,%20powerlevel10k)"&gt;reddit reference&lt;/a&gt;)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Quit iTerm2 - &lt;code&gt;iTerm2 &amp;gt; Quit iTerm2&lt;/code&gt; or press ⌘ Q.&lt;/li&gt;
&lt;li&gt;Start iTerm2.&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;iTerm2 &amp;gt; Preferences &amp;gt; Profiles &amp;gt; Text&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If you have multiple profiles, on the left, click the one you want to change.&lt;/li&gt;
&lt;li&gt;Adjust Font on the right.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  6. ohmyzsh Plugins
&lt;/h3&gt;

&lt;p&gt;A list of all &lt;strong&gt;ohmyzsh&lt;/strong&gt; plugins is available at &lt;a href="https://github.com/ohmyzsh/ohmyzsh/wiki/Plugins" rel="noopener noreferrer"&gt;Github ohmyzsh/plugins&lt;/a&gt;&lt;br&gt;
or run &lt;code&gt;ls ~/.oh-my-zsh/plugins&lt;/code&gt;&lt;br&gt;
To see which plugins are enabled, run &lt;br&gt;
&lt;code&gt;echo $plugins&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;There are also lots of custom plugins built within &lt;a href="https://github.com/zsh-users" rel="noopener noreferrer"&gt;zsh-users community&lt;/a&gt;. Install the following custom plugins:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clone &lt;a href="https://github.com/zsh-users/zsh-syntax-highlighting" rel="noopener noreferrer"&gt;zsh-syntax-highlighting&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Clone &lt;a href="https://github.com/zsh-users/zsh-autosuggestions" rel="noopener noreferrer"&gt;zsh-autosuggestions&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Clone &lt;a href="https://github.com/zsh-users/zsh-completions" rel="noopener noreferrer"&gt;zsh-completions&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;code&gt;open ~/.zshrc&lt;/code&gt;&lt;br&gt;
find the line &lt;em&gt;source "$ZSH/oh-my-zsh.sh"&lt;/em&gt;&lt;br&gt;
add the following before that line&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Activate custom plugins&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;open ~/.zshrc&lt;/code&gt;&lt;br&gt;
find a line &lt;strong&gt;plugins=(&lt;/strong&gt; and update it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;plugins=(
git 
zsh-autosuggestions 
zsh-syntax-highlighting
zsh-completions 
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7. iTerm Color Schemes
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/mbadolato/iTerm2-Color-Schemes/" rel="noopener noreferrer"&gt;Github mbadolato/iTerm2-Color-Schemes&lt;/a&gt;&lt;br&gt;
Import color schemes into iTerms 2&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd Downloads
wget https://github.com/mbadolato/iTerm2-Color-Schemes/archive/refs/heads/master.zip
unzip master.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may need to install &lt;strong&gt;wget&lt;/strong&gt; and &lt;strong&gt;unzip&lt;/strong&gt; Homebrew formulae&lt;br&gt;
&lt;code&gt;brew install wget&lt;/code&gt;&lt;br&gt;
&lt;code&gt;brew install unzip&lt;/code&gt;&lt;br&gt;
Import &lt;code&gt;.itemcolors&lt;/code&gt; items found at &lt;code&gt;~/Downloads/iTerm2-Color-Schemes-master/schemes&lt;/code&gt;&lt;br&gt;
&lt;code&gt;iTerm2 &amp;gt; Preferences &amp;gt; Profile &amp;gt; Colors &amp;gt; Color Presets &amp;gt; Import&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To delete them later, follow this &lt;a href="https://gist.github.com/kecebongsoft/11312110" rel="noopener noreferrer"&gt;Bulk remove iTerm2 color schemes&lt;/a&gt; guide.&lt;/p&gt;

&lt;p&gt;Update:&lt;br&gt;
How to go one word backwards and forwards using &lt;code&gt;Option key + Left key&lt;/code&gt; and &lt;code&gt;Option key + Right key&lt;/code&gt;&lt;br&gt;
&lt;a href="https://apple.stackexchange.com/a/293988" rel="noopener noreferrer"&gt;https://apple.stackexchange.com/a/293988&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;References:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/abdfnx/oh-my-zsh-powerlevel10k-cool-terminal-1no0"&gt;https://dev.to/abdfnx/oh-my-zsh-powerlevel10k-cool-terminal-1no0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://techviewleo.com/how-to-install-zsh-and-oh-my-zsh-on-macos-big-sur/" rel="noopener noreferrer"&gt;https://techviewleo.com/how-to-install-zsh-and-oh-my-zsh-on-macos-big-sur/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>monterey</category>
      <category>iterm2</category>
      <category>powerlevel10k</category>
      <category>m1</category>
    </item>
  </channel>
</rss>
