-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
100 lines (53 loc) · 1.66 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
" Colors {{{
" colorscheme solarized
colorscheme molokai
" colorscheme vim-code-dark
syntax enable " enable syntax processing
" }}}
" Spaces & Tabs {{{
set tabstop=4 " number of visual spaces per TAB
set softtabstop=4 " number of spaces in tab when editing
set expandtab " tabs are spaces
" }}}
" UI Layout {{{
set number " show line numbers
set showcmd " show command in bottom bar
set nocursorline " highlight current line
filetype indent on " load filetype-specific files
set wildmenu " visual autocompletion for command menu
set lazyredraw " redraw only when need to
set showmatch " highlight matching brackets ()[]{}
set number relativenumber " enable hybrid line numbers (relative and absolute line numbers)
set nu rnu
" }}}
" Searching {{{
set incsearch " search as characters are entered
set hlsearch " highlight matches
" remap <leader><space> :nohlsearch<CR> " turn off search highlight
" }}}
" Folding {{{
set foldenable " enable folding
set foldlevelstart=10 " open most folds by default
set foldnestmax=10 " 10 nested fold max
set foldmethod=indent " set fold based on indent level
" }}}
" Movement {{{
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" move to beginning/end of line
nnoremap B ^
nnoremap E $
" $/^ doesn't do anything
nnoremap $ <nop>
nnoremap ^ <nop>
" highlight last inserted text
nnoremap gV `[v`]
" }}}
" Leader Shortcuts
let mapleader="," " leader is comma
" jk is escape (NOTE: NO COMMENTS OR WHITESPACE AFTER REMAP COMMAND)
inoremap jk <esc>
" toggle undo tree (gundo)
nnoremap <leader>u :GundoToggle<CR>
" }}}