Merge branch 'master' of github.com:lervag/vim-latex

This commit is contained in:
Karl Yngve Lervåg 2013-10-15 10:19:22 +02:00
commit 4d6643c5bb
2 changed files with 58 additions and 25 deletions

View File

@ -15,10 +15,19 @@ function! latex#change#delim(open, close)
let [d1, l1, c1, d2, l2, c2] = latex#util#get_delim() let [d1, l1, c1, d2, l2, c2] = latex#util#get_delim()
let line = getline(l1) let line = getline(l1)
let line = strpart(line, 0, c1 - 1) . a:open . strpart(line, c1 + len(d1)) let line = strpart(line,0,c1 - 1) . a:open . strpart(line, c1 + len(d1) - 1)
call setline(l1, line) call setline(l1, line)
if l1 == l2
let n = len(a:open) - len(d1)
let c2 += n
let pos = getpos('.')
let pos[2] += n
call setpos('.', pos)
endif
let line = getline(l2) let line = getline(l2)
let line = strpart(line, 0, c2 - 1) . a:close . strpart(line, c2 + len(d2)) let line = strpart(line,0,c2 - 1) . a:close . strpart(line, c2 + len(d2) - 1)
call setline(l2, line) call setline(l2, line)
endfunction endfunction
@ -73,7 +82,9 @@ function! latex#change#toggle_delim()
" "
let [d1, l1, c1, d2, l2, c2] = latex#util#get_delim() let [d1, l1, c1, d2, l2, c2] = latex#util#get_delim()
if d1 =~ 'left' if d1 == ''
return 0
elseif d1 =~ 'left'
let newd1 = substitute(d1, '\\left', '', '') let newd1 = substitute(d1, '\\left', '', '')
let newd2 = substitute(d2, '\\right', '', '') let newd2 = substitute(d2, '\\right', '', '')
elseif d1 !~ '\cbigg\?' elseif d1 !~ '\cbigg\?'

View File

@ -471,7 +471,7 @@ parsed once in order to define the highest fold level based on which parts
section, etc.) are present. If the document has been edited and a new fold section, etc.) are present. If the document has been edited and a new fold
level is required (or has become redundant), then |latex#fold#refresh| can be level is required (or has become redundant), then |latex#fold#refresh| can be
used to refresh the fold level settings. This function is mapped by default used to refresh the fold level settings. This function is mapped by default
to `zx`. to 'zx'.
Associated settings: Associated settings:
|g:latex_fold_enabled| |g:latex_fold_enabled|
@ -491,8 +491,8 @@ INDENTATION *vim-latex-indent*
The official indentation function is pretty good and allows for some The official indentation function is pretty good and allows for some
customization. However, I am not quite satisfied, so I wrote my own customization. However, I am not quite satisfied, so I wrote my own
indentation function that is not customizable at all (at least for now), but indentation function that is not customizable at all (at least for now), but
that I think is generally better. It is enabled by default, but may be that I think is better. It is enabled by default, but may be disabled if
disabled if desired |g:latex_indent_enabled|. desired |g:latex_indent_enabled|.
Associated settings: Associated settings:
|g:latex_indent_enabled| |g:latex_indent_enabled|
@ -544,14 +544,13 @@ enabled by default, but may be disabled if desired.
Associated settings: Associated settings:
|g:latex_motion_enabled| |g:latex_motion_enabled|
|g:latex_motion_matchparen| |g:latex_motion_matchparen|
|g:latex_motion_open_pats|
|g:latex_motion_close_pats|
Functions: Functions:
|latex#motion#find_matching_pair| |latex#motion#find_matching_pair|
|latex#motion#next_sec| |latex#motion#next_section|
|latex#motion#select_current_env| |latex#motion#sel_delimiter|
|latex#motion#select_inline_math| |latex#motion#sel_environment|
|latex#motion#sel_inline_math|
============================================================================== ==============================================================================
CHANGE *vim-latex-change* CHANGE *vim-latex-change*
@ -637,8 +636,9 @@ Overview:~
|latex#latexmk#stop_all| |latex#latexmk#stop_all|
|latex#motion#find_matching_pair| |latex#motion#find_matching_pair|
|latex#motion#next_sec| |latex#motion#next_sec|
|latex#motion#select_current_env| |latex#motion#sel_delimiter|
|latex#motion#select_inline_math| |latex#motion#sel_environment|
|latex#motion#sel_inline_math|
|latex#reinit| |latex#reinit|
|latex#toc#open| |latex#toc#open|
|latex#toc#toggle| |latex#toc#toggle|
@ -656,16 +656,22 @@ Overview:~
Detailed descriptions:~ Detailed descriptions:~
*latex#change#env* *latex#change#env*
Change the current environment name to the one passed as an argument.
*latex#change#env_prompt* *latex#change#env_prompt*
Change the current environment name to one typed at a prompt.
*latex#change#toggle_delim* *latex#change#toggle_delim*
Toggle delimiters between `(` `)` and `\left(` `\right)` (and similar).
*latex#change#toggle_env_star* *latex#change#toggle_env_star*
Toggle star for the current environment.
*latex#change#wrap_selection* *latex#change#wrap_selection*
Wrap the current selection within a supplied command.
*latex#change#wrap_selection_prompt* *latex#change#wrap_selection_prompt*
Wrap the current selection within a command given at a prompt.
*latex#complete#omnifunc* *latex#complete#omnifunc*
An 'omnifunc' for label and citation completion, see |vim-latex-completion|. An 'omnifunc' for label and citation completion, see |vim-latex-completion|.
@ -726,10 +732,14 @@ Finds a matching pair of parenthesis or begin-end-tags. The functions is used
A motion command function that moves to the next section. Used to redefine A motion command function that moves to the next section. Used to redefine
the mappings for ']]', '[[', and similar. the mappings for ']]', '[[', and similar.
*latex#motion#select_current_env* *latex#motion#sel_delimiter*
A function that is used to create text objects for text contained within a set
of delimiters.
*latex#motion#sel_environment*
A function that is used to create text objects for environments. A function that is used to create text objects for environments.
*latex#motion#select_inline_math* *latex#motion#sel_inline_math*
A function that is used to create text objects for inline math structures. A function that is used to create text objects for inline math structures.
*latex#reinit* *latex#reinit*
@ -745,22 +755,34 @@ the TOC window.
Toggle TOC window: If TOC window is open, then close it. If it is closed, Toggle TOC window: If TOC window is open, then close it. If it is closed,
then open it (but do not move the cursor to the window). then open it (but do not move the cursor to the window).
*latex#util#convert_back* *latex#util#convert_back*
Convert from stuff like `\IeC{\"u}` to corresponding unicode symbols.
*latex#util#get_delim* *latex#util#get_delim*
Get surrounding delimiters (with position).
*latex#util#get_env* *latex#util#get_env*
Get surrounding environment. If optional argument supplied, the function also
returns the position (line and column number) of the begin and end structure.
*latex#util#has_syntax* *latex#util#has_syntax*
Checks if the given position (or current position) is within the given syntax
structure.
*latex#util#in_comment* *latex#util#in_comment*
Checks if the given position (or current position) is within a comment.
*latex#util#kpsewhich* *latex#util#kpsewhich*
Parse file with kpsewhich.
*latex#util#tex2tree*
*latex#util#tree2tex*
*latex#util#tex2tree*
Turn tex structure to a tree composed of lists. E.g. >
{ testing { tex2tree { } } } => [ "testing" , [ "tex2tree", []]]
<
*latex#util#tree2tex*
Turns a tree composed of lists into tex structure. E.g. >
[ "testing" , [ "tex2tree", []]] => { testing { tex2tree { } } }
<
*latex#view* *latex#view*
Open the output file (specified with |g:latex_latexmk_output|) with the Open the output file (specified with |g:latex_latexmk_output|) with the
default viewer |g:latex_viewer|. default viewer |g:latex_viewer|.