What's your minimal .vimrc file if you have a new machine or are in a VM?
There are many things you can put in a .vimrc file, I can remember having a very large one with lots of ascii art on it.
As I've got older I've preferred a quite minimal setup, I spend a lot of time in "configuration land" and I try to stick with as many defaults as I can.
This is my minimum .vimrc file that I like:
inoremap jj <Esc>
set number
set relativenumber
let &t_SI = "\e[6 q"
let &t_EI = "\e[2 q"
syntax on
colorscheme koehler
set ignorecase
It's not much.
There's probably more things I could put in. There's probably things I could take away.
inoremap jj <Esc>
I like this one, escaping from insert mode takes a lot of hand movement compared to just typing "jj", e.g. you could press escape which is abit of a finger stretch. Ctrl + C is another option.
Pressing "jj" is easy!
set number
set relativenumber
I like having numbers along the side, it helps with orientation in a file. Combine this with relativenumber and I'm able to do more accurate commands between lines, e.g. 12j, or 34k or block vision mode with ctrl + I which functions like a multi-cursor. I get the current line which the cursor happens to be on with this combination so I know which line number I'm on.
let &t_SI = "\e[6 q"
let &t_EI = "\e[2 q"
I like knowing the difference when looking at the cursor whether its a line for insert mode or a block for normal mode (the default is a solid block for both insert and normal mode). The above lets this happen.
syntax on
This allows for the highlighting in different colors for syntax in programming languages, this is included in vim, this makes sure it's switched on.
colorscheme koehler
Ok, this one might not be needed. I like this scheme as the color contrast is very sharp, but this might not be everyone's up of tea (might not be everyone's preference for the American reader).
set ignorecase
I like this one as it allows search to be case insensitive which I prefer when searching in vim with '/' or '?'.
This list does not include plugins, there are many vim plugins which I like but it requires extra steps to install them, over the years I've tried to get used to the defaults of things so I spend less time in configuration land.
Vim plugins I like are nerdtree (this gives you a sidebar for file navigation), ale (this gives you diagnostics, fixes and linter support). I used to be into vim wiki as well but I think that may have gone out of fashion, I think the avalanche of note taking apps may have contributed to that.
Would love to hear if anyone else has a minimal .vimrc setup!
0 positive reactions
Reactions are optional and use an anonymous browser cookie. Remove your reaction with the same button, or clear this site's data in your browser. See Privacy.