Read more

Some useful vim settings

Tobias Kraze
February 13, 2017Software engineer at makandra GmbH

Below is a list of some VIM settings I find useful. You can add them to your .vimrc.

source $VIMRUNTIME/mswin.vim                 " adds Ctrl-X, Ctrl-C, Ctrl-V; block visual mode is now Ctrl-Q
behave mswin

set autowriteall                             " autosave all files when a buffer is closed

set backupdir=~/.temp                        " dont pollute local directory with swap file, backup files etc
set dir=~/.temp

set undofile                                 " enable persistent undo
set undodir=~/.temp

set encoding=utf-8

set expandtab                                " replace tabs with spaces
set shiftwidth=2
set tabstop=2

set fileformats=unix,dos                     " prefer unix linebreaks, but also support DOS linebreaks

set guioptions-=T                            " remove toolbar in UI mode

set ignorecase                               " search is case insensitive, unless you use upper case characters
set smartcase

set scrolloff=2                              " start scrolling when you get close to the top or bottom

set textwidth=0                              " dont automatically insert linebreaks

set wildmenu                                 " show a menu in the status line when tab-completing commands

set history=500                              " longer history for : commands

set showbreak=↳\                             " nicer line wrapping, preserving indentation
set breakindent

set mousefocus                               " autofocus windows on hover

au FocusLost * silent! wa                    " save all buffers when vim loses focus

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot
Posted by Tobias Kraze to makandra dev (2017-02-13 11:16)