mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 10:30:05 +08:00
Remove old functions
This commit is contained in:
parent
b7e1a25ad3
commit
caaf3ea5f9
@ -109,7 +109,7 @@ function! SpaceVim#layers#lang#java#config() abort
|
||||
autocmd FileType java setlocal omnifunc=javacomplete#Complete
|
||||
call SpaceVim#mapping#gd#add('java', function('s:go_to_def'))
|
||||
endif
|
||||
autocmd FileType jsp call JspFileTypeInit()
|
||||
autocmd FileType jsp call <SID>JspFileTypeInit()
|
||||
augroup END
|
||||
let g:neoformat_enabled_java = ['googlefmt']
|
||||
let g:neoformat_java_googlefmt = {
|
||||
@ -123,6 +123,14 @@ function! SpaceVim#layers#lang#java#config() abort
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! s:JspFileTypeInit()
|
||||
set tags+=~/others/openjdk-8-src/tags
|
||||
set omnifunc=javacomplete#Complete
|
||||
inoremap . <c-r>=OnmiConfigForJsp()<cr>
|
||||
nnoremap <F4> :JCimportAdd<cr>
|
||||
inoremap <F4> <esc>:JCimportAddI<cr>
|
||||
endfunction
|
||||
|
||||
function! s:language_specified_mappings() abort
|
||||
|
||||
let g:_spacevim_mappings_space.l = {'name' : '+Language Specified'}
|
||||
|
@ -16,16 +16,23 @@
|
||||
|
||||
|
||||
function! SpaceVim#layers#lang#xml#plugins() abort
|
||||
let plugins = []
|
||||
call add(plugins,['Valloric/MatchTagAlways', { 'on_ft' : ['html' , 'xhtml' , 'xml' , 'jinja']}])
|
||||
call add(plugins,['sukima/xmledit', { 'on_ft' : ['html' , 'xhtml' , 'xml' , 'jinja']}])
|
||||
return plugins
|
||||
let plugins = []
|
||||
call add(plugins,['Valloric/MatchTagAlways', { 'on_ft' : ['html' , 'xhtml' , 'xml' , 'jinja']}])
|
||||
call add(plugins,['sukima/xmledit', { 'on_ft' : ['html' , 'xhtml' , 'xml' , 'jinja']}])
|
||||
return plugins
|
||||
endfunction
|
||||
|
||||
function! SpaceVim#layers#lang#xml#config() abort
|
||||
function! s:xml_file_init() abort
|
||||
set omnifunc=xmlcomplete#CompleteTags
|
||||
if filereadable('AndroidManifest.xml')
|
||||
set dict+=~/.vim/bundle/vim-dict/dict/android_xml.dic
|
||||
endif
|
||||
endfunction
|
||||
augroup spacevim_lang_xml
|
||||
autocmd!
|
||||
autocmd FileType xml call XmlFileTypeInit()
|
||||
autocmd FileType xml call <SID>xml_file_init()
|
||||
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
|
@ -1,3 +1,12 @@
|
||||
"=============================================================================
|
||||
" functions.vim --- public function for SpaceVim
|
||||
" Copyright (c) 2016-2017 Wang Shidong & Contributors
|
||||
" Author: Wang Shidong < wsdjeg at 163.com >
|
||||
" URL: https://spacevim.org
|
||||
" License: GPLv3
|
||||
"=============================================================================
|
||||
|
||||
|
||||
function! OnmiConfigForJsp()
|
||||
let pos1 = search('</script>','nb',line('w0'))
|
||||
let pos2 = search('<script','nb',line('w0'))
|
||||
@ -11,84 +20,6 @@ function! OnmiConfigForJsp()
|
||||
return "\<esc>a."
|
||||
endif
|
||||
endf
|
||||
function! BracketsFunc()
|
||||
let line = getline('.')
|
||||
let col = col('.')
|
||||
if line[col - 2] ==# ']'
|
||||
return "{}\<esc>i"
|
||||
else
|
||||
return "{\<cr>}\<esc>O"
|
||||
endif
|
||||
endf
|
||||
function! XmlFileTypeInit()
|
||||
set omnifunc=xmlcomplete#CompleteTags
|
||||
if filereadable('AndroidManifest.xml')
|
||||
set dict+=~/.vim/bundle/vim-dict/dict/android_xml.dic
|
||||
endif
|
||||
endf
|
||||
function! WSDAutoComplete(char)
|
||||
if(getline('.')=~?'^\s*.*\/\/')==0
|
||||
let line = getline('.')
|
||||
let col = col('.')
|
||||
if a:char ==# '.'
|
||||
return a:char."\<c-x>\<c-o>\<c-p>"
|
||||
elseif line[col - 2] ==# ' ' ||line[col -2] ==# '(' ||line[col - 2] ==# ','
|
||||
return a:char."\<c-x>\<c-o>\<c-p>"
|
||||
elseif line[col - 3] ==# ' ' && line[col - 2] ==# '@'
|
||||
return a:char."\<c-x>\<c-o>\<c-p>"
|
||||
else
|
||||
return a:char
|
||||
endif
|
||||
else
|
||||
"bug exists
|
||||
normal! ma
|
||||
let commentcol = searchpos('//','b',line('.'))[1]
|
||||
normal! `a
|
||||
if commentcol == 0
|
||||
return a:char."\<c-x>\<c-o>\<c-p>"
|
||||
else
|
||||
return "\<Right>".a:char
|
||||
endif
|
||||
endif
|
||||
endf
|
||||
function! ClosePair(char)
|
||||
if getline('.')[col('.') - 1] == a:char
|
||||
return "\<Right>"
|
||||
else
|
||||
return a:char
|
||||
endif
|
||||
endf
|
||||
|
||||
function! CloseBracket()
|
||||
if match(getline(line('.') + 1), '\s*}') < 0
|
||||
return "\<CR>}"
|
||||
else
|
||||
return "\<Esc>j0f}a"
|
||||
endif
|
||||
endf
|
||||
|
||||
function! QuoteDelim(char)
|
||||
let line = getline('.')
|
||||
let col = col('.')
|
||||
if line[col - 2] ==# "\\"
|
||||
"Inserting a quoted quotation mark into the string
|
||||
return a:char
|
||||
elseif line[col - 1] == a:char
|
||||
"Escaping out of the string
|
||||
return "\<Right>"
|
||||
else
|
||||
"Starting a string
|
||||
return a:char.a:char."\<Esc>i"
|
||||
endif
|
||||
endf
|
||||
function! JspFileTypeInit()
|
||||
set tags+=~/others/openjdk-8-src/tags
|
||||
set omnifunc=javacomplete#Complete
|
||||
inoremap . <c-r>=OnmiConfigForJsp()<cr>
|
||||
nnoremap <F4> :JCimportAdd<cr>
|
||||
inoremap <F4> <esc>:JCimportAddI<cr>
|
||||
endfunction
|
||||
|
||||
function! MyLeaderTabfunc() abort
|
||||
if g:spacevim_autocomplete_method ==# 'deoplete'
|
||||
if g:spacevim_enable_javacomplete2_py
|
||||
|
Loading…
Reference in New Issue
Block a user