1. 28
  1.  

  2. 10

    This is basically my stance towards vi/vim too. But whenever possible, I prefer vis over “regular” vi, since it’s smaller and faster than vim, but has those few features like text objects and macros I really would miss in nvi.

    1. 3

      Yes, vis is great especially for things like multiple cursors, structural regular expressions, treating newlines like any other characters and much more.

      1. 1

        I’ve been using vis as my main editor for probably about a year now. I don’t miss Vim (Neovim specifically) at all. Everything feels so much more simple and manageable, and I can make up for any missing functionality with Lua.

      2. 3

        Not totally config-less but its not much for sure.

        % cat .exrc 
        set noautoindent
        set number
        set ruler
        set tabstop=8
        set wrapmargin=0
        
        1. 2

          I didn’t know whether in include my config in the article, but here it is:

          set all&
          set ruler
          set backspace=indent,eol,start
          set incsearch hlsearch ignorecase
          set bg=dark
          set et ts=4 sw=4 sts=4 autoindent
          filetype plugin indent on
          set hidden
          syn on
          nnoremap Y y$
          nnoremap <silent> <C-l> :nohl<CR><C-l>
          
        2. 1

          So when might I want a config-less editor? Genuine question.

          1. 3

            The article spends two paragraphs on this…

            1. 6

              The thing is that the article is predicated on the assumption that the editor you use has to be on the system where you’re editing the file. If there are constraints preventing you from setting the system up as you want then you just have to use what’s on the system. If that’s vi, then you use vi. If it’s another editor then you use that. End of story.

              But if there are no constraints preventing you from running an sshd on the system, then you can use the emacs on your laptop, with your entire config, to access its file system using tramp and you don’t have to feel like you’re editing with one hand tied behind your back.

              Maybe I should have phrased my question, given the choice, when would I want to choose to use a config-less editor?

              1. 3

                Hello bon, here are my answers to your questions, I hope they are helpful.

                If there are constraints preventing you from setting the system up as you want then you just have to use what’s on the system. If that’s vi, then you use vi. If it’s another editor then you use that. End of story.

                Constraints are certainly one reason why I use vi on remote systems (I don’t always have sudo access :)), but sometimes I also just don’t want to take the time and put in the effort of installing my personal configuration of Emacs. Knowing how to use vi certainly releases some of the “pressure” of transferring my config directory: I just go “meh”, use vi, and I’m happy.

                But if there are no constraints preventing you from running an sshd on the system, then you can use the emacs on your laptop, with your entire config, to access its file system using tramp and you don’t have to feel like you’re editing with one hand tied behind your back.

                I don’t like Tramp in Emacs for two reasons. The main reason is that Tramp assumes that I know which file I want to edit, but very often when I’m on a remote system, it’s because it’s a server that’s misbehaving and I’m looking around for the issue. I want to be shelled into the machine and use all the Unix tools that I’m used to to find the problem: find, grep, htop, lsof, etc. I don’t know yet which file I want to edit, I’m still just fishing around for it.

                Once I find some candidates, I want to inspect them, determine if they’re what I’m looking for, and perhaps edit them. If I’m using the editor on the remote machine, that’s done really quickly. With Tramp, I need to switch from the ssh terminal to my Emacs window and try and remember the syntax for opening a remote file—that’s my other reason for not liking Tramp, I always forget its syntax—before I know if that file was interesting or not. That cuts into my flow, and so I don’t like to use Tramp.

                1. 2

                  With Tramp, I need to switch from the ssh terminal to my Emacs window and try and remember the syntax for opening a remote file—that’s my other reason for not liking Tramp, I always forget its syntax—before I know if that file was interesting or not. That cuts into my flow, and so I don’t like to use Tramp.

                  What do you mean with “syntax”? It’s just a regular C-x C-f and then /ssh:[ssh alias]/ [RET] and Tramp is turned on. Ivy even let’s me just type /ssh: and choose a host. You can even use eshell, and just type cd /[host]: and it’s the same as above. My issue is rather that it’s often too slow for a quick edit (as you mention), since Tramp has a bit of an overhead, due to all the data being transfered in base 62.

                  1. 2

                    If the remote system is running sshd, you can also use sshfs to mount the remote filesystem on your development machine. Probably not worth it to edit a single file, but it does make it easy to use any editor you like, along with any other tools you have on your development machine which aren’t on the target (Can do some exploration to find the file to edit, but that will depend whether exploration consists of looking inside various files and directories or also involves running executables on the remote machine). It’s also handy for things like using a visual diff tool to compare a remote file or directory with a local file or directory.

                    1. 2

                      The main reason is that Tramp assumes that I know which file I want to edit, but very often when I’m on a remote system, it’s because it’s a server that’s misbehaving and I’m looking around for the issue. I want to be shelled into the machine and use all the Unix tools that I’m used to to find the problem: find, grep, htop, lsof, etc. I don’t know yet which file I want to edit, I’m still just fishing around for it.

                      As @zge mentions (and I think is important enough to reïterate), this is actually possible with Tramp: you can shell out with M-!, and run eshell, and everything just works as you would want. There’s no need for an ssh session in a terminal emulator at all, because emacs can handle it.

                      As a practical matter (again, as @zge mentions), the performance is not necessarily as great as it could be. Still, it’s pretty powerful & it’s very often useful to me.

              2. 1

                I routinely install emacs on machines (they’re rebuilt daily) and just fire it up and use it with no extra configuration beyond defaults. If I am going to be using it for a while, I’ll turn on ido-mode (if I remember) and xterm-mouse-mode (so I can scroll with the mouse mostly ;), which I just do with a quick ctrl-x.