-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
139 lines (106 loc) · 3.74 KB
/
.vimrc
File metadata and controls
139 lines (106 loc) · 3.74 KB
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
call plug#begin('~/.vim/plugged')
" Package to show register with " and @
Plug 'junegunn/vim-peekaboo'
" Package for autocompletion
Plug 'https://github.com/Shougo/neocomplete.vim'
" Package for code snippet inclusion
Plug 'Shougo/neosnippet'
" Package for easy commenting and uncommenting
Plug 'scrooloose/nerdcommenter'
" Go Language packages
Plug 'fatih/vim-go'
" Syntax checking
Plug 'scrooloose/syntastic'
" Vim support
Plug 'lervag/vimtex'
" Tree file system
Plug 'scrooloose/nerdtree'
" Add and remove brackets, ...
Plug 'tpope/vim-surround'
" Add markdown plugins
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'
call plug#end()
set nocompatible
syntax on
filetype plugin indent on
set tabstop=4 " show existing tab with 4 spaces width
set hidden "Buffer is hidden and not closed
set nowrap "Don't wrap lines
set backspace=indent,eol,start "Allow backspacing over everything in insert mode
set expandtab " On pressing tab, insert 4 spaces
set autoindent
set copyindent
set shiftwidth=4
set shiftround " when indenting with '>', use 4 spaces width
set showmatch "set shoe matching parenthesis
set ignorecase "ignore cas when searching
set smartcase "ignore case if search pattern is all lowercase,
"case-sensitive otherwise
set smarttab "insert tabs on the start of a line according to
"shiftwidth, not tabstop
set hlsearch "highlight search terms
set incsearch "show search matches as you type
set number "Always show line numbers
set relativenumber "Always show relative numbers
set nobackup "Don't make a backup
set noswapfile "Don't save swap files
set autowrite "Save file when building it
set pastetoggle=<F2>
let g:neocomplete#enable_at_startup = 1 "Start neocomplete on startup
"Easy window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
"Faster Go Error navigation"
map <C-n> :cnext<CR>
map <C-m> :cprevious<CR>
nnoremap <leader>a :cclose<CR>
"Nerdtree command"
map <C-t> :NERDTreeToggle<CR>
autocmd FileType go nmap <leader>r <Plug>(go-run)
autocmd FileType go nmap <leader>t <Plug>(go-test)
" run :GoBuild or :GoTestCompile based on the go file
function! s:build_go_files()
let l:file = expand('%')
if l:file =~# '^\f\+_test\.go$'
call go#cmd#Test(0, 1)
elseif l:file =~# '^\f\+\.go$'
call go#cmd#Build(0)
endif
endfunction
autocmd FileType go nmap <leader>b :<C-u>call <SID>build_go_files()<CR>
let g:go_list_type = "quickfix" "Only use one type of error list
" Remove search highlighting
nmap <silent> ,/ :nohlsearch<CR>
" Additional syntastic setting
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" Set python3 checking
let g:syntastic_python_python_exec= 'usr/bin/python3'
" Add c++11 support"
let g:syntastic_cpp_compiler = 'g++'
let g:syntastic_cpp_compiler_options = '-std=c++11'
let g:syntastic_cpp_cpplint_exec = 'cpplint'
let g:syntastic_cpp_checkers = ['gcc', 'cpplint']
" Add one whitespace after comments of nerdcommenter
let NERDSpaceDelims=1
" Autocompltion for vimlatex
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {}
endif
let g:neocomplete#sources#omni#input_patterns.tex =
\ '\v\\%('
\ . '\a*%(ref|cite)\a*%(\s*\[[^]]*\])?\s*\{[^{}]*'
\ . '|includegraphics%(\s*\[[^]]*\])?\s*\{[^{}]*'
\ . '|%(include|input)\s*\{[^{}]*'
\ . ')'
autocmd vimenter * NERDTree
" Remove foldng option for markdown files
let g:vim_markdown_folding_disabled = 1