-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
193 lines (169 loc) · 4.77 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
"-----Plugins-----"
call plug#begin("~/.vim/plugged")
" feature
"Plug 'SirVer/ultisnips'
"Plug 'Valloric/YouCompleteMe'
"Plug 'Yggdroot/indentLine'
"Plug 'alvan/vim-closetag'
"Plug 'gregsexton/MatchTag'
"Plug 'honza/vim-snippets'
Plug 'jiangmiao/auto-pairs'
Plug 'bronson/vim-trailing-whitespace'
Plug 'ervandew/supertab'
Plug 'eugen0329/vim-esearch'
Plug 'itchyny/lightline.vim'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'justinmk/vim-sneak'
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree'
Plug 'tpope/vim-surround'
Plug 'dense-analysis/ale'
Plug 'zivyangll/git-blame.vim'
" theme
Plug 'NLKNguyen/papercolor-theme'
Plug 'morhetz/gruvbox'
Plug 'rakr/vim-two-firewatch'
Plug 'romainl/flattened'
Plug 'tomasr/molokai'
Plug 'kaicataldo/material.vim'
Plug 'gruvbox-material/vim', {'as': 'gruvbox-material'}
" syntax
Plug 'StanAngeloff/php.vim'
Plug 'cakebaker/scss-syntax.vim'
Plug 'jwalton512/vim-blade'
Plug 'othree/html5.vim'
Plug 'pangloss/vim-javascript'
Plug 'posva/vim-vue'
Plug 'leafgarland/typescript-vim'
call plug#end()
"-----Configs-----"
" theme
set termguicolors
let g:gruvbox_material_background = 'medium'
let g:gruvbox_material_disable_italic_comment = 1
colorscheme gruvbox-material
set background=dark
"let g:material_theme_style = 'darker'
"let g:two_firewatch_italics=1
"let g:molokai_original = 1
" nerdtree
let NERDTreeShowHidden=1 "show hidden files
let NERDTreeIgnore=['\.git$', '\.DS_Store$', '\.swp$', '.gitkeep', '.gitattributes', '.idea', '.vscode'] "hide certain file types
let NERDTreeCascadeSingleChildDir=0 "disable auto collapse single children folder
" lightline
" let g:lightline = { 'colorscheme': 'gruvbox' }
" let g:lightline = { 'colorscheme': 'material_vim' }
let g:lightline = {'colorscheme' : 'gruvbox_material'}
" let g:lightline = { 'colorscheme': 'PaperColor' }
" closetag
let g:closetag_filenames = "*.html,*.xhtml,*.phtml,*.vue"
" vim-esearch
let g:esearch = {
\ 'adapter': 'rg',
\ 'backend': 'vim8',
\ 'out': 'win',
\ 'batch_size': 1000,
\ 'use': ['visual', 'hlsearch', 'last'],
\ 'default_mappings': 1,
\}
" vim-surround
let g:surround_no_mappings = 1
" ultisnips
" let g:UltiSnipsExpandTrigger="<tab>"
" let g:UltiSnipsJumpForwardTrigger="<tab>"
" let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
" ycm
" let g:ycm_key_list_select_completion = ['<C-j>', '<Down>']
" let g:ycm_key_list_previous_completion = ['<C-k>', '<Up>']
" supertab
let g:SuperTabDefaultCompletionType = '<C-n>'
" nerdcommenter
let g:NERDSpaceDelims = 1
let g:NERDTrimTrailingWhitespace = 1
let g:NERDDefaultAlign = 'left'
" ale
let g:ale_linter_aliases = {'vue': ['vue', 'javascript']}
let g:ale_fixers = {'javascript': ['eslint'], 'vue': ['eslint']}
let g:ale_linters = {'javascript': ['eslint'], 'vue': ['eslint', 'vls']}
let g:ale_fix_on_save = 1
" vim
let mapleader = ' '
set autoindent
set backspace=indent,eol,start
set clipboard=unnamed
set completeopt=longest,menuone,preview
set omnifunc=syntaxcomplete#Complete
set copyindent
set expandtab
set hlsearch
set ignorecase
set incsearch
set laststatus=2
set mouse=a
set nowrap
set number
set ruler
set shiftwidth=4
set showcmd
set showmode
set smartcase
set smarttab
set softtabstop=4
set t_Co=256
set tabstop=4
set ttyfast
set lazyredraw
set splitbelow
syntax on
filetype plugin indent on
"highlight Comment cterm=italic
"highlight htmlArg cterm=italic
"-----Key-Mapping-----"
set pastetoggle=<F3>
map <F1> :FZF <CR>
map <F2> <C-W>w
map <F4> :FixWhitespace <CR>
map <F5> :NERDTreeTabsToggle <CR>
nmap <leader><space> :nohlsearch <CR>
map <C-P> :FZF <CR>
tnoremap <Esc> <C-\><C-n>
map f <Plug>Sneak_s
map F <Plug>Sneak_S
nmap sc <Plug>Csurround
nmap sd <Plug>Dsurround
nmap sy <Plug>Ysurround
xmap sv <Plug>VSurround
nnoremap <Leader>0 :<C-u>call gitblame#echo()<CR>
" Tab
nnoremap <C-Left> :tabprevious<CR>
nnoremap <C-Right> :tabnext<CR>
noremap <leader>1 1gt
noremap <leader>2 2gt
noremap <leader>3 3gt
noremap <leader>4 4gt
noremap <leader>5 5gt
noremap <leader>6 6gt
noremap <leader>7 7gt
noremap <leader>8 8gt
noremap <leader>9 9gt
"-----Auto-Commands-----"
" Source vimrc on save
augroup autosourcing
autocmd!
autocmd BufWritePost ~/.vimrc source %
augroup END
" Sync syntax
autocmd! BufEnter * :syntax sync fromstart
" Delete white space on save
autocmd! BufWritePre * FixWhitespace
" Spacing file types
autocmd Filetype blade setlocal ts=4 sts=4 sw=4
autocmd Filetype html setlocal ts=2 sts=2 sw=2
autocmd Filetype json setlocal ts=2 sts=2 sw=2
autocmd Filetype javascript setlocal ts=2 sts=2 sw=2
autocmd Filetype php setlocal ts=4 sts=4 sw=4
autocmd Filetype sass setlocal ts=4 sts=4 sw=4
autocmd Filetype scss setlocal ts=4 sts=4 sw=4
autocmd Filetype vue setlocal ts=2 sts=2 sw=2
autocmd Filetype typescript setlocal ts=2 sts=2 sw=2