-
Notifications
You must be signed in to change notification settings - Fork 11
/
vimrc
54 lines (47 loc) · 1.96 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
set encoding=utf-8
scriptencoding utf-8
if v:version < 910
" Set default 'runtimepath' without ~/.vim folders
let &runtimepath=printf('%s/vimfiles,%s,%s/vimfiles/after', $VIM, $VIMRUNTIME, $VIM)
" What is the name of the directory containing this file?
let s:portable=expand('<sfile>:p:h')
" Add the directory to 'runtimepath'
let &runtimepath=printf('%s,%s,%s/after', s:portable, &runtimepath, s:portable)
let &packpath=&runtimepath
endif
" Use sensible XDG paths
set viminfo='1000,n$XDG_CACHE_HOME/vim/info
set directory=$XDG_CACHE_HOME/vim/swap//
set undodir=$XDG_CACHE_HOME/vim/undo//
set backupdir=$XDG_CACHE_HOME/vim/backup//
set spellfile=$XDG_DATA_HOME/vim/spell/en.utf-8.add
" Enable backups and undo
set backup
set undofile
set shiftround " round indent to multiple shiftwidth
set hlsearch " highlight search results
set ignorecase " ignore case when searching
set smartcase " when searching try to be smart about cases
set nowrap " don't wrap lines
set clipboard=unnamed,unnamedplus " merge clipboard with x11 and mac
set list listchars=tab:>-,trail:·,extends:►,precedes:◄ " indicate various special chars
set number " show line numbers ...
set relativenumber " ...and use relative style numbers
set cursorline " highlight line with cursor
set shortmess+=c " shut off completion messages
set whichwrap+=<,>,h,l,[,] " autowrap to next line for cursor movements
set splitbelow " when splitting windows put new ones below ...
set splitright " ...and to the right
set path+=** " search subfolders recursively
set fillchars=diff:\ , " set <space> as fill character for diffs on string removal (default is <minus> char)
" Scrolling
set scrolloff=8 " start scrolling when we're 8 lines away from margins
set sidescroll=1 " enable sidescrolling too
set sidescrolloff=8 " start sidescrolling 8 chars away from margins
" Tabs, make them 4 spaces by default
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
" Source local configuration
runtime vimrc.local