Oh My Zsh is an open source, community-driven framework for managing your zsh configuration.įirst, you’ll want to dive into the configuration file for zsh to change a few defaults. This is helpful so you can start an interactive process in one tab and then open a new tab to interact with that directory. Change this to ‘Reuse Previous Sessions Directory’ so when the new tab spawns it will be in the same directory as the last. By default, the new tab opens from the user’s root directory. One of the changes that I would suggest making is changing the default behavior for opening a new tab (Command+t). On the link below you’ll find a download button which will download a zip and installer for iTerm2.Īfter iTerm2 is installed, you can open the preferences from the top menu bar (iTerm2 -> Preferences) or Command+, Install a new terminal called iTerm2 that provides more robust features and customization. Here’s two pro tips to get your terminal running at tip-top condition. Import-Module Terminal-Icons -Scope Local -ForceĬreate the $PROFILE file to run when initiating a PowerShell session.As a developer, when you switch from a Windows based PC or laptop to a Mac, you’ll start to notice an affinity for the terminal. Install-Module Terminal-Icons -Scope CurrentUser -Repository PSGallery -Force Install plug-ins for oh-my-posh, like Terminal Icons. Set-PoshPrompt -Theme powerlevel10k_rainbow Again, it's totally up to you which theme you're going to pick, but this post chooses either Spaceship or Powerlevel10k - Rainbow. Import-Module oh-my-posh -Scope Local -Force Install-Module oh-my-posh -Scope CurrentUser -Repository PSGallery -Force If not, enter the pwsh command to switch your prompt to PowerShell. Make sure that you see the PowerShell prompt. Let's configure oh-my-posh on your Azure Cloud Shell this time. Now, your Azure Cloud Shell starts using oh-my-zsh. ~/oh-my-azure-cloud-shell/switch-p10k-clock.sh ~/oh-my-azure-cloud-shell/switch-p10k-clock.sh -c If you are with the Powerlevel10k theme and want to turn on or off the current time, run the following script: # Turn on the clock feature ~/oh-my-azure-cloud-shell/install.sh -t p10k # Install oh-my-zsh with the theme of "Powerlevel10k" ~/oh-my-azure-cloud-shell/install.sh -t spaceship # Install oh-my-zsh with the theme of "Spaceship" If you want to run all steps above in just one command, run the following: # Download the GitHub repository Then, you will have the oh-my-zsh applied shell prompt. Once everything so far is done, restart Azure Cloud Shell. Unfortunately, you can't run the chsh -s $(which zsh) command because sudo is not allowed. p10k configureĪs mentioned above, Azure Cloud Shell uses Bash Shell by default. If you choose the Powerlevel10k theme, run the following command for further configuration. ~/.oh-my-zsh/custom/themes/powerlevel10k.zsh-theme Ln -s ~/.oh-my-zsh/custom/themes/powerlevel10k/powerlevel10k.zsh-theme \ ~/.oh-my-zsh/custom/themes/powerlevel10k -depth=1 ~/.oh-my-zsh/custom/themes/spaceship.zsh-theme Ln -s ~/.oh-my-zsh/custom/themes/spaceship-prompt/spaceship.zsh-theme \ ~/.oh-my-zsh/custom/themes/spaceship-prompt -depth=1 It's totally up to you which theme you're going to pick, but this post chooses either Spaceship or Powerlevel10k. ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-completions If you want more plug-ins, follow the steps below. Although there are many good plug-ins, this post will install the three popular ones – zsh-completions, zsh-syntax-highlighting and zsh-autosuggestions. If not, enter the bash command to switch your prompt to Bash. Make sure that you see the Bash Shell prompt. Let's configure oh-my-zsh on your Azure Cloud Shell. This GitHub repository provides the working shell script source for your reference. Throughout this post, I'm going to show how to configure your shell environment for both. Therefore, if you want either oh-my-zsh or oh-my-posh, or both, you should configure it by yourself. Azure offers Azure Cloud Shell service, which uses both Bash Shell and PowerShell by default. It might also be possible to have heard of or currently use oh-my-posh for your PowerShell. You likely heard of or currently use oh-my-zsh for your terminal on Linux or Mac, or WSL on Windows. This post has been republished via RSS it originally appeared at: Microsoft Tech Community - Latest Blogs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |