Vim 8.1
vim8.org
vim8.org
You mean, like the visual modes in Vim? Where you select text before running a command on it?
It's a powerful primitive in Kakoune, from regex to multiple cursors. My vim knowledge on selection mode is quite limited however, so I can't directly compare them.
Can you just turn on selection mode and use that all the time? I may have to try that, as it sounds like you're suggesting it's a first class feature in Vim. Something I never got the feeling of.
I have no idea. I've never used Kakoune.
> Can you just turn on selection mode and use that all the time?
How would you use that? Have a text selected all the time or what?
Ie, even ignore advanced features, Kakoune fundamentally is permanently in a select->action mode, rather than vim's action->motion mode.
You replied to my comment of the reversed select->action mode that Kakoune uses saying that Vim can do the same thing with Visual Selection mode. So that's why I asked, is that something I can just work in all the time? Because with Kakoune, I am working in that all the time.
That's why I asked, because you countered saying Vim can do that, but I don't want to constantly go into visual mode. I work in Kakoune none stop like that, it's core to the editor. Can visual mode do that?
You can get an idea of the kind of things that are possible from this demo: https://vimeo.com/82711574
Kakoune looks pretty interesting on the other hand. It even has a Clippy. I'll be trying that one out!
Of course there is the other extreme of Oni https://github.com/onivim/oni
I've been wanting to try and make a frontend for Kakoune, but for times sake, I wanted to leverage existing frameworks. If it's possible to write an editor in Qt, perhaps I should look it up.
--
1: https://www.ostechnix.com/pacvim-a-cli-game-to-learn-vim-com...
2: https://superuser.com/questions/246487/how-to-use-vimtutor
Thanks Bram!
Added bonus if you force yourself to use a handful of commands for the whole 7 days (I suggest focusing on dd, yyp, xp, cw and obviously hkjl for movement)
Except Debian's install CD. They only have nano.
Also, when programming, my writing speed is not my bottleneck, but I hate using my touchpad to move the cursor and want to learn vim for both editing prownes and server file editing too.
I don't have a problem using hjkl, I guess my problem is NOT needing to move around inside insert mode. Tips?
But you can also use ctrl+o [movement command] while in insert mode to do one-off movements and end up back in insert afterwards.
I honestly don't think however that you betray any vim sacred cows by using the arrow keys, or even the mouse when they are convenient. Such as when in insert mode.
hjkl is just much more convenient in normal mode while your hands are already in the right position.
iThe default mode is called "normal mode" for a reason.ESC:wq
Ctrl-O <command>
to issue single normal mode commands from insert mode. Most purists would say switch to normal mode to navigate, and by and large that's true (especially, IMHO, if you bind 'jk' to Esc which is much faster for a touch typist). However, insert mode does let you do this to avoid the arrow keys: inoremap <A-h> <Left>
inoremap <A-l> <Right>
inoremap <A-k> <Up>
inoremap <A-j> <Down>
Which some would say enforces 'bad' habits, but I reckon do whatever feels effective to you. If you do find yourself leaning on the direction keys for more than a few repeats, there's probably a faster way though!The only time my progress is hindered (im still not amazing in Vim) is during debugging, which is why I'm pretty excited about this update.
But my vim knowledge helps me every time I need to configure a Linux server, so it wasn't a completely useless experience after all.
It also speaks to a part of myself that wants to force myself to use the terminal so that I am forced to use an environment which is, in some sense, fully programmable. Also it's nice when you log in to servers (yes, some do still do that; the dying art of vimming over 400ms This is not necessarily a universal viewpoint.
As for plugins, its usually better to learn to do things in pure vim first so that you're not crippled when you get some vanilla goodness 400ms away. Viva vim, viva mosh. Have had some issues with neovim, jedi, jedi-vim python-language server. The prediction looks okay, but it always lags the UI slightly when pulling up predictions which is jarring. This is one part of Pycharm that is missed.
edit: lots "clicks" when you understand verbs, nouns and more complex movements. it's rare to use single character movements once you're proficiently expressing yourself.
It took me ~ a month before I was fully getting the hang of it. Now I'm about a year in and not only has my familiarity with my keyboard greatly improved, but I am finally reaping the benefits of speed and portability (gotta love having an identical editor experience on any machine you SSH into).
Definitely don't do that. A well-written IDE should never make one express movement in terms of text because source code is only serialized as text, but the unit of movement should always be symbols. I love vim dearly, and it is an outstanding text editor, but no one should be programming in it when a more intelligent editor exists for the language.
I have seen people trying to fight with the vim plugin in IJ and it has yet to end well
This is just one example of many I could come up with. Code is text, and vim can easily be made to understand that text well.
Vim is also extremely powerful when customized to your needs. Build your own setup over time. Start with vanilla vim and add to it over time. If anything annoys you and requires too much manual repetition, it can probably be automated and streamlined.
Force yourself to use Vim for everything, and soon enough it'll be second nature.
Also — consider Neovim. It's real vim, but better.
Most are pretty young I believe, so maybe not ready for you. I'm sure it's coming though :)
There is no emulator that has that completeness. Most scarcely implement the beginner commands.
It's partly a joke, but it is the "rip off the bandaid" style way to learn Vim. On a system like that you pretty much either learn Vim or perish. I had a Dell laptop like that in grad school which is where I probably used Vim the most consistently I'll ever use it in my life (and used all sorts of other fun key-focused things like xmonad and Vimperator then as well).
It took my brain a while to stop reaching for them but eventually it worked. To this day I naturally shy away from them although I've overcome that somewhat when it comes to using the numeric keypad.
It's kinda of similar to the Right Menu key in Windows. I hit Shift-F10 for so long I never got used to this new key and used it.
† "vi-ctims" pun not intended; but then...
Once I learned the basics, I only use vim itself for commits and small scripts, but this made using vim /modes/ in spacemacs and VSCode practical.
Without the basic vocabulary it just feels like turning on 'cripple mode' while you're trying to get work done.
I'm still not an expert; I heavily reuse the same ~15 commands. I've found learning that vocabulary to be very much worthwhile.
As an example, my transition was something like this: I'd use a vim plugin, and use say 5- 7 basic actions + movements like `cw`, `c$` `i`, and keep it limited to that for a while. If you're frustrated, simple insert mode (`i`) is all you need to get back to your comfort zone. Pretty soon, you get those ingrained, and then start looking for other tricks to learn. A few years later, it's second nature and you're probably slightly more productive. Bottom line is that it shouldn't take you 2 months to break even, hopefully.
And every time I wonder if there's a better way to do whatever I'm doing, I look it up, and - lo and behold - I learn some cool new feature that I can organically introduce into my workflow.
Learning vim in this way has been immensely satisfying. I look at time spent in vim as an investment in my career as a software developer. For as long as I'm in this industry, I'm going to need to edit text. vim can do just about anything and everything; will run on any architecture, past, present, or (it's safe to assume) future; and has allowed me to reduce the amount of time that I spend doing repetitive editing tasks.
Also, something I wish I knew back when I was learning is `:set nonumber` to turn off the gutter and be able to copy things with the mouse (`:set number` turns it back on).
If I had known this, my experience wouldn't have been as bad as it was until I learned to use the registers.
n and N - find previous and next match for current search.
Also make sure you understand the difference between u/CTRL-R and g+/g-.
Macros (q) are also useful. Also, v, V, CTRL-V for selections. And gv to re-select previous selected area and gn / gN to operate on the next/previous match.
Try out: l (line), n/p (next/previous instance of word), f (file)
Note that you can hammer these.
The next important thing I suggest is using buffers, splits, and marks.
It might take a bit more effort to learn than, say, Sublime Text or Atom, yet after playing with "vimtutor" and reading a blog-post or two, you can learn how to open a couple of files and display them in splits, how to do modal editing, search, replace, copy/paste[1], undo/redo, save and close in a vim buffer. It's basically everything you will need to start using vim as your primary editor and it can be learned in a couple of hours.
After that, you can always learn deeper aspects of vim later and customize it in a leisurely pace in weeks to come.
I suspect most Vim users feel comparatively fast because of all the time they spent learning keybindings, not because of the editor. So just do that: figure out how to do editing actions faster in your current editor. I can beat a significant fraction of VimGolf scores with Sublime Text.
See :help terminal
It's a shortcut for pasting.
echo 'imap <esc> there is no escape ' >> ~/.vimrc
(And I actually use it in Termux)