" #plugins{{{
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/bundle')
"css3-syntax
Plug 'hail2u/vim-css3-syntax'
"scss-syntax
Plug 'cakebaker/scss-syntax.vim'
"tagbar
Plug 'majutsushi/tagbar'
"vim-surround
Plug 'tpope/vim-surround'
"undotree
Plug 'mbbill/undotree'
" Ctrlp
Plug 'ctrlpvim/ctrlp.vim'
"
" Obsession
Plug 'tpope/vim-obsession'
" vim-css-color
" Plug 'ap/vim-css-color'
" vim-javascript
Plug 'pangloss/vim-javascript'
" ultisnips
" https://github.com/sirver/UltiSnips
Plug 'SirVer/ultisnips'
" and some snippets
" https://github.com/honza/vim-snippets
" Plug 'honza/vim-snippets'
" ALE
" https://github.com/w0rp/ale
Plug 'w0rp/ale'
" MatchTag
" https://github.com/gregsexton/MatchTag
" DISABLED DUE TO KNOWN ISSUE - https://github.com/gregsexton/MatchTag/issues/40
" Plug 'gregsexton/MatchTag'
" phpcomplete.vim
" https://github.com/shawncplus/phpcomplete.vim
Plug 'shawncplus/phpcomplete.vim'
" https://github.com/dsawardekar/wordpress.vim
" For up to date Wordpress Files see:
" https://github.com/joseluis/wordpress.vim-generator
"Plug 'dsawardekar/wordpress.vim'
" disabled - doesn't support universal ctags?
" vim-vue
" https://github.com/posva/vim-vue
Plug 'posva/vim-vue'
" vim-commentary
" https://github.com/tpope/vim-commentary
Plug 'tpope/vim-commentary'
" vim-repeat
" https://github.com/tpope/vim-repeat
Plug 'tpope/vim-repeat'
" https://github.com/mattn/emmet-vim
Plug 'mattn/emmet-vim'
" vimwiki
" https://github.com/vimwiki/vimwiki
Plug 'vimwiki/vimwiki'
" gitgutter
" https://github.com/airblade/vim-gitgutter/blob/master/README.mkd
Plug 'airblade/vim-gitgutter'
" vim-gutentags
" https://github.com/ludovicchabant/vim-gutentags
Plug 'ludovicchabant/vim-gutentags'
" vim-qlist
" https://github.com/romainl/vim-qlist/
" Plug 'romainl/vim-qlist'
" fugitive-vim
" https://github.com/tpope/vim-fugitive/blob/master/README.markdown
Plug 'tpope/vim-fugitive'
" vim-dispatch
" https://github.com/tpope/vim-dispatch
Plug 'tpope/vim-dispatch'
" colorV
" https://github.com/gu-fan/colorv.vim
Plug 'gu-fan/colorv.vim'
" vim switch
"https://github.com/AndrewRadev/switch.vim
Plug 'AndrewRadev/switch.vim'
" gitv
" https://github.com/gregsexton/gitv
Plug 'gregsexton/gitv'
" wakarime
" https://wakatime.com/vim
Plug 'wakatime/vim-wakatime'
" vim-easy-align
" https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
" vim-instant-markdown
" https://github.com/suan/vim-instant-markdown
Plug 'suan/vim-instant-markdown'
" asyncomplete.vim
" https://github.com/prabirshrestha/asyncomplete.vim
" Plug 'prabirshrestha/asyncomplete.vim'
" Plug 'yami-beta/asyncomplete-omni.vim'
" Plug 'prabirshrestha/asyncomplete-ultisnips.vim'
" Plug 'prabirshrestha/asyncomplete-file.vim'
" Plug 'prabirshrestha/asyncomplete-buffer.vim'
" Plug 'prabirshrestha/asyncomplete-tags.vim'
" Plug 'prabirshrestha/asyncomplete-lsp.vim'
" Plug 'Shougo/neco-vim'
" Plug 'prabirshrestha/asyncomplete-necovim.vim'
" vim-lsp
" https://github.com/prabirshrestha/vim-lsp
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
" inline_edit.vim
" https://github.com/AndrewRadev/inline_edit.vim
Plug 'AndrewRadev/inline_edit.vim'
call plug#end()
"}}}
runtime macros/matchit.vim
" #plugin settings{{{
" inline_edit.vim
let g:inline_edit_patterns = [{
\ 'main_filetype': '*html',
\ 'sub_filetype': 'scss',
\ 'indent_adjustment': 1,
\ 'start': ''
\ }]
let g:inline_edit_autowrite = 1
let g:inline_edit_proxy_type = "tempfile"
let g:inline_edit_new_buffer_command ="tabedit"
let g:inline_edit_modify_statusline = 0
nnoremap ie :InlineEdit
" asyncomplete.vim
"{{{
" let g:asyncomplete_auto_popup = 0
" let g:asyncomplete_remove_duplicates = 1
" inoremap asyncomplete#force_refresh()
" not working why?
" let g:asyncomplete_min_chars = 3
" augroup User asyncomplete_setup
" autocmd!
" autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
" augroup END
" call asyncomplete#register_source(asyncomplete#sources#file#get_source_options({
" \ 'name': 'file',
" \ 'whitelist': ['*'],
" \ 'priority': -20,
" \ 'completor': function('asyncomplete#sources#file#completor')
" \ }))
" call asyncomplete#register_source(asyncomplete#sources#ultisnips#get_source_options({
" \ 'name': 'ultisnips',
" \ 'whitelist': ['*'],
" \ 'priority': -30,
" \ 'completor': function('asyncomplete#sources#ultisnips#completor'),
" \ }))
" call asyncomplete#register_source(asyncomplete#sources#necovim#get_source_options({
" \ 'name': 'necovim',
" \ 'whitelist': ['vim'],
" \ 'priority': -40,
" \ 'completor': function('asyncomplete#sources#necovim#completor'),
" \ }))
" call asyncomplete#register_source(asyncomplete#sources#buffer#get_source_options({
" \ 'name': 'buffer',
" \ 'whitelist': ['*'],
" \ 'blacklist': ['go'],
" \ 'priority': -50,
" \ 'completor': function('asyncomplete#sources#buffer#completor'),
" \ }))
" call asyncomplete#register_source(asyncomplete#sources#omni#get_source_options({
" \ 'name': 'omni',
" \ 'whitelist': ['*'],
" \ 'blacklist': ['c', 'cpp', 'html', 'python', 'vue'],
" \ 'priority': -60,
" \ 'completor': function('asyncomplete#sources#omni#completor')
" \ }))
" call asyncomplete#register_source(asyncomplete#sources#tags#get_source_options({
" \ 'name': 'tags',
" \ 'whitelist': ['*'],
" \ 'blacklist': ['vim', 'python'],
" \ 'priority': -70,
" \ 'completor': function('asyncomplete#sources#tags#completor'),
" \ 'config': {
" \ 'max_file_size': 50000000,
" \ },
" \ }))
"}}}
" vim-lsp
"{{{
let g:lsp_signs_enabled = 1
let g:lsp_signs_error = {'text': '>>'}
let g:lsp_signs_warning = {'text': '>'}
let g:lsp_signs_information = {'text': '--'}
let g:lsp_signs_hint = {'text': '--'}
let g:lsp_diagnostics_echo_cursor = 1
let g:lsp_diagnostics_echo_delay = 0
nnoremap \l :LspDocumentDiagnostics
nnoremap \h :LspHover
nnoremap \d :LspDefinition
nnoremap \r :LspReferences
nnoremap \n :LspRename
nnoremap \s :LspDocumentSymbol
nnoremap \w :LspWorkspaceSymbol
nnoremap \ff :LspDocumentFormat
nnoremap \fr :LspDocumentRangeFormat
augroup User lsp_setup
autocmd!
if executable('vls')
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'vue',
\ 'cmd': {server_info->['vls']},
\ 'whitelist': ['vue'],
\ })
endif
if executable('pyls')
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'pyls',
\ 'cmd': {server_info->['pyls']},
\ 'whitelist': ['python'],
\ })
endif
if executable('typescript-language-server')
au User lsp_setup call lsp#register_server({
\ 'name': 'typescript-language-server',
\ 'cmd': { server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']},
\ 'root_uri': { server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_directory(lsp#utils#get_buffer_path(), '.git/..'))},
\ 'whitelist': ['typescript', 'javascript', 'javascript.jsx']
\ })
endif
augroup END
"}}}
" ALE
"{{{
nnoremap ne :lnext
nnoremap pe :lprev
let g:ale_sign_error = '>>'
let g:ale_sign_warning = '>'
let g:ale_sign_column_always = 1
" let g:ale_linters = {'scss': ['stylelint'], 'javascript': ['eslint'], 'php':['php'], 'html':['htmlhint'], 'python': [], 'vue': []}
let g:ale_linters = {'scss': ['stylelint'], 'javascript': [], 'php':['php'], 'html':['htmlhint'], 'python': [], 'vue': []}
" let g:ale_linters_explicit = 1
let g:ale_html_htmlhint_options = '-c ~/.htmlhintrc --format=unix'
let g:ale_fixers = {'javascript': ['eslint']}
"}}}
" vim-easy-align
"{{{
xmap ga (EasyAlign)
nmap ga (EasyAlign)
"}}}
" switch.vim
"{{{
let g:switch_mapping = '-'
let g:switch_custom_definitions = [
\ ['0', '1'],
\ ['ease-in', 'ease-out'],
\ ['auto', 'none'],
\ ['left', 'right'],
\ ['top', 'bottom'],
\ ['relative', 'absolute', 'fixed']
\ ]
"}}}
" gitgutter
"{{{
nmap ]h GitGutterNextHunk
nmap [h GitGutterPrevHunk
omap ih GitGutterTextObjectInnerPending
omap ah GitGutterTextObjectOuterPending
xmap ih GitGutterTextObjectInnerVisual
xmap ah GitGutterTextObjectOuterVisual
"}}}
" Use the silver searcher ag command instead of grep
"{{{
if executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
"vim-wiki
let g:vimwiki_list = [{'path': '~/vimwiki/', 'path_html': '~/vimwiki_html/'}]
" emmet
let g:user_emmet_leader_key=',,'
let g:user_emmet_settings = {
\ 'indentation': ' ',
\ 'html': {
\ 'indentation': ' ',
\ }
\}
"}}}
" vue-vim
"{{{
" disable preprocessor checking for vue files - increases speed
let g:vue_disable_pre_processors=0
" set custom syntax highlighting
augroup fixhighlighting
autocmd!
autocmd BufNewFile,BufRead *.vue syntax sync fromstart
augroup END
"}}}
" ultisnips
"{{{
nnoremap ul :call ListUltisnips()
inoremap jkul :call ListUltisnips()
let g:UltiSnipsSnippetsDir='~/.vim/UltiSnips'
" Trigger configuration. Do not use if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger=''
let g:UltiSnipsJumpForwardTrigger=''
let g:UltiSnipsJumpBackwardTrigger=''
let g:UltiSnipsEditSplit='horizontal'
function! ListUltisnips() abort
let l:snips = UltiSnips#SnippetsInCurrentScope(1)
let l:keylist = sort(keys(l:snips))
echo ' --------------------------------------------------'
for l:key in l:keylist
echo printf(" %-10s\t%s", l:key, l:snips[l:key])
endfor
echo '---------------------------------------------------'
endfunction
function! CompleteSnippets(findstart, base)
if a:findstart
let l:line = getline('.')
let l:start = col('.') - 1
while l:start > 0 && l:line[l:start - 1] =~ '\a'
let l:start -= 1
endwhile
return l:start
else
let l:res = []
let l:snips = UltiSnips#SnippetsInCurrentScope(1)
let l:keylist = sort(keys(l:snips))
for l:key in l:keylist
if l:key =~ '^' . a:base
let l:item = {'word': l:key, 'menu': l:snips[l:key]}
call add(l:res, l:item)
endif
endfor
return l:res
endif
endfunction
set completefunc=CompleteSnippets
"}}}
" Netrw
"{{{
let g:netrw_liststyle=3
let g:netrw_list_hide='^\..*'
let g:netrw_preview = 0
"}}}
" undotree
"{{{
nnoremap ut :UndotreeToggle
"}}}
" TagBar
"{{{
nnoremap tb :TagbarOpen fj
nnoremap ] :tag /[.#@]=expand('')
let g:tagbar_autoclose = 1
" let g:tagbar_autopreview = 1
" let g:tagbar_previewwin_pos = ''
let g:tagbar_type_css = {
\ 'ctagstype' : 'css',
\ 'kinds' : [
\ 'c:classes',
\ 'i:ids',
\ 't:tags',
\ 'm:medias'
\ ]
\}
let g:tagbar_type_scss = {
\ 'ctagstype' : 'scss',
\ 'kinds' : [
\ 'v:variables',
\ 'c:classes',
\ 'i:ids',
\ 't:tags',
\ 'd:medias',
\ 'm:mixins',
\ 'f:functions'
\ ]
\}
let g:tagbar_type_vue = {
\ 'ctagstype' : 'vue',
\ 'kinds' : [
\ 'o:objects',
\ 'f:functions',
\ 'a:array',
\ 's:string',
\ 'b:boolean',
\ 'n:number',
\ 'v:variable'
\ ]
\ }
"}}}
" gutentags
"{{{
let g:gutentags_ctags_tagfile = '.tags'
let g:gutentags_ctags_exclude = ['package.json', 'Session.vim', 'package-lock.json', 'TODO.txt']
"}}}
" colorV
"{{{
let g:colorv_no_global_map = 1
let g:colorv_win_pos = 'top'
let g:colorv_preview_area = 0
nnoremap cv :ColorV
nnoremap ce :ColorVEdit
nnoremap cc :call ToggleColorPreview()
nnoremap ci :ColorVInsert
nnoremap cp :ColorVPicker
function! ToggleColorPreview() abort
if !exists('w:colorv_is_previewing')
let w:colorv_is_previewing = 0
endif
if w:colorv_is_previewing == 0
execute 'ColorVPreview'
let w:colorv_is_previewing = 1
else
execute 'ColorVClear'
let w:colorv_is_previewing = 0
endif
endfunction
"}}}
" vim-instant-markdown
" this doesn't work - issue is open in guthub
let g:instant_markdown_open_to_the_world = 1
"}}}
" vim: foldmethod=marker