-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
166 lines (106 loc) · 2.8 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
"
" Gunjan's vim settings
"
" Plugins:
" matchit - Match HTML tags using %
" pathogen
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" Use UTF-8 as the default buffer encoding
set enc=utf-8
" Use Unix as the standard file type
set ffs=unix,dos,mac
" Remember up to 100 'colon' commmands and search patterns
set history=100
" Don't redraw while executing macros (good performance config)
set lazyredraw
""
"" APPEARANCE
""
" Turn syntax highlighting on
syntax on
" Show line numbers
set number
" Colored column (to see line size violations)
set colorcolumn=80
highlight ColorColumn ctermbg=238
set background=dark
let g:solarized_termcolors=256
colorscheme solarized
""
"" INDENTATION
""
" Set proper indentation width
set tabstop=4
set shiftwidth=4
" Round indent to multiple of 'shiftwidth' for > and < commands
set shiftround
" Use spaces for indentation
set expandtab
" Allow backspacing over everything
set backspace=indent,eol,start
""
"" RULER
""
" Show nice info in ruler
set ruler
set laststatus=2
" Show (partial) commands (or size of selection in Visual mode) in the status line
set showcmd
" Always show Show current mode at the bottom
set showmode
""
"" UTILITY
""
" Write with sudo ":w!!"
cnoremap w!! w !sudo tee % >/dev/null
" Use menu to show command-line completion (in 'full' case)
set wildmenu
" Set command-line completion mode:
" - on first <Tab>, when more than one match, list all matches and complete
" the longest common string
" - on second <Tab>, complete the next full match and show menu
set wildmode=list:longest,full
" Ignore case when searching
set ic
" If searched string contains uppercase make search case sensitive
set scs
filetype plugin on
filetype indent on
" Source .vimrc after saving .vimrc
autocmd bufwritepost .nvimrc source $MYVIMRC
" Don't highlight results of a search
set nohlsearch
" Jump 5 lines when running out of the screen
set scrolljump=1
" Indicate jump out of the screen when 3 lines before end of the screen
set scrolloff=3
""
"" KEY MAPPING / SHORTCUTS
""
" Delete/Copy current word
" caw, yaw
" caW, yaW
" Delete/Copy between enclosures
" yi{, yi(, yi[, yi", yi'
" di{, di(, di[, di", di'
let mapleader = ","
" page down with <Space>
nmap <Space> <PageDown>
" page down with <Space>
" nmap <Space> <PageUp>
" visual shifting (does not exit Visual mode)
vnoremap < <gv
vnoremap > >gv
" Highlight current line in insert mode.
" autocmd InsertLeave * se nocul
autocmd InsertEnter * se cul
" highlight Pmenu ctermbg=238 gui=bold
" highlight PmenuSel ctermbg=001 gui=bold
" Initialize pathogen
execute pathogen#infect()
let g:CommandTMaxHeight=20
let g:CommandTCancelMap='<Esc>'
let g:CommandTAcceptSelectionTabMap='t'
set grepprg=ack-grep