mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:50:05 +08:00
Improve js support
This commit is contained in:
parent
3f9c3dd5ee
commit
4b52c2caba
@ -1,17 +1,29 @@
|
||||
function! SpaceVim#layers#lang#javascript#plugins() abort
|
||||
let plugins = []
|
||||
call add(plugins,['pangloss/vim-javascript', { 'on_ft' : ['javascript']}])
|
||||
if has('nvim')
|
||||
call add(plugins,['carlitux/deoplete-ternjs', { 'on_ft' : ['javascript']}])
|
||||
else
|
||||
call add(plugins,['ternjs/tern_for_vim', { 'on_ft' : ['javascript'],
|
||||
\ 'build' : 'npm install',
|
||||
\ }])
|
||||
endif
|
||||
call add(plugins,['othree/javascript-libraries-syntax.vim', { 'on_ft' : ['javascript','coffee','ls','typescript']}])
|
||||
call add(plugins,['mmalecki/vim-node.js', { 'on_ft' : ['javascript']}])
|
||||
call add(plugins,['othree/yajs.vim', { 'on_ft' : ['javascript']}])
|
||||
call add(plugins,['othree/es.next.syntax.vim', { 'on_ft' : ['javascript']}])
|
||||
call add(plugins,['maksimr/vim-jsbeautify', { 'on_ft' : ['javascript']}])
|
||||
return plugins
|
||||
let plugins = []
|
||||
call add(plugins,['pangloss/vim-javascript', { 'on_ft' : ['javascript']}])
|
||||
if has('nvim')
|
||||
call add(plugins,['carlitux/deoplete-ternjs', { 'on_ft' : ['javascript']}])
|
||||
endif
|
||||
call add(plugins,['ternjs/tern_for_vim', { 'on_ft' : ['javascript'],
|
||||
\ 'build' : 'npm install',
|
||||
\ }])
|
||||
call add(plugins,['othree/javascript-libraries-syntax.vim', { 'on_ft' : ['javascript','coffee','ls','typescript']}])
|
||||
call add(plugins,['mmalecki/vim-node.js', { 'on_ft' : ['javascript']}])
|
||||
call add(plugins,['othree/yajs.vim', { 'on_ft' : ['javascript']}])
|
||||
call add(plugins,['othree/es.next.syntax.vim', { 'on_ft' : ['javascript']}])
|
||||
call add(plugins,['maksimr/vim-jsbeautify', { 'on_ft' : ['javascript']}])
|
||||
return plugins
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#layers#lang#javascript#config() abort
|
||||
call SpaceVim#mapping#gd#add('javascript', function('s:gotodef'))
|
||||
endfunction
|
||||
|
||||
function! s:gotodef() abort
|
||||
if exists(':TernDef')
|
||||
TernDef
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
" vim:set et sw=2 cc=80:
|
||||
|
@ -39,7 +39,10 @@ let g:deoplete#omni#input_patterns.perl = get(g:deoplete#omni#input_patterns, 'p
|
||||
\])
|
||||
|
||||
" javascript
|
||||
let g:deoplete#omni#input_patterns.javascript = get(g:deoplete#omni#input_patterns, 'javascript', ['[^. \t0-9]\.\w*'])
|
||||
"let g:deoplete#omni#input_patterns.javascript = get(g:deoplete#omni#input_patterns, 'javascript', ['[^. \t0-9]\.\w*'])
|
||||
let g:deoplete#ignore_sources.javascript = get(g:deoplete#ignore_sources, 'javascript', ['omni'])
|
||||
call deoplete#custom#set('ternjs', 'mark', 'tern')
|
||||
call deoplete#custom#set('ternjs', 'rank', 9999)
|
||||
|
||||
" php
|
||||
let g:deoplete#omni#input_patterns.php = get(g:deoplete#omni#input_patterns, 'php', [
|
||||
|
Loading…
Reference in New Issue
Block a user