mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 20:10:05 +08:00
Improve js support
This commit is contained in:
parent
3f9c3dd5ee
commit
4b52c2caba
@ -3,11 +3,10 @@ function! SpaceVim#layers#lang#javascript#plugins() abort
|
|||||||
call add(plugins,['pangloss/vim-javascript', { 'on_ft' : ['javascript']}])
|
call add(plugins,['pangloss/vim-javascript', { 'on_ft' : ['javascript']}])
|
||||||
if has('nvim')
|
if has('nvim')
|
||||||
call add(plugins,['carlitux/deoplete-ternjs', { 'on_ft' : ['javascript']}])
|
call add(plugins,['carlitux/deoplete-ternjs', { 'on_ft' : ['javascript']}])
|
||||||
else
|
endif
|
||||||
call add(plugins,['ternjs/tern_for_vim', { 'on_ft' : ['javascript'],
|
call add(plugins,['ternjs/tern_for_vim', { 'on_ft' : ['javascript'],
|
||||||
\ 'build' : 'npm install',
|
\ 'build' : 'npm install',
|
||||||
\ }])
|
\ }])
|
||||||
endif
|
|
||||||
call add(plugins,['othree/javascript-libraries-syntax.vim', { 'on_ft' : ['javascript','coffee','ls','typescript']}])
|
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,['mmalecki/vim-node.js', { 'on_ft' : ['javascript']}])
|
||||||
call add(plugins,['othree/yajs.vim', { 'on_ft' : ['javascript']}])
|
call add(plugins,['othree/yajs.vim', { 'on_ft' : ['javascript']}])
|
||||||
@ -15,3 +14,16 @@ function! SpaceVim#layers#lang#javascript#plugins() abort
|
|||||||
call add(plugins,['maksimr/vim-jsbeautify', { 'on_ft' : ['javascript']}])
|
call add(plugins,['maksimr/vim-jsbeautify', { 'on_ft' : ['javascript']}])
|
||||||
return plugins
|
return plugins
|
||||||
endfunction
|
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
|
" 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
|
" php
|
||||||
let g:deoplete#omni#input_patterns.php = get(g:deoplete#omni#input_patterns, 'php', [
|
let g:deoplete#omni#input_patterns.php = get(g:deoplete#omni#input_patterns, 'php', [
|
||||||
|
Loading…
Reference in New Issue
Block a user