Once you have used 'notepad.exe', you have used all text editors—they said. A text editor is a text editor is a text editor—they said. After the fi...
For further actions, you may consider blocking this person and/or reporting abuse
Bill Joy, the creator of
vi
, who used an ADM-3A terminal (which is why some of the keys are mapped the way they are, and the ADM-3A didn't have separate arrow keys, and placement of ESC and CTRL). His interviews where he is nostalgic about howvi
came about, in a world with 300 baud modems (2400 baud if you're lucky!), super-slow bandwidth where every character is "expensive" to transmit, whyvi
has so many short single-character commands. And how with modern computers with enormous speed and incredible bandwidth make the raison d'être forvi
to be obsolete.Nevertheless,
vi
persisted. (AndVim
too!)Nice one! My only words of caution are applicable if you find yourself editing files across a number of different systems (especially when there may be network security restrictions at play): The more heavily you rely on customization, the more you're going to bash your head on your keyboard trying to remember how to do it the vanilla way. I used to have a heavily modified .vimrc with all kinds of plugins and custom keybinds, but ended up getting rid of many of them in favor of building muscle memory around the built-in commands instead after sufficient time was spent bashing my own head on my keyboard. YMMV though :)
I agree, with caveats. Muscle-memory is a tricky thing. Therefore, learning the fundamentals is important before trying to customize. I probably should have mentioned that somewhere clear. Let me put it this way.
Whenever I introduce customization to an environments/tools—be it software or not—my idea is to learn the fundamentals of how it was meant to be used, then add bells and whistles. If you lose the bells and whistles, you still have access to the basics you learn to see you through. Same goes for vim.
If I can't get my customizations in, I should be able to get basic editing done without slowing me down too much. But if I can help it, there's no point of avoiding other niceties you can get. I have the ease of access with vimfiles on GitHub for the same reason.
nnoremap <Leader>/ :let @/=""<CR>
Might be a better way to clear / after the search. See stackoverflow.com/a/657484 (+ comments)
It can definitely be useful depending on what you want to achieve. However, I wouldn't necessarily call it "better" without a context.
To elaborate, while
:let @/=""<CR>
clears the search pattern, what I have (i.e.,:noh
/:nohlsearch
) only clears the highlighting (i.e., search pattern remains the same, just without highlighting), which is exactly what I want in most cases. This way, if I need to jump to the next occurrence of search pattern, I only need to pressn
which will do so, as well as start highlighting again.Sure, different workflow, different approach.
I guess I'm too used to my typical workflow: while I still need my search result - I want it highlighted, but after I'm done with it - it should be gone.
I use
:command! C let @/=""
so I can simply hit:C
to clearWell, mapping is one's personal preference of course :)
Vim is really amazing. Today I use vim only for changing some configuration on my system or a minor thing in a file, but I know I should use it more, much more.
Thanks for the awesome article (makes me excited in making vim my main editor)! :D
Thanks you for good article!
Hi, could you please explain what QuickfixToggle() is supposed to be used for?
Vim has an inbuilt QuickFix window feature which can pop into view on errors, etc, sort of like in popular IDEs. This is sometimes used by filetype plugins as well. For example, if you run a compile action while on a file, the compiler errors could be displayed in the QuickFix window. Here's an outside link which shows it with a little more detail.
While it can be quite useful, it can be annoying if you have to open it manually too often (e.g.,
:copen
or:cope
) or if you have to go close it by typing in the relevant command (e.g.,:cclose
or:ccl
).Therefore, I wanted to map a keyboard shortcut which would toggle the QuickFix window. This is the action I have defined in the
QuickfixToggle()
function. It is later mapped to<leader>q
.That's so cool! Thank you for a thorough explanation.
Thanks for sharing this helpful content, for me that i'm a newbie in Vim (with a lot of useless experience in VsCode and SublimeText) resulted very clearing. 👏🏽