1. 11
  1. 8

    If you can handle learning Vim then very little else about using GNU/Linux is going to be painful by comparison ;-p

    1. 6

      Haha, I like to think of learning Vim like this:

      Beginner Vim: there are so many commands to memorize!

      Intermediate Vim: Everything fits together so beautifully!

      Advanced Vim: Why are -es and -Es different flags? Why are there separate select and visual modes? Why is the syntax highlighter so janky? Why does undo work normally while recording a macro but undoes the entire thing while in the middle of replaying a macro? What the heck is up with Vimscript? Why is Z only used for ZZ? What’s U even FOR?

      1. 2

        Why is Z only used for ZZ?

        It’s also used for ZQ, which is equivalent to :q!

        1. 1

          Yeah, Vimscript is the part of vim that the longer you spend with it, the more glaring the problems and inconsistencies become

      2. 6

        I like when people make their subheaders their points. Makes it easy for me to do this:

        It’s yours to configure

        Emacs literally gives you a high-level programming language to use to mold the editor into whatever you want it to be. And before you say Emacs Lisp isn’t very widely used outside of Emacs, what else uses Vimscript?

        Familiarity in an alien place

        Emacs is marginally less alien than Vim, but it’s still its own little world with its own conventions and words, but the main idea is that Emacs can be used to interact with just about anything. The a-ha moment for Emacs is realizing that it’s a generic UI construction kit based around the notion that everything can be represented as text, so strong text manipulation gives you a strong UI metaphor and an overall powerful environment.

        Building a mentality

        Again, Emacs does this: Emacs is the UI builder, text is the UI element, and Emacs provides strong text manipulation as a basic building block.

        … and I did read the actual text under the headers. Most of it is pretty congruent with what I wrote (that is, I restated a lot of his points using Emacs instead of Vim) except at the end, where he says:

        Vim is just a text editor. That is why it is so good at doing lot’s of stuff, because it’s such a clean and simple baseplate, it leaves so much room to play and invent new uses for it. The simplicity of Vim also means that you don’t have to jump through a billion hoops to let other programs talk to vim. want to pipe fzf into vim so you can fuzzy search and edit files quickly? Easy. Got a long command that is a pain to edit just on the main terminal? Well, open it in Vim and then run it. The fact that it inter-links with so much, means that the first bits of knowledge that a new user learns are useable in most situations.

        Emacs knows it isn’t “just” a text editor, but that it uses text editing as a UI concept to allow the user to do other things in a fluent, powerful fashion. Yes, fluent: Simple UIs often fail to be fluent, because simple UIs are usually built around making a few things very quick and hiding everything else, and making things impossible to configure because help systems tend to deviate from reality if something is configurable. (Except Emacs’ help system, of course.) Fluent UIs reward learning by allowing more advanced users to do more things by muscle memory, even fairly advanced things, which necessarily involves not hiding functionality. Progressive disclosure is in tension with fluency, in other words.

        And I circle back around, because both Emacs and Vim are fluent UIs. Vim is a fluent UI for editing text, whereas Emacs is a fluent UI for using text to do everything else.

        1. 2

          The difference between vim and emacs is that one of them you’ll find installed on servers and the other one you’ll find people embed web browsers in. Vimscript sucks and I love lisp but that and “UI construction kits” are not the reasons to tell a beginner that emacs is pertinent in their toolkit for exploring and interacting with linux systems.

          1. 4

            Developers vs sysadmins, I suppose: Developers (should be able to) configure their own environments and work as they want to, whereas sysadmins take systems as they find them or have to make them, and must take their environments as they are as well. That said, Emacs with Tramp is a powerful combination.

            1. 2

              Every developer must learn to administrate their system before they can use it to its full potential 😉

              1. 3

                One thing I’ve learned as someone who’s trained as a developer and has worked as a sysadmin is that administering your own system is very different from administering a whole bunch of systems which have their own constraints. Even if you don’t have cattle, going from one pet to multiple pets requires tools the casual sysadmin never needs.

            2. 4

              What many people don’t realise is that you don’t need to have emacs installed on servers. If you have it installed locally (on your laptop), and you have ssh access to the server, then you can merrily edit all files on the server, including as sudo, using tramp.

              This also has the advantage that you can have your emacs config set up as you like it on your laptop and don’t need to copy it around to servers for running them there.

              1. 2

                You don’t always have ssh access to the machines you want to work on. A great and simple example is a coworker’s machine.

              2. 3

                The difference between vim and emacs is that one of them you’ll find installed on servers

                But by that logic Vim shouldn’t have to be extendable, and instead provide the same UI on any installation. It should be something more like a (n)vi with maybe added syntax highlighting and multiple file support.

                1. 2

                  Vim shouldn’t have to be extendable

                  This was basically my point. Conversations about extensibility in this matter are pretty useless.

              3. 1

                a-ha moment for Emacs is realizing that it’s a generic UI construction kit based around the notion that everything can be represented as text, so strong text manipulation gives you a strong UI metaphor and an overall powerful environment.

                For me the “a-ha” moment was realising that Emacs is a lisp interpreter that has text editing as it’s side effect. UI construction seems (to me, at least) be derived from/secondary to this fact.

              4. 8

                These arguments kind of remind me of myself when I was learning *nix systems, and reflecting back on why and when I came up with them (using Arch, reading Unix mysticism, having little to no help, encountering OS problems with little to no real-life help) it seems to me as though they were sorts of self legitimisation, transforming weaknesses into virtues, as to defend my own choices against myself.

                Passages from this article, such as

                This elegant OS that seemed to have everything that I could ever want or need wrapped up in a shell environment.

                Read UNIX-HATERS if you want to re-think how elegant *nix systems really are. The thing is just we’ve just become immune to most of it’s peculiarities, that we stop thinking about them, even though we work with them all the time (just think of many peculiarities the shell has)

                It’s yours to configure

                I just point to http://www.islinuxaboutchoice.com/

                Vim is hard to learn.

                No, I’m sorry but it really isn’t. Vim is even easier to learn than vi, which has it’s peculiarities, but all you need to use vim is

                • i for insert mode, then use the editor like any normal editor
                • ESC for normal mode, then don’t do anything you don’t know
                • :q for exiting without writing
                • :wq for exiting with writing

                The rest, dd, y3w, yi(va(p (?), … can all be learned if and when you need it, making it optional. Search and undo is easy to learn, but most people don’t even think of macros as to use them.

                But if you tell yourself that it’s hard and mystical, then you can legitimise going through a phrase of inconvenience, where honestly nano or any other editor would have done it too.

                If you want to enjoy a hard-to-use editor, limit yourself to ed or sed.

                And so on. Hope you don’t take my words too hardly, it just reminds me too much of mistakes I have made in the past.

                1. 5

                  Vim is hard to learn.

                  No, I’m sorry but it really isn’t.

                  I’m firmly in this camp. After reading a sparse one page tutorial and using it for a minute you know what you’re doing wrong when it behaves differently from how you wanted it to. There are basically three failure modes: “forgot to enter insert mode”, “forgot to exit insert mode” and “I accidentally mashed some keys and I have no idea what vim just did, but I’ll just press u a few times”. It may be hard to get used to, but that’s not the same as hard to learn.

                  I’d add

                  • u for undo

                  to the list of basic things.

                  1. 3

                    An additional failure mode: you try to save with ^X^S. The ^X puts it in macro recording mode (?) which is confusing enough, but then ^S freezes the screen through software flow control…eventually you will remember that software flow control exists and type ^Q ESC to get back to a situation you can escape from. The time it takes to remember may be hours depending on how recently you have done this.

                2. 1

                  I’m a pretty experienced developer and I prefer sublime text or howl over vim or emacs. Send me your hate messages.

                  1. 3

                    Why?

                    1. 2
                      • I like to use a mouse to select text for copy/paste.
                      • I use auto formatters like clang-format, gofmt and cargo format and black when programming, so the editor is not relevant for that nitty gritty formatting of code.
                      • Code completion is pretty good and uniform nowadays due to language server protocol regardless of editor.
                      • I run compilation and other jobs via a terminal in a tiling window manager, so don’t use any editor functionality for that.
                      • I have an opinion that if a project needs automated navigation, the code is too complicated to follow mentally anyway.
                      • Sublime text multi cursor mode does most of what I would use macros for in other editors.
                      • Sublime text performs well.
                      • I haven’t really seen any compelling evidence of vim or emacs being more productive other than anecdotal word of mouth from people with possible biases. (On this note, I would love a really skilled developer to make a video demonstrating the benefits while working on a real project.)

                      The only time I use vim is when editing over ssh.

                      One day I hope to replace sublime and my minimal vim usage with an OSS GUI editor programmable with https://janet-lang.org/ , but don’t have time to write it.

                      1. 4

                        Generally, you don’t want to use Emacs because it’s a text editor, but rather because it’s a good work environment. My main reason for investing time into it, is that it’s just the most comfortable environment I have ever used.

                        I have an opinion that if a project needs automated navigation, the code is too complicated to follow mentally anyway.

                        How is this related to text editors?

                        1. 1

                          How is this related to text editors?

                          If someone is of the opinion that vim or emacs have better code navigation capabilities.

                          is that it’s just the most comfortable environment I have ever used.

                          I never found either particularly comfortable, not sure what I was doing wrong. I used vim for a year or two, and never really clicked, I did the emacs tutorial at least 3 times but never resonated with memorizing multi-key stroke hotkeys.

                          1. 2

                            If someone is of the opinion that vim or emacs have better code navigation capabilities.

                            No, not that I know of. That being said, the problem of “code navigation” is really more of an idea than related to a text editor. That means that anyone could come up with a good idea to elegantly or intuitively browse code, and if that already exists, implementing it for Emacs (and maybe even Vim) usually doesn’t turn out to be too much of a problem.

                            I never found either particularly comfortable, not sure what I was doing wrong.

                            First of all, Vim isn’t the environment. Vim is the text editor within the Unix-Shell environment. It is on this level that one should compare it to Emacs. And Emacs, on the other hand has a usable but not that spectacular default configuration. Setting up Emacs is (as much as I hate the analogy) a certain rite where you learn the editor, and the editor is taught to your needs. “memorizing multi-key stroke hotkeys” turns out to be nothing when it becomes muscle memory – “safe a file” just becomes a certain finger movement, with little difference to regular typing.

                            It is then, if you have chosen to invest some time, which might be a week or a year, that you get to enjoy comport (if you’re lucky ;^)).

                        2. 3

                          No hate messages from me but note that emacs can do all of these.

                          1. 2

                            Right, I’m just not convinced it does them that much better than many other editors.

                            I don’t quite understand why programmers really like emacs or vim. I tried both multiple times and wasn’t impressed with either of them enough to change what I already knew.

                            I would like someone to convince me, but I’m not sure i’ve seen anything particularly great before.

                            1. 3

                              I’m also in the sublime text camp, but I might be able to shed some light.

                              Having learned to use vim well is a huge sunk cost with substantial benefits in terms of speedy editing (multi-cursor usually replaces fancy commands, but can’t always). I couldn’t recommend someone start learning vim today, but I can definitely see the value in having learned it.

                              As far as Emacs goes - there’s an old joke that “Emacs is a great operating system that just needs a good text editor”.

                              Quite a bit of the value of emacs is that you’re expected to customize it to fit your personal ergonomics; it’s common to see it as the only thing running on a developers computer, managing mail/calendar/chat windows/code files/server processes/etc.

                              Because all of this stuff is running in a single, scriptable process with a high level language, it’s trivial to wire different parts together (eg “file emails from my project manager into my ‘work todo’ list”).

                          2. 2

                            You’re welcome to use whatever you feel most productive in. I’ll say though that I’m a big fan of Vim primarily because I can do all the text editing I want without my hands ever leaving the keyboard. The default keyboard shortcuts on all of the GUI editors I’ve used don’t really get the job done, and constantly having to take your hands off the keyboard, move to the mouse, click or select something, then back to the keyboard feels like swimming in molasses once you get used to Vim. That may be why it’s hard to see - you can’t really video what it feels like to have all of the movement keys committed to muscle memory and not have to think about grabbing the mouse.

                            IMO, an essential companion is tmux, which lets you tile things and switch between them arbitrarily, still without ever leaving the keyboard.

                            1. 1

                              I like to use a mouse to select text for copy/paste.

                              I’m pretty sure this works in Vim and Emacs, although a compilation flag may need to be enabled.

                              1. 1

                                Well, with Xorg when you select text you can use the middle mouse button (or shift-insert) to paste. Selected text is automatically added to the clipboard.

                                If you like multiple cursors, you might find vis interesting. I can see why you like whatever you’re using though, your reasons are fair enough.

                            2. 1

                              Eh. Personally, I don’t really care what tools other people use. It’s like worrying about what toilet paper brand your neighbor uses. It has no effect on me at all.

                              I think a lot has to do with how you build your mental model with the things that you’re working on. I never really gave a hoot about Emacs, until I started doing serious Erlang and Racket development. That’s not to say you can’t/shouldn’t/whatever use other tools to do that but for ME Emacs made me significantly more productive when I could twist my env to my modalities, instead of the other way around.

                              I find these ‘editor wars’ as tedious as Ford/Chevy and Chocolate/Vanilla. Who cares? Drive what you want and eat the flavor that you want. If you’re curious about what other people do and why, cool! It’s NOT on me ( or others ) to convince you… Convince yourself or don’t worry about it.