15 ms·
Learn Vim (2021)
- xwdv 4y agoNever bet against a developer that has mastered vim. If vim is what they use on a daily basis, that’s not a developer you should fuck with. You’re dealing with a very dedicated individual. You don’t know what they’re capable of.
- Nginx487 4y agoI have a counterexample. One member of our team tried to adopt Vim as a primary development tool for Python projects, while rest of the team used products of JetBrains. On the course of two months he tried to set up all linters, static analyzers and refactoring tools to keep up with the rest of the team, being the most unproductive developer all this time. When it became clear it won't be better, he was asked not to play cool hacker and use appropriate tools to solve the problem. End of story.
- steelersfan5 4y ago[dead]
- DungeonDevil3 4y ago[dead]
- born_to_flirt 4y ago[dead]
- Kingofallking 4y ago[dead]
- BadGuy4U 4y ago[dead]
- IzzaBigDeal8 4y ago[dead]
- ImImpatient4 4y ago[dead]
- SoExcited 4y ago[dead]
- vram22 4y agoThose new to vi(m), check this vi quickstart tutorial that I created. https://gumroad.com/l/vi_quick https://gumroad.com/l/vi_quick From the start of a Twitter subthread I wrote about the tutorial (thread unfortunately deleted later by accident - Twitter should have an undo feature like vim, heh): [ Those new to vi / vim, hit the ground running with my short vi quickstart tutorial here: https://gumroad.com/l/vi_quick https://gumroad.com/l/vi_quick I first wrote that tutorial at the request of a couple of Windows system admin friends of mine (at a company where I worked earlier), who were tasked with managing a few Unix boxes, without knowing Unix. They used the tutorial and later told me that it helped them to quickly start using vi to do their work on those boxes, including editing config files, simple shell scripts, etc. Edit: Since vi is mostly a subset of vim, the tutorial works for vim too. ]
- brucethemoose2 4y agoI defaulted to Nano when I picked up linux, and that unfortunate choice has bitten me in the butt.
- captnitro 4y agoHaving only used Nano since picking up Linux 2 years ago, I’m not sure what I’m missing. Can you make a case for me to learn Vim?
- petepete 4y agoIf you're productive and happy with nano I'm not sure there is one. I love vim and find it an incredibly productive tool, but it's rare that my editing speed is the limiting factor. However, in recent years with LSPs, the suggestions and completion are something I really wouldn't want to give up.
- bendiksolheim 4y agoIf by "only used" you really mean you never ever use anything else I don’t believe you are missing anything. Other than bragging rights of using Vim, of course /s But if you occasionally use other editors, many of them have plugins or modes enabling Vim keybindings. In my daily work I switch between Emacs, IntelliJ, Vim and XCode, and all of them have varying degrees of Vim emulation, which makes switching a lot easier.
- duskwuff 4y ago> Can you make a case for me to learn Vim? If you're coming from nano, I'd point to: 1) UI improvements like better syntax highlighting, split windows and tabs, and mouse support. 2) A cohesive language of key bindings that allows you to easily construct and perform commands like "delete everything from the cursor up to the next quotation mark" or "lower-case this paragraph". 3) A huge library of scripts and extensions to add or extend features like syntax highlighting and indentation rules for new languages, Git integration, or language server support (which provides IDE-style features like jump-to-definition, error/warning indications, and autocompletion)
- Daunk 4y agoI love Vim, it's just a shame it takes 200 years to setup properly.
- I_complete_me 4y agoBut a very enjoyable 200 years it must be said!
- crispinb 4y agoBut if you develop the habit of spending just 10 minutes a day on it, you can spread that over 10 million years.
- noloblo 4y agoUse neovim or astrovim or spacevim These are setup perfectly and come with just the right batteries installed
- agrippanux 4y agoLunarVim is a good choice as well, just works out of the box
- noloblo 4y agoWhat's lunarvim what are it's advantages over space or ASTRO Vim
- jzelinskie 4y agoI'd honestly point folks towards Helix[0] these days if they don't already have something keeping them on neovim/vim. There's very little in the ways of needing to configure Helix; it has built-in most functionality that you'd find with batteries-included vim "distributions" and it works out of the box with the installed LSP servers on your system. [0]: https://github.com/helix-editor/helix https://github.com/helix-editor/helix
- noloblo 4y ago
- cbushko 4y agoI've re-built my neovim config like 3 times this year as I have played with several 'distributions' and styles. SpaceVim, LunarVim, AstroVim, and NVChad to name a few. This last weekend I gave LazyVim a try and it is by far the most sane config setup I have used and I will now be sticking with it. There is a starter repo where you clone it, delete the .git directory and start customizing. https://github.com/LazyVim/LazyVim https://github.com/LazyVim/LazyVim My config is here, feel free to copy/steal it. https://github.com/curtbushko/nvim https://github.com/curtbushko/nvim
- jalino23 4y agohttps://github.com/helix-editor/helix https://github.com/helix-editor/helix is the answer mate
- arcanemachiner 4y agoI'm happy to dump NeoVim if Helix is actually better. But is the ecosystem _really_ there yet?
- eldenring 4y agoUnfortunately there is no ecosystem. Helix does not provide an extension interface.
- phist_mcgee 4y agoHuge downside for me. Not that I want to muck around with plugins all day, but having the ability to add a few helper plugins to ease certain tasks is a godsend in terminal editors. Especially if you really dislike certain defaults packaged with the editor.
- cbushko 4y agoThat is too bad. If they did then they would probably garner huge community support and the gaps would be quickly filled in.
- tarkin2 4y agoI've found learning vim--either as a plugin for IntelliJ or Chrome or Firefox or as a minor mode in Emacs or by itself--probably the most productive thing I've done on a computer. I spend all my time editing code. It's incredibly useful to learn how to do that quickly. I went through trying to customise it perfectly but I found it is better--more portable for one thing--to learn its defaults. I enable a couple of things, like mkview and tabstop etc, but no more than 10 or 15 lines. My only criticism relates to the fact it's an editor, not an IDE; there's vimscript and I've made various vimscripts to give it IDE-like functionality, but the plugin system, and plugin systems, or lack of a in-build one, let it down. And it doesn't seem, unlike emacs, that is was designed with extensibility in mind. But as an editor: it's unparalleled.
- Koshkin 4y agoI don’t know about it being unparalleled, but when I am in a terminal I don’t think twice before typing ‘vi’.
- ElijahLynn 4y agoAnd for those who don't know, on most modern Linux-based distributions `vi` is an alias for `vim` which is Vim (Vi IMproved).
- phist_mcgee 4y agoTrue scotsmen exclusively use ed.
- neverrroot 4y agoYou might want to look into Neovim, many things are easier/friendlier to set up. It’s likely also the better investment down the road, can’t imagine vim will be able to keep up with the speed Neovim is moving at. Also rather disappointing decision in Vim 9 with regards to Vimscript vs something established e.g. Lua.
- ElijahLynn 4y agoFor those wanting to practice this, also consider pairing this with Ilya Grigorik's VimGolf >> https://www.vimgolf.com/ https://www.vimgolf.com/.
- user3939382 4y agoI try to use it in my IDE but there are too many conflicts (>1) and I give up and turn the mode off.
- eachro 4y agoI generally prefer vim to vscode. But being able to jump to the file where highlighted functions/classes/etc are defined in vscode is very convenient and something I am not able to do in vim. I'm sure there's probably a vim plugin that can allow me to do this too but I just haven't spent the time to look for it.
- shaunsingh0207 4y agoNeovim + lsp (coc.nvim/ale can do this in vim as well)
- exabyte 4y agocheck out [astronvim](https://astronvim.github.io/ https://astronvim.github.io/)
- imron 4y agoCtags
- kadoban 4y agoYou can also just embed neovim in vscode. It's a vscode extension, works extemely well.
- msravi 4y agoUse cscope and ctags. It's very intuitive
- samdcbu 4y agoNo one should be learning Vimscript at this point. That language should have died a long time ago. A new user coming to the Vim ecosystem in 2023 would be best served by using Neovim with Lua.
- lachlan_gray 4y agoVimscript is still really great for making edits and automating odd little things. I find it especially useful for refactoring
- Scarbutt 4y agoyou still need to know vimscript for extending with lua.
- elteto 4y agoVim now has vim9 script which is fully integrated and is actually very pleasant to use. It’s like a watered down TypeScript.
- silver-arrow 4y agoVim9script is pretty darn good; and fun to use.
- shuntress 4y agoI can handle basic editing in vim and I have given real tries to use it as my main text editor but I just cannot find a way to get as comfortable in vim as I can in VS Code.
- maxbond 4y agoSpeaking as a vim user who can't get comfortable in VSCode - use VSCode then, it's a great editor!
- revscat 4y agoPick a tool and learn it well. Doesn’t matter which one, really, so long as you’re productive with it.
- pugworthy 4y agoIronically I'm more comfortable in VS once I found the VI plugin ;)
- ddlutz 4y agoI don't really "get" using vim as an editor, but I love using vim bindings in vs-code. I've been using vim bindings for maybe a year now? Didn't really keep track of when I started. I definitely consider myself a novice, and maybe am using vim to 10% of it's potential, but the little bit I do use is nice. On the other hand, I've never considered typing speed or editing speed the bottleneck in programming, it's usually debugging, solving problems, or reading files with 10k+ LOC and multi-hundred line files figuring out what they are doing.
- 63 4y agoI hated all the configuration stuff to get a usable vim ide. VS Code and its plugins Just Work™ for ide stuff with almost no setup so it was a lot easier for me to just use vs code with vim bindings than to get a good vim setup. Plus I can fall back on visual editing a lot easier this way if I forget some esoteric vim functionality and have to click through a menu.
- jossclimb 4y agoStick with VS code I have a vim config I have used for years, but I have just gone with it now and embraced VS code, it's a brilliant tool.
- bee_rider 4y agoI dunno, I never sat down to learn vim, just used it every day for a couple years. I’m not one of those wizards who is, like, answering stack overflow questions or writing wiki articles, but I get the job done. Is it necessary to learn Vim? Seems like a chore. Is the text editor really a bottleneck for anyone? I find that no matter how slow I type, I need to spend more time thinking of what to type anyway, if I’m doing anything interesting.
- X6S1x6Okd1st 4y agoI similarly have mostly not learned vim, but every now (usually on fridays) I spend a bit of time seeing if there's an easier way to do something. My recent learning was :quickfix. I normally build in a terminal anyways so this was a pretty nice little speedup for iterating on static analysis results or a build problem.
- tambourine_man 4y agoMany years ago, decades actually, I used TextEdit + services shortcuts to filter text through grep, sed, awk. I found even syntax highlighting a distraction. Then I saw someone using Vim. I was instantly hocked. The sheer speed of everything happening in the screen, I needed to learn that. And so I did and it’s been an amazing ride. It’s a pain at the beginning, the amount of time I invested in my .vimrc will probably never payoff, mathematically speaking. But the joy and delight you get from using it everyday, the freedom and efficiency is just addictive. It’s not for everyone, I was raised on the Mac paradigm, where “modes are evil”, so it was a step learning curve. But few programs have brought me this much joy and excitement over the years.
- blindhippo 4y agoIt’s not a bottleneck for anyone. Some people just like playing with tools. They do it for loads of reasons, but end of the day it’s basically a hobby tangentially related to software development. I torment a friend of mine who talks all the time about VIM and their most recent config/workflow. But end of day, he’s happy and having fun while being productive.
- 4y ago
- pugworthy 4y agoIt's kind of weird to read about "learning" VIM, at least from someone who's been using it (er VI) for 40 years. It's nuts, but if asked, I don't even know how to do certain things in VI; I just do them. Ask me what keys to press to go up, or down, or right or left? I dunno - I just do it. Yea it's nuts. It's like baby duckling bonding - the first editor mindset (aka EMACS vs VI) you use, you just bond to and it just is natural. Not better, just natural. At the same time, I don't utilize it to its full strength. I probably do things that seem laborious to some, but no big deal to me.
- hodgesrm 4y agoSame here. I remember vi commands as finger movements on the keyboard. Example formatting a block of text is !}fmt but I can't remember it except as a sequence of key presses. It was hard even to get the actual sequence of characters for this comment. edit: clarity
- sizzzzlerz 4y agoMy vim history is much like yours. I’ve tried to learn more about its features but unless they made their way into my daily workflow immediately, I just as easily forget them. Finally, I threw in the towel and decided I knew enough to get my work done and stopped.
- sanderjd 4y agoHa this is so true. I wrote in a comment elsewhere in this thread that I mostly just use the movement keys hjkl with a fast key repeat. But I'm still kind of wondering whether the movement keys are actually hjkl, because I'm writing this on my phone so I can't check whether those are actually the keys I use to move around, and I haven't actually thought about it in like a decade.
- imiric 4y agoSlight tangent, but what's with the capitalization of VI and VIM? You surely know those are not acronyms, yet I've seen VIM miscapitalized many times, even by experienced users, and it's always slightly irritating. EMACS, while historically accurate, also isn't common anymore.
- sanderjd 4y agoDoes anybody have a good wysiwyg word processing approach using vim keybindings? Editing markdown docs as plaintext is not as good for writing prose as I would like, but editing documents without vim keybindings is also unpleasant for me.
- G3rn0ti 4y agoEmacs + Evil Mode + Org Mode + Org Mode Customizations Google for „Emacs from scratch“ which will guide you through.
- endorphine 4y agoI'm using vim for 10 years and I know I have a lot of "bad" habits that I'm trying to eliminate, but it's hard. For example: 1. instead of doing 4j I might do jjjj 2. if I'm in the middle of a word and want to change it, I'll do bcw instead if ciw 3. if I want to copy 3 lines, I'll do Shift-V+jjj+ESC, instead of just 3yy 4. (possibly other 100 items here...) But I find it very hard to change those habits. Anyone else struggling with this? Any tips to share in case you managed to get rid of them?
- nbonaparte 4y agoFor 1, I use https://github.com/ja-ford/delaytrain.nvim https://github.com/ja-ford/delaytrain.nvim (for nvim only); it basically stops repeated navigation keys from working for a short while.
- endorphine 4y agoAwesome, I might try that!
- jonhohle 4y agoMe too, after 18 years! A decade ago I decided that I should probably learn the idiomatic way to do things and went through different learn-to-vim tutorials but none of it ever stuck. I finally decided that the way I use vim is the way I use vim, and when I can’t figure out how to do something and can’t do it with another tool, I’ll learn a little more which may or may not be retained. There’s a mountain of things vim can do and adding plugins on top of that makes it a never ending climb that I’m happy to climb as I need too. That doesn’t really answer your question, except to say, me too, and that I’ve just let it go. (And vim is compete’s with a web browser as the program I spend the most time in).
- LanternLight83 4y agoI don't have any answers. I've got an Emacs plugin installed that's kinda like easy-motion, and actually have started to use that.. but I think I'll be sticking to eg. `hhjjjj` for the rest of my life. I write a lot of Lisp, so I wonder of learning more structural editing commands (eg. something like `jump-to-sibling-sexp`) could help me map my intents more cleanly, but wouldnt be able to carry that into other languages and expect I'd fall right back into my old ways. Maybe it just isn't so bad. When your findger is on a key, there's a lot of value in not moving at all. Counting is taxing and lacks feedback, which is why I hate resizing terminal panes. Maybe there's more power in learning and integrating new habits, like easy-motion or search-forward (even for short distances), than in eliminating old ones. As an aside, the most jarring thing about going back to Vim from Emacs (which I do multiple times a day) is not having nornal-mode & co. in the mini-buffer / command-line. Love how emacs treats it as just another buffer, so even eg. visual-mode works in there.
- ktzar 4y agoGood to know it's learnt the same way as in 1998
- vlz 4y agoGreat to see a vim tutorial that has buffers as one of the very first topics! In many vim tutorials you wade through hours of moving/editing ("This is how you delete a word.", "This is how you delete two words", ...) before you finally get to the most basic UI elements. The author also quickly introduces helpful concepts like :h, .vimrc without going into too much detail up front. From the first chapters this seems to be well structured according to what you need to know when learning not according to some natural structure of the topic as perceived by someone who is an expert already.
- mo_42 4y agoI have been using Vim for about 15 years now. I'm not really opinionated about Vim, Emacs, or any other IDE. There are many great tools out there. Also Vim emulators are really powerful in IDEs. There's however one thing I don't hear very often: Vim is not a text editor with "powerful" features such as useful keybindings. It's more a language for editing text. As with programming languages your ability increases super-linearly as you learn to compose keys.
- tmdh 4y agoI really want to use vim, but I can't because it's laggy whenever I try to use a premade setup like AstroNvim. I don't want to learn how to setup my vim enviroment. I want a VSCode-like experience in vim, out-of-the-box. I have used Helix for some time, but it has it's annoyances.
- LoveMortuus 4y agoI can use vim, but I still find it easier to just open a file in nano and write. I feel like I should be able to use a tool without thinking and without having to learn how the tool works, at least in regards to text editing. And I feel that nano or pretty much any other editor except vim can be used the same way, just like a notepad on Windows or gedit or geany, you open a file and you start editing or you move to the desired location using the arrow keys or a mouse and start editing. The very joke of "How to exit vim" feels like a good example of bad user experience and poorly developed tools. Crude example: Imagine if you couldn't drop a hammer and it was just stuck to your hand just because you didn't know that you had to type :q!. But since I know how to use it at least the basics it is somewhat comforting knowing that pretty much any machine I'll touch will probably have vim pre-installed, so I don't have to spend time searching what is the name of the program to edit files. I have seen that some have an alias 'edit' to whichever is the default one, but thus far 'edit' hasn't worked on any of the machines I've tried. Yes, vim can do a lot more then just edit files, but at the end of the day... I just want to edit, compile, fix, repeat. (https://youtu.be/wBoRkg5-Ieg https://youtu.be/wBoRkg5-Ieg)