DEV Community

Cover image for Improve your productivity by using more terminal and less mouse (🚀).

Improve your productivity by using more terminal and less mouse (🚀).

Sotiris Kourouklis on April 30, 2024

Many beginners might think that only senior developers can use the terminal for productivity. When I started learning programming, I was afraid to ...
Collapse
 
latobibor profile image
András Tóth • Edited

Hey, senior software engineer here. I try to use a great IDE as much as possible and the terminal as little as possible.

Why? Let's say I'm writing and fixing unit tests. The jest integration runs in my Webstorm works as a breeze: I get diff, I can click on the failing test, it jumps to the relevant line in the codebase, I can put in a breakpoint if I want it and so on. Lightning fast, I have everything at my hands, no need to manually scroll, load, struggle with something. 21st century experience.

I do advocate for learning the keyboard shortcuts while using the IDE and also to learn tricks like multiline cursor editing and so on, because they save so much time.

Now, about typing speed. Mostly I think for a while, then type out my code, the check the results (either through a unit test or on the frontend). Half of my "coding time" is actually also talking with stakeholders, making agreement with my colleagues on what to work on and what not to work on. It's not a typing competition, it's not a copy-paste-modify extravaganza. If I'm writing 2-3x times the same thing or modified version of the same thing I step back to evaluate if I need to extract the code or if I expect them to diverge a couple of iterations later, therefore no need to extract the code. It requires stopping and thinking, nonetheless.

Finally, about CLIs: I hate command line interfaces. They violate "avoid mental mapping" principle of clean coding: you have to memorize the flags for each CLI tool, remember if -f was file or force or folder or something completely different. There are conventions, yes, but not everyone follows them. The only things I do in the terminal are basically "npm start" or "npx something something". Very, very limited instructions.

Summary: you have to use the tools to be productive. You have to code and plan your productivity in accordance of the tools available. If you "muscle" your code through and ignore very effective coding assistance tools, you can have the illusion of productivity as you type a lot, and press Enter a lot, but in reality you are doing double/triple work.

Collapse
 
nandorholozsnyak profile image
Nándor Holozsnyák

Exactly 👆
I share the same opinions, although I still want to learn how to use Neovim and standard vim. 😅

Collapse
 
latobibor profile image
András Tóth

Thanks for your comment and for all the likes on it! Sometimes I feel alone with my opinion and that's pretty scary. So your support feels encouraging.

Collapse
 
phalkmin profile image
Paulo Henrique

terminal is 🔥 - I dare any GUI to let me type fuck and then get the correct command I need.

( But I still need to make zsh better on mac - AND discover how to make the settings work when I'm connected via ssh)

Collapse
 
secondsleepblaine profile image
Blaine

I agree with the overall thesis here. One thing I'd add is that if you're a beginner, you may need to force yourself to use each CLI tool even though it will be slower at first. But if you eat your vegetables for just a few days, you'll be rewarded.

The whole Windows vs Mac argument is silly, silly, silly. We love to act like there's an objectively better OS, but it's all just opinions. I'm a Mac user who works heavily in the Microsoft ecosystem and I love it. I also think Windows is amazing OS. I also think the Ubuntu desktop is fantastic.

However, I can objectively say that PowerShell is superior to all CLI options. Come on, it's an object-oriented shell that runs on all platforms! If you disagree, you're an idiot.

Collapse
 
ruanltbg profile image
Ruan Carlos

Hey you, if you are a new engineer around, don't fall to this post.

  • The guy that wrote this is not a senior engineer, he has only 7 years of experience.
  • The text is based on his opinion not based on data.
  • The text has no fundaments, as if you as engineers spend most of your time creating folders or touching files. If you do that or use that as param to compare productivity, you are for sure not a senior+ engineer.
  • What is productivity and why create a folder 0.01 second faster matters so much for you to be disrespectful to others?

Kids, don't be like this person, be respectful, add your opinion not impose it.
Gather data, measure, compare and then expose the result. Have a positive thinking and try to aggregate.

This post is so disrespectful on so many ways that deserves a report.

Collapse
 
ezpieco profile image
Ezpie

NeoVim Mentioned! Let's go!!!!

Collapse
 
purdy profile image
Jason Purdy

When it comes to trying to find a previous command in your terminal, you can use Ctrl+R and it pulls up a search where you can type part of the command to find it. You can hit Ctrl+R repeatedly to go through other results. Bonus, this feature is also available in your MySQL/MariaDB console.

Collapse
 
orenc profile image
Chanan Oren

Also, as long as you have "stty -ixon" (Linux and *BSD I'm not sure about MacOS) in the shell session (in config or manually run), if you Ctrl+r past your intended command you can switch direction and search forward with Ctrl+s (if you don't turn off the flow control commands with the above stty command then when you press Ctrl+s the shell output will appear frozen until pressing Ctrl+q)

On ZSH with flow control commands disabled then Ctrl+q is mapped to push-line by default you can remap to push-line-or-edit (sgeb.io/posts/bash-zsh-half-typed-... )

Collapse
 
ezekiel_77 profile image
Ezekiel

Powershell Alternative for touch is New-Item or ni. And No Powershell is not shit

Collapse
 
orenc profile image
Chanan Oren

Does New-Item also update the timestamp on existing files? I'm not against PowerShell, just might not be an entirely equivalent command if it doesn't update timestamps (though does cover the most common use).

touch updates accessed and modified timestamps if the file(s) exist (current time by default arguments available for setting a specific time).

Collapse
 
jefflindholm profile image
Jeff Lindholm

Nope it does not - but it is easy to create a touch command in powershell, and put it in your profile.

Collapse
 
gokayburuc profile image
gokayburuc.dev

I also recommend adding key assignments and job automation and specifying time differences.

Especially for very repetitive vim regex or file searches opts, assigning keys provides a tremendous speed increase in tasks.

Collapse
 
marissab profile image
Marissa B

I get where you're coming from, but gatekeeping, nasty stuff like this:

Also let's be honest to all the mouse-only-users you are kind of dull.
if you are using the mouse for most of your activities, you are kind of noob.
The people who right-click to create a file are said to have mental issues

...just makes you come off like an unprofessional jerk, which I don't think was your goal here and it's not the kind of vibe this site is about.

Collapse
 
citrix123 profile image
RahulAN

Hello there, I like your post, but I would recommend to make a combination of Windows and Linux. Development on Linux is much better it depends on your domain, I mostly spend my time with remote ssh Linux workspace on vscode on Windows, It makes debugging much much easier than vim where you have no X environment running at all.

Collapse
 
casperbraske profile image
Luis

There's a third option: the keyboard. If I want to copy/paste random files from one dir to another, file explorer is "billions" of times faster, for example. New folder? Ctrl+shift+N. Navigate dirs? Ctrl+L, super+arrows etc.
Same thing for non-terminal editors/IDEs.

Collapse
 
faaktap profile image
Fakie Tap

We are all programmers here. Best to use programming to make your tasks easier.
I use batch files in windows.

When I start a new project, I just add new commands to my batch file to do all the typical tasks for that project.

I also associated Alt-F1, and Alt-F2 with 2 command windows. So I always have two cmd windows open.

so to for instance open my foo project, load code editor, and start a node session

  1. Press Alt-F1 (open or goto cmd session)
  2. type "d foo" (change folder to my foo project)
  3. type "serve" (start a npm run serve)
  4. type "code ." (open vscode on current folder)

etc...

Yeah - I'm working in windows.

It also means I do not forget commands.
If I find a nice way to do XYZ - I will save a batch file called XYZ in my bin folder.
If I need to do XYZ 2 years later - that batch file is waiting for me.

Collapse
 
karma0 profile image
Bobby

I came to the same conclusion - the context switching for motor memory is too much time wasted in the long run unless you can type with one hand while you mouse with the other.

Don't listen to the negative feedback from others - only you know what works and feels good for you. For me, browsing and selecting text with a mouse while I'm coding is the most painful part of my job, so I focus on using vim modes in apps when it's available and using keyboard shortcuts with scripts backing them in UIs that have easy interfaces (like i3).

Also, when it comes to the "wow" factor if folks watch closely they'll see what I'm doing and they may even get impressed, but usually they're just overwhelmed trying to follow out keep up, and that's probably a little intimidating.

The "cool" occasions definitely don't outweigh the "outdated tech" commentary I get - like, "welcome to the 21st century!" Or, "you still use v-i!?". These people haven't relentlessly pursued continuous and gradual performance improvements in software development over long periods of time. So, don't do it for the wow factor - do it because it feels good when you do it.

No one will understand why you do it, but you will, and that's all that matters.

Nice work! What's next? Maybe a new keyboard layout? 😉

Collapse
 
dimau profile image
Dmitrii Ushakov

Just use IDE like WebStorm for programming

Collapse
 
joaf93 profile image
Joachim

You can get just as far, if not further (in terms of speed) using keyboard shortcuts and Microsoft PowerToys (fantastic program)

That said, a well configured terminal with good auto completion and tab navigation is a must!

Collapse
 
rodrigodip profile image
Rodrigo De Paula

Very nice! I do agree about that tools are meant to be used and improves productivity. But how about the mouse situation? I feel like it's drag me down.
I'm a beginner so I'm always trying to use the CLI and recently installed the Vim motion extension on my VS code, man no more up and down arrows.

Collapse
 
dexternjr profile image
Dexter NJIE

Hey👋🏽
I personally think GUI and CLI r good just depends in what you r doing as they both have their strength and weaknesses. I would say programmers, script writers turn to stick to CLI while designers turn to stick to GUI. Nevertheless i think you should go with the flow, just go what ever makes you more productive.

Collapse
 
joset98 profile image
joset98 • Edited

I think you insult me because I use window, but thank you for your advice dude

Collapse
 
mohamed155 profile image
Mohamed Ramadan

If you're a Windows user, I recommend using Powershell 7 with Windows terminal app. It runs Linux commands on Windows.

Collapse
 
deepak_patel_fdf85cf0ffd6 profile image
Deepak patel

I use all of them but I am still not able to use web without mouse, any suggestions would be helpful. Thanks