-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
60 lines (48 loc) · 1.33 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
55
56
57
58
59
60
set nocompatible
set showcmd
" === indentation ===
filetype plugin indent on " use file type plugins
set tabstop=2
set softtabstop=2
set shiftwidth=2 " a tab is 2 spaces
set expandtab
set autoindent
set smartindent
set smarttab
set backspace=indent,eol,start " allow backspacing over everything in insert mode
" searching
set hlsearch " highlight search terms
set incsearch " search as you type
set ignorecase " ignore case when searching
set smartcase " ignore case if all lower-case
" maintain more context around the cursor
set scrolloff=3
" comfortable leader
let mapleader=","
" interface
set number
set notitle
set background=light
set laststatus=2 " always show the status line
set t_Co=256 " tell vim explicitly that the terminal has 256 colors
syntax enable
" files
set nobackup
set noswapfile
set autoread " reload files changed externally
set encoding=utf8
" buffers & co.
set hidden " hide buffers rather than closing them
set history=1000
set undolevels=1000
" useful things
" w!! to force write files that require root permissions
cmap w!! %!sudo tee > /dev/null %
" === whitespace ===
nnoremap <silent> <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR> " F5 removes trailing whitespace
" === file ignore settings ===
set wildignore+=*/.git
set wildignore+=*.png,*.gif,*.jpg
" mouse scroll support
set mouse=
set ttymouse=