So, competition is good. Neovim introduces async. Bram, after years of refusing to do it, releases vim 8 with async. Neovim introduced an embedded terminal. Bram thereafter introduces an embedded terminal in 8.1. I'll be curious to see how close the two implementations are to each other.
Man I wish I could switch back to Vim. GUI frontends for Neovim has made me want Vim so bad, but I just can't get away from Kakoune. The model of select first, action after (reverse of vim) is so so much better for me. Kakoune just gives me so much clarity over I'm doing at any one time. I guessed too frequently in vim :/.
Yes, you could say that all selection operations work in visual mode by default. Combined with multi-cursor / multi-selection, this turns out to very powerful.
I get it that you have your reasons to use Neovim more than Vim, and a large
number of them is probably difficult to articulate, but framing it like Vim
had no mode for selecting text visually is unfair.
I don't think visual selections in vim work the same as in kakoune though, do they?
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.
Not sure, I've not used selection mode all the time lol. You're the one who (due to my interpretation) implied Kakoune and Vim were similar on the text selection mode.
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?
Really want to try kak but the lack of IDE plugins stops me completely. I pretty much exclusively use IntelliJ or VSCode with the vim plugin, especially in IntelliJ the auto completion is just so much better and so much less effort to set up than a million vim plugins.
There's a WIP Kakoune mode plugin for VSCode, [0] which is unfortunately unusable and unmaintained. I keep checking every couple of months, hoping the developer will pick it up again, but so far no luck.
Out of curiosity, how well did the Qt frontend for Neovim work for you?
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.
I tested :terminal but I still prefer my tmux + vim config (seems more productive). But, I have to say that for ssh connections this will be really useful.
I personally didn't like how :terminal was implemented. The keystrokes are not intuitive at all. Sure, I could remap some keys around, but what's the point?!
Tmux + Vim is just better.
I want to learn Vim and tried several times (with vim modes form Intellij mainly) but failed under pressure to get actual things done. I see great potential and I know I have to sacrifice 1-2 month of productivity to get up to speed but I fail every time.
I've been a heavy Vim user for 20 years, and I hear people say this all the time. Recent converts especially love to write breathless blog posts exalting Vim's editing model as the One True Way, but the truth is that if your editing speed is the bottleneck for your productivity, you must surely be some kind of software engineering deity. There's absolutely no shame in sticking with a model that works for you if you're productive and efficient.
I think editing friction can take a toll on your total mental energy. I also think that workspace automation can significantly improve the speed at which you complete a task. Vim macros make repetitive tasks on any size file a breeze.
Same here, I've been using Vim for a long time. The main reason is that I touch type and I really don't like to use the arrow keys. However, I really wonder if I'm really more productive using Vim rather standard shortcuts plus the trackpad.
I know im vim'ing wrong, but I just can't stop using arrow keys. Part of it is because I end up navigating around a little bit in insert mode sometimes, and switching between arrow keys for insert mode ans hjkl for other modes seems dumb.
I don't have a problem using hjkl, I guess my problem is NOT needing to move around inside insert mode. Tips?
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:
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 vim way is to simply escape out of insert mode, do your movement commands, then go back in.
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.
Try HardMode (https://github.com/wikitopian/hardmode) for vim. While it also disables some other stuff, the idea is it will force you to use the more efficient movement options.
It's not always about typing speed. When typing you are articulating a thought process to the computer, and the faster you can articulate the current thought, the quicker you're on to the next one (although that may involve pondering and not typing) and so on. Vim has really useful "intermediate" things like registers, macros, :args and :argdo which make some menial tasks a little more bearable.
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.
Yep. I think that I know vim well enough, it was a time when I spend months in vim writing C++. vim really shines when you need to do some repetitive tasks. But I've found out that in recent years I don't have those tasks. I'm using Intellij Idea now. If I need to do some repetitive thing, I either rethink the task; use search-replace with regex or just use Idea multiple cursors. Sure, vim might be a little bit better at text editing, but given that I'm spending may be 1% of time on text editing, this optimization just doesn't matter. I tried IdeaVim and decided to stay with traditional hotkeys.
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.
Completely agree. Use whatever you're comfortable with. No one should feel any shame for not using VIM/Emacs. But with that said, I feel like once you are comfortable with these tools, it's a more pleasurable experience.
They all do pretty much the same, just implemented in different ways. The only reason I tell people that vim is the better choice (when starting from scratch) is that Vi is on every unix system and it is nice to be able to work on any machine. If you don't plan on using unknown machines, do whatever works best for you.
Thanks for chipping in with this. As an Atom undesirable, I've found myself wanting to use Vim now and again over the years, but I know that my productivity shortcomings revolve mostly around motivation, drive and cognitive ability, not typing speed or editing slickness. I think with a handful of keyboard shortcuts I can mostly keep productive speed, although I'm sure I'd never outpace a Vim user.
This. I switched to Vim full time as part of starting a new job and picking up a new stack/language, because I was so frustrated with how useless/frustrating Ruby IDE and editor environments all seemed.
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.
I often have something to do on some remote linux server and I want to kill my self every time I open some large file in Nano trying to edit something.
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 think you can successfully migrate to vim modes by using less than optimal vim habits initially. I don't think anyone is going to go through the entire action list and instinctively remember all of them, and be able to use them at a moments notice.
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.
This is how I've learned! I'm about 8 years in with vim, but I'm no vim-journeyman; I just learned enough to get started. Movement, find-and-replace, splits. The basics.
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.
> If you're frustrated, simple insert mode (`i`) is all you need to get back to your comfort zone.
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.
If I had as much extra time as I ever wanted one of the projects I'd work on would be a vim-style modal editor where ctrl-X in insert mode usually corresponded to X in normal mode and where CUA conventions are followed when practical. And where you do move-command rather than command-move and you have both an emacs yank-ring and a vim jump-ring.
Path I took is to learn the basic movements. Then just put a sticky note with new commands each week. Whatever I didn't use I didn't commit to memory. But knowing commands exists helps.
By far I think the most over looked commands are the <C-x> commands while in insert mode. They do the auto complete. They all follow this pattern <C-x>letter.
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.
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.
Use real vim, not emulators. Emulators all suck, and won't teach you the right habits.
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.
I actually disagree. I found what finally led to me using VIM was enabling VIM keybindings in RStudio. It's an emulated VIM setup, so not every command is supported, but it does have the advantage that at any point Insert mode works pretty much exactly like a non-vim setup. After a few months of this sort of semi-usage, I started to feel confident enough to use regular VIM, and started looking into more advanced command usage. The biggest thing was still, the ability to drop into Insert mode and have things like selection, copy/paste, backspace behavior, all work like they would in a normal text editor. If I got frustrated and needed to "just get something done", I didn't have to drop into notepad or whatever to do that. Rather than start off with no vimrc, I think its a lot more helpful to start with a vimrc that disables a bunch of functionality or makes it work "normally", which you can then re-enable as you see the need. For example, at first I shortcutted all registers to the system register.
What, specifically, is the problem with emulators that make them not teach the right habits? I get that emulators are likely more bloated and have less features than real vim/neovim. But, to me, that's not a dealbreaker, especially since it can be really convenient to use an emulator in an IDE.
As an aside, there are GUIs coming out for Neovim that give you features of IDEs with 100% real backing of Vim/Neovim. Ie, it's actually Neovim, but the GUI is just a frontend with IDE bells and whistles.
Most are pretty young I believe, so maybe not ready for you. I'm sure it's coming though :)
I would agree with this. Emulators typically are missing a few features, so moving from emulator -> vim should work okay. On the other hand, I've never had success going from vim -> emulator. It's always missing a few key features in my muscle memory that completely destroy my productivity.
Nah. Vim bindings in VS Code are the sweet spot for me. Some of the Vim emulation isn't perfect but having something like 99% of Vim is plenty plus I get my preferred layout, debugging tools, etc.
I use Vim bindings for VS Code with the Angular work I'm doing at my job. I can vouch that they're the best emulated bindings outside of any JetBrains app that I've touched.
Atom's vim-mode-plus is superb! I've actually started to like it more than "real vim". Atom itself is a work-in-progress, but I'm extremely happy with its vim emulation. The only thing missing is a macro system.
There is this game that was posted to HN earlier this week [1]. There is also `vimtutor` a text file that walks you through a tutorial in vim, I believe this ships by default with vim [2].
Vimtutor done once a day for a week beats anything else
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)
vimtutor is what got me over the initial hump. I dabbled with Vim for a year or so before I found it. Within a couple of weeks after using it for an hour or so a day I felt very comfortable and have used Vim, environment permitting, as my primary editor ever since.
You don't have to use VIM as your daily driver, you can use it on your personal projects. I was in the same boat as you. But now that I am comfortable with VIM, I feel like learning it has been one of the most rewarding and fruitful investments I have made in myself. I use it for JavaScript, Python, C#, golang, and more.
I think learning to touch type is an unofficial prerequisite for learning vim. If you "peck & hunt" type and use vim on top of that, I think you'll get frustrated pretty quickly.
The thing that (finally) worked for me was to pick a language that I wasn't using at work (C in this case), and do a project in it using exclusively vim.
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.
Find a good cheatsheet that you're able to browse through quickly. Uninstall every GUI editor you have on your machine.
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).
I was in a similar situation, tried a few times but always bounced off. In the end, a job where I had to use vim (because connection to our remote dev machines was abysmally slow) forced me to learn it. I think that even then for some time I used to say that any love for vim is just a symptom of the Stockholm Syndrome. Then at some point I discovered the "quicklist" feature, which with :cex system('...') became my conversion point. Now I'm also fully in the "Stockholm Syndrome" victims† camp, and do love my oppressor, for a few years already... Only sometimes for faster browsing/reading with a mouse I switch to some "classical" IDE with a files pane and quick navigation, like IntelliJ or VSCode.
I don't think you have to sacrifice any meaningful amount of productivity to learn Vim. Contrary to popular opinion, I think vim has a pretty smooth learning curve to begin editing with it.
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.
Have you tried to switch for a while to a laptop with no mouse, a terrible trackpad that hardly ever works, and painful to use and/or broken Home/End/Page Up/Page Down and Arrow keys?
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).
When I got serious about learning Vim and was doing vimtutor I rigged up a piece of cardboard over the numeric keypad, the PgUp, etc keys and the arrow keys so when I tried to use them I couldn't.
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.
If you just want to learn Vim because you think it's some magically fast editor, don't. It's not particularly fast at expressing actions, and modal editing is mostly useful if you have a particular dislike of chording.
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.
You're absolutely right that you have to sacrifice some productivity to get it done. I was lucky enough to have been working a graveyard NOC job for a few months and had nothing but time (when fires weren't burning). This gave me the opportunity to just immerse myself in VIM. It's easily been one of the best things I've ever done for my productivity.
I'm currently trying to switch from Eclipse to vim: to ease the transition I'm using gvim.
One difficulty with vim is that you have to configure it because by default it's pretty dumb..
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
I'd love to see you swap the implementation two methods efficiently without vim. For me, just a few keystrokes: dim]mvimp2[mP and about 3 seconds. For you: a bunch of clicking and selecting, I imagine.
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.
After running :terminal, is there a way to yank text from my editor window and paste it into the terminal? Likewise, is there a way to copy text from the output of a command (run in the terminal) and paste it into the other window?
probably a good idea, but I've always gotten by with selecting text, then just `:!pbcopy && pbpaste` when I need to get something TO the system clipboard.
In a terminal window, you can type CTRL-W N (with upper case N) to switch the terminal to normal mode, where you can then move in the buffer and copy things in the terminal buffer using regular vim commands. You can go back to typing commands in the terminal by typing i or a (as when going in insert mode). You can paste in the terminal using CTRL-W " followed by the register name.
You can go to terminal-normal mode using ctrl-w N, and then you can select and yank as usual. To paste, you can use ctrl-w " <register>. Also see :help terminal.