vim
vim
is great.
I started with learning vim
as it’s straightforward to use. vim
, although not often included in default tools offered by Unix OS’s, can be accessed as vi
.
Learning how to edit in vim
- and I’m still learning - has sped up programming. I’ve added vim
to every editor I have, including my IDE.
emacs
emacs
was something that I’ve always wanted to learn, but struggled to do so. I like the core concept of extensibility and self-documenting:
At its core is an interpreter for Emacs Lisp, a dialect of the Lisp programming language with extensions to support text editing.
It is essentially just a Lisp programme. It’s insanely configurable. As I was learning Clojure
, I thought this would familiarise me faster to the world of Lisp languages.
I have yet to be comfortable with emacs
, but I’ll get there one day.
Org mode
In another editing-tools-universe, I’ve come across Org mode
, a plugin for emacs
. I was looking for a tool that could unify the various note taking tools I was using. At this point, I was jumping between notebooks, Evernote, Airtables, Todoist, and more, and I was getting tired of jumping between tool. Org mode
seemed like the best thing that could merge all of the things.
Learning emacs
proved to have a steep learning curve, especially after I’ve familiarised myself with vim
.
Spacemacs
This distribution of emacs
gives you emacs
and vim
. I started using it, I liked it for a bit. But since the corporate proxy gave me a huge headache, I stopped using it eventually. It is the most popular distribution for emacs
and vim
.
Doom
This is a different distribution that I found potentially more vim
-friendly and faster than Spacemacs
vim
Command | Description |
---|---|
:! |
Run Shell command |
: |
jumping to line |
:w |
Save |
:! rm |
Remove |
:w other_filename |
Saving to a new file |
Esc |
Normal Mode |
i |
Insert Mode |
I |
Insert before word |
hjkl |
left down up right |
w |
Start of word |
b |
Beginning of word |
e |
end of word |
o |
open line after |
O |
open line before |
f<m> |
forward to character m |
F<m> |
|
gg |
to the beginning of file |
G |
to the end of file |
<n>G |
to line n |
, |
to the next sentence |
; |
|
u |
undo changes in the current command |
Ctrl+R |
redo changes in the current command |
d<m> |
delete in direction m |
dd |
delete line |
r |
replace |
R |
overwrite |
/<w> |
search mode, search for w |
n |
search mode, next |
N |
search mode, previous |
. |
Repeat last command |
% |
Matching parenthesis |
p |
paste from d |
0 |
Beginning |
$ |
End of line |
x |
delete under cursor |
X |
delete left of cursor |
v |
visual mode |
emacs
A list of the shortcuts for Doom is in this file: evil-bindings
M-x package-refresh-contents
M-x package-list-packages
To get some commands running, always start with Ctrl + X
Ctrl-x-b
creates buffers
Ctrl-x-k
kills buffers
C-x C-f
(C meaning Ctrl) opens file
C-x C-s
saves the file
M-x
means Alt + X
C-c C-t
toggle task states
emacs
) - Dig into Org Mode