1. 14

  2. 2

    The directory browser that ships with vim is not particularly intuitive and ships with a wealth of features I will most likely never use. I get the sense that many developers just blindly install a shiny plugin without understanding what netrw can do. Sure, netrw is not perfect but less dependencies in my life and striving for simplicity is a good thing.

    It’s okay to use plugins if it’ll make your life better, even if you can manage to the same things in an unintuitive way without it.

    1. 3

      Clearly, yes, but there’s also value in keeping your configuration small and easy-to-maintain. Also, in being able to use computers you haven’t extensively customized.

      I know that you lean heavily into “programming” your environment with AutoHotKey etc., and I know there are advantages to doing it that way. Me, I started out doing sysadmin stuff, so being able to use a “stock” computer was important to me - and I’m trying to keep maintenance work down so that I can do more “fun” stuff.

      1. 2

        Oh, totally agreed! There is significant value in keeping your setup minimalist, and I know I’ve given up a lot of good stuff by customizing so heavily. Whenever I have to SSH into an AWS instance it’s miserable. And I can only afford to customize so much because I’m independent and use only one computer.

        I mostly push back because a lot of online vim communities turn it into almost of a moral thing: ultraminimalism is The Right Way and heavily customizing is Wrong. You see this sentiment a lot on r/vim, esp with -romainl-, and to my understanding it’s also infected the vim IRC. The world is big enough for both of us.

        1. 1

          ultraminimalism is The Right Way and heavily customizing is Wrong

          Not specific to vim, but there is a big advantage in discouraging customisation among your core userbase: it encourages you to get the defaults right. This is a problem that a lot of open source programs suffer from: you end up with a load of customisation potential and all of the long-term users have a setup that is very different from new users. New users struggle to get the thing to work because they haven’t accumulated the massive set of configuration options that everyone who uses the program seriously has built up over the years.

          I keep reading about how amazing neovim is, but when I spent half an hour trying to follow some instructions from someone who had an (apparently) amazing config and gave up. It doesn’t matter to me that it can do all of these amazing things if I can’t figure out how to make it to do any of them.

          1. 1

            Isn’t that more of a second-order knowledge gathering (project level) and/or experience transfer problem (social level)? The developer has provided a set of features believed to be useful or at least interesting, yet does not follow up to learn how they are actually used or baked into a workflow as a step to provide presets that can be added to/subtracted from and taught. The users react to this by creating ad-hoc exchanges with low visibility/poor discovery/upstream desynchronisation and a lot of other problems.

    2. 1

      My file browsing needs are mostly fulfilled by ls/cd when I’m outside of neovim in a tmux split and with fzf — when in neovim. I even have the following alias which I almost exclusively use to start a new neovim instance:

      alias vimz="nvim +Files"

      I wish there was a way to replace directory listing in neovim with fzf somehow so vim ./dir / :e ./dir opens up nvim +'Files ./dir'

      1. 2

        I wish there was a way to replace directory listing in neovim with fzf somehow so vim ./dir / :e ./dir opens up nvim +‘Files ./dir’

        Pretty sure that’s possible as dirvish does it. Looks like it just hooks in to the BufEnter and WinEnter autocmd from a quick look (I think?) And Netrw is also just a plugin: it’s just shipped by default with Vim.

        1. 1

          Indeed, thanks for the hint!

          function! s:isdir(dir)
            return !empty(a:dir) && isdirectory(a:dir)
          augroup dir
            " Remove netrw and NERDTree directory handlers.
            autocmd VimEnter * if exists('#FileExplorer') | exe 'au! FileExplorer *' | endif
            autocmd VimEnter * if exists('#NERDTreeHijackNetrw') | exe 'au! NERDTreeHijackNetrw *' | endif
            " Open fzf for directories
            autocmd BufEnter * if !exists('b:dir') && <SID>isdir(expand('%:p'))
              \ | let b:dir = 1
              \ | exe 'Files ' . expand('%:p')
              \ | endif
            " Automatically close fzf buffers
            autocmd BufLeave * if exists('b:dir')
              \ | bdelete
              \ | endif
          augroup END
      2. 1

        I once encountered a bug in Netrw, and I looked at the source to see if I could fix it. It was bad enough that I just stopped using Netrw altogether.

        I’ve been using dirvish for a few years. I don’t really use sidebars (or windows in general), but it allows me to do vim . or :e . and then browse files like that, which I find rather convenient.