7 ms·
Vim 8.1
- ssijak 8y agoI 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.
- mdaniel 8y agowith vim modes form Intellij mainly 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
- SeoxyS 8y agoI'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.
- ivanche 8y agoPlease try harder. Ctrl+Shift+Up (or Ctrl+Shift+Down), about 0.3 seconds.
- kenneth 8y agoUse 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.
- supermdguy 8y agoWhat, 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.
- notheguyouthink 8y agoAs 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 :)
- xur17 8y agoI 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.
- maxk42 8y agovim's feature-set is not just large -- it's vast. After 11+ years using it, I doubt I'm familiar with 1%. There is no emulator that has that completeness. Most scarcely implement the beginner commands.
- extr 8y agoI 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.
- taf2 8y agoCommand line - and just keep trying... after a few years it’ll stick
- inyorgroove 8y agoThere 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]. -- 1: https://www.ostechnix.com/pacvim-a-cli-game-to-learn-vim-commands/ https://www.ostechnix.com/pacvim-a-cli-game-to-learn-vim-com... 2: https://superuser.com/questions/246487/how-to-use-vimtutor https://superuser.com/questions/246487/how-to-use-vimtutor
- smhenderson 8y agovimtutor 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. Thanks Bram!
- tomcooks 8y agoVimtutor 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)
- computerex 8y agoYou 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.
- jmcphers 8y agoI'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.
- computerex 8y agoCompletely 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.
- godelski 8y agoThey 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.
- greenhouse_gas 8y ago>Vi is on every unix system Except Debian's install CD. They only have nano.
- godelski 8y agoAre you sure? I just looked through an old Debian 8 iso that I have and it had vim in it.
- ssijak 8y agoI 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.
- throwaway413 8y agoFind 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).
- sudeepto_dutta 8y agoI 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.
- ben174 8y agoYou'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.
- WorldMaker 8y agoHave 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).
- smhenderson 8y agoWhen 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.
- akavel 8y agoI 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. † "vi-ctims" pun not intended; but then...
- samatman 8y agoThe 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.
- danielbarla 8y agoI 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.
- eckza 8y agoThis 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.
- strkek 8y ago> 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.
- Symmetry 8y agoIf 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.
- maxk42 8y agoIt's okay: We all did.
- renox 8y agoI'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..
- aranelsurion 8y agoI 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.
- Veedrac 8y agoIf 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.
- brunoluiz 8y agoI 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.
- toxik 8y agoI'm psyched about what this means for debugger integration!
- xur17 8y agoThat would be amazing - I use tmux + vim, and the one thing it's lacking is debugger integration.
- caiob 8y agoI 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.
- emacsvimlover 8y agoAfter 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?
- Elidrake24 8y agoFor Mac OS, I'd suggest sharing the default storage buffer with the clipboard: http://vim.wikia.com/wiki/Mac_OS_X_clipboard_sharing http://vim.wikia.com/wiki/Mac_OS_X_clipboard_sharing
- jdc0589 8y agoprobably 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.
- bartbes 8y agoYou 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.
- dpelle 8y agoIn 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. See :help terminal
- emacsvimlover 8y agoThanks all!
- e12e 8y agoThe default keybindings are ctrl-w "" (assuming you want to paste from " register - or * to paste from clipboard: ctrl-w " * ). It's a shortcut for pasting.
- notheguyouthink 8y agoMan 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 :/.
- sushisource 8y agoReally 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.
- jean- 8y agoThere'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. [0]: https://github.com/glennsl/kakode https://github.com/glennsl/kakode
- dozzie 8y ago> The model of select first, action after (reverse of vim) is so so much better for me. You mean, like the visual modes in Vim? Where you select text before running a command on it?
- sanjeetsuhag 8y agoCan someone identify what font is used in the screenshots?
- teamhappy 8y agoI think it's this one: https://fonts.google.com/specimen/Cousine https://fonts.google.com/specimen/Cousine
- cwkoss 8y agoprank your friends: echo 'imap <esc> there is no escape ' >> ~/.vimrc
- strkek 8y agoYou'd still be able to use `C-[` though. (And I actually use it in Termux)
- moistoreos 8y agohuehuehue
- teilo 8y agoSo, 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.