Use <plug>(vl-...) instead of <plug>VimLatex

This commit is contained in:
Karl Yngve Lervåg 2015-01-30 19:47:19 +01:00
parent de98b867e3
commit 5f7d78383e
7 changed files with 106 additions and 107 deletions

View File

@ -149,9 +149,9 @@ function! s:init_environment() " {{{1
command! -buffer VimLatexReinitialize call latex#reinit()
" Define mappings
nnoremap <buffer> <plug>VimLatexInfo :call latex#info()<cr>
nnoremap <buffer> <plug>VimLatexHelp :call latex#help()<cr>
nnoremap <buffer> <plug>VimLatexReinit :call latex#reinit()<cr>
nnoremap <buffer> <plug>(vl-info) :call latex#info()<cr>
nnoremap <buffer> <plug>(vl-help) :call latex#help()<cr>
nnoremap <buffer> <plug>(vl-reinit) :call latex#reinit()<cr>
endfunction
function! s:init_errorformat() " {{{1

View File

@ -5,15 +5,15 @@
"
function! latex#change#init(initialized) " {{{1
nnoremap <buffer> <plug>VimLatexDeleteEnv :call latex#change#env('')<cr>
nnoremap <buffer> <plug>VimLatexDeleteCmd vaBom`o<esc>xg``xdF\
nnoremap <buffer> <plug>VimLatexChangeEnv :call latex#change#env_prompt()<cr>
nnoremap <buffer> <plug>VimLatexChangeCmd :call latex#change#command()<cr>
nnoremap <buffer> <plug>VimLatexToggleEnvStar :call latex#change#toggle_env_star()<cr>
nnoremap <buffer> <plug>VimLatexToggleDelim :call latex#change#toggle_delim()<cr>
nnoremap <buffer> <plug>VimLatexChangeToCmd :call latex#change#to_command()<cr>i
inoremap <buffer> <plug>VimLatexChangeToCmd <c-r>=latex#change#to_command()<cr>
inoremap <buffer> <plug>VimLatexCloseEnv <c-r>=latex#change#close_environment()<cr>
nnoremap <buffer> <plug>(vl-delete-env) :call latex#change#env('')<cr>
nnoremap <buffer> <plug>(vl-delete-cmd) vaBom`o<esc>xg``xdF\
nnoremap <buffer> <plug>(vl-change-env) :call latex#change#env_prompt()<cr>
nnoremap <buffer> <plug>(vl-change-cmd) :call latex#change#command()<cr>
nnoremap <buffer> <plug>(vl-toggle-star) :call latex#change#toggle_env_star()<cr>
nnoremap <buffer> <plug>(vl-toggle-delim) :call latex#change#toggle_delim()<cr>
nnoremap <buffer> <plug>(vl-create-cmd) :call latex#change#to_command()<cr>i
inoremap <buffer> <plug>(vl-create-cmd) <c-r>=latex#change#to_command()<cr>
inoremap <buffer> <plug>(vl-close-env) <c-r>=latex#change#close_environment()<cr>
endfunction
function! latex#change#command() " {{{1

View File

@ -42,17 +42,17 @@ function! latex#latexmk#init(initialized) " {{{1
command! -buffer -bang VimLatexStatus call latex#latexmk#status(<q-bang> == "!")
" Define mappings
nnoremap <buffer> <plug>VimLatexCompile :call latex#latexmk#compile()<cr>
nnoremap <buffer> <plug>VimLatexCompileSS :call latex#latexmk#compile_ss(0)<cr>
nnoremap <buffer> <plug>VimLatexCompileToggle :call latex#latexmk#toggle()<cr>
nnoremap <buffer> <plug>VimLatexCompileOutput :call latex#latexmk#output()<cr>
nnoremap <buffer> <plug>VimLatexStop :call latex#latexmk#stop()<cr>
nnoremap <buffer> <plug>VimLatexStopAll :call latex#latexmk#stop_all()<cr>
nnoremap <buffer> <plug>VimLatexErrors :call latex#latexmk#errors(1)<cr>
nnoremap <buffer> <plug>VimLatexClean :call latex#latexmk#clean(0)<cr>
nnoremap <buffer> <plug>VimLatexCleanFull :call latex#latexmk#clean(1)<cr>
nnoremap <buffer> <plug>VimLatexStatus :call latex#latexmk#status(0)<cr>
nnoremap <buffer> <plug>VimLatexStatusAll :call latex#latexmk#status(1)<cr>
nnoremap <buffer> <plug>(vl-compile) :call latex#latexmk#compile()<cr>
nnoremap <buffer> <plug>(vl-compile-ss) :call latex#latexmk#compile_ss(0)<cr>
nnoremap <buffer> <plug>(vl-compile-toggle) :call latex#latexmk#toggle()<cr>
nnoremap <buffer> <plug>(vl-compile-output) :call latex#latexmk#output()<cr>
nnoremap <buffer> <plug>(vl-stop) :call latex#latexmk#stop()<cr>
nnoremap <buffer> <plug>(vl-stop-all) :call latex#latexmk#stop_all()<cr>
nnoremap <buffer> <plug>(vl-errors) :call latex#latexmk#errors(1)<cr>
nnoremap <buffer> <plug>(vl-clean) :call latex#latexmk#clean(0)<cr>
nnoremap <buffer> <plug>(vl-clean-full) :call latex#latexmk#clean(1)<cr>
nnoremap <buffer> <plug>(vl-status) :call latex#latexmk#status(0)<cr>
nnoremap <buffer> <plug>(vl-status-all) :call latex#latexmk#status(1)<cr>
" The remaining part is only relevant for continuous mode
if !g:latex_latexmk_continuous | return | endif

View File

@ -8,72 +8,71 @@ function! latex#mappings#init(initialized)
call latex#util#set_default('g:latex_mappings_enabled', 1)
if !g:latex_mappings_enabled | return | endif
nmap <buffer> <localleader>li <plug>VimLatexInfo
nmap <buffer> <localleader>lh <plug>VimLatexHelp
nmap <buffer> <localleader>lR <plug>VimLatexReinit
nmap <silent><buffer> <localleader>li <plug>(vl-info)
nmap <silent><buffer> <localleader>lh <plug>(vl-help)
nmap <silent><buffer> <localleader>lR <plug>(vl-reinit)
" Change
nnoremap <buffer> dse <plug>VimLatexDeleteEnv
nnoremap <buffer> dsc <plug>VimLatexDeleteCmd
nnoremap <buffer> cse <plug>VimLatexChangeEnv
nnoremap <buffer> csc <plug>VimLatexChangeCmd
nnoremap <buffer> tse <plug>VimLatexToggleEnvStar
nnoremap <buffer> tsd <plug>VimLatexToggleDelim
nnoremap <buffer> <F7> <plug>VimLatexChangeToCmd
inoremap <buffer> <F7> <plug>VimLatexChangeToCmd
inoremap <buffer> ]] <plug>VimLatexCloseEnv
nmap <silent><buffer> dse <plug>(vl-delete-env)
nmap <silent><buffer> dsc <plug>(vl-delete-cmd)
nmap <silent><buffer> cse <plug>(vl-change-env)
nmap <silent><buffer> csc <plug>(vl-change-cmd)
nmap <silent><buffer> tse <plug>(vl-toggle-star)
nmap <silent><buffer> tsd <plug>(vl-toggle-delim)
nmap <silent><buffer> <F7> <plug>(vl-create-cmd)
imap <silent><buffer> <F7> <plug>(vl-create-cmd)
imap <silent><buffer> ]] <plug>(vl-close-env)
if g:latex_latexmk_enabled
nmap <buffer> <localleader>ll <plug>VimLatexCompileToggle
nmap <buffer> <localleader>lo <plug>VimLatexCompileOutput
nmap <buffer> <localleader>lk <plug>VimLatexStop
nmap <buffer> <localleader>lK <plug>VimLatexStopAll
nmap <buffer> <localleader>le <plug>VimLatexErrors
nmap <buffer> <localleader>lc <plug>VimLatexClean
nmap <buffer> <localleader>lC <plug>VimLatexCleanFull
nmap <buffer> <localleader>lg <plug>VimLatexStatus
nmap <buffer> <localleader>lG <plug>VimLatexStatusAll
nmap <silent><buffer> <localleader>ll <plug>(vl-compile-toggle)
nmap <silent><buffer> <localleader>lo <plug>(vl-compile-output)
nmap <silent><buffer> <localleader>lk <plug>(vl-stop)
nmap <silent><buffer> <localleader>lK <plug>(vl-stop-all)
nmap <silent><buffer> <localleader>le <plug>(vl-errors)
nmap <silent><buffer> <localleader>lc <plug>(vl-clean)
nmap <silent><buffer> <localleader>lC <plug>(vl-clean-full)
nmap <silent><buffer> <localleader>lg <plug>(vl-status)
nmap <silent><buffer> <localleader>lG <plug>(vl-status-all)
endif
if g:latex_motion_enabled
nmap <buffer> % <plug>VimLatex%
xmap <buffer> % <plug>VimLatex%
omap <buffer> % <plug>VimLatex%
nmap <buffer> ]] <plug>VimLatex]]
nmap <buffer> ][ <plug>VimLatex][
nmap <buffer> [] <plug>VimLatex[]
nmap <buffer> [[ <plug>VimLatex[[
xmap <buffer> ]] <plug>VimLatex]]
xmap <buffer> ][ <plug>VimLatex][
xmap <buffer> [] <plug>VimLatex[]
xmap <buffer> [[ <plug>VimLatex[[
omap <buffer> ]] <plug>VimLatex]]
omap <buffer> ][ <plug>VimLatex][
omap <buffer> [] <plug>VimLatex[]
omap <buffer> [[ <plug>VimLatex[[
xmap <buffer> ie <plug>VimLatexie
xmap <buffer> ae <plug>VimLatexae
omap <buffer> ie <plug>VimLatexie
omap <buffer> ae <plug>VimLatexae
xmap <buffer> i$ <plug>VimLatexi$
xmap <buffer> a$ <plug>VimLatexa$
omap <buffer> i$ <plug>VimLatexi$
omap <buffer> a$ <plug>VimLatexa$
xmap <buffer> id <plug>VimLatexid
xmap <buffer> ad <plug>VimLatexad
omap <buffer> id <plug>VimLatexid
omap <buffer> ad <plug>VimLatexad
nmap <silent><buffer> % <plug>(vl-%)
xmap <silent><buffer> % <plug>(vl-%)
omap <silent><buffer> % <plug>(vl-%)
nmap <silent><buffer> ]] <plug>(vl-]])
nmap <silent><buffer> ][ <plug>(vl-][)
nmap <silent><buffer> [] <plug>(vl-[])
nmap <silent><buffer> [[ <plug>(vl-[[)
xmap <silent><buffer> ]] <plug>(vl-]])
xmap <silent><buffer> ][ <plug>(vl-][)
xmap <silent><buffer> [] <plug>(vl-[])
xmap <silent><buffer> [[ <plug>(vl-[[)
omap <silent><buffer> ]] <plug>(vl-]])
omap <silent><buffer> ][ <plug>(vl-][)
omap <silent><buffer> [] <plug>(vl-[])
omap <silent><buffer> [[ <plug>(vl-[[)
xmap <silent><buffer> ie <plug>(vl-ie)
xmap <silent><buffer> ae <plug>(vl-ae)
omap <silent><buffer> ie <plug>(vl-ie)
omap <silent><buffer> ae <plug>(vl-ae)
xmap <silent><buffer> i$ <plug>(vl-i$)
xmap <silent><buffer> a$ <plug>(vl-a$)
omap <silent><buffer> i$ <plug>(vl-i$)
omap <silent><buffer> a$ <plug>(vl-a$)
xmap <silent><buffer> id <plug>(vl-id)
xmap <silent><buffer> ad <plug>(vl-ad)
omap <silent><buffer> id <plug>(vl-id)
omap <silent><buffer> ad <plug>(vl-ad)
endif
if g:latex_toc_enabled
nmap <buffer> <localleader>lt <plug>VimLatexTocOpen
nmap <buffer> <localleader>lT <plug>VimLatexTocToggle
nmap <silent><buffer> <localleader>lt <plug>(vl-toc-open)
nmap <silent><buffer> <localleader>lT <plug>(vl-toc-toggle)
endif
if g:latex_view_enabled
nmap <buffer> <localleader>lv <plug>VimLatexView
nmap <silent><buffer> <localleader>lv <plug>(vl-view)
if has_key(g:latex#data[b:latex.id], 'rsearch')
nmap <buffer> <localleader>lr <plug>VimLatexRSearch
nmap <silent><buffer> <localleader>lr <plug>(vl-reverse-search)
endif
endif
endfunction

View File

@ -12,33 +12,33 @@ function! latex#motion#init(initialized) " {{{1
call latex#util#set_default('g:latex_motion_matchparen', 1)
" Define mappings
nnoremap <buffer> <plug>VimLatex% :call latex#motion#find_matching_pair()<cr>
xnoremap <buffer> <plug>VimLatex% :<c-u>call latex#motion#find_matching_pair(1)<cr>
onoremap <buffer> <plug>VimLatex% :normal v%<cr>
nnoremap <buffer> <plug>VimLatex]] :call latex#motion#next_section(0,0,0)<cr>
nnoremap <buffer> <plug>VimLatex][ :call latex#motion#next_section(1,0,0)<cr>
nnoremap <buffer> <plug>VimLatex[] :call latex#motion#next_section(1,1,0)<cr>
nnoremap <buffer> <plug>VimLatex[[ :call latex#motion#next_section(0,1,0)<cr>
xnoremap <buffer> <plug>VimLatex]] :<c-u>call latex#motion#next_section(0,0,1)<cr>
xnoremap <buffer> <plug>VimLatex][ :<c-u>call latex#motion#next_section(1,0,1)<cr>
xnoremap <buffer> <plug>VimLatex[] :<c-u>call latex#motion#next_section(1,1,1)<cr>
xnoremap <buffer> <plug>VimLatex[[ :<c-u>call latex#motion#next_section(0,1,1)<cr>
onoremap <buffer> <plug>VimLatex]] :normal v]]<cr>
onoremap <buffer> <plug>VimLatex][ :normal v][<cr>
onoremap <buffer> <plug>VimLatex[] :normal v[]<cr>
onoremap <buffer> <plug>VimLatex[[ :normal v[[<cr>
xnoremap <buffer> <plug>VimLatexie :<c-u>call latex#motion#sel_environment(1)<cr>
xnoremap <buffer> <plug>VimLatexae :<c-u>call latex#motion#sel_environment()<cr>
onoremap <buffer> <plug>VimLatexie :normal vie<cr>
onoremap <buffer> <plug>VimLatexae :normal vae<cr>
xnoremap <buffer> <plug>VimLatexi$ :<c-u>call latex#motion#sel_inline_math(1)<cr>
xnoremap <buffer> <plug>VimLatexa$ :<c-u>call latex#motion#sel_inline_math()<cr>
onoremap <buffer> <plug>VimLatexi$ :normal vi$<cr>
onoremap <buffer> <plug>VimLatexa$ :normal va$<cr>
xnoremap <buffer> <plug>VimLatexid :<c-u>call latex#motion#sel_delimiter(1)<cr>
xnoremap <buffer> <plug>VimLatexad :<c-u>call latex#motion#sel_delimiter()<cr>
onoremap <buffer> <plug>VimLatexid :normal vi(<cr>
onoremap <buffer> <plug>VimLatexad :normal va(<cr>
nnoremap <buffer> <plug>(vl-%) :call latex#motion#find_matching_pair()<cr>
xnoremap <buffer> <plug>(vl-%) :<c-u>call latex#motion#find_matching_pair(1)<cr>
onoremap <buffer> <plug>(vl-%) :normal v%<cr>
nnoremap <buffer> <plug>(vl-]]) :call latex#motion#next_section(0,0,0)<cr>
nnoremap <buffer> <plug>(vl-][) :call latex#motion#next_section(1,0,0)<cr>
nnoremap <buffer> <plug>(vl-[]) :call latex#motion#next_section(1,1,0)<cr>
nnoremap <buffer> <plug>(vl-[[) :call latex#motion#next_section(0,1,0)<cr>
xnoremap <buffer> <plug>(vl-]]) :<c-u>call latex#motion#next_section(0,0,1)<cr>
xnoremap <buffer> <plug>(vl-][) :<c-u>call latex#motion#next_section(1,0,1)<cr>
xnoremap <buffer> <plug>(vl-[]) :<c-u>call latex#motion#next_section(1,1,1)<cr>
xnoremap <buffer> <plug>(vl-[[) :<c-u>call latex#motion#next_section(0,1,1)<cr>
onoremap <buffer> <plug>(vl-]]) :normal v]]<cr>
onoremap <buffer> <plug>(vl-][) :normal v][<cr>
onoremap <buffer> <plug>(vl-[]) :normal v[]<cr>
onoremap <buffer> <plug>(vl-[[) :normal v[[<cr>
xnoremap <buffer> <plug>(vl-ie) :<c-u>call latex#motion#sel_environment(1)<cr>
xnoremap <buffer> <plug>(vl-ae) :<c-u>call latex#motion#sel_environment()<cr>
onoremap <buffer> <plug>(vl-ie) :normal vie<cr>
onoremap <buffer> <plug>(vl-ae) :normal vae<cr>
xnoremap <buffer> <plug>(vl-i$) :<c-u>call latex#motion#sel_inline_math(1)<cr>
xnoremap <buffer> <plug>(vl-a$) :<c-u>call latex#motion#sel_inline_math()<cr>
onoremap <buffer> <plug>(vl-i$) :normal vi$<cr>
onoremap <buffer> <plug>(vl-a$) :normal va$<cr>
xnoremap <buffer> <plug>(vl-id) :<c-u>call latex#motion#sel_delimiter(1)<cr>
xnoremap <buffer> <plug>(vl-ad) :<c-u>call latex#motion#sel_delimiter()<cr>
onoremap <buffer> <plug>(vl-id) :normal vi(<cr>
onoremap <buffer> <plug>(vl-ad) :normal va(<cr>
" Highlight matching parens ($, (), ...)
if !a:initialized && g:latex_motion_matchparen

View File

@ -27,8 +27,8 @@ function! latex#toc#init(initialized) " {{{1
command! -buffer VimLatexTocToggle call latex#toc#toggle()
" Define mappings
nnoremap <buffer> <plug>VimLatexTocOpen :call latex#toc#open()<cr>
nnoremap <buffer> <plug>VimLatexTocToggle :call latex#toc#toggle()<cr>
nnoremap <buffer> <plug>(vl-toc-open) :call latex#toc#open()<cr>
nnoremap <buffer> <plug>(vl-toc-toggle) :call latex#toc#toggle()<cr>
endfunction
function! latex#toc#open() " {{{1

View File

@ -47,9 +47,9 @@ function! latex#view#init(initialized) " {{{1
endif
" Define mappings
nnoremap <buffer> <plug>VimLatexView :call g:latex#data[b:latex.id].view()<cr>
nnoremap <buffer> <plug>(vl-view) :call g:latex#data[b:latex.id].view()<cr>
if has_key(data, 'rsearch')
nnoremap <buffer> <plug>VimLatexRSearch
nnoremap <buffer> <plug>(vl-reverse-search)
\ :call g:latex#data[b:latex.id].rsearch()<cr>
endif
endfunction