102
Apr 20 '15
And many more hours trying to figure out how to use it in the first place. (For context, written by an occasional vim user).
38
u/ngildea Apr 20 '15
Maybe if you used if more than occasionally you wouldn't be so confused! :P
45
u/Neekoy Apr 20 '15 edited Sep 08 '26
Marvelous coordinated pause smile cough blanket
This post was anonymized with Redact
21
u/gellis12 Apr 20 '15
You forgot
:wto save, and:wqto save and close the file.5
→ More replies (1)6
u/Neekoy Apr 20 '15 edited Sep 08 '26
Public unite important vase tie almond
This post was anonymized with Redact
10
u/gellis12 Apr 20 '15
I had never heard of ZZ before today, but I'll probably be using it from now on! Thanks!
→ More replies (9)7
7
u/Tarmen Apr 20 '15
To be fair, you are missing a lot when ignoring text objects. Stuff like cib to delete what was in the next pair of brackets, go into insert mode and lets you type a replacement. Afterwards you can type . to repeat.
Not really necessary to use it but super helpful.
→ More replies (1)5
u/MoragX Apr 20 '15
It's not so much that Vi is so hard, but rather that with a modern text editor, most of the shortcuts are standard to the rest of the computing world and so you don't have to memorize anything. So Vi isn't hard, but everything else is so easy.
2
u/rgzdev Apr 21 '15
Also a lot of people don't understand that VI's need for a command driven interface was dictated by the needs of writing code in a TTY in something slower than a 56k modem. Having a command for "change in quotes" made a lot more sense back then. Ditto for things like hjkl, they are artifacts of its time, the whole "but you don't have to remove your fingers from the homerow" it's really irrelevant since when coding you spend more time thinking than typing.
3
u/pehnn_altura Apr 21 '15
:%s/foo/bar/g
Find and replace all instances of foo with bar. Great shortcut if you need to rename a variable!
2
u/minno Apr 21 '15
I prefer :%s/foo/bar/gc so that I don't accidentally change a part of the file I didn't mean to.
→ More replies (1)2
u/VictoryGin1984 Apr 21 '15
Or better yet, :%s/\<foo\>/bar/g, so you only match the whole word "foo".
→ More replies (6)2
u/Endur Apr 21 '15
Took me a while to remember that syntax. I still need to look it up to remember what letter does confirmation and all that other stuff
3
3
u/the_omega99 Apr 21 '15
Two other useful things that vim users should know (because while the stuff you listed are the essentials, they don't really do anything that you can't do in virtually every editor):
Macros: hit
q<letter>to start recording and save the macro into<letter>(this lets you record multiple macros). Do whatever actions you want, then hitqto stop recording. Now whenever you type@<letter>, you'll perform the recorded actions. If you specify a number before@<letter>, you'll perform the macro that many times.Incredibly useful for avoiding repetitive commands. Macros can easily be the #1 time saver, since repetitive commands are a strong thing to stamp out.
ci<symbol>to change within some kind of enclosing symbol ({,[,", etc). For example, if our text is:<someXml attribute="value" />Then inside of the double quotes, we could type
ci"and it'll change the text to<someXml attribute="" />And put the cursor in insert mode after the starting double quote. Similarly, typing
ci<will change the text to<>And put the cursor after the starting angle bracket.
2
u/Endur Apr 21 '15
Got anymore useful and more advanced commands?
I use a vim plugin for my IDE and use all the above commands above, it's great!
The one command I probably use the most is D. It cuts everything from the cursor to the end of the line. I can't remember if it puts you in insert mode, but you can always follow up with an A to put you in insert mode at the end of the line.
→ More replies (1)2
1
u/Zagorath Apr 21 '15
As a Dvorak user, hjkl are basically unusable for me, so I've always used arrow keys. But to be honest, I really don't understand why hjkl would be better to use even for people stuck using the QWERTY keyboard layout.
The arrows are laid out in an intuitive way versus hjkl which is all in a single row. h is left, fine, and l is right. But there's no intuition for whether j or k should be up. Sure, Vim doesn't care about intuition, it favours speed of use for the user who already knows how to use it. But I fail to see the advantage of hjkl over the arrows. It's just as fast to use, but far less intuitive.
4
u/Matthicus Apr 21 '15
The advantage is that they're on the home row. You can move the cursor around, quickly input whatever commands you want to use, and when you want to enter input mode and start typing, your hands are still right where you need them. The only bad thing about vim is the use of Esc to exit input mode, but that is easily remedied by swapping Esc and Caps Lock, at which point you can do pretty much everything without ever having to move an entire hand.
→ More replies (1)2
Apr 21 '15
Especially if you have a compact keyboard like on a MacBook where the distance to the arrows is quite low anyway. I always just use arrows.
0
Apr 20 '15
[deleted]
7
4
u/paraffin Apr 20 '15
i for insert mode, ctrl+shift+v or shift+insert to paste
3
u/the_omega99 Apr 21 '15
Note that you probably have to set paste mode, otherwise vim will likely try to format your pasted text and possible screw it up. You could do this with
:set pasteand:set nopaste, but more ideally you should make a shortcut for this. I use this in my .vimrc:map <leader>pp :setlocal paste!<cr>This lets you type
<leader>ppto toggle paste mode. IIRC,<leader>is backslash by default, but that's a pain in the ass to type, so most people change it to,(comma) with:let mapleader = "," let g:mapleader = ","Thus,
,ppwill toggle paste mode.→ More replies (3)4
Apr 21 '15
Well, if you know how to do yank (
y) and put (p), system clipboard is"+yand"+pwhich is fairly easy to remember I think.→ More replies (1)1
u/kernco Apr 20 '15
**warning** (netrw) using Pexplore or <s-up> improperly; see help for netrw-starstar
35
13
u/ModusPwnins Apr 20 '15
I, too, saw this tweet.
8
u/TweetsInCommentsBot Apr 20 '15
Over 1 year, the average Vim user saves 11 minutes in productivity.
However, they lose 27 hours through evangelising Vim to non-users.
This message was created by a bot
30
Apr 20 '15
An average vim user might only save 11 minutes, an expert vim user saves an hour a day :P
19
Apr 21 '15
Maybe if your job is a transcriber. What I didn't realize until after I'd learned Vim is that I spend most of my day as a programmer thinking, not typing.
That being said, the typing part does go a lot faster.
5
Apr 21 '15
What I found after becoming proficient with vim is that the editing part suddenly has no mental overhead anymore. Since pretty much everything is muscle memory by now it feels like a more direct link to the code I'm editing.
0
Apr 21 '15
[deleted]
2
Apr 21 '15 edited Apr 21 '15
Yes. Depending on the language and available plugins that could be with or without actual code introspection, but it will always (i.e. without any plugins too) keep a list of all words in the current buffer to offer you a very simple and naive kind of autocompletion in the worst case. In practice that works surprisingly well, but there are plugins that improve it a lot so you get fully context aware auto completion just as you have in an IDE.
By the way, there's also auto completion for file paths, complete lines and using dictionaries (which can save some time when writing something that isn't code), and some other stuff that I keep forgetting.
EDIT: This is what it looks like with C and clang_complete: http://i.imgur.com/lcyYQrm.gifv A lot of people prefer YouCompleteMe these days though.
1
u/LankyCyril Apr 21 '15
Even when you're thinking, you'll have to occasionally navigate the text. And vim makes that easier, too.
3
u/MoragX Apr 20 '15
I assume the hour you save is the time you would spend complaining to your coworkers that you're not using vim?
-3
Apr 20 '15
Unless you have around 5 million lines which you need to run a macro on. glhf doing that manually.
7
u/iamafuckingrobot Apr 20 '15
Why not record your macro once with 'q', then replay it 5,000,000 times with '@'.
qa <perform action> q5000000@a.4
6
u/ThatFlyingHippo Apr 21 '15
Am I the only one that uses vim so often that when I finish typing something in another text editor I always have to delete the extra keystrokes that I am used to saving my work?
\027:wq
2
u/TwilightTwinkie Apr 21 '15
All the time. All my friends use vim and if we are working on a Google doc together every once in a while someone will do it. I more commonly type
jkas it's my escape sequence instead of moving my had and tapping esc. Screws with me all the time when I go use a friend computer who doesn't havejkset.1
u/ExceedinglyEdible Apr 23 '15
I experience the opposite. I have to press backspace three times in
nanowhen saving, to remove the extra ":wq" in there.
70
u/iLostMyAcc Apr 20 '15
I really don't know why people use vim. Can anyone explain it to me?
294
u/why-the Apr 20 '15 edited Apr 20 '15
Summer of 1997.
We had this little Slackware Linux server running as a router/firewall/email server in a closet, in another building, next to a bunch of wiring for this little internet cafe I worked at.
We found out our 'sysadmin' was running a pirate FTP site off of it. They fired him and told me -- since they had seen me using IRC remotely on a shell and assumed that meant I 'knew unix' -- to take over administration of this machine. I was young, naive and thought it would be fun.
A few weeks later I screw up trying to remotely recompile and install an updated kernel (back when this was difficult), and suddenly it stops responding.
So, in the height of summer, I'm stuck in a hot, dark, tiny closet for hours, sitting on the floor cross-legged trying to figure out how exactly I'm going to get this working again.
...and the only editor that you could use was vi, which I had never used before.
It was in that moment that I decided I was going to learn that awful, twisted evil little program because there was no way I was going to be defeated by a text editor. After that I made sure I used vi any time I needed to edit any text file, just so I would know how to use it if the situation ever came up again.
So I use it out of fear, really.
46
41
6
u/Neekoy Apr 20 '15 edited Sep 08 '26
Dinosaurs grey nonmetal dolls versed nose rain close
This post was anonymized with Redact
2
86
u/noop__ Apr 20 '15
Because it let's me modify text faster, and more precisely than any other text editor in existence. And the portability (console based, *nix) makes it so I can have the same text editing workflow on all of my machines including the several thousand headless servers I manage.
28
u/iLostMyAcc Apr 20 '15
" it let's me modify text faster, and more precisely than any other text editor in existence." Do you have a example?
18
u/dysmas Apr 20 '15
It's not just being "faster" though, which lets be honest - is debatable.
The main thing that sticks me to vim is how it makes editing text effortless,
When I want to modify a given piece of text, the vim commands map very closely to my mental wishes, the changes just flow out.
10
u/nupanick Apr 20 '15
This is the right answer imho. It's not that vim somehow magically speeds up your workflow; I find for most tasks it takes about as long as a traditional editor still. It's just that vim's shortcuts are designed specifically to work the way you think when you work with text documents a lot. I've already internalized the shortcut for quickly cutting and pasting a single line, for instance, because I do that a lot when I'm making lists. And on top of this, it's console-based, which is a big plus over any graphical editor because it means I can use it on any machine.
26
u/noop__ Apr 20 '15
The vast array of movement and editing commands, and the modal interface with which they're presented allows almost anything to be just a couple of keystrokes away rather than being hidden away in the menus of gui text editors. Yeah, there's a steep learning curve to vim, but once you get the hang of it, you'll feel completely crippled in anything else (of course, until you get really good with $othereditor, but then you can make this decision for yourself, and I'll bet $10 you'll choose vim).
11
u/Dooey Apr 21 '15
Gui editors: Features are hidden away in menus Vim: Feature are hidden away in man pages.
I'm not sure which is better.
→ More replies (7)10
u/mallardtheduck Apr 20 '15
just a couple of keystrokes away rather than being hidden away in the menus of gui text editors
Except that every GUI ever binds the menus to simple keystrokes. That way, "power users" can do things fast, while new users still have a chance to learn.
51
u/larhorse Apr 20 '15
so no on the example?
I mean, don't get me wrong, I absolutely understand the point about having an editor that I can use on a headless server pretty much anywhere, and I put up with vim during day to day use because of that. (cause really, VIM is better than nano at least)
That said, I vastly prefer pretty much anything else for actual coding. Sublime, Atom, TextMate, hell even Notepad++ if I happen to be stuck on windows (although NEVER notepad).
I even caved two years or so ago, and spent 6 months using nothing but vim to see if it changed my feelings about it. I really wanted to feel like I was being more productive, but in all measures, I wasn't. Turns out the mouse is REALLY damn good at doing things like selectively targeting text and precisely moving selections. It's almost like it was designed for that task. Plus it means I don't have to keep hundreds of esoteric key commands in my head!
18
u/noop__ Apr 20 '15 edited Apr 20 '15
90% of my editing (4-12 hrs/day depending on the day), is done through an ssh session, so gui editing isn't really even a valid comparison. But that's just my use case. Obviously if another tool works better for you, you should use it.
and spent 6 months using nothing but vim to see if it changed my feelings about it
That is not nearly enough time to learn vim. I learn new stuff about it (and it makes me better) every week, and I've been using vim as my exclusive editor (aside from when I'm giving new stuff a shot) for the last decade.
12
u/muffsponge Apr 20 '15
So, if spend more than 6 months learning vim, will I ever make up that time in productivity? I feel comfortable using mouse in an IDE with intelligent autocomplete to get things done quickly. I just can't seem warrant the extra time to learn and remember all these commands.
→ More replies (6)17
u/noop__ Apr 20 '15
I just can't seem warrant the extra time to learn and remember all these commands.
Then don't :). Nobody is saying you have to use vim. At the end of the day, it doesn't matter what tools you use, it matters how well you do your job. If you think you're at your best using a gui editor, totally do it.
→ More replies (7)4
u/DrHenryPym Apr 20 '15
Small example:
Use
*on a word, and it will search for that word.Use
ceto change the highlighted word.Use
nto find the next word.Use
.to repeat the last change.Repeat steps 3 and 4. (Only two keyboard presses)
Or:
:%s/
<Ctrl-r> //new_word/g
<Ctrl-r> /will access the register used for searching.
<Ctrl-r> "will access the last copied or deleted text. Usepto paste it wherever.
<Ctrl-r> +will access clipboard.I know that most editors can do all this very simply, but the fact that it only takes a few keypresses to quickly automate some editing goes a long way.
→ More replies (2)→ More replies (4)6
u/scragar Apr 20 '15
I have 1 big argument, 54 buffers/clipboards(a-z, A-Z,
*is your normal clipboard and there's the standard buffer it will use if none is specified), combine with a similar number of bookmarks(52 in total, a-z are unique per file, while A-Z are unique across the whole profile and will open the file the bookmark was last placed in if you jump to it) makes it insanely powerful.Yes, it takes a great deal of getting used to, but it's hard to question how handy it is(I mean given the improvements of win7/8 it's now almost as good as a Linux distro, but I still really miss 2 clipboards/buffers at work).
9
u/j201 Apr 20 '15
If you search 'vim screencasts', you'll find a bunch. This is a cool one: http://blog.extracheese.org/2010/11/screencast-custom-vim-refactorings.html
→ More replies (1)→ More replies (2)4
u/astrellon3 Apr 20 '15
Best examples I can give you is the ability to modify the entire contents within a set of brackets or quotes. eg:
string url = "http://..... long url ...";My cursor can be anywhere on that line (including before the start of the string) and I can type
ci"Can that will take me to the first set of double quotes if in not within one already and delete the contents. The same applies to {}s, ()s, []s and XML tags (they are treated slightly differently) which means you can take the contents of a huge function or for loop and stick it somewhere else. Now this isn't something I do often, usually I'm changing something in a string or a function call or a function signature. It's nice to have the ability to change these things and move them around regardless of their size.
This is just one example, but it's usually the thing I miss the most when using other text editors.
3
u/gellis12 Apr 20 '15
Also,
:s/phrase 1/phrase 2/will replace any instance ofphrase 1withphrase 2in your document. You can also pressVto select whole lines of text, then type:s/^/#/to put a#at the beginning of each selected line.3
u/Dooey Apr 21 '15
I'm pretty sure even Notepad has find and replace.
Most editors also let you comment out lines with a couple keys. In Sublime Text, it's Cmd+/, and it auto-detects what syntax you are using, and what a comment is in that syntax.
→ More replies (3)6
u/cheald Apr 20 '15
I've yet to meet a vim user who can code in fewer keystrokes than I can in Sublime.
It's boss for headless servers though.
30
u/noop__ Apr 20 '15
Who cares about fewer keystrokes? I want speed, precision, and environmental continuity.
3
u/cheald Apr 20 '15
Sublime is fast, precise, and portable, as well. I can't use it in headless environments, obviously, but I'm happy to use vim there.
4
10
u/noop__ Apr 20 '15
portable
can't use it in headless environments
Using it in headless environments is what I originally meant by portable. vim works pretty much everywhere, and comes pre-installed on pretty much everything. Including that server you're consoled into in the middle of the night trying to get back online (though luckily, this is dying with applications being redesigned for IaaS.) Sublime is portable to all the places I don't care about, so I haven't really given it a fair shake, but it doesn't fit my use case anyway. If it works for you, by all means have at it.
→ More replies (1)4
u/Tysonzero Apr 20 '15
That's because with sublime you spend time using the mouse, way more than an extra keystroke or two.
And if you try to claim that you don't use the mouse, then you definitely use more keystrokes than the average VIM user.
13
u/cheald Apr 20 '15 edited Apr 20 '15
I work in Sublime entirely without the mouse. I also use vim (and am probably an "average vim user").
I regularly pair with co-workers who use vim (and have exclusively for years), and the amount of typing they do drives me crazy; maybe I just haven't met the uber-vim users yet. I'm faster in Sublime than they are in vim.
→ More replies (4)17
u/b93b3de72036584e4054 Apr 20 '15
What's wrong with using the mouse ? We are developers, not data-entry clerks. I spend way more time thinking about what I write than actually writing it.
→ More replies (1)17
u/memeship Apr 20 '15
Yeah, this is my argument. Actually writing code does not take up the majority of my time. I don't need to spend a year learning a text editor to shave off "keystrokes" from my dev time.
11
Apr 20 '15
Exactly. If you're a developer and you're typing into a code editor nonstop, you're doing something wrong. Good software comes down to its design - how easy it is to extend, maintain, and understand - which requires more thinking and planning than coding. Text editors probably don't even make it into the list of bottlenecks for software engineers.
I have nothing at all against vim, but I would bet that the vast majority of vim advocates are sysadmins (or people who have a lot of experience in that field), as vim is the best text editor accessible via nearly all terminals, whereas most programmers will probably choose something other than vim as their text editor, since most beginners learn within a GUI environment.
→ More replies (1)0
1
u/3pieceSuit Apr 21 '15
I've only ever found one single feature that emacs has and Vim lacks that I desire to use: Quotation mark matching. Even using backticks I've never found a way to have Vim match quotation marks.
0
Apr 20 '15
But you can just run eclipseplease^don't^kill^me
8
u/Elnof Apr 20 '15
On headless servers? I have machines that don't have X installed - I'm not installing X (plus VPN, NX, etc) just to edit some text files in Eclipse.
→ More replies (2)6
u/Inspector-Space_Time Apr 20 '15
Yes, even on them. I use PHPStorm to work on servers all the time.
You can auto-sync directories with servers. So I have all the advantages of an IDE with code on the server.
1
1
42
u/jpco Apr 20 '15
Do you mean like, as opposed to emacs, or why anyone uses a textual editor at all?
Or are you being facetious... I can't tell..
12
8
Apr 20 '15
So this question of yours is here to prove the bottom part of the image, look at all the answers! You won't get mine, I'll go to vim to save those several productivity seconds for today :)
10
u/3pieceSuit Apr 20 '15 edited Apr 20 '15
Reasone # 1: Modular Keybinds
e.g. d is the prefix for all delete commands, y for all cut (yank) commands. So dw deletes to the end of a word, while yw cuts to the end of a word. dd deletes a line, naturally yy yanks an entire line
This is fairly natural and intuitive once you get accustomed to using plain keys as shortcuts (instead always coupled with a modifier)
Reason # 2: Discrete Modes
Insert Mode, Visual Mode, etc. These modes mean that keybinds can be far simpler, often only 1 or 2 characters as opposed to the arcane combinations of modifier keys and letter keys that emacs/nano/ etc demand.
8
u/Sean1708 Apr 20 '15
Reason # 3: There are literally no other modal editors that feel even half as natural as vim.
4
4
u/phail3d Apr 20 '15
This article really cleared up a lot of things for me: http://www.viemu.com/a-why-vi-vim.html
I had personally been using vim in high school and university for quite a while, but without really knowing how to use it (being always in insert mode, using arrow keys and so on). This is not really productive, and my time would have been better served with using another editor.
However, when I started on my first job, I deliberately took the first month or so to really learn vim, and it has been one of the best investments of my time. It makes common text editing chores such a breeze, and all the key bindings get stuck in your muscle memory so they come automatically any way! The flipside, of course, is that I sometimes have hard time using other editors (and Word) without vim key bindings... :wq
The article I linked to really outlines the best parts of vim, IMO. This article by Bram Moolenaar is also rather good.
4
u/Cley_Faye Apr 20 '15
Because it's a text editor and it is good at editing text and other text-based stuff?
3
Apr 20 '15
It's an editor with a relatively steep learning curve, but can be really efficient once you learn how to use it. It's available on pretty much any system you'll use (including obscure/legacy ones), has scripting for plugins so it's fairly extensible.
Personally, I learned the basic movements and how to set up basic niceties like syntax highlighting and tab/space options, then I've gotten to lazy to do much else. But it's a good always-available option, I think.
2
Apr 20 '15
vim and/or vi comes preinstalled on most distros, also I like the simplicity of the commands (they aren't that wierd after a while). I use it on a daily basis, both on my PC (Ubuntu) and my phone (Android).
It just works really well for simple text editing.
Currently my goto program for large projects is Sublime, but maybe I'll switch to vim for everything once I get my plugins sorted out.
2
u/totemcatcher Apr 20 '15
Two main reasons for me, I suppose:
Multitool. I find myself facing repetative or unusual challenges when editing text all the time. When writing a lot of documentation, scripts in various languages, and parsing through plenty of code quickly, vim provides all the functions I need without the use of other tools.
Locked in. Even if there was something better, I wouldn't use it. I'm so invested in learning how to use vim successfully that it would be a waste to change. It takes a very long time to map all the useful functions of vim into your muscle memory (or to create your own custom cheat sheet with all the little tricks people have developed and shared) but once you have it, and you apply them regularly, there's simply nothing better and unlikely to be unless it's merely a plugin or alternate interface for vim.
2
u/captainjon Apr 20 '15
The ability to use regular expressions, it's pretty much everywhere (hell it's on my jail broken iPhone). It's an awesome editor. Adaptable. Can use syntax highlighting, bracket matching. Besides the terminal rules. Especially editing live code.
2
u/Krissam Apr 20 '15
I've always liked using my keyboard way more than using a mouse, I've always felt I spent way too much time with my hand on my mouse while coding, so when I first learned that vim could be used keyboard only without any issues, it felt natural for me to at least give it a go.
I'm not 100% up to my old speed of coding yet, but every day i get just a little bit faster, so I'm guessing it will come with time. But even if I don't ever reach the speed at which i could code before, I enjoy coding a lot more now than I ever did using a "real" ide.
2
u/noratat Apr 20 '15
Because it works on the command line / over ssh, and because it lets me do things without having to abuse key modifiers which require contorting my hands all day.
I don't care about the no mouse thing, since that's mostly bullshit (vim can feel faster than using mouse, but in practice it doesn't make much difference).
2
4
u/dynoraptor Apr 20 '15
If you don't want to use a mouse at all and only want to use a keyboard.
4
u/Antrikshy Apr 20 '15
I don't use my mouse with Sublime Text either. And the keyboard shortcuts are the same as every other app, including my browser.
4
u/dynoraptor Apr 20 '15
Vim has more keyboard shortcuts then the shortcurts you are referring to. A lot of text editors have a Vim mode though, in Sublime Text it's called vintage mode
→ More replies (3)4
u/phaseMonkey Apr 20 '15
Back when Dinosaurs roamed the earth and I had to do my lab work via a 56k dialup to a Unix system, I used vi.
It made sense back then.
1
u/davros_ Apr 20 '15
I use it because I like it and it suits my workflow. It's not for everyone, though. The best tool is the one you're best at.
1
u/ThatFlyingHippo Apr 21 '15
Because my Dad has been using it since it came out. When I was 8 I wanted to learn python. He said "O.K. Here." Bought me a python book and dumped me into vi. I can now edit files a lot faster than my friends. Once you know vi well, it is amazing. Also, if you want to learn the vi commands, learn ed. Sidenote: My Dad knows EVERY shortcut. I had a friend over and he was mesmerized at how efficient his vi usage was.
1
Apr 21 '15
Why does anyone prefer any tool? Personally I just prefer the interface it provides me over anything else I've tried. I'm more efficient and have less mental overhead.
→ More replies (2)1
Apr 20 '15
I use it because it's small and simple(once you get the hang of it), relatively easy to configure and portable. I dislike IDEs with tons of functionality.
17
u/Unzile Apr 20 '15
Pico master race
42
u/TheBelligerentOne Apr 20 '15
No fuck you. Nano is where it's at.
3
u/Unzile Apr 20 '15
Notepad is better than Nano, but Pico is better than Notepad, Vim, Emacs and everything else. Pico master race
19
0
5
19
4
1
u/tron_fucking_harkin Apr 21 '15
Why would I want to save time? I get paid by the hour
1
u/kobaltzz Apr 21 '15
So that on your review, you'd get a better raise? ;)
1
u/tron_fucking_harkin Apr 21 '15
You make a good point but my dev platform is windows 93 and I don't think I can get vim
1
u/ExceedinglyEdible Apr 23 '15
At work I used to run a stripped down Ubuntu VM just to have a decent coding environment. Cygwin would have worked but it's a bit of a pain to setup properly. Management would not let me have a Linux box. I do not work there anymore.
12
u/myropnous Apr 20 '15
GNU emacs master race
40
u/3pieceSuit Apr 20 '15
emacs is a great operating system, if only it had a decent text editor built in...
24
u/Creshal Apr 20 '15
You can run vim in emacs' terminal emulator.
5
u/barsoap Apr 20 '15
Just use spacemacs. A distribution of Evil on the emacs kernel.
→ More replies (2)
4
5
u/BleLLL Apr 20 '15
Pretty new to programming here. Im using gedit for c and eclipse IDE for java. I tried looking at vim and i really dont get what its supposed to do. Is it just a text editor like gedit? Its not an IDE as well.
19
u/Elnof Apr 20 '15
Yes, text editor. No, not like gedit. ViM / VI is a modal text editor that is designed so that the user's hands never need to leave the keyboard. It can be an IDE via plugins or you can subscribe to the "Unix is my IDE" mentality.
6
Apr 20 '15
On a Thinkpad your hands also stay on the keyboard.
2
1
u/ExceedinglyEdible Apr 23 '15
I'd rather tap "gg" than scroll all the way up, or reach for Ctrl-Home
5
u/BleLLL Apr 20 '15
So its not necessary if I like coding the normal text editor way, using both mouse and keyboard and dont program in low level languages?
18
u/Elnof Apr 20 '15
When is anything necessary? I use Vim for just about everything because I really like it and it makes me more productive, not because there's a need.
→ More replies (1)10
u/xkcd_transcriber Apr 20 '15
Title: Real Programmers
Title-text: Real programmers set the universal constants at the start such that the universe evolves to contain the disk with the data they want.
Stats: This comic has been referenced 374 times, representing 0.6171% of referenced xkcds.
xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete
7
u/Tysonzero Apr 20 '15
It has little to do with the level of the programming language. Honestly dynamically typed HIGH level languages are probably even more suited for native (no plugins, plugins make statically typed language way more fun) VIM.
2
Apr 21 '15
Can confirm, I have been writing Haskell at work and at home with Vim for over a year now and it's great.
6
u/Cley_Faye Apr 20 '15
The thing is, properly used vim (I'm not talking about plugin, but just basic editing stuff) is waaaaaay faster than typing in a "notepad"-like IDE.
Opening files, moving from one to another, cutting/pasting, and other basic stuff is available at hand. Most stuff use 2-3 keystrokes, which are faster than just even reaching your mouse.
3
Apr 20 '15
It's just a matter of preference, really. I use Vim but I also use Atom a lot, especially for languages I don't use enough to bother having a Vim-plugin for it.
And if you're not feeling limited by what you're currently using, you're probably fine.
3
Apr 20 '15
Text editor, with plugin support. I have a linter for varous languages and there are intellisense plugins as well (which I don't use atm).
Also it works in a terminal which is a huge plus for remote editing over SSH.
1
u/BleLLL Apr 20 '15
What kind of plugins? There are also plugins on gedit and eclipse as well.
4
Apr 20 '15
Themes, new syntax highlighting, linters, an awesome statusline (vim-airline), a shell tab (vim-shell IIRC), ...
Yoh can do a LOT with vim. (Not as much as I've heard from emacs but still quite a lot)
EDIT: IIRC there are also build automation plugins and plugin managers that manage plugins so you don't have to clutter your .vimrc
→ More replies (1)2
u/BleLLL Apr 20 '15
Well i have no idea what the last three are but the first few are available on gedit, sublime text and eclipse as well. I guess if i will need to know about these things i will find out about them when the time comes.
2
Apr 20 '15
Linter -> shows syntax errors and things like "Unused variable", "reference error", etc
vim-airline -> makes the statusline look much better and makes it modular (i.e. you can add a git module that shows the repo status and shows diff symbols next to line numbers or as colored line numbers)
vim-shell -> Lets you open a tab/window/split in vim that works like a terminal (starts bash/zsh/fish/whatever in a vim window with vims copy/paste system
→ More replies (4)2
u/silentclowd Apr 20 '15
I personally use Sublime Text 3. It's pretty open to work however you want it to work, but also has some awesome shortcuts. It also has great plugin support that is searchable right in the editor (after you install Package Manager)
It even has a plugin that makes it emulate Vim shortcuts if you decide you do want to use them.
1
u/lc929 Apr 20 '15
it's great!! there's a plugin for it in pretty much every IDE. best investment to learn it. If i counted the times of having to go back and forth between my keyboard and mouse i would never get anything done...especially when doing HTML markup.
here are some resources to get your started type vimtutor into terminal vim-adventures.com http://code.snipcademy.com/tutorials/vim/navigation/navigating-controls
2
u/patternmaker Apr 20 '15
And our perpetual fight against the godless emacs users will ensure :w at the great :qa!
2
u/OscarAlcala Apr 20 '15
Not to mention the hours spent learning VIM in the first place which means they'll have to use it for a few decades to pay that time debt and turn it into actual time-saving.
2
u/concavecat Apr 20 '15 edited Feb 20 '24
groovy cows prick snobbish faulty snow quaint profit smoggy distinct
This post was mass deleted and anonymized with Redact
1
u/YourInvisibleFriend Apr 21 '15
/u/amirlyanon 11 WHOLE MINUTES
1
1
u/jon_laing Apr 21 '15
If I'm being honest, I only learned vim out of boredom at my first office job. It was a semi competition between a coworker and myself to see who could learn the most obscure piece of technology and incorporate it into their workflow. (Both of us were 24 and this was 2011, so vim was pretty obscure to us.) I was also using a less than stellar open source IDE at the time, so I needed to make a switch anyway. If it hadn't been for that I'm not sure I would have learned it. Now I can't live work without it. I work on a laptop, and using a mouse to do work is really frustrating, so it's nice I don't have to do that anymore. Also, I like the linguistic shortcuts as opposed to the chordal shortcuts most other editors have. Lastly, I usually code as a rails engineer, which relies on the terminal a lot, and being already in the terminal speeds up my productivity.
On the other hand, I have a new job with a lot less free time, and I got curious about emacs. Even in evil mode, I couldn't wrap my head around it, and I didn't have the spare time to learn it for curiosity's sake.
So yeah, if you have the curiosity, a dissatisfaction with your current editor, and, most importantly, the time for that learning curve, go for it. Otherwise, it probably won't impress you too much.
1
u/tuhdo Apr 22 '15
Check Spacemacs if you are a Vim user and want more and more and more, an Emacs configuration made for Vim users by Vim users.
1
u/tuhdo Apr 21 '15
Emacs includes Vim editing interface as a subset of it now. So, you now have asuperset of Vim. Also, check Spacemacs if you are a Vim user and want more and more and more.
1
u/dddbbb Apr 22 '15
2
u/xkcd_transcriber Apr 22 '15
Title: Is It Worth the Time?
Title-text: Don't forget the time you spend finding the chart to look up what you save. And the time spent reading this reminder about the time spent. And the time trying to figure out if either of those actually make sense. Remember, every second counts toward your life total, including these right now.
Stats: This comic has been referenced 196 times, representing 0.3224% of referenced xkcds.
Title: Automation
Title-text: 'Automating' comes from the roots 'auto-' meaning 'self-', and 'mating', meaning 'screwing'.
Stats: This comic has been referenced 169 times, representing 0.2780% of referenced xkcds.
xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete
1
u/gwoplock Apr 20 '15
I personally use nano just because I don't feel like (too lazy) learning how to use it.
1
u/flaxeater Apr 21 '15
I'm not saying you're bad if you use and IDE, I'm just saying you might not be good, but if you used vim, you're good.
-5
u/barodapride Apr 20 '15
I decided to learn vim about 6 months ago just to see if it would really make me faster. It's not a good text editor. The only good thing about it is it's available in the console. Sure you can customize it to make it not as terrible but then if you use any other machine you have to get your configuration on that machine somehow or you're using plain vim which is terrible. I've wasted so much time figuring out how to do such simple things it's a shame. And I don't see it paying off. All the talk about being really fast with vim is a lie. I could not find one video where I saw someone being significantly more effective using vim than anything else. Changing modes all the time is so annoying it negates any benefits from having modes.
→ More replies (2)6
Apr 21 '15
It's not a good text editorI have no idea what I'm talking about and interpret my anecdotal half-ass effort to learn as the summation of all human experience with Vim.FTFY
→ More replies (3)
0
Apr 20 '15
[deleted]
72
u/kjanssen Apr 21 '15
This is a pretty accurate description of what it feels like after learning vim and using it consistently. Once you first become proficient, its exciting.
Then, once you get really used to it, and the vim way really seeps in, you begin to feel crippled when you don't have it. Writing emails, essays, or pretty much anything not in vim feels what I can only describe as trying to write with a pencil with the wrong hand. You can do it, but it feels unnatural, and you consciously notice the impediment to getting your thoughts out.
Like it's stated above, you can't go back even if you wanted. Luckily, most other editors and IDEs have some plugin that will emulate vim-style editing for you.
6
u/quaunaut Apr 21 '15
And sometimes, it lets you do fucking magic.
Here's a talk including a bunch of live coding from EmberConf this year, from Toran Billups. He TDDs a new ember project, beautifully, and the magic he does in vim is jaw-dropping, until you've seen better.
→ More replies (2)→ More replies (16)5
u/Sean1708 Apr 21 '15
The amount of times I've typed my Esc mapping in reddit comments is ridiculous.
→ More replies (1)28
u/stealer0517 Apr 21 '15
I just use nano because it tells me how to quit out of it
→ More replies (4)15
u/DonCasper Apr 21 '15
Quitting stuff in Linux is a bit of a task in general. It's always ctrl+c, except for when it's ctrl+x, unless it's just q or just x. Of course sometimes it isn't even a command, you need to bring up the menu with : and type quit, except when there is a terminal GUI, then you might have to bring up the menu with Alt, and then hit X.
Honestly it doesn't bother me now, but quitting command line utilities was the biggest pain in the ass when I was learning Linux. I went from installing Windows and having it work, to installing Linux and getting dumped on the command line where I had to set up X-conf and whatever the fuck the wireless system was called in 2003. The learning curve sucked.
Say what you will about Ubuntu/canonical making Linux dumb, but at least new users get a functional desktop before they have to learn the dark arts.
→ More replies (5)45
32
9
u/tommcdo Apr 21 '15
When you're infected with Vim, all other modes of editing text become deeply unsatisfactory to you.
I've never heard anyone describe that better. "Deeply unsatisfactory". It's like you transcribed my soul.
7
u/Sporz Apr 21 '15
That was awesome :)
I think it's definitely the speed of thought thing. The text navigation is definitely one thing (dancing through the file with precision in a matter of keystrokes!) but the way buffers and file navigation works in vim is great too. Whenever I have to go drag my mouse somewhere in an editor to find a function definition or some file, it often feels like my brain got derailed. I used Eclipse for years (and it's a fine IDE) but with projects including more than like a dozen or two dozen files (The projects I work with contain hundreds or thousands) it felt like the editor was making me click navigate a complex filetree and maybe some menus to get to where I wanted.
With vim's buffers I can do it in a matter of keystrokes and not lose my context (it even remembers the order of files I've traversed) in each frame. The buffer concept itself is jarring to people (people who haven't used vim or emacs expect tabs) but it becomes really powerful just keeping your train of thought together.
full disclosure though: I use emacs now - BUT I use a plugin called evil-mode that emulates vim's keybindings and Ex commands and covers like 99% of vim's functionality that I use. I use vim's commands almost whenever possible so I basically still use vim - I just have emacs functionalities available too.
→ More replies (3)4
u/Endur Apr 21 '15
It is an addiction. I'm a junior dev who was forced into vim during one of my classes. I started using it for my other classes (it was really helpful in operating systems) and the rest was history. Now I can't live without it, I'm constantly installing Vim plugins for every other editor I use
→ More replies (1)7
u/CJYP Apr 21 '15
You get my upvote for a well thought out and stated argument, even if I don't use vim myself.
3
u/Browsing_From_Work Apr 21 '15
If you like vim, you should consider using the
set -o vioption to enable vi mode at your command line. It makes the command line an extension of vi.→ More replies (1)3
u/rwoln Apr 22 '15
Excellent warnings on the vim disease; I appreciate your keeping the infection away from your junior engineers. This should not be spread.
I succumbed to vim in my youth. Two C.S. degrees worth of code, one doctoral thesis (LaTeX? think nroff), and three startups later, I was almost a terminal case.
Only a decade in management freed me from this addiction. Now I can use Eclipse without too many withdrawal symptoms.
Be safe. Heed LegionSB.
→ More replies (38)5
u/skrillexisokay Apr 21 '15
I'd be very curious to hear if anyone has used both vim and sublime text (or a similar editor) extensively. I'm yet to hear of a standard vim action that I can't do with a hotkey in sublime text. For example, your string example is achievable with the keystroke:
ctrl-shift-m, 'The exception is direct unix integration, but I can't think of anything one would want to use frequently other than sed and tr, functionality that sublime has built in.
And like it or not, some things are faster with a mouse....
→ More replies (19)13
u/Sean1708 Apr 21 '15
I think this is a fundamental misunderstanding when people talk about Vim, it doesn't necessarily do more than any other text editor but it does do it in a very different way.
For example, in Sublime world changing everything between quotes would be two actions:
ctrl-shift-m # change between ' # quotation marksbut in Vim world it would be three actions:
c # change i # inside ' # quotation markswhich means I can do any of the following in an intuitive way (it might not be intuitive for you but it's intuitive for me, just like
crtl-shift-mis intuitive for you but it isn't for me):d # delete i # inside ' # quotation marks d # delete a # inside and including ' # quotation marks c # change t # everything before the next ' # quotation mark c # change t # everything before the next w # letter 'w'In Sublime I'm guessing that you would probably need to remember several different meta keys, which is probably perfectly intuitive in it's own right but it's just a different way of doing things.
Again, not everybody likes this way of doing things and it's not objectively better but people who do like it have good reasons for doing so.
→ More replies (2)
9
u/TED96 Apr 20 '15
I'd learn vim, if the Visual Studio (yeah, I like IDEs) plugin for vim wouldn't conflict with Resharper...
EDIT: Also, seriously, why do people prefer to edit code in a text editor? (and VS sets the bar pretty high for IDEs)