-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.vimrc vol.2
141 lines (110 loc) · 3.66 KB
/
.vimrc vol.2
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
" plugins
execute pathogen#infect()
" bundles I use with pathogen: neocomplete, syntastic, tagbar
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)
set nocompatible
" use indentation of previous line
set autoindent
" use intelligent indentation for C
set smartindent
" " configuring the backspace button
set backspace=indent,eol,start
" configure tabwidth and insert spaces instead of tabs
set tabstop=4 " tab width is 4 spaces
set softtabstop=4
set shiftwidth=4 " indent also with 4 spaces
set expandtab " expand tabs to spaces
" turn syntax highlighting on
set t_Co=256
syntax on
" colorscheme wombat256
" highlight matching braces
set showmatch
" intelligent comments
set comments=sl:/*,mb:\ *,elx:\ */
set showcmd
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" show your position within file
set ruler
"highlight matches of search
set hlsearch
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" With a map leader it's possible to do extra key
" combinations
" like <leader>w saves the current file
let mapleader = ","
let g:mapleader = ","
" Pressing ,ss will toggle and untoggle spell checking
map <leader>ss :setlocal spell!<cr>
" Fast saving
nmap <leader>w :w!<cr>
" syntastic key mappings
nmap <leader>n :lnext<cr>
nmap <leader>m :lprevious<cr>
"switch quickly between open tabs in vim
nmap <leader>z :tabprev<cr>
nmap <leader>x :tabn<cr>
" tagbar mapping
nmap <F8> :TagbarToggle<CR>
"turn off visual bells
set visualbell
set t_vb=
" Map W Q and Wq to lowercase
cmap W w
cmap Q q
cmap Wq wq
cmap WQ wq
"syntactic plugin settings
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_cpp_compiler = 'g++'
let g:syntastic_cpp_compiler_options = '-std=c++11 -Wall -Wextra -pedantic'
let g:syntastic_c_compiler = 'gcc'
let g:syntastic_c_compiler_options = '-std=c11 -Wall -Wextra -pedantic'
let g:syntastic_javascript_checkers = ['jshint']
let g:syntastic_python_python_exec = '/usr/local/bin/python3'
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" neocomplete settings
let g:acp_enableAtStartup = 0
let g:neocomplete#enable_at_startup = 1 " neocomplete plugin
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#sources#syntax#min_keyword_length = 2
let g:neocomplete#auto_completion_start_length = 2
let g:neocomplete#max_list = 20
let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
" Define dictionary.
let g:neocomplete#sources#dictionary#dictionaries = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
" Define keyword.
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns['default'] = '\h\w*'
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType cs setlocal omnifunc=OmniSharp#Complete
" Enable heavy omni completion.
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {}
endif