Basic Vim Setup on Fedora
Vim is probably one of the first things I configure when logging into a new machine. While there is a lot of flexibility with regards to the configuration of a Vim setup, I tend to find myself just getting the basics going first - at letting it grow from there.
I do use a custom dot files setup for my “regular” working setup, however, this has not been something I’ve actively maintained for a some time - and consequently, it can take a bit of effort to now get it running on a new machine. On the to-do list for a rainy day.
So first things first, better make sure that we have the latest and greatest version of Vim installed.
1sudo dnf install vim
For Fedora, this seems to have pulled down a package called vim-enhanced
.
Next, we’ll want to the system to actually use Vim whenever it can.
1echo 'export EDITOR=vim' >> ~/.bashrc
Finally, we’ll configure an extremely minimal - but useful - .vimrc
file.
colorscheme default " The default colorscheme is usually a good baseline for me
syntax on " Syntax highlighting will make working with common file types a lot nicer
set autoindent " Enables auto-indenting
set expandtab " Converts <tab> to <space> characters (personal preference)
set hlsearch " Enables highlight search
set relativenumber " Enables relative line numbers (I find these more practical than traditional line numbers)
set softtabstop=4 " Sets the soft tab stop to 4 spaces
set tabstop=4 " Sets the tab stop to 4 spaces
This is usually “good enough” to have a functional editing environment, which can then be used to configure the rest of the system.