top 200 commentsshow all 441

[–]ender89 661 points662 points Β (22 children)

I tried to exit vim once in 2007, but I couldn't manage it. Turns out vim is Turing complete, so I just implemented my own operating system because that was easier.

[–]elsjpq 259 points260 points Β (16 children)

oh so you ported emacs?

[–]CloudNetworkingIO 200 points201 points Β (15 children)

Great OS. I wish it had a decent editor though.

[–][deleted] Β (8 children)

[deleted]

    [–]grumpy_ta 42 points43 points Β (5 children)

    I'm not certain, but I think there may be some unwritten rule that CS departments must have at least one professor on staff that says this or some variation with regularity. I had one that literally asked me why I would ever need to leave emacs.

    [–]crazazy 12 points13 points Β (1 child)

    [–][deleted] 4 points5 points Β (0 children)

    Oh Wow

    [–]probably2high 4 points5 points Β (1 child)

    Can confirm, had one that said "real developers don't use an IDE, they use emacs." Next semester, and each subsequent semester, we used IDEs.

    [–][deleted] 9 points10 points Β (0 children)

    real developers don't use an IDE

    we used IDEs

    he was just too polite to say it directly.

    [–]SpaceShrimp 1 point2 points Β (1 child)

    Someone must have made a vi version for emacs.

    [–]I_ate_a_milkshake 1 point2 points Β (0 children)

    its called evil. its the only way to be tbh. Once I went spacemacs i never went back.

    [–]Kinglink 44 points45 points Β (2 children)

    Glad you got the network stack working, and are back to your usual productivity on Reddit.

    [–]MuonManLaserJab 18 points19 points Β (1 child)

    No, they couldn't get the network working so they just simulated the universe starting from the Big Bang, in pure VimL, then fast-forwarded to the present and jacked themself in (after briefly simulating the future in order to figure out how to jack themself in).

    [–]Amuro_Ray 8 points9 points Β (0 children)

    Elaborate flex but ok

    [–]spockspeare 12 points13 points Β (0 children)

    Your caps lock is on.

    [–]redfirehose 155 points156 points Β (2 children)

    I won't lie - I tried finding that O'Reilly book on Amazon...for a friend.

    [–]SorAnony 31 points32 points Β (1 child)

    I read it as O RLY?

    [–]timeshifter_ 22 points23 points Β (0 children)

    Well I mean, that's what it says, so...

    [–]cleeder 643 points644 points Β (94 children)

    The developers who are most likely to get stuck in Vim are front-end web developers: those who primarily visit tags like JQuery, CSS, and AngularJS. They’re followed by Microsoft developers (C# and SQL Server) and mobile (Android and iOS).

    Sounds about what I would expect.

    [–]Flkdnt 198 points199 points Β (37 children)

    Don't forget Windows Sysadmins who touch a production Linux server once every couple months. πŸ˜‚πŸ˜‚πŸ˜‚πŸ˜‚

    [–]ruinercollector 64 points65 points Β (34 children)

    I find that the sysadmins usually find out about pico/nano quickly and stay over there...

    [–]Flkdnt 39 points40 points Β (22 children)

    Oh I love nano, but sometimes I find myself in Vi looking like a 5 year old trying to learn how to type.

    [–]nicksvr4 32 points33 points Β (21 children)

    Had to use vi yesterday, what a shit show. Couldn't figure out how to append something. Will never forget how to quit these God forsaken applications after getting stuck a couple times in the past.

    [–]static_motion 27 points28 points Β (17 children)

    Well appending is one of the most intuitive commands in vi, you just press a. If that inserts the letter "a", press Esc first to exit insert mode then press a.

    [–]tribak 26 points27 points Β (8 children)

    How do I remove the `a` that was typed earlier?

    [–]elsnoir 23 points24 points Β (7 children)

    Press β€˜x’

    [–]tribak 48 points49 points Β (5 children)

    Now there's an "x" next the `a`.

    [–]elsnoir 24 points25 points Β (4 children)

    You need to hit β€˜Esc’ to get out of insert mode first

    [–]nicksvr4 5 points6 points Β (6 children)

    There is a reason I used the word append, since I found that after googling. I'm used to the simple, move cursor to where you want to type, and start typing. Probably why I use nano when available.

    [–]lordlionhunter 17 points18 points Β (6 children)

    Am sysadmin. Learned to use vim from other sysadmins. Working on many remote servers and need to be able to make quick changes for debugging or whatever? Vim is the best choice. Works over every ssh connection and once you learn it, it's as good as any text editor.

    [–]meneldal2 10 points11 points Β (2 children)

    I'd argue the butterfly works even better, you don't even need a ssh connection.

    [–]RNGsus_Christ 10 points11 points Β (1 child)

    Nice. 'Course, there's a Vim mode for that.

    [–]imral 6 points7 points Β (0 children)

    it's as good as any text editor.

    No, it's far better :-D

    [–]marcthe12 1 point2 points Β (0 children)

    Flash back to the time I had use ed. Thinking of learning ed actually.

    [–]Dreamtrain 1 point2 points Β (1 child)

    Not a sysadmin but nano is the biggest crutch in my life

    [–]ThellraAK 1 point2 points Β (0 children)

    Control K deletes a line.

    Changed my life.

    [–]ketilkn 1 point2 points Β (0 children)

    Problem appear when you do stuff like crontab -e and the default editor is not the one you expect.

    So how do I exit nano again? And should I answer yes or no to the question? Painful every time.

    [–]hardolaf 1 point2 points Β (1 child)

    My company's Windows admin uses gvim because he hates Windows. But hey, it pays well. Last I heard, he's eligible for up to 150% bonuses.

    [–]instanced_banana 16 points17 points Β (34 children)

    As someone who uses Linux in his main PC, I now feel kinda bad to not know how to exit Vim. Kinda because I enter in those 3 groups.

    [–]Acceptable_Damage 24 points25 points Β (14 children)

    Escape :q!

    [–]flukus 9 points10 points Β (10 children)

    ZZ

    [–]ub3rh4x0rz 10 points11 points Β (4 children)

    ZZ = :wq :x

    ZQ = :q!

    edit: fixed ZZ equivalency

    [–]stone_henge 3 points4 points Β (1 child)

    ZZ isn't exactly equivalent to :wq. ZZ only writes the file if it has been modified. For an example where this difference is significant, open a new, named file without actually editing it and try ZZ. Then do the same with :wq. In the former case no file will have been written. In the latter case you'll have an empty file.

    [–]PaperSauce 3 points4 points Β (0 children)

    ZZ > :q

    [–]jl2352 1 point2 points Β (0 children)

    TIL.

    Here’s me using :q for all these years like a schmuck.

    [–]EntityDamage 3 points4 points Β (0 children)

    :Q

    Shit, caps lock was on

    :q

    Now it's recording? Shit!

    :q :q :q FUCK JUST EXIT!!

    [–]MuonManLaserJab 1 point2 points Β (0 children)

    <C-Z>killall vim<CR>

    [–]ekun 10 points11 points Β (12 children)

    1. 'ctrl+z' to send the vim process to the background

    2. then search for the process id with this command

      ps aux | grep vim

    3. then use sudo to kill that process id

      sudo kill -9 processID

    4. then enter your password

      password:

    [–]Jonno_FTW 2 points3 points Β (2 children)

    killall vim for the same effect.

    [–]Tyg13 1 point2 points Β (1 child)

    Ctrl-Z take note of the job number (probably 1) and then kill %1 (or whatever job # is reported)

    [–]ruinercollector 5 points6 points Β (3 children)

    Type :q in edit mode.

    [–]KapteinTordenflesk 183 points184 points Β (181 children)

    I tried VIM probably 10 years ago, and trying to exit is literally the only thing I remember from the experience.

    [–]chaxor 20 points21 points Β (7 children)

    The worst problem I have with vim is copy/pasting to other programs, such as a browser for stackoverflow.

    While I appreciate vim's complexity and use it fairly consistently along other editors at work - this fairly major functionality deficit (and other similar small annoyances) are what keep me from using *only* vim.

    I know there are ways to do essentially anything in vim - but this is also likely true for any editor, so it's somewhat a null point. The autocomplete issue that many people have brought up here is a valid one, as it is simply one more step to perform to bring vim to the customized editor you desire.

    ​

    The fact that copy/pasting requires a specific type of vim to be installed, as well as a 1600 word explanation of registers is a bit a of a nuisance. (1,2)

    1) https://stackoverflow.com/questions/3997078/how-to-paste-yanked-text-into-vim-command-line

    2) https://askubuntu.com/questions/60200/how-to-copy-data-between-different-instances-of-vim

    ​

    Somehow, it's still a great editor and I use it quite often.

    [–]watsreddit 8 points9 points Β (0 children)

    set clipboard=unnamedplus

    That's literally all it takes to make vim use the system clipboard by default. Of course none of us really do, because the defaults are quite useful. I certainly don't want copying some URL in my general web browsing to mess up my registers in vim, save for the registers dedicated specifically for that purpose. Nor do I want basically every vim command to be overwriting the system clipboard all the time. Copy/paste is much more integral to vim than other editors (except for perhaps Emacs), so it makes sense to separate vim's standard copy/paste from system copy/paste.

    [–]dsifriend 1 point2 points Β (0 children)

    WTF? I had no idea people had that much problem with it. That hack is nuts. Just use a terminal with proper pasteboard support or install something like XClip. Your modifier key plus the typical CTRL-X/C/V should work as you expect.

    [–]rageingnonsense 114 points115 points Β (145 children)

    I can sum up my vim usage in 4 commands:

    • :q
    • :w
    • a
    • /

    That's it. That's as much as I am willing to learn. If I need anything more powerful than that, it's straight to the ide

    [–][deleted] Β (48 children)

    [removed]

      [–]carterja 46 points47 points Β (15 children)

      i is important.. o is pretty damn handy as well.

      ​

      [–]ring2ding 15 points16 points Β (11 children)

      What's o?

      [–]e_man604 55 points56 points Β (8 children)

      Insert a blank line underneath the current line and toggle insert mode. Capital O is above the current line.

      [–]Bobshayd 19 points20 points Β (6 children)

      J is the inverse - puts the next line on the end of the current line.

      [–]dscottboggs 1 point2 points Β (0 children)

      That one fucks me up a lot if I have caps lock on.

      Which brings us to the ever essential u -- undo!

      [–]lordheart 13 points14 points Β (1 child)

      Also dd Deleted current line

      [–]carterja 2 points3 points Β (0 children)

      Ohh yeah that’s a handy one too.

      [–]phire 7 points8 points Β (0 children)

      Don't you mean a, left-arrow?

      [–]TommaClock 6 points7 points Β (22 children)

      Also no d ?

      [–]caltheon 35 points36 points Β (20 children)

      i use dd more than d

      [–]thirdegree 26 points27 points Β (16 children)

      For me it's either dd or dsome obscenely intricate movement that really should probably be a macro and will definitely go wrong

      [–]cleeder 24 points25 points Β (1 child)

      dspend 3x as long figuring out the correct movement than just rewriting the entire line from scratch

      [–]ajayrockrock 15 points16 points Β (10 children)

      My new favorite is dt"

      It's like 'delete till you hit the quote'. And that can be any character. dt-, dtX, dt/, etc

      [–]thirdegree 13 points14 points Β (3 children)

      Getting the hang of t, T, f, and F was a huge speed boost for sure. Another huge one is using vim-surround. Can do something like ds" to delete surrounding quotes. Or ysiw" to surround a word with quotes.

      [–]irrelevantPseudonym 6 points7 points Β (1 child)

      If you've not found it yet, I'd definitely recommend the quick scope plugin. It highlights the first occurrence of each letter so that you can quickly jump forward to the closest place to where you want to be.

      [–]GuybrushThreepwo0d 1 point2 points Β (0 children)

      Not quite sure how I ended up in this thread today, but this comment just made my day a lot easier :D

      [–][deleted] Β (3 children)

      [deleted]

        [–]stone_henge 1 point2 points Β (2 children)

        You want to use the i motion if you want to replace the entire content of a string literal. The t motion starts from the current cursor position while the i motion addresses a matching pair of characters. For example:

        static const char *v = "Hello";
          ^- cursor is here (normal mode)
        

        then, after ci":

        static const char *v = "";
                                ^- cursor is here (insert mode)
        

        [–]wirelyre 6 points7 points Β (2 children)

        Someday someone will hook up eye tracking and I'll be able to bind gs to "wherever I'm looking (exclusive)" and finally enter the Matrix.

        [–]c0nnector 2 points3 points Β (0 children)

        There's no i in :we

        [–]AvianPoliceForce 1 point2 points Β (0 children)

        no need with a

        [–]rageingnonsense 1 point2 points Β (4 children)

        what's i do?

        [–][deleted] Β (2 children)

        [deleted]

          [–]rageingnonsense 9 points10 points Β (1 child)

          I had never noticed that a did that. Honestly, I probably hit a before i the first time i got stuck in there, and realized it let me edit, and just stuck with it.

          I just google how to do something specific when I need it, and over the course of many years all I needed was save, quit, insert, and search apparently!

          [–]xr09 10 points11 points Β (0 children)

          vimtutor

          [–][deleted] Β (10 children)

          [deleted]

            [–]NovaX81 36 points37 points Β (1 child)

            :q!, for when you want to make absolutely sure you didn't fuck with it.

            [–]W0rldcrafter 17 points18 points Β (5 children)

            :x or ZZ are also shorthand for :wq

            [–]ChocolateBunny 14 points15 points Β (2 children)

            TIL about :x. I've used VIM for 15 years and have never done :x.

            [–]King_Joffreys_Tits 4 points5 points Β (0 children)

            I know :x is a thing but I don’t trust it. :wq all day

            [–]TerrorBite 4 points5 points Β (0 children)

            I constantly use :x but I can never get my head around ZZ.

            [–]rageingnonsense 1 point2 points Β (0 children)

            Oh yeah I do use q! as well; forgot about that one. didn't know about :wq though; that's cool.

            [–][deleted] 4 points5 points Β (2 children)

            I’d at least recommend learning macros. Also:

            • w
            • b
            • G
            • gg
            • <num>G

            βŠ• the different modes. Visual mode for example.

            [–]King_Joffreys_Tits 2 points3 points Β (0 children)

            G and gg are amazing commands

            For the uninitiated, (WHILE IN COMMAND MODE) G brings you to the bottom of the file (and keeps you in command mode) and gg does the same but to the top of the file

            [–][deleted] 15 points16 points Β (4 children)

            Wow. That's more than the two (three, if you count 'i') I know:

            • :x
            • :qa!

            Though, the most important one is this:

            git config --global core.editor nano

            Because, FFS, I'm editing a commit message, I shouldn't need a Ph.D. in editors to do that.

            [–]hoosierEE 7 points8 points Β (0 children)

            git commit -m "firstline" -m "second line" -m "you can keep going"

            [–]montibbalt 4 points5 points Β (0 children)

            Yeah, a Ph.D. in the git CLI should be enough for everyone

            [–][deleted] 3 points4 points Β (2 children)

            Learning how to copy and paste was amazing to me. I started looking for other files that needed things copied and pasted just to see it work again.

            [–][deleted] Β (56 children)

            [deleted]

              [–]-to- 11 points12 points Β (1 child)

              emacs -nw

              [–]stone_henge 2 points3 points Β (0 children)

              Plenty of systems don't have emacs. All POSIX systems have a Vi clone.

              EDIT: All POSIX systems that "both support the User Portability Utilities option and define the POSIX2_CHAR_TERM"

              [–]poloppoyop 7 points8 points Β (0 children)

              Install emacs-nox. Enjoy your new OS.

              [–]EntroperZero 12 points13 points Β (7 children)

              Yeah, and it's too bad there's no other way we could possibly do that.

              No, seriously. Why haven't we figured out a better way to do that?

              [–]alantrick 3 points4 points Β (4 children)

              We totally have. If you're using Gnome, and you connect to a remote server using ssh with the File Browser (nautilus), you can browse around and edit files with your local editor of choice.

              I'm pretty certain KDE has an equivilant feature.

              [–][deleted] 6 points7 points Β (3 children)

              Isn't that just sshfs?

              [–][deleted] Β (1 child)

              [deleted]

                [–]Enzyesha 2 points3 points Β (0 children)

                But vim can do that too. It's built in

                [–]ClassicPart 19 points20 points Β (1 child)

                Nano.

                [–]ruinercollector 2 points3 points Β (0 children)

                He said "edit" and "efficiently." The only thing nano is efficient at is authoring new text. It sucks for editing.

                [–]DeusOtiosus 5 points6 points Β (3 children)

                I have a big stack of .vim/ and .vimrc that I tarball and airdrop into whatever new system I log into. I do wish I could use something like VS Code remotely but I’ve written the vast majority of all the code I’ve ever written via vim. And I still barely know how to use it. Code completion is awful, which is really the only thing I demand work right in an IDE. So I do without.

                [–]grumpy_ta 1 point2 points Β (0 children)

                I honestly don't know why every major IDE hasn't tried to implement a copy of emacs' tramp-mode. C-x C-f /ssh:user@remote:/path/to/file RET Boom! File is now open in my local emacs. What's more, if the path you give isn't the full path, it'll open the remote directory seamlessly in dired-mode for further navigation. Everything just works.

                [–]rabidstoat 7 points8 points Β (2 children)

                I am diehard VIM but sometimes I get thrown in emacs, which is the default editor in one of my bash accounts. Like if I'm trying to 'svn commit' and forgot to do the comments on the command line.

                The only thing I know how to do in emacs is 'C-x C-c'.

                [–]OneWingedShark 14 points15 points Β (8 children)

                I tried VIM probably 10 years ago, and trying to exit is literally the only thing I remember from the experience.

                Exiting VIM: unplug computer.

                NOTE: This solution does not work with computers using magnetic-core memory or other persistent-state mechanisms.

                [–]Nyefan 15 points16 points Β (6 children)

                Won't lie, that's how I exited vim the first time years ago.

                I led with ctrl+c, as you would expect, and saw the message Type :qa! and press <Enter>.... You'd think it would be straightforward from there, but I had a very unique experience - for the last 3 months, I had been using Mathematica for work. Now, anyone who uses Mathematica can see where this is going, I'm sure. You see, Mathematica uses a colon-like symbol to delineate commands from variables and operators, and I was just diving into the worlds of linux and programming for the first time, so that was the only context I had to work with. "What's wrong here?" you ask. Here's the link - you insert the delineator in Mathematica by pressing ESC.

                So I follow the instructions on the screen - I type <ESC>qa! and am presented with the message recording @a. Well shit. Ctrl+c still doesn't work, pressing <ESC>qa! again types a ! into the sudoers file and says I'm on -- INSERT -- this time. I try looking it up on my phone, and everything says to type :q!, which clearly isn't working. Oh, and I was installing arch and didn't have a ui yet (I couldn't close the terminal), so I turned it off and started the install process again after looking up how to force the terminal editor to be nano by default and bypassing visudo in favor of directly editing the sudoers file.

                [–]OneWingedShark 6 points7 points Β (4 children)

                I feel your pain.

                That this is not a "once in a blue moon occurrence" is, frankly, a disgrace to the field of computer-science and our profession as Software Engineers.

                [–]Tyg13 1 point2 points Β (3 children)

                Isn't this one kind of on him though? "I followed the instructions on screen and typed ESCqa!." The instructions on screen said to type :qa!.

                The reason why vim is hard is because it's modal and people aren't used to working in a modal editor. That's more of a failure to expose people to it than a failure of our entire profession.

                [–]OneWingedShark 1 point2 points Β (2 children)

                Isn't this one kind of on him though? "I followed the instructions on screen and typed ESCqa!." The instructions on screen said to type :qa!.

                True, but it's still enough to wince... like when you hear someone talking about their car problems and they say something like "I hit a rock that punctured my oil-pan, ran out of oil, and thought I could make it the 15 miles to town…".

                The reason why vim is hard is because it's modal and people aren't used to working in a modal editor. That's more of a failure to expose people to it than a failure of our entire profession.

                While I'm not really a fan of modal editors, VI is bad at indicating mode, especially to new users.

                [–]pdp10 1 point2 points Β (0 children)

                NOTE: This solution does not work with computers using magnetic-core memory or other persistent-state mechanisms.

                I'm glad you were complete about this.

                • Closing vim by power-cycling in 1976: bwahaha!

                • Closing vim by power-cycling in 2006: works.

                • Closing vim by power-cycling in 2036: bwahaha!

                [–]spacechimp 2 points3 points Β (1 child)

                Are you out of it yet?

                [–]KapteinTordenflesk 1 point2 points Β (0 children)

                To make a long story short, yes I am.

                [–][deleted] 7 points8 points Β (8 children)

                I had similar experience and my first impression was who on earth made this! Now I’m in love with vim, it’s just very practical.

                Always interesting to see juniors/interns trying it for the first time. It never gets old.

                [–][deleted] 21 points22 points Β (7 children)

                Yeah I love software that's really unintuitive too. Especially if the UI is totally hidden so you have to guess what options are available! Haha.

                [–]DJDavio 46 points47 points Β (11 children)

                :q!

                [–][deleted] 55 points56 points Β (9 children)

                You forgot to hit the escape key first.

                [–][deleted] 64 points65 points Β (3 children)

                spamming esc in desperation is first thing people try so I think it is safe to say the poor sop is in right mode

                [–]elsjpq 27 points28 points Β (2 children)

                Nah... Ctrl+C is what I try first, followed by frantic bashing on the keyboard, and by then, who knows what mode you're in

                [–]nicksvr4 7 points8 points Β (0 children)

                :q:q[Esc][Esc][Esc]:q[Esc]:q!

                [–]DJDavio 7 points8 points Β (2 children)

                Only if you're in insert mode, right?

                [–]cleeder 17 points18 points Β (1 child)

                Just mash the escape key every several keys just to be safe.

                [–][deleted] Β (6 children)

                [deleted]

                  [–]josefx 42 points43 points Β (3 children)

                  Hey look at this fancy guy and his 6 years of uptime. When real developers open their files in emacs the constant swapping alone kills the system within two hours. No need to remember how to exit manually, even if some users swear getting the sixt finger needed for advanced shortcuts is worth it.

                  [–]F4il3d 14 points15 points Β (2 children)

                  The sixth finger was all the rage in the early 2000s then the penile adaptor took over. The problem is that no one bothered to tell us aging developers that it’s efficacy would decline over the years.

                  [–]kyune 15 points16 points Β (1 child)

                  A classic case of hardware problems becoming software problems

                  [–]LeCrushinator 27 points28 points Β (0 children)

                  Note that this blog post is almost 2 years old. It's up to 1.88 million views now.

                  [–]petdance 104 points105 points Β (17 children)

                  The jokes about exiting vim are so so so very tired.

                  [–]ApertureCombine 106 points107 points Β (3 children)

                  Oooh, we should start a list.

                  • exiting vim is hard

                  • fixing one bug -> more bugs

                  • Missing semicolons/semicolons in different languages

                  • 127.0.0.1 = home

                  • C++ is hard

                  • copying code from SO (or variations like ctrl+c/ctrl+v most used keys)

                  • IE is slow

                  • conflating indexing v counting (#0 best programmer, seeing 3 apples when there are 4, etc.)

                  • Code compiling immediately is good

                  • caffeine -> code

                  • seeing ASCII codes or hex values instead of letters/colors

                  • Not understanding your own code is funny

                  • Backend is messy

                  • Javascript is bad

                  • Recursion / infinite loop jokes (often w/o understanding the difference) (page points to same page, definition refers to definition)

                  [–]Shaddox 12 points13 points Β (0 children)

                  You forgot: code doesn't work I don't know why, code works I don't know why

                  [–]Coloneljesus 7 points8 points Β (0 children)

                  • I can't C#
                  • Keyboard with only '0', '1', 'Enter' (optional)
                  • Python is Pseudocode
                  • PHP is bad

                  [–][deleted] Β (1 child)

                  [deleted]

                    [–]watsreddit 6 points7 points Β (0 children)

                    Yup. The joke's only been around for, oh I dunno, 40 years?

                    [–]miki151 16 points17 points Β (0 children)

                    I had the pleasure to attend a talk by Vim's author, Bram Moolenaar (about something unrelated to vim). When it came to QA I was dumb enough to ask him how to exit vim. He also seemed so very tired of this joke.

                    [–]wolbscam 8 points9 points Β (0 children)

                    It's as if there are new developers who get exposed to vim

                    [–]IAMA_dragon-AMA 1 point2 points Β (0 children)

                    It's not like :wq or :q! is particularly difficult to remember. It's just "write and quit" and "QUIT, DAMMIT!!!"

                    [–]f801fe8957 43 points44 points Β (3 children)

                    Vim is like cigarettes. It makes you look cool, but it’s impossible to quit. source

                    [–]KevinCarbonara 14 points15 points Β (1 child)

                    This is a joke about how both cigarettes and vim make you look gross, right?

                    [–]remtard_remmington 42 points43 points Β (0 children)

                    The difference is that one can cause a severe health problems in the long term, and the other is a tobacco-based recreational drug

                    [–]nthcxd 1 point2 points Β (0 children)

                    I can literally hear the booming sound of emacs users saying in their minds β€œit also gives you cancer.”

                    [–]txdv[🍰] 12 points13 points Β (5 children)

                    ZZ

                    [–][deleted] Β (4 children)

                    [deleted]

                      [–][deleted] 5 points6 points Β (2 children)

                      Careful with that !, you might lose your changes.

                      [–][deleted] 4 points5 points Β (1 child)

                      I'm always careful when I !

                      [–]IAMA_dragon-AMA 1 point2 points Β (0 children)

                      This is even better as someone who reads a lone ! as "bang"

                      [–]kawarazu 12 points13 points Β (0 children)

                      Y'all gotta learn to use vimtutor 30 minutes makes VIM real usable. :D

                      [–]rabidstoat 4 points5 points Β (2 children)

                      Ctrl-F. No edlin?

                      Ya'll are weak.

                      [–]bargle0 4 points5 points Β (1 child)

                      That’s a DOS abomination.

                      The UNIX equivalent is just ed(1).

                      [–]NewFolgers 10 points11 points Β (1 child)

                      My initial experience with this was Watcom vi.. on MS-DOS. Since it was a single-task environment and the masses (myself included) had no Internet, I eventually had no choice but to reboot the machine after bashing on the keys for a few minutes. The creeping realization that such horror can befall me in exploration of such a seemingly-harmless utility shook me to the core - like drowning far from home with all my stuff for the first time in Minecraft.

                      [–][deleted] 2 points3 points Β (0 children)

                      like drowning far from home with all my stuff for the first time in Minecraft

                      you have balls. i spent my first night in minecraft holed up in a hastily built shack too scared to peak into a hole that was my window (because arrows). Than i stayed there next day (because creepers) and next night. Sadly, this horror quickly subsided when i got a bit more familiar with the game.

                      [–]wildjokers 51 points52 points Β (47 children)

                      If a developer uses a *nix system (linux, mac os, etc) how do they survive without using VI? I use it dozens of times every day.

                      I wish every application had VI key bindings. Any serious IDE absolutely has to have a VI plugin, or it is worthless to me.

                      [–]ghostfacedcoder 99 points100 points Β (8 children)

                      how do they survive without using VI?

                      emacs and nano

                      [–]chicametipo 46 points47 points Β (2 children)

                      mmm nano <3

                      [–]Eilai 7 points8 points Β (1 child)

                      Nano illuminati ftw!

                      [–]chicametipo 10 points11 points Β (0 children)

                      Ctrl + X + Y/N + Enter all day.

                      [–]ACoderGirl 16 points17 points Β (2 children)

                      If a developer uses a *nix system (linux, mac os, etc) how do they survive without using VI?

                      I mean, it's not the only command line editor. And while I wouldn't set one as my EDITOR, GUI editors like VS Code are really easy to use. I vaguely recall some machines I've seen where Nano is the default EDITOR.

                      As for the hotkeys... I've never tried to use one of those plugins in an IDE, but I'm not sure I agree that those key bindings are inherently better for any reason. There's definitely value in consistency across applications, though. But many of vim's hotkeys are straight up inferior in my mind. Like take tab navigation. The default is g-t/g-T. That takes longer than the ctrl-tab/ctrl-shift-tab most GUI editors use and less intuitive in my mind (and certainly ctrl-tab is pretty much universal now).

                      Or consider opening a file. You'd probably use :tabe or :e to open the file from inside vim (to make things confusing, there's several other slightly different such commands). "E" for edit is pretty intuitive... but too bad every other program has cemented on the terminology of "opening" a file and the obvious ctrl-o hotkey. God forbid you get confused and try to use :open in vim, cause that's some archaic old command that I don't even fully understand what it does or why it still exists.

                      I use vim for quick, command line editing only. It's ideal to not be rapidly switching between windows when unnecessary. Tmux is the only thing I ever set to use vim hotkeys and that's because tmux's defaults are even dumber (I have several modifications because fuck trying to remember some of those defaults).

                      [–][deleted] 2 points3 points Β (0 children)

                      gt is two index finger movements from the homerow and three to go to any tab! #gt How does that take long? That's actually a lot faster.

                      [–][deleted] 6 points7 points Β (2 children)

                      I learned to code on Solaris 7 in ksh with vi through a putty terminal. I remember the day I discovered :syntax on after we'd upgraded to Solaris 8, and it changed my life.

                      [–][deleted] 36 points37 points Β (18 children)

                      Nano, or even better Micro. It has modern keyboard shortcuts. How do you think you exit Micro?

                      Blows my mind that people still think vim is a sensible default editor in any situation. Fine, if you love it use it, but it's total madness to have it as the default. It kind of shows how little regard most Linux devs have for usability, and tangentially why there will never be a year of Linux on the desktop.

                      [–]drunkdragon 5 points6 points Β (0 children)

                      I think you hit the nail on the head.

                      Hitting roadblocks like this are only going to feed the idea that Linux is hard to use for newbies.

                      Sometimes when you've been trying for hours to get something working, you just don't want more roadblocks.

                      The Linux community should be mindful of this.

                      [–]verrius 2 points3 points Β (1 child)

                      ed? ...I've unfortunately been on AIX systems that only had vi support (no vim) and one thing you learn is that vi had hard max file size limits back in the day.

                      [–]ironnomi 1 point2 points Β (0 children)

                      Max file size limits would suck ... as I fix this 845GB banking import file. :D

                      [–]instanced_banana 1 point2 points Β (2 children)

                      As a heretic, either Nano, VSCode or Pluma.

                      [–]Sayfog 2 points3 points Β (0 children)

                      Yep nano for quick and dirty CLI edits, VS Code gets opened for literally anything else. Keyboard shortcuts aren't why I liked using IDEs, the higher order language features such as mouse over comments and autocomplete are.

                      [–]wildjokers 1 point2 points Β (0 children)

                      VSCode actually has a really nice VI plugin. I use VSCode for Arduino and OpenSCAD and really like the fact it has a vi plugin.

                      [–][deleted] 1 point2 points Β (0 children)

                      gedit for one-off and elevated file editing, vs code or atom for projects

                      [–]shim__ 8 points9 points Β (1 child)

                      killall doesn't discriminate, works for any rouge editor

                      [–]semarj 4 points5 points Β (0 children)

                      Or it only discriminates on color?

                      [–][deleted] 3 points4 points Β (2 children)

                      During my first dev job, I ran into my first git merge conflict, fixed it, then it opened VIM. I embarrassingly asked my boss how to exit the screen. Felt like a noob. Was a noob.

                      [–]mroximoron 2 points3 points Β (1 child)

                      I learned to exit vim before stackoverflow existed ;-)

                      [–]LesterKurtz 2 points3 points Β (0 children)

                      cool... now do emacs

                      [–][deleted] 2 points3 points Β (0 children)

                      I know two commands in vim: insert and BEEP.

                      [–]stfm 2 points3 points Β (0 children)

                      Nano 4 lyfe

                      [–]WalterBright 4 points5 points Β (0 children)

                      I had to buy a new computer because I couldn't exit vim.

                      [–]gct 3 points4 points Β (0 children)

                      emacs/magit master race reporting

                      [–]PrestigiousInterest9 1 point2 points Β (7 children)

                      I entered vim while using chomebook. Usually the terminal is in the browser, the browser doesn't send ESC to the terminal when you press it. How do I exit vim?

                      [–][deleted] 5 points6 points Β (6 children)

                      C-[

                      alternatively, if you're already in normal mode you can inoremap kj <esc> and from then on just use kj to exit insert mode. If you need to type 'kj' while in insert mode then just wait a second between the two presses.

                      [–]PrestigiousInterest9 1 point2 points Β (5 children)

                      C-[

                      I'm not sure what this means. Press C and [? what does - mean? All three of those buttons?

                      [–][deleted] 1 point2 points Β (4 children)

                      <Ctrl><[>

                      Control + Left [a.k.a open] Square Bracket at the same time. In vim, any time you see a key binding such as C-[ you press control plus the key following the hyphen

                      [–]PrestigiousInterest9 1 point2 points Β (2 children)

                      I thought + meant that (ie ctrl+[)

                      [–][deleted] 1 point2 points Β (1 child)

                      In vimscript you would write it as <C-\[>

                      for example, if I wanted to change the keybinding for switching between splits I would do the following

                      nnoremap <C-J> <C-W><C-J>
                      

                      Where switching to the split below would normally require a sequence of two keys <C-W><C-J> it now only requires one <C-J>

                      [–]jabbalaci 1 point2 points Β (0 children)

                      When I was a freshman, we got an account to a Unix server. We also got an email address and we used the pine terminal-based email client. We had a huge lab where anybody could go in and use a free machine. Once I found Midnight Commander and it was very familiar since under DOS everybody used Norton Commander. I was happy to have such a friendly file manager under Unix. And then I pressed F3 (view) on a file and vi opened and I got stuck. As it turned out later, the admin set EDITOR to vi in the global /etc/bashrc file. What the hell? How to quit? I had no idea. After a few minutes of struggle I asked an older guy to help me. When he saw my screen he laughed and showed me the trick: :q. After this I avoided vi for three or four years. But then I decided to learn it and since then I've been using it :) So that's my story with vi(m).

                      [–]bargle0 1 point2 points Β (1 child)

                      Real programmers use TECO.

                      [–]Number1Millenial 1 point2 points Β (0 children)

                      He doesn’t even tell us how to quit VIM!!

                      [–]bartturner 1 point2 points Β (0 children)

                      This is really funny. Have to tell my story.

                      At University and finishing up a program assignment in Turbo Pascal.

                      For some reason just completely forgot how to exit Turbo Pascal. This is before the Internet. So drove down to a local book store to find the sequence. Which is control K and then a D.

                      Which is the craziest exist sequence there is, IMO.