" Use VIM improved mode set nocompatible " Ensure we work with Unicode set encoding=utf-8 scriptencoding utf-8 " Disable VIM's startup message set shortmess+=I " Number of remembered undo steps set undolevels=1000 " Ensure the XDG variables exist even when `vim` is started " outside a login shell (e.g., from a desktop launcher) let $XDG_CONFIG_HOME = get(environ(), 'XDG_CONFIG_HOME', $HOME . '/.config') let $XDG_STATE_HOME = get(environ(), 'XDG_STATE_HOME', $HOME . '/.local/state') set runtimepath^=$XDG_CONFIG_HOME/vim set runtimepath+=$XDG_CONFIG_HOME/vim/after " Set environment variables for convenient usage let $RC = expand('$XDG_CONFIG_HOME/vim/vimrc') let $RTP=split(&runtimepath, ',')[0] " Make :!cmd use `bash` and load the shell aliases set shell=/bin/bash let $BASH_ENV = expand("$XDG_CONFIG_HOME/shell/aliases") " Detect the file's type and load the corresponding plugin and indent files filetype plugin indent on " Enable syntax highlighting syntax on " Configure tab behavior set expandtab " Insert spaces instead of tab characters set tabstop=4 " Width of an existing tab character set shiftwidth=4 " Width of one >> or << indent step set softtabstop=4 " Width inserted/removed by and set shiftround " Round indents to a multiple of shiftwidth set autoindent " Keep the previous line's indent on a new line vnoremap >gv vnoremap