Maximizing use of the terminal

Maximizing use of the terminalAlbin GroenBlockedUnblockFollowFollowingMay 11If you are a developer or engineer you have probably touched the terminal or a command line of some sort before.

There is a reason why so many think the command line is so much more powerful than using a graphical user interface.

If you are comfortable with it you can navigate around your operating system and computer much faster and get much more done in less time.

Especially if you work with software development, using the terminal can greatly improve your productivity and workflow.

Getting comfortable with the terminal can take quite some time.

But it is certainly worth it.

Rome was not built overnight after all — or however, it goes.

Investing time into your tools as a software developer is something that will gradually improve your workflow and enjoyment of doing work you previously may not have prioritized.

Setting up a perfect development environment is a long process.

Here are some tips and tricks to get your boring old terminal interesting and more enjoyable to work with every day.

Some of these tips you may already know of— but hopefully, you will find some of it useful.

1.

Terminal & shellThe shell is the engine of your terminal.

The default shell on most machines is called Bash (The Born Again Shell).

Although Bash works perfectly fine, many are switching to other UNIX shells like Zsh, Fish, and Rc, since these are much more customizable.

This article will be aimed at terminals running with Zsh, but the majority of the tips will also work for other shells.

The default terminal on your computer is most likely not very customizable and therefore I, as well as many other developers, recommend a terminal like iTerm if you are on Mac.

iTerm comes with many amazing features and is extremely configurable.

Installing iTerm2 & ZSHIf you want to read the full documentation on installing ZSH I highly recommend visiting the official Github repository:iTerm2https://www.

iterm2.

comZSH$ brew install zsh zsh-completionsSet ZSH as your default terminal shell by entering the following command inside of a terminal window:$ chsh -s /bin/zshNow, after installing and opening iTerm2 you should be greeted with something like this.

2.

Sessions, windows, and pane-managementAfter getting set up with a new terminal and terminal shell engine we want to install a tool called Tmux.

Tmux is a great terminal multiplexer tool for managing multiple sessions and activities at once, using multiple windows, and splitting your window into multiple panes however you want.

Tmux event lets you shut down your terminal and still let processes and activities run in the background while you work on something else.

Installing TmuxAssuming you have Homebrew installed on your machine, installing Tmux is as easy as running the following command$ brew install tmuxNow, to start a new Tmux session just type the following:$ tmuxNow with Tmux up and running we can easily split panes as we want, create multiple sessions, switch between tabs, add windows and much more.

Read more about Tmux here:Tmux Cheat Sheet & Quick ReferenceLatest shortcuts, quick reference, examples for tmux terminal multiplexer which runs on Linux, OS X, OpenBSD, FreeBSD…www.

tmuxcheatsheet.

com3.

Themes & FontsThe most fun part with setting up your computers’ terminal and terminal-shell include styling it the way you want to.

Luckily iTerm2 and Zsh are very customizable and easy to theme and configure as you want to.

For this article, we will install a theme for iTerm2 called Lovlace and also enable a popular Zsh theme called Agnoster .

iTerm2 lovelace themelovelace.

itermcolorsDropbox is a free service that lets you bring your photos, docs, and videos anywhere and share them easily.

Never email…www.

dropbox.

comZsh Agnosteragnoster/agnoster-zsh-themeA ZSH theme designed to disclose information contextually, with a powerline aesthetic – agnoster/agnoster-zsh-themegithub.

comThe great part of installing themes for Zsh is it is a really easy process.

All you have to do is go ahead and choose a theme, open the configuration file, and input the theme you want to use.

Like the following:$ nano ~/.

zshrcAnd changed to the following ZSH_THEME=”agnoster”Close nano by hitting ctrl+x and save by hitting y.

After this, you will have to refresh your Zsh configuration by entering the following command into a terminal window.

$ source ~/.

zshrcYou now have successfully enabled the Agnoster theme for Zsh!4.

PluginsZsh is, as mentioned, very customizable and allows for many add-ons and plugins.

Some of my favorite plugins allow for auto-suggestions when typing commands, syntax highlighting for easier realizing mistakes when typing in the terminal, as well as the git plugin for Zsh.

Installing Zsh-plugins is really easy.

All you have to do is download the plugin you want to install, place it inside of Zsh’s plugins folder and then add it in the configuration file.

Or if you are running Zsh with Oh-My-Zsh, which we are doing, all you have to do is clone a git repo with the plugin and add it to our configuration file.

Zsh-autosuggestionsgit clone https://github.

com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.

oh-my-zsh/custom}/plugins/zsh-autosuggestionsThen go ahead and add into your Zsh configuration file inside of the plugins section.

Here, you add all of the plugins you want to install.

Many plugins are already located inside of the plugins map and you can just enable them by adding them to the plugins section.

Zsh-syntax-highlightinggit clone https://github.

com/zsh-users/zsh-syntax-highlighting.

git ${ZSH_CUSTOM:-~/.

oh-my-zsh/custom}/plugins/zsh-syntax-highlightingNow just follow the previous process by adding the plugin inside of the plugins section in your configuration file.

While you are already inside of the configuration file I highly recommend adding the git plugin which allows you to enter git commands with loads of shorthands for improved speed and productivity.

At this point, you will have a very intuitive terminal to work with every day, instead of clicking around user interfaces.

This, at least for me, increased productivity and workflow substantially as I felt so comfortable with the command line after using it for a couple of months.

Being able to have multiple sessions at once, split panes to have a server running on one side and a text-editor like Nano or Vim on the other side is very freeing.

And remember, what works best for you, are always the best tools.

.. More details

Leave a Reply