mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 12:40:05 +08:00
parent
4b990165e8
commit
2cee009847
@ -41,7 +41,6 @@ function! SpaceVim#autocmds#init() abort
|
|||||||
autocmd FileType cs set comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,f:///,f://
|
autocmd FileType cs set comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,f:///,f://
|
||||||
autocmd FileType vim set comments=sO:\"\ -,mO:\"\ \ ,eO:\"\",f:\"
|
autocmd FileType vim set comments=sO:\"\ -,mO:\"\ \ ,eO:\"\",f:\"
|
||||||
autocmd FileType lua set comments=f:--
|
autocmd FileType lua set comments=f:--
|
||||||
autocmd FileType vim setlocal foldmethod=marker
|
|
||||||
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
|
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
|
||||||
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
|
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
|
||||||
autocmd Filetype html setlocal omnifunc=htmlcomplete#CompleteTags
|
autocmd Filetype html setlocal omnifunc=htmlcomplete#CompleteTags
|
||||||
|
@ -8,19 +8,19 @@
|
|||||||
|
|
||||||
function! SpaceVim#layers#lang#javascript#plugins() abort
|
function! SpaceVim#layers#lang#javascript#plugins() abort
|
||||||
let plugins = [
|
let plugins = [
|
||||||
\ ['Galooshi/vim-import-js', {
|
\ ['Galooshi/vim-import-js', {
|
||||||
\ 'on_ft': 'javascript', 'build' : 'npm install -g import-js' }],
|
\ 'on_ft': 'javascript', 'build' : 'npm install -g import-js' }],
|
||||||
\ ['heavenshell/vim-jsdoc', { 'on_cmd': 'JsDoc' }],
|
\ ['heavenshell/vim-jsdoc', { 'on_cmd': 'JsDoc' }],
|
||||||
\ ['maksimr/vim-jsbeautify', { 'on_ft': 'javascript' }],
|
\ ['maksimr/vim-jsbeautify', { 'on_ft': 'javascript' }],
|
||||||
\ ['mmalecki/vim-node.js', { 'on_ft': 'javascript' }],
|
\ ['mmalecki/vim-node.js', { 'on_ft': 'javascript' }],
|
||||||
\ ['moll/vim-node', { 'on_ft': 'javascript' }],
|
\ ['moll/vim-node', { 'on_ft': 'javascript' }],
|
||||||
\ ['neoclide/vim-jsx-improve', { 'on_ft': 'javascript' }],
|
\ ['neoclide/vim-jsx-improve', { 'on_ft': 'javascript' }],
|
||||||
\ ['othree/es.next.syntax.vim', { 'on_ft': 'javascript' }],
|
\ ['othree/es.next.syntax.vim', { 'on_ft': 'javascript' }],
|
||||||
\ ['othree/javascript-libraries-syntax.vim', {
|
\ ['othree/javascript-libraries-syntax.vim', {
|
||||||
\ 'on_ft': ['javascript', 'coffee', 'ls', 'typescript'] }],
|
\ 'on_ft': ['javascript', 'coffee', 'ls', 'typescript'] }],
|
||||||
\ ['othree/yajs.vim', { 'on_ft': 'javascript' }],
|
\ ['othree/yajs.vim', { 'on_ft': 'javascript' }],
|
||||||
\ ['pangloss/vim-javascript', { 'on_ft': 'javascript' }],
|
\ ['pangloss/vim-javascript', { 'on_ft': 'javascript' }],
|
||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
if !SpaceVim#layers#lsp#check_filetype('javascript')
|
if !SpaceVim#layers#lsp#check_filetype('javascript')
|
||||||
call add(plugins, ['ternjs/tern_for_vim', {
|
call add(plugins, ['ternjs/tern_for_vim', {
|
||||||
@ -39,10 +39,8 @@ function! SpaceVim#layers#lang#javascript#set_variable(var) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SpaceVim#layers#lang#javascript#config() abort
|
function! SpaceVim#layers#lang#javascript#config() abort
|
||||||
" pangloss/vim-javascript {{{
|
|
||||||
let g:javascript_plugin_jsdoc = 1
|
let g:javascript_plugin_jsdoc = 1
|
||||||
let g:javascript_plugin_flow = 1
|
let g:javascript_plugin_flow = 1
|
||||||
" }}}
|
|
||||||
|
|
||||||
call add(g:spacevim_project_rooter_patterns, 'package.json')
|
call add(g:spacevim_project_rooter_patterns, 'package.json')
|
||||||
|
|
||||||
@ -64,18 +62,16 @@ function! SpaceVim#layers#lang#javascript#config() abort
|
|||||||
let g:neomake_javascript_eslint_args = ['-f', 'compact', '--fix']
|
let g:neomake_javascript_eslint_args = ['-f', 'compact', '--fix']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
augroup SpaceVim_lang_javascript
|
if s:auto_fix
|
||||||
autocmd!
|
augroup SpaceVim_lang_javascript
|
||||||
autocmd FileType javascript setlocal foldmethod=syntax
|
autocmd!
|
||||||
if s:auto_fix
|
|
||||||
autocmd User NeomakeFinished checktime
|
autocmd User NeomakeFinished checktime
|
||||||
autocmd FocusGained * checktime
|
autocmd FocusGained * checktime
|
||||||
endif
|
augroup END
|
||||||
augroup END
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:on_ft() abort
|
function! s:on_ft() abort
|
||||||
" Galooshi/vim-import-js {{{
|
|
||||||
nnoremap <silent><buffer> <F4> :ImportJSWord<CR>
|
nnoremap <silent><buffer> <F4> :ImportJSWord<CR>
|
||||||
nnoremap <silent><buffer> <Leader>ji :ImportJSWord<CR>
|
nnoremap <silent><buffer> <Leader>ji :ImportJSWord<CR>
|
||||||
nnoremap <silent><buffer> <Leader>jf :ImportJSFix<CR>
|
nnoremap <silent><buffer> <Leader>jf :ImportJSFix<CR>
|
||||||
@ -85,9 +81,7 @@ function! s:on_ft() abort
|
|||||||
inoremap <silent><buffer> <C-j>i <Esc>:ImportJSWord<CR>a
|
inoremap <silent><buffer> <C-j>i <Esc>:ImportJSWord<CR>a
|
||||||
inoremap <silent><buffer> <C-j>f <Esc>:ImportJSFix<CR>a
|
inoremap <silent><buffer> <C-j>f <Esc>:ImportJSFix<CR>a
|
||||||
inoremap <silent><buffer> <C-j>g <Esc>:ImportJSGoto<CR>a
|
inoremap <silent><buffer> <C-j>g <Esc>:ImportJSGoto<CR>a
|
||||||
" }}}
|
|
||||||
|
|
||||||
" heavenshell/vim-jsdoc {{{
|
|
||||||
|
|
||||||
" Allow prompt for interactive input.
|
" Allow prompt for interactive input.
|
||||||
let g:jsdoc_allow_input_prompt = 1
|
let g:jsdoc_allow_input_prompt = 1
|
||||||
@ -101,7 +95,6 @@ function! s:on_ft() abort
|
|||||||
" Enable to use ECMAScript6's Shorthand function, Arrow function.
|
" Enable to use ECMAScript6's Shorthand function, Arrow function.
|
||||||
let g:jsdoc_enable_es6 = 1
|
let g:jsdoc_enable_es6 = 1
|
||||||
|
|
||||||
" }}}
|
|
||||||
|
|
||||||
if SpaceVim#layers#lsp#check_filetype('javascript')
|
if SpaceVim#layers#lsp#check_filetype('javascript')
|
||||||
nnoremap <silent><buffer> K :call SpaceVim#lsp#show_doc()<CR>
|
nnoremap <silent><buffer> K :call SpaceVim#lsp#show_doc()<CR>
|
||||||
|
@ -14,13 +14,5 @@ endfunction
|
|||||||
|
|
||||||
|
|
||||||
function! SpaceVim#layers#lang#json#config() abort
|
function! SpaceVim#layers#lang#json#config() abort
|
||||||
" elzr/vim-json {{{
|
|
||||||
" conceal by default
|
|
||||||
let g:vim_json_syntax_conceal = 0
|
let g:vim_json_syntax_conceal = 0
|
||||||
" }}}
|
|
||||||
|
|
||||||
augroup SpaceVim_d_lang_json
|
|
||||||
autocmd!
|
|
||||||
autocmd FileType json setlocal foldmethod=syntax
|
|
||||||
augroup END
|
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
Reference in New Issue
Block a user