-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
85 lines (73 loc) · 1.43 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
set nocompatible
command M :w | :make
nnoremap t lbve~l
nmap X bde
nmap J 5jzz
vnoremap J 5jzz
nmap K 5kzz
vnoremap K 5kzz
nmap F <C-F>zz
nmap Q <C-B>zz
nmap o<Esc>
map G G$
map £ ^
nnoremap r q
nmap q bi"ea"
" store history of past sessions
set undofile
syntax enable
syntax on
highlight trailingWhitespace ctermbg=darkgreen guibg=lightgreen
match trailingWhitespace /\s\+$/
set showmode
set shiftwidth=4
set tabstop=4
set softtabstop=4
set autoindent
set smartindent
set noswapfile
set mouse=a
set expandtab
set fileformat=unix
autocmd FileType make set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab
autocmd FileType c,sh set tabstop=2 shiftwidth=2 softtabstop=2
" typing keys in visual mode overwrites the buffer
vnoremap a sa
vnoremap c sc
vnoremap f sf
vnoremap g sg
vnoremap m sm
vnoremap n sn
vnoremap o so
vnoremap q sq
vnoremap r sr
vnoremap t st
vnoremap v sv
vnoremap z sz
vnoremap 0 s0
vnoremap 1 s1
vnoremap 2 s2
vnoremap 3 s3
vnoremap 4 s4
vnoremap 5 s5
vnoremap 6 s6
vnoremap 7 s7
vnoremap 8 s8
vnoremap 9 s9
vnoremap x xi
" better indentation
vnoremap < <gv
vnoremap > >gv
" backspace
set backspace=2
augroup vimrcEx
au!
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
augroup END