Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Am I the only one using vanilla vim with a minimal configuration file (<50 lines)? I set tabs to 4 spaces, put syntax highlighting on, set background to dark, add fuzzy finding, and configure netrw (default file browsing).

Very easy to setup. Moreover, when I'm on a different computer and open (vanilla) vim without any configurations. I know that everything is more or less the same as my default vim environment. I think it's not that hard to learn developing in the default vim environment, with some minor tweaks.

Also related, How to Do 90% of What Plugins Do (With Just Vim): https://www.youtube.com/watch?v=XA2WjJbmmoM



I can’t use vim at all without at least vim-surround. Too much muscle memory for the bindings for that one.

I was absolutely thrilled to find that VSCode’s vim emulation included vim-surround! I guess someone out there has the same problem I do.

So much programming is editing various text surrounds: parents, braces, brackets, quotes of various flavors.

I also really like having semantic completions. I get by with YouCompleteMe, but it’s a little jank in my build system.


No. I've been dragging my small (106 line) .vimrc around pretty much unchanged for at least a couple of decades. It's mostly just setting different colour schemes for different filetypes. I've been a vi user for about 4 decades.

I need a small, fast text editor that works over remote connections, works on Linux and Windows, needs no configuration or plugins to be useful, and just works and gets out of my way. VSCode does not fulfill most of those needs. Plain old vim (and not neovim) does.


I really think this is the best way to use it for many people. You need something more complex? It's ok to bundle vim with any of great IDE's out there.

I learned how to change colorscheme more than 20 years ago because my CRT monitor made it impossible to read comments on default themes. I use same command today on my local terminals, bastions accessible via web or remote sessions ... for basically the same reason.

If you code from one machine spending time to set up IDE and then leaving it be makes sense. But if you are more of an admin, or learn a lot and jump from host to host, from learning platform temporary environments to cloud environments, from mobile to some remote mainframe that is being decommissioned for past 7 years? You could just figure out how to change 2-3 basic options and have a predictable environment for next few decades.


I’m at home on vanilla vim, but there are some quality-of-life stuff I’ve been collecting over the millennia that are just too good to give up on my day to day use. One has to find its own balance of custom vs default.


I do roughly this too, except my vimrc is about 8 lines. I type it out from memory every time I use a new machine.


Would you mind sharing it? Im just getting to grips with vim so any pointers towards some simple improvements would be much appreciated.


Sure:

  set ts=4
  set sw=4
  set softtabstop=4
  set expandtab
  set hlsearch
  set incsearch
  set wildmode=longest,list
OK, only 7 lines then :)

Basically: tabs are 4 spaces, searching works better, and tab completion works like bash.


Oh no, I need at the very least timeoutlen, visualbell and line number. I type that manually when I SSH if I must. Don't want to wait for ESC, no beeps at all and I wanna know where I am on the document.

And lots more is needed for decent Vim IMO. smartcase, set hidden, etc.


I read that most people only use about 10% of vim's features, but everyone uses a different 10% :)


relativenumber is essential too, unless you like typing something like d-638-<Shift>-G just to delete 15 or 20 lines of text.


I actually think lack of line numbering is essential, because I quite frequently want to select blocks of code with the mouse and yank into the clipboard.


That is true, but you can integrate tmux and vim with the system's clipboard. Then again, :set nu! is easy to type.


Thank you!


Take a look at the vim-sensible plugin. No need to install it, just see what the generally agreed sensible settings are.


Most of vim-sensible is already default or equivalent on Neovim, fwiw.


I worked this way for ages, but over time I came to appreciate some modern IDE-like conveniences like linters (I use ALE for this stuff). Especially thanks to LSP (which neovim supports natively, though I stick to upstream Vim myself) you can get a lot of value from these.

I think it's easy to go overboard though. A lot of plugins (and these meta-plugins) provide little value over what vim can do on its own with a little configuration.


Neovim isn't exactly downstream. It's a hard fork from ten years ago. They've gone their separate ways for a long time


There is always people coming over from established purpose made IDEs who want to test to waters and bare vim is pretty feature parse out of the box, so these huge plugin & configuration monoliths offer easy stepping stone into vim.

Of course with these packages you are trading flexibility for features and you are inheriting ways of working from someone stranger, but it is not that much different than using any IDE. While this offers a nice(r) gate into vim-ming it does kind a miss the biggest perk of using vim - which is molding it to your exact needs and preferences, but that is not something you will do over night. I have been in both camps. I have installed way too many plugins and then gone to very sparse configuration. I think with NeoVim I have found somewhat of a balance, but I think reworking your vim config is a natural thing every five years or so. We grow as people and developers and our needs change and the tools evolve.


I have a one-line vimrc, mainly to undo the damage the change in defaults vim 8.0 brought (so I've got things like set t_BE=). I used to have to also have set noincsearch and set scrolloff=0, but something in my environment seems to been upgrade so I no longer need that in my vimrc


You're not the only one, but my configuration is the opposite of yours.

These are the three lines I always use on any vim install.

    let loaded_matchparen = 1

    syntax off

    map ; :
The first two lines are crucial, because I find rainbow colored text and flashing punctuation extremely distracting. If you find monochrome code unreadable, then that's a problem with your formatting style that you can easily fix.

The last line is really handy for not having to hold down shift so much.


Not at all. This boring answer is very useful for general use. I have some fun plugins that have been useful (YouCompleteMe was helpful for C development) but they break and I don't notice. But at work someome else maintains an IDE for me, so I use that.


Nothing says someone doesn't grok vim like a permanent nerdtree pane.


It helps though with remembering where you are in your codebase. Rather than cluttering my brain with the info that Nerdtree provides, I can instead use the extra brainpower for other things.


Yeah I've been using vim with just a custom theme and a fairly vanilla .vimrc for 20 years. I just copy it around with me. These posts always make me feel like I'm missing out.


I use neovim for my development. It has a bunch of plugins to facilitate using it as my primary code editor. I don't particularly enjoy typing things out over and over again (I have RSI) so to me a config that doesn't have things like autocomplete aren't going to be acceptable to me long term. LSP also makes it easier for autocomplete to function with the context of your development environment, which allows me to type even less.

I'm not going to sacrifice my 95% use case for the 5% of time (probably even less) that I am in a situation where I don't have access to my own config. If I am just editing a few lines in a config file on a server, it doesn't really matter that I don't have my config.

With that being said, not everyone wants or needs plugins and their needs are different from mine. Do what serves your needs. I would simply advise anyone to consider if their workflow is serving themselves or not. A lot of people get stuck in the mindset that they need to simplify in order to facilitate easy transitions to situations that just don't come up all that often.


With less plugins and less custom configuration it becomes much easier to work in environments outside your home. Also it is more robust and less things break!


You're not, mine is only 10 lines and no plugins.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: