9 ms·
Why, oh why, do those nutheads use vi? (2007)
- beej71 5y agoAt this point, using other non-vim editors makes me feel like I have one hand tied behind my back. But maybe that's just because I'm not good with those editors. :) I once asked my dive instructor about the debates surrounding various dive gear setups. He said, "Strive to be an excellent diver with any gear."
- Koshkin 5y ago> feel like I have one hand tied behind my back I’ve heard of an editor that can be used with two mice.
- GhettoComputers 5y agoAnyone using Colemak and vim? I see a lot of different ways to combine both but they all are different and I don’t know which is a good one besides remapping the home row.
- Faaak 5y agoDvorak and vim here. Pro tip: don't remap. If you do it'll be hell when you have to use another "standard" vim (remote server, et.). Good Luck suffering for some months though, it's worth it in the end :-)
- GhettoComputers 5y agoThank you! I’ll try this first.
- ijlx 5y agoI use Colemak and vim. I learned Colemak before I got comfortable in vim, so I also spent some time trying to figure out what is best to do. I recommend just leaving hjkl in their default positions, no rebinding. That's what I ended up on and I don't regret it. They aren't in too awkward a position (all accessible by your right index finger). The default bindings are meant to be easily memorable, and you can use them anywhere you can find vim, even if you don't have your custom config.
- GhettoComputers 5y agoThanks I’ll give that a try first, it’s been paralyzing me from using it.
- vivab0rg 5y agoI'm getting close to be a 10-year Vim user and I've spent the last year learning Colemak slowly and paciently. I tried remapping for Colemak's sake, but I quickly decided against it. Now I've settled on Colemak-DH with an Extended Layer implemented with Kmonad and I'm a lot happier. For text navigation (besides the extended layer) I just use the EasyMotion plugin, so no need of remapping. I'm really digging it.
- Flankk 5y agoI have no issues with vscode as an editor for creating source code and the file explorer is essential. However, refactoring makes wish I'd have learned vim. I get the job done going mouse to keyboard to mouse to keyboard but it's definitely not optimal.
- stevebmark 5y agoVim is a text editor, not an IDE, and has limited refactoring capabilities and a poor plugin ecosystem. For fast code editing and refactoring, Vim will only slow you down.
- Lio 5y agoVim/NeoVim’s plugin support includes both native plugins in VimL or Lua and plugins via LSP. An LSP client is built into NeoVim itself and support of VSCode extensions not covered by LSP is also available via plugin.
- dotancohen 5y agoRefactoring is one of the few things that I prefer an IDE for. I say that as someone who lives in VIM and uses IdeaVIM in the Jetbrains editors.
- BoorishBears 5y agoIf VSCode isn't giving you help with refactoring, either you haven't configured it properly, or the language you're using probably doesn't support refactoring in any environment.
- eitland 5y ago> I get the job done going mouse to keyboard to mouse to keyboard but it's definitely not optimal. I've seen the rise of Vim popularity from the sidelines, I learned it at the same time as I learned eclipse, continued using vim while learning Sublime Text, IntelliJ, Netbeans and VSCode and I still use Vim. Here are my thoughts: If only people had spent half the time they waste on learning enough Vim to impress others learning and setting up VS Code, eclipse, IntelliJ (or tjeir language variant), NetBeans - or even I guess even though I don't like it myself - Visual Studio (the old one). Please, please, please: at least for those who use modern languages with IDE support, take the time to consider learning the basics of an IDE. The correct way to refactor moden code isn't to learn to study Vim for years to do it in half the time or with half the shortcuts, but to navigate to the correct line (down, down down), the correct place (2 x ctrl + arrow right) mark the code in question (5 x shift + arrow down to get the majority of it, then shift end to the end of the line) and ctrl + shift + p or something, extra(ct variable), name it and finished. And this is just the straight forward way for someone knowing nothing but standard text navigation on Linux/Windows: if someone spends a fraction of the time some use on Vim they'll find that there are shortcuts to expand selection to scope built into modern IDEs by default. The above can be shortened to: - four times arrow down (we go into the middle of the mess) - ide specific shortcut (or your chosen shortcut, they can be exported and imported) to expand selection to scope - ctrl + shift + p to open command palette - ext (since it is near the top of the list anyway), rename, done Edit: there exist one good reason to use emacs and vim - they won't be integrated with Github and dumbed down over night, see for example https://news.ycombinator.com/item?id=29461226 https://news.ycombinator.com/item?id=29461226 Personally I rather learn IntelliJ, Netbeans, eclipse and VS Code somewhat fluently though.
- garmaine 5y agoThey’re not willingly using vi. They just launched it and couldn’t figure out how to quit, and now they’re just kinda stuck.
- pjio 5y agoNot that hard, just type this command and press enter: :wa|:!kill -9 $PPID
- tomkat0789 5y agoThat was always my intro to vi: I was (for example) doing a merge or something from git bash, then suddenly it dropped me into vi. I've made a few tries to learn vi, but I just don't edit text frequently enough to remember everything about it. I typically have to use Google to figure out how to exit it whenever some tool has it as the default and randomly drops me into it. I remember a non-Linux friend of mine having a really poor introduction to Unix/Linux because he got bogged down in learning vi in addition to Unix's other foibles!
- vram22 5y ago>he got bogged down in learning vi in addition to Unix's other foibles! Check: https://mobile.twitter.com/vasudevram/status/1289676146670354432 https://mobile.twitter.com/vasudevram/status/128967614667035... It's a vi quickstart tutorial that I created. From the start of that Twitter subthread: [ 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. ]
- LAC-Tech 5y agoI've tried vim on and off for the past... almost 10 years. I'll use it for months at a time, tell myself it's the editor for me, then go off it. Not sure what sort of time commitment is needed, or if it's just the wrong editor for me.
- dotancohen 5y agoVI[M] is a redhead. Temperamental, difficult to get along with, will ruin everything if you touch it the wrong way. It is not for everyone. But I married a redhead, so VIM is quite comfortable for me. I've had slips of the finger turn more than one evening into an all-nighter. I've had moments of pure ecstasy, where just a few fancy seconds of creativity have enabled creations beyond what I'd dreamed possible. I've cursed, I've laughed, I've cried in both joy and frustration. That danger-benefit balance is not for everyone. That's why Jetbrains and Brunettes exist and flurish.
- bee_rider 5y agoI think it is not a great editor for people who want to like their editor. Like I tried eclipse, but it was laggy. I tried Notepad++, but it is too GUI. I tried VSCode but getting it to be much better than vim requires tracking down a bunch of questionable extensions or the cool extension everyone is buzzing about doesn't have FORTRAN support. I dunno. I use vim. I don't like vim. I don't like any editor. It is there, it doesn't do what I want it to all the time, but it reads and writes files, autocommands are easy to set up, and I can just plop whatever unix commands I want in there. vim is pretty boring and basic, but I go back to it because it doesn't do anything actively annoying to me.
- tryauuum 5y agoThe part "I can just plop whatever Unix commands I want in there" resonates with me. For example, I can select several lines and pass them to "sort | uniq -c". Or to "python -m json.tool"
- hvgk 5y agoI’ve used it for 22 years at this point. I still don’t know how to use more than the basics. I think you settle into a comfortable zone where you know enough and stop looking for progression. In my case that was fairly early on. What makes me happy to use vim is the odd few hours here and there in visual studio with a large project loaded.
- gigatexal 5y agoHonestly, investing the time to learn vi/vim is such a productivity hack that I’m glad some old grey beards from a previous company all but forced me to learn it. I can’t use anything else now: I’m much too slow in anything but vim.
- wruza 5y agoYep, the same experience. But after seeing/trying what vscode can (with so much ease) outside of a scope of pure text editing, I now feel “scammed”. Vim’s worst side is that it’s scriptable, configurable, fast, good-nuanced, but still a “dumb” text editor that lacks integration with modern tools and techniques.
- cercatrova 5y agoI use neovim inside VSCode, there's an extension that works pretty well https://github.com/asvetliakov/vscode-neovim https://github.com/asvetliakov/vscode-neovim
- wruza 5y agoThanks for the cue, I should try it the next time I feel acute missing out.
- gigatexal 5y agoI dunno. I guess I am still in the phase of vim-plugins-are-magic. I've, over time, crafted a really robust neovim setup: I've got plugins that make git use easy, file searching, really good language server support, etc etc and all of this is done more or less native (some tools call out to nodejs powered things but shrug) and doesn't spin up my laptop's fans like vscode used to with a handful of plugins and things.
- krysp 5y agoI'd recommend having a look at https://github.com/neoclide/coc.nvim https://github.com/neoclide/coc.nvim if you feel you're missing out from not having VSCode extensions - it's available for both vim and neovim. Allows you to use those language servers that you're otherwise not able to in vanilla vim, with additional surrounding tooling - I honestly don't miss anything from VSCode at this point
- ghayes 5y agoI keep trying to get into vim, but I just really enjoy multi-cursor editing in Sublime Text. The example in the article of changing multiple lines using '.' to repeat is the same as selecting the three lines in Sublime Text, entering multi-line edit mode, and then typing the change once. The same applies for replacing a single word (e.g. with Cmd+D) and/or regex replacements. Basically, I have a really easy time avoiding any repetitive commands in my normal day, so I wonder what the real advantage of vim would be for my use case. Or maybe I just don't know what I haven't yet learned...
- saboot 5y agoIt's been a while since I've used vim, but I definitely recall doing multiline editing as you describe in vim. There is a visual-block mode that does multiple cursor manipulation
- sva_ 5y agoYou can select multiple lines in vim using ctrl-v, then do some action on all lines like inserting by shift-i, or whatever you want to do with the lines. Replacement with regex is also trivial.
- deleted 5y ago[deleted]
- stevebmark 5y agoAs a power Vim user, I can attest that multiple cursors do at least 75% of what I want to do in Vim, and multiple cursors are better and faster.
- h0l0cube 5y agoHow about macros? I find i use them on at least a daily basis
- cercatrova 5y agoWhat kinds of macros do you use?
- Aloha 5y agoI used vi, but I realized it has a bunch of really powerful stuff I don't need. I have tr, sed, awk and grep for those things can heck, I have a whole shell built just for text processing. Nano (and before it, pico) work better for me in 80% of use cases where I need to just edit text. On windows I can use notepad++, which is probably the best win32 text editor in existence, bar none. Between it's plug-ins, and powershell (albeit with a hammer like coaxing), it's just about as powerful as the Unix environment.
- marklgr 5y agoI also like and use tools like sed and awk; using the vim internal tools are very easy to learn if you come from there, and they have the advantage of being better suited for working with whole buffer (multilines, paragraphs etc.), instead of on a line-by-line basis. I believe vim is a great editor for the kind of people who like sed, awk, and working from/with the shell, since it's pretty much the same culture.
- cosmotic 5y agoAll these features are available in IntelliJ (and sister) editors, even without the VI plugin. The keystokes are more intuitive especially with familiarity with practically any other non-vi, non-emacs text editor.
- hereforphone 5y agoHow much time have you spent with vim? How much with IntelliJ?
- BoorishBears 5y agoOk let's be real for a second... only one of those has people googling for a way to exit it. Like yes, a lot of people don't give vim a chance, but vim also uses a very specific style of shortcut. If you can cut and paste with your keyboard, you already use IntellJ-style shortcuts (because those are just the default style of hotkey people are used to). The same doesn't go for vim.
- deleted 5y ago[deleted]
- apetrovic 5y agoTo be fair, lots of vim proponents obviously didn't spent much time in editors they're dunking on. The extent of sophistication mentioned for non-vim editors is "you can use ctrl+arrows to move around". Followed with "even if you like editor X, you can use vim emulation". And that vim emulation is usually just map of existing editor functionality to vim layer. (I'm not saying that vi(m) doesn't have its merits, just that the argument can go both ways)
- hereforphone 5y agoMy perspective (limited use of IntelliJ) is that the editor is very geared towards Java, which I loath and despise. Maybe this is an unfair prejudiced. I also like working from the command line.
- nomercy400 5y agoBased on the first example in the post, you could say that vi is a macro editor/runner, and not a text editor. What is the first/main thing you can do when opening a file with vi? Shoot commands at it, not edit text.
- baash05 5y agoI think when I edit services/jobs in rails I get some solid use of VIm, but I find navigating through files to be tedious. In rails I have to do this all the time, and short of installing plugins to make it more "many file friendly", I can't get past that limit.
- tommyage 5y ago`nnoremap <space><space> :ls<cr>:b<space>` Is crucial for my personal workflow and one of the only bindings i require. I use it in conjunction with `nnoremap - :Explore<cr>` Which opens the best directory navigator in existence (actually dired should be named here) This changes the game dramatically. Read about :ls and :b
- alexose 5y agoI use vim because I haven't found a better tool for manipulating rectangles of text. I don't do anything too sophisticated with it (after 13 years, I still navigate with the arrow keys), but I do keep my .vimrc in version control. Highly recommended.
- gumby 5y agoI agree, it seems absurd when Emacs Makes All Computing Simple.
- silisili 5y agoI used to use Vim exclusively, but realized it got me into a bad habit of not separating files out well. The hassle of switching files makes me tend to create fewer of them, which can make it harder to find things later. I still love it as a pure text editor, but for code, I've gone to an IDE and don't see myself returning.
- bee_rider 5y agoI have nmap Tl :tabnext<CR> nmap Th :tabprev<CR> nmap Tn :tabnew<CR> in my .vimrc, to make it more convenient to work with multiple files.
- marklgr 5y agoYes, if you want/need an IDE, by all means do. Vim is an editor, a very powerful one with all sorts of tools, but it's generally ill-advised to try and make it work like an IDE. As far as I'm concerned, as a grey beard sysadmin, I don't need an IDE, so I value more the advanced editing features of Vim and I've been happy with it for years (more than I'd like to admit).
- newbie789 5y agoThis kinda seems performative. While showing off how incredibly weird and genuinely user-hostile it is in the modern world, is tongue-in-cheek showing off how the author is cool. Literally, why should I care what you write your code in? Is this some sort of frat hazing thing where you’ve gotta prove that you can run with the ~big boys~ or whatever? I remember back in the day writing php in notepad being cool, do I get points???
- scrame 5y agoCounterpoint: vi sucks. Emacs is clearly the superior OS.
- GhettoComputers 5y agoEmacs can be good, but VS code killed it.
- hvgk 5y agoYeah Eight-hundred Megs And Continuously Swapping these days :)
- jokteur 5y agoI currently have VS code open with multiple plugins and a dozen of opened files, and it is using 33MB of RAM. Of course, vi would never use that much RAM, but for the functionnality that VS code offers, I find this acceptable.
- alxlu 5y agoAre you sure you're measuring the ram properly? I just opened VSCode with nothing open and it's taking several hundred MB. The main process only uses about 50MB, but it also spawns several Code Helper processes. Some of which use between 50-150MB each.
- hvgk 5y agoYou’re reading something wrong. Mine is idling at 500Mb here with one YAML file open.
- GhettoComputers 5y agoWith a project and text file open I’m getting around 500-700mb, still perfectly acceptable to me.
- GhettoComputers 5y agoNever noticed, didn’t even know it was an electron app until I looked it up, with RAM at $30 for 8GB at most and 16GB being found for $50 it’s easy to use. I use codium though so no telemetry, and it’s easy to setup anywhere and easy for others to understand.
- deergomoo 5y agoI’d be interested in a modal editor built with modern conventions in mind. I love the modal editing model, but there’s no denying that vim can be a little clunky when dealing with things that have come along since, like the system clipboard.
- 63 5y agoThis post is exactly what I was looking for. I went through vimtutor some time ago and have been using vim since, but I kept thinking "there HAS to be a better way to do this thing but it wasn't in vimtutor." Just using . and f is going to help me tremendously. I'd be interested in any other resources that bridge to the gap between vimtutor and the manual.
- Apfel 5y agoThe book "Practical Vim" is written with this exact use case in mind. And it's great
- asicsp 5y agoI have a list of resources here: https://learnbyexample.github.io/curated_resources/vim.html https://learnbyexample.github.io/curated_resources/vim.html I'd recommend this SO answer (https://stackoverflow.com/a/1220118 https://stackoverflow.com/a/1220118) and this series of articles "Vim from the ground up" (https://thevaluable.dev/vim-beginner/ https://thevaluable.dev/vim-beginner/) I'm also writing a reference guide (https://learnbyexample.github.io/vim_reference/ https://learnbyexample.github.io/vim_reference/)
- gtsop 5y agoOne extra reason: An actual health benefit (at least for me) reducing the hand strain from switching to keyboard and mouse. Using tmux takes this to the next level.
- surajs 5y agovi/emacs are old and reliable text editors for people who either like to show off or don't trust modern IDEs. their logic is reductionist and simplistic but not simple.
- pjmlp 5y agoI learned vi on Xenix, and used its clones several times since then. Same applies to Emacs, first touch on DG/UX, although I was on the XEmacs side of the fence and it was my main programming editor until around 2005. Both of them were a cruch for lack of proper IDE tooling on UNIX clones, thankfully those days are gone and I don't miss having them as my only option to work on UNIX clones.
- eitland 5y agoExample 1: bool ProcessFunkyParam(int nitems, bool properly); bool RecallClunkyItem(bool displace): bool DisposeOfAllParams(int ntrials); This example is nice for I have used vim often if I have to look after servers, and I agree this is really nice. In an VSCode or an IDE however, this is just as easy or easier: - <End> to get to the end of the line - shift + alt + <arrow down> twice to get to enable block editing and get a cursor on the end of all three lines simultaneously - backspace once to delete all semicolons - type <space> and one { and <enter> to get at new line, you'll also get the closing curly brace on a line below and your insertion points will be on the starting point for all the three new functions we created. Example 2: if (!entry.used && equivalent(entry.key(). qk.key) && (curcontext & entry.contexts)) Here I just - get my cursor anywhere inside the expression in question, - press ctrl + alt + v for extract variable - and IntelliJ pops a dialog that gives me options for how big chunk of the expression I want to extract. As I move between the options using my keyboard it highlights the expression. - when I select it IntelliJ already creates it as a value on the line above, complete with a temporary name based on its content. The name is selected already to rename and if I type something else or accept it, it renames it both in the declaration and where it was substituted immediately.
- lostmsu 5y agoFor example 1 I bet Visual Studio or CLion or both have a context menu item, that creates implementations in the correct file and navigates you to it with ~ 4 key presses in total. So vim loses before his example even starts, because it takes much more to select functions, copy them, switch to implementation, find a place and paste.
- eitland 5y agoExactly. If people want to use vim and to use git only by cli, by all means, but if we could stop the cult like part of it that would be nice. Same goes for telling students who are learning Java for the first time that it is smart to start with plain Notepad and javac. Starting to program should be encouraging, not a hazing ritual.
- dang 5y agoSome past threads: Why, oh WHY, do those #? nutheads use vi? - https://news.ycombinator.com/item?id=18582221 https://news.ycombinator.com/item?id=18582221 - Dec 2018 (23 comments) Why, oh WHY, do those #? nutheads use vi? - https://news.ycombinator.com/item?id=14153147 https://news.ycombinator.com/item?id=14153147 - April 2017 (1 comment) Why, oh why, do those nutheads use vi? (2007) - https://news.ycombinator.com/item?id=9362786 https://news.ycombinator.com/item?id=9362786 - April 2015 (126 comments) Why, oh why, do those nutheads use vi? - https://news.ycombinator.com/item?id=3542507 https://news.ycombinator.com/item?id=3542507 - Feb 2012 (220 comments) Why, oh WHY, do those #?@! nutheads use vi? - https://news.ycombinator.com/item?id=151637 https://news.ycombinator.com/item?id=151637 - April 2008 (52 comments)
- deleted 5y ago[deleted]
- exabrial 5y agoEven in 2021, I love using vim. I can absolutely fly through the editor using keyboard shortcuts. I use it exclusively as a commandline editor though for managing remote systems. It's not to say it isn't a bit quirky, but it is to say the tool you know how to use is far better than than one you don't.