Browse Source

Add "Back to the basics: a simple terminal" post

A post about my brand-spanking new setup using only what a terminal will
provide. Simple and useful.
master
parent
commit
c452e0e456
No known key found for this signature in database

+ 233
- 0
content/post/2019-05-10-adventures-in-terminal.md View File

@@ -0,0 +1,233 @@
1
++++
2
+title = "Back to the basics: a simple terminal"
3
+date = 2019-05-10T10:42:17+03:00
4
+draft = false
5
+weight = 0
6
+tags = ["development", "terminal", "vim", "tmux", "alias", "productivity"]
7
+categories = []
8
++++
9
+
10
+Ever since the release of Windows' Virtual Desktops, I've found them very
11
+useful. I thought that compartmentalizing every single part of my PC workflow
12
+would be excellent using Virtual Desktops: I could have one desktop for
13
+development, one for my [L.I.F.E Stack](https://blog.stormhub.io/2019/01/20/the-l.i.f.e-stack/),
14
+one for my times when I simply relax (music, chat, et cetera) and that was
15
+pretty much it. Even after my switch from Windows to Linux, it was actually
16
+pretty good in order to stop my constant gliding  between windows and
17
+procrastination, but it soon turned to this:
18
+
19
+![A GIF of me just switching between desktops extremely quickly.](/public/img/switching-desktops.gif)
20
+
21
+> I think this was a bad idea.
22
+
23
+To be frank, this soon turned in a constant wasting of time of switching
24
+desktops that was not only visually jarring, but also time-wasting and useless,
25
+and it never really stopped me from opening one of the "non-productive" virtual
26
+desktops anyway. So, obviously, I had to do something about it.
27
+
28
+I quickly decided that the best thing by far to improving my productivity and
29
+need to multitask by simply constraining myself significantly: no browser, no
30
+more than one virtual desktop, and trying to limit the apps I could open on my
31
+computer at one time without it causing inconveniences to me.
32
+
33
+The answer? A terminal!
34
+
35
+---
36
+# I love terminals!
37
+
38
+Honestly, they're super cool. Not only do they make you look like one of those
39
+l33t haxXxors, but they also make it incredibly easy to program with an actual
40
+understanding of the deeper, more intricate aspects of coding that very many
41
+IDEs tend to abstract. I've always been of the opinion that knowing how things
42
+work beneath the cover to be very important, which is why I've always been fond
43
+of terminals.
44
+
45
+As such, when the idea struck to convert my entire computer life to one window,
46
+I quickly fell in love with the idea, and I set out and got to work at being
47
+able to make such a thing. I obviously needed 4 basic things to have in a
48
+terminal that would seriously need migration, the rest was merely a distraction:
49
+
50
+* my development environment
51
+* my e-mail and chat rooms
52
+* my music
53
+* my journal and L.I.F.E Stack
54
+
55
+The first thing I did for my migration, though, is move to a different terminal:
56
+Zsh. While Bash (the default shell for basically everyone) is good, I prefer
57
+Zsh simply due to the [Oh-My-Zsh](https://github.com/robbyrussell/oh-my-zsh/)
58
+project, which is the only plugin "distribution" I actually like.
59
+
60
+I have the default theme, along with *very few* plugins: *sudo*, *git* and 
61
+*git-flow*, *npm*, *golang*, and *you-should-use* (reminds me to use the aliases
62
+set in the Zsh configuration). A simple shell for a simple man, and I love it
63
+just the way it is.
64
+
65
+![Screenshot of the very simple shell.](/public/img/a-simple-shell.jpg)
66
+
67
+After that, however, I soon realized that I will probably need a bit of help in
68
+order to keep a bunch of terminal programs in one TTY, and the help came in the
69
+form of an old friend of mine: Tmux! Tmux stands for **T**erminal
70
+**Mu**ltiple**x**er and it is the best way to have multiple terminals in one
71
+TTY (better than *screen*, don't @ me). After a bit of configuration, which took
72
+heavy inspirations from [this .tmux.conf](https://github.com/gpakosz/.tmux), I
73
+finally had the ability to have a terminal work as my main desktop. It also
74
+looks cool, and as we all know, style is always a plus.
75
+
76
+![A screenshot of my tmux session.](/public/img/tmux-screenshot.jpg)
77
+
78
+Now, on to the development part. I need a text editor. I don't like Nano,
79
+but Emacs is too hard, so what am I left with?
80
+
81
+...Oh, no...
82
+
83
+---
84
+# We meet again, Vim.
85
+
86
+Vim! Of course, the biggest enemy of every non-terminal-savvy programmer of
87
+computer user in the **world**. It doesn't matter who you are, you have been
88
+stuck in Vim without being able to quit from it at least once in your computer
89
+cience career. At least that's how the joke goes, right?
90
+
91
+![Yeah, yeah, we all get stuff in Vim sometimes.](/public/img/vim-welcome.jpg)
92
+
93
+> I don't get it though, it says how to exit it on the welcome screen!
94
+
95
+In case you haven't been exposed to it, Vim is a special kind of text editor in
96
+your terminal, notorious for its incredibly weird keybindings that, while
97
+incredibly stupid at first, allow you to write things incredibly quickly after
98
+a while. My first tip would be the `.` command, which allows you to repeat the
99
+last action you've done in Vim, which can be useful if you have to repeat
100
+something throughout your file, like searching for a word. (You do that by
101
+typing `/` and then the word to search in Normal mode, which is the default
102
+one). Believe it or not, Vim actually makes you quite productive if you start
103
+learning it right, even though it takes a long time.
104
+
105
+Personally, I've seen a lot of people be scared of it, and for good reason, but
106
+I have two pieces of advice that I found were crucial to not only get me used to
107
+Vim, but also to be productive to it.
108
+
109
+Most importantly, no matter what, you must **never** use anyone else's config blindly,
110
+ever. The best and quickest way to be overwhelmed by Vim is to download some
111
+random Vim distribution and use it with no clue as to what it actually does,
112
+what bindings it has and what plugins it installs. I recommend simply starting
113
+off by installing some [sensible Vim defaults](https://github.com/tpope/vim-sensible)
114
+and then adding plugins as you go to your Vim configuration, depending on what
115
+you need. Always follow the "Keep It Simple, Stupid" rule, and grow along with
116
+your Vim configuration. Only add a line in your .vimrc file if you are ever
117
+actually certain you like that settings.
118
+
119
+Personally, the only things I found worth adding to default Vim is a Powerline,
120
+the Monokai theme and
121
+[YouCompleteMe](https://github.com/Valloric/YouCompleteMe), an auto-completion
122
+engine that is actually pretty damn good. That being said, vim is now my main
123
+text editor, and I absolutely love it. I write faster than I've ever written
124
+code before.
125
+
126
+![A screenshot of my Vim setup on a C++ exercise.](/public/img/vim-screenshot.jpg)
127
+
128
+---
129
+# Mail sucks less now, honestly.
130
+
131
+By far my most disorganized part of my life was my e-mail. My old Gmail address
132
+looks horrible, and that is excluding the absolute monstrosity that is my Yahoo!
133
+e-mail (whose password I forgot since its creation nearly 9 years ago). I've
134
+always had a problem with sorting my e-mail: I found interfaces cumbersome,
135
+complicated with their automatic labeling. I would miss e-mails, I would screw
136
+up with my categories, and every time I would connect an e-mail client to them,
137
+some part of it would mess up.
138
+
139
+This is why, for one thing, I constructed my own mail server (that'll be a story
140
+for another time), and secondly, it's why I started looking for more clean
141
+alternatives to e-mail clients, and where else to go but the terminal.
142
+
143
+Meet Neomutt: a fork of Mutt that turns e-mail into a very simple terminal
144
+application. Nothing fancy, just folders, inboxes, and a dead simple interface
145
+for reading and managing e-mail. No more, no less.
146
+
147
+![Neomutt in action.](/public/img/neomutt-screenshot.jpg)
148
+
149
+Surprisingly, this has helped not only with my e-mail organization, but also
150
+made me realize that I had some bad e-mail habits. For instance, I used to
151
+always archive everything, no matter what. Now, I read my e-mails, I sort
152
+through them, I trim away whatever newsletters I'm not interested in, etc.
153
+It's actually really nice now, and I enjoy the process.
154
+
155
+Configuring Mutt, no matter what, can be a pain, though, which is why I started
156
+with a bit of help. I first inspected to see what
157
+[this Mutt configuration wizard](https://github.com/LukeSmithxyz/mutt-wizard)
158
+would do, and worked from there. I basically have all my e-mails configured
159
+there for now, but I will slowly deprecate my other e-mail addresses to make sure
160
+I don't end up missing e-mails by not checking. In addition, using this
161
+configuration, Neomutt integrates really well with GPG, so I end up having a
162
+super simple process for singing and encrypting e-mails. Overall, I'd recommend
163
+you try it out, too. It might start off badly, but the pace will probably pick
164
+up soon.
165
+
166
+---
167
+# Spotify in the terminal? No way.
168
+
169
+Yeah, I use Spotify for music. I know, it's basic, but it gets the job done.
170
+Unfortunately, there's no officially supported terminal client for Spotify.
171
+Luckily, there's a workaround.
172
+
173
+I used [Mopidy](http://mopidy.com/) which is a really cool daemon for the MPD
174
+protocol, the standard way of listening to music from your terminal. Mopidy
175
+comes with a lot of configuration, but I personally simply added to it the
176
+Spotify backend, along with some local music that I didn't have on Spotify. I
177
+did later add a Podcast backend for the very few podcasts I ocasionally listen
178
+to, and a scrobbler for Last.fm. However, you're probably asking:
179
+
180
+> "But where's the terminal client for the music?
181
+
182
+That, my friend, would be
183
+[ncmpcpp](https://wiki.archlinux.org/index.php/ncmpcpp), which is a terminal
184
+client for the MPD protocol. I followed
185
+[this guide](https://medium.com/@theos.space/using-mopidy-with-spotify-and-ncmpcpp-44352f4a2ce8)
186
+to enable the visualizer as well (I wouldn't recommend following the Spotify
187
+part, it's outdated), and that was it! Music in my terminal. Honestly, it looks
188
+pretty cool, too!
189
+
190
+![Me listening to music.](/public/img/tmux-music-screenshot.jpg)
191
+
192
+---
193
+# Typing my thoughts in the terminal made me revision my previous workflow.
194
+
195
+You see, previously, I used Zim for my note-taking. I realized that,
196
+surprisingly enough, even *that* was too complicated. In addition, it lacked a
197
+compatibility layer with my mobile phone, which would've made it easier to write
198
+in my journal. As such, I switched from Zim to [Joplin](https://joplinapp.org/)
199
+for my note-taking. Honestly, it not only works better with cross-platform
200
+stuff (mobile app and all), it's encrypted and can be synced easily. At its
201
+core, it's also essentially a bunch of Markdown notes, so easily exportable.
202
+Migration was easy, since all I had to do was export notes from Zim using
203
+Markdown and import them to Joplin just as easily. Joplin also comes with a
204
+terminal client, so imagine my delight that at this point, 100% of my activities
205
+on my PC could be switched to a terminal fully! Amazing!
206
+
207
+![Joplin in action.](/public/img/joplin-screenshot.jpg)
208
+
209
+---
210
+# But what about the browser?
211
+
212
+Alas, I cannot transfer my browser to a terminal (I mean, I could, but not
213
+fully), and I am ok with that. The problem with web browsers nowadays is that
214
+they let you do anything in the same environment. This means that they're a
215
+jack-of-all-trades, master of none kind of deal. In addition, browsers are the
216
+bane of my existence, since I can oh so easily open a new tab and go on Reddit
217
+or YouTube and waste time doing stuff there. I think that it's best this way.
218
+
219
+I've been using this terminal setup on my PC for a while now and I can honestly
220
+say I am incredibly satisfied with it. I know that it's not fancy-looking, and
221
+obviously not particularly advanced (yet, that .vimrc keeps growing), but I'm
222
+certain that, with time, my terminal will keep growing with me, allowing me to
223
+slowly learn to be more effective in it, more effective than ever before.
224
+
225
+I don't need all the tools in the world *right now*, I need just enough to get
226
+myself going, and that's all you really need. If you ever need more, you can get
227
+it when you need it, but for now, all I need is a shell.
228
+
229
+And honestly, it might be all I ever need.
230
+
231
+---
232
+If you're curious to join me on my journey of using terminals as your main
233
+workflow, you can [talk to me](/contact) about it at any time.

BIN
static/public/img/a-simple-shell.jpg View File


BIN
static/public/img/joplin-screenshot.jpg View File


BIN
static/public/img/neomutt-screenshot.jpg View File


BIN
static/public/img/switching-desktops.gif View File


BIN
static/public/img/tmux-music-screenshot.jpg View File


BIN
static/public/img/tmux-screenshot.jpg View File


BIN
static/public/img/vim-screenshot.jpg View File


BIN
static/public/img/vim-welcome.jpg View File


Loading…
Cancel
Save