-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
96 lines (83 loc) · 2.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
85
86
87
88
89
90
91
92
93
94
95
" vundle
set nocompatible
filetype on
filetype indent on
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Plugins
Plugin 'ycm-core/YouCompleteMe'
Plugin 'powerline/powerline', {'rtp': 'powerline/bindings/vim/'}
Plugin 'jiangmiao/auto-pairs'
Plugin 'vim-scripts/java_getset.vim'
Plugin 'sbdchd/neoformat'
Plugin 'prettier/vim-prettier'
Plugin 'vim-scripts/xmledit'
Plugin 'othree/yajs.vim'
Plugin 'othree/es.next.syntax.vim'
Plugin 'preservim/nerdtree'
Plugin 'ryanoasis/vim-devicons'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'tiagofumo/vim-nerdtree-syntax-highlight'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" powerline
set laststatus=2
set t_Co=256
" general
syntax on
set shell=bash
set number
set tabstop=4
set shiftwidth=4
set expandtab
set modeline
set hlsearch
set autoindent
set encoding=utf-8
set colorcolumn=80,100
highlight ColorColumn ctermbg=235
highlight CursorLine ctermbg=236 cterm=None
" light theme
"highlight ColorColumn ctermbg=230
"highlight CursorLine ctermbg=231 cterm=None
set cursorline
" highlight non-ascii characters
au BufReadPost * syntax match nonascii "[^\u0000-\u007F]" containedin=ALL
highlight nonascii ctermbg=1
" ycm settings
let g:ycm_confirm_extra_conf = 1
let g:ycm_enable_diagnostic_highlighting = 0
let g:ycm_max_diagnostics_to_display = 1000
" java_getset
let b:javagetset_getterTemplate =
\ "\n" .
\ "%modifiers% %type% %funcname%() {\n" .
\ " return %varname%;\n" .
\ "}"
let b:javagetset_setterTemplate =
\ "\n" .
\ "%modifiers% void %funcname%(%type% %varname%) {\n" .
\ " this.%varname% = %varname%;\n" .
\ "}"
" two char indentation for java and js
autocmd FileType java setlocal shiftwidth=2 tabstop=2
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2
autocmd FileType html setlocal shiftwidth=2 tabstop=2
"autocmd FileType c setlocal shiftwidth=4 tabstop=4
autocmd FileType c setlocal shiftwidth=8 tabstop=8 noexpandtab
autocmd FileType h setlocal shiftwidth=8 tabstop=8 noexpandtab
" ejs as html
au BufNewFile,BufRead *.ejs set filetype=html
" faster motion with Ctrl+hjkl
noremap <C-j> 4j
noremap <C-k> 4k
noremap <C-h> 4h
noremap <C-l> 4l
" toggle relativenumber
nmap <F2> :set rnu!<CR>
" toggle line numbers
nmap <F3> :set nu!<CR>
" allow typing out
let g:AutoPairsShortcutFastWrap = "<C-f>"