-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
66 lines (56 loc) · 1.2 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
61
62
63
64
65
66
" encoding
set encoding=utf-8
scriptencoding utf-8
" aesthetics
set background=dark
set cursorline
set display+=lastline
set encoding=utf-8
set fillchars+=vert:\┊
set listchars=tab:»\ ,trail:▁,extends:…,precedes:…,nbsp:&,eol:¬
set nocursorline
set nowrap
set number
set scrolloff=12
" files
filetype plugin on
filetype plugin indent on
set hidden
set wildignore=*.swp,*.DS_Store,.git/,.tags
" leader
let mapleader="\<space>"
" syntax
set hlsearch
syntax on
set spellfile=~/.vim/spell/custom.utf-8.add
" tabs
set autoindent
set expandtab
set softtabstop=2
set shiftwidth=2
" project-specific vim configuration
set exrc
set secure
" speedz
set updatetime=100
" system clipboard
function! SetSystemClipboard()
if !has("clipboard")
echo "Note: This version of Vim doesn't have system clipboard access"
return
endif
if has('Darwin')
set clipboard+=unnamed,unnamedplus
else
set clipboard=unnamed
endif
endfunction
call SetSystemClipboard()
" clear trailing whitespace
function <SID>RemoveTrailingWhiteSpace()
let line = line(".")
let column = col(".")
keepp %s/\s\+$//e
call cursor(line, column)
endfunction
autocmd BufWritePre * :call <SID>RemoveTrailingWhiteSpace()