Thread: [Vim-latex-devel] Feature suggestion: distinct tw for normal/math modes
Brought to you by:
srinathava,
tmaas
From: Julien C. <jul...@gm...> - 2009-01-07 10:32:48
|
Dear all, I suggest this feature to be added : allow two distinct "tw" settings for normal and math modes. Personnally, I often want my paragraphsto be tw=72, but to wrap my math formulas myself (i.e. tw=0), regardless of the length of line -- some intricate math expressions can sometimes be more appreciated on a very long line by themselves, when the things around matter more. I don't know how easy this is to implement, though. Best, and thanks for this great tool ! Julien |
From: Mike R. <ri...@um...> - 2009-01-07 20:54:30
|
Julien, I've run into this problem as well. There are a couple things I do to deal with the way vim wraps text. First, I typeset my math in a certain style: - I almost always use the AMS align or align* environments. [see :h imaps.txt for how to make LatexSuite style maps, I use EAL and EAS, respectively]. - For long equations, I only put one term on each line. - For terms on the right-hand side, I prepend each line with '{} '. So LHS terms go all the way to the left, slightly indented. RHS terms are indented by three more columns due to the '{} '. Doing it this way immediately makes vim's native linewise commands MUCH more useful in equations. Second, I have the following code in my ~/.vim/ftplugin/tex.vim: omap <buffer> lp ?^$\\|^\s*\(\\begin\\|\\end\\|\\renewcommand\\|\\label\\|\\item\)?1<CR>//-1<CR>.<CR> nmap gwlp gwlp`` The first line makes an object for a "LaTeX paragraph". You can use it with gw, as in gwlp. The second line makes gwlp also do "``" so the cursor is in the same place in the text as it was previously. Basically, gwlp will reformat the current paragraph until it reaches a blank line or a begin or end of environment or a label or an item command. This way gwlp won't mess up your math, but your text will still be formatted correctly. Hope this helps! -Mike Richman On Wed, Jan 7, 2009 at 5:32 AM, Julien Cornebise <jul...@gm...> wrote: > Dear all, > > I suggest this feature to be added : allow two distinct "tw" settings for > normal and math modes. > > Personnally, I often want my paragraphsto be tw=72, but to wrap my math > formulas myself (i.e. tw=0), regardless of the length of line -- some > intricate math expressions can sometimes be more appreciated on a very long > line by themselves, when the things around matter more. > > I don't know how easy this is to implement, though. > Best, and thanks for this great tool ! > > Julien > > ------------------------------------------------------------------------------ > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB > _______________________________________________ > Vim-latex-devel mailing list > Vim...@li... > https://lists.sourceforge.net/lists/listinfo/vim-latex-devel > > |
From: Manuel Pégourié-G. <mp...@el...> - 2009-01-07 23:55:56
|
Hi Mike, Mike Richman a écrit : > Basically, gwlp will reformat the current paragraph until it reaches a > blank line or a begin or end of environment or a label or an item > command. This way gwlp won't mess up your math, but your text will > still be formatted correctly. > OMG! I've been looking for this for sooooo long! Thanks a lot. I guess the culprit is that omap defines new "objects". Is is possible possible to define objects like "e" for environment such that ae means the whole environment including the \begin and \end lines, and ie just the body? I'll test it tomorrow, and try to understand how it works, and maybe come back with a few more questions. Thanks again, Manuel. |
From: Mike R. <ri...@um...> - 2009-01-08 01:03:50
|
The thing is, omap actually just defines a map that is in effect in object-pending mode -- when the cursor is half-height in gvim. In this case, the map goes backwards till it finds something that could be considered the start of a LaTeX paragraph, then it does ".", or the same thing, until the end of a LaTeX paragraph. I think "dlp" would also work, but clp would not work: it would clear the text till the start, and insert .// or something. So I'm not sure if we can make ae/ie maps that work exactly like ap/ip do; those seem to have an advantage since they're built-in. But if anyone has a way, please share! :) -Mike On Wed, Jan 7, 2009 at 6:55 PM, Manuel Pégourié-Gonnard <mp...@el...> wrote: > Hi Mike, > > Mike Richman a écrit : >> Basically, gwlp will reformat the current paragraph until it reaches a >> blank line or a begin or end of environment or a label or an item >> command. This way gwlp won't mess up your math, but your text will >> still be formatted correctly. >> > OMG! I've been looking for this for sooooo long! Thanks a lot. > > I guess the culprit is that omap defines new "objects". Is is possible > possible to define objects like "e" for environment such that ae means > the whole environment including the \begin and \end lines, and ie just > the body? > > I'll test it tomorrow, and try to understand how it works, and maybe > come back with a few more questions. > > Thanks again, > Manuel. > |
From: Mike R. <ri...@um...> - 2009-01-08 03:23:22
|
Update: you *can* make more complex mappings. In this case, I've made a robust object map for lp. It works in both object-pending or visual mode. Here is the code in my ~/.vim/ftplugin/tex.vim: " Section: Paragraph formatting (autofill) {{{ " Correctly format paragraphs in LaTeX. " The exec command should be one line: watch out if the e-mail client " or server inserts any line breaks. function! g:Tex_SelectParagraph () exec "normal ?^$\\|^\s*\\(\\\\begin\\|\\\\end\\|\\\\renewcommand\\|\\\\label\\|\\\\item\\)?1\<cr>v//-1\<cr>$" endfunction omap <buffer> lp :call g:Tex_SelectParagraph()<cr> vmap <buffer> lp <esc>:call g:Tex_SelectParagraph()<cr> " }}} Now you can use ylp, dlp, clp, vlp, etc. I plan to make additional ones for "in environment", "an environment", "an equation", and more. For more info on how this works, check out :h omap-info. Mike Richman On Wed, Jan 7, 2009 at 6:55 PM, Manuel Pégourié-Gonnard <mp...@el...> wrote: > Hi Mike, > > Mike Richman a écrit : >> Basically, gwlp will reformat the current paragraph until it reaches a >> blank line or a begin or end of environment or a label or an item >> command. This way gwlp won't mess up your math, but your text will >> still be formatted correctly. >> > OMG! I've been looking for this for sooooo long! Thanks a lot. > > I guess the culprit is that omap defines new "objects". Is is possible > possible to define objects like "e" for environment such that ae means > the whole environment including the \begin and \end lines, and ie just > the body? > > I'll test it tomorrow, and try to understand how it works, and maybe > come back with a few more questions. > > Thanks again, > Manuel. > |
From: Ted P. <te...@te...> - 2009-01-09 17:36:07
|
This is a very cool little tool. I've shortened it a bit (to prevent "Press ENTER" prompts on narrow windows and low cmdheight) and added some other tags... " Section: Paragraph formatting (autofill) {{{ " Correctly format paragraphs in LaTeX. " The exec command should be one line: watch out if the e-mail client " or server inserts any line breaks. function! g:Tex_SelectParagraph () exec "normal ?^$\\|^\s*\\\\\\(begin\\|end\\|\\(new\\|renew\\|provide\\)com\\|def\\|[ls]et\\|label\\|item\\)?1\<cr>v//-1\<cr>$" endfunction omap <buffer> lp :call g:Tex_SelectParagraph()<cr> vmap <buffer> lp <esc>:call g:Tex_SelectParagraph()<cr> " }}} Hopefully that doesn't wrap much. If it does, join everything on the "exec" line. The "exec" line has no spaces. --Ted On 1/7/09 10:23 PM, Mike Richman wrote: > " Section: Paragraph formatting (autofill) {{{ > " Correctly format paragraphs in LaTeX. > " The exec command should be one line: watch out if the e-mail client > " or server inserts any line breaks. > function! g:Tex_SelectParagraph () > exec "normal ?^$\\|^\s*\\(\\\\begin\\|\\\\end\\|\\\\renewcommand\\|\\\\label\\|\\\\item\\)?1\<cr>v//-1\<cr>$" > endfunction > omap<buffer> lp :call g:Tex_SelectParagraph()<cr> > vmap<buffer> lp<esc>:call g:Tex_SelectParagraph()<cr> > " }}} -- Ted Pavlic <te...@te...> Please visit my ALS association page: http://web.alsa.org/goto/tedpavlic My family appreciates your support in the fight to defeat ALS. |
From: Ted P. <te...@te...> - 2009-01-09 17:43:10
|
Caveat: You have to make sure you have a \begin{doc} and an \end{doc} or that to work well. Rather, if you are in an included TeX without a \begin{doc}, like: % ==== This is a test \begin{equation} x=5 \end{equation} % ==== If you put your cursor on the "is" line and hit "vlp", you select everything from "\begin{equation} down. On 1/7/09 10:23 PM, Mike Richman wrote: > " Section: Paragraph formatting (autofill) {{{ > " Correctly format paragraphs in LaTeX. > " The exec command should be one line: watch out if the e-mail client > " or server inserts any line breaks. > function! g:Tex_SelectParagraph () > exec "normal ?^$\\|^\s*\\(\\\\begin\\|\\\\end\\|\\\\renewcommand\\|\\\\label\\|\\\\item\\)?1\<cr>v//-1\<cr>$" > endfunction > omap<buffer> lp :call g:Tex_SelectParagraph()<cr> > vmap<buffer> lp<esc>:call g:Tex_SelectParagraph()<cr> > " }}} -- Ted Pavlic <te...@te...> Please visit my ALS association page: http://web.alsa.org/goto/tedpavlic My family appreciates your support in the fight to defeat ALS. |
From: Julien C. <jul...@gm...> - 2009-01-08 09:11:57
|
Wow, thanks for all these informations ! That will be really useful, right now !! Thanks ! On Thu, Jan 8, 2009 at 4:23 AM, Mike Richman <ri...@um...> wrote: > Update: you *can* make more complex mappings. In this case, I've made > a robust object map for lp. It works in both object-pending or visual > mode. Here is the code in my ~/.vim/ftplugin/tex.vim: > > " Section: Paragraph formatting (autofill) {{{ > " Correctly format paragraphs in LaTeX. > " The exec command should be one line: watch out if the e-mail client > " or server inserts any line breaks. > function! g:Tex_SelectParagraph () > exec "normal ?^$\\|^\s*\\(\\\\begin\\|\\\\end\\|\\\\renewcommand\\|\\\\label\\|\\\\item\\)?1\<cr>v//-1\<cr>$" > endfunction > omap <buffer> lp :call g:Tex_SelectParagraph()<cr> > vmap <buffer> lp <esc>:call g:Tex_SelectParagraph()<cr> > " }}} > > > Now you can use ylp, dlp, clp, vlp, etc. > > I plan to make additional ones for "in environment", "an environment", > "an equation", and more. For more info on how this works, check out > :h omap-info. > > Mike Richman > > On Wed, Jan 7, 2009 at 6:55 PM, Manuel Pégourié-Gonnard <mp...@el...> wrote: >> Hi Mike, >> >> Mike Richman a écrit : >>> Basically, gwlp will reformat the current paragraph until it reaches a >>> blank line or a begin or end of environment or a label or an item >>> command. This way gwlp won't mess up your math, but your text will >>> still be formatted correctly. >>> >> OMG! I've been looking for this for sooooo long! Thanks a lot. >> >> I guess the culprit is that omap defines new "objects". Is is possible >> possible to define objects like "e" for environment such that ae means >> the whole environment including the \begin and \end lines, and ie just >> the body? >> >> I'll test it tomorrow, and try to understand how it works, and maybe >> come back with a few more questions. >> >> Thanks again, >> Manuel. >> > |
From: Ted P. <te...@te...> - 2009-01-08 13:30:08
|
Keep in mind that any "movement" can follow those g commands. So even if your the Tex_SelectParagraph you choose doesn't fit the weird case you're dealing with at this instant, you can probably build a quick regexp by inspection that will. For example, if a \ is coming up on the start of the next line, something like gw/^\\ will apply a gw up to the line just before it. --Ted On 1/8/09 4:11 AM, Julien Cornebise wrote: > Wow, thanks for all these informations ! That will be really useful, > right now !! > Thanks ! > > On Thu, Jan 8, 2009 at 4:23 AM, Mike Richman<ri...@um...> wrote: >> Update: you *can* make more complex mappings. In this case, I've made >> a robust object map for lp. It works in both object-pending or visual >> mode. Here is the code in my ~/.vim/ftplugin/tex.vim: >> >> " Section: Paragraph formatting (autofill) {{{ >> " Correctly format paragraphs in LaTeX. >> " The exec command should be one line: watch out if the e-mail client >> " or server inserts any line breaks. >> function! g:Tex_SelectParagraph () >> exec "normal ?^$\\|^\s*\\(\\\\begin\\|\\\\end\\|\\\\renewcommand\\|\\\\label\\|\\\\item\\)?1\<cr>v//-1\<cr>$" >> endfunction >> omap<buffer> lp :call g:Tex_SelectParagraph()<cr> >> vmap<buffer> lp<esc>:call g:Tex_SelectParagraph()<cr> >> " }}} >> >> >> Now you can use ylp, dlp, clp, vlp, etc. >> >> I plan to make additional ones for "in environment", "an environment", >> "an equation", and more. For more info on how this works, check out >> :h omap-info. >> >> Mike Richman >> >> On Wed, Jan 7, 2009 at 6:55 PM, Manuel Pégourié-Gonnard<mp...@el...> wrote: >>> Hi Mike, >>> >>> Mike Richman a écrit : >>>> Basically, gwlp will reformat the current paragraph until it reaches a >>>> blank line or a begin or end of environment or a label or an item >>>> command. This way gwlp won't mess up your math, but your text will >>>> still be formatted correctly. >>>> >>> OMG! I've been looking for this for sooooo long! Thanks a lot. >>> >>> I guess the culprit is that omap defines new "objects". Is is possible >>> possible to define objects like "e" for environment such that ae means >>> the whole environment including the \begin and \end lines, and ie just >>> the body? >>> >>> I'll test it tomorrow, and try to understand how it works, and maybe >>> come back with a few more questions. >>> >>> Thanks again, >>> Manuel. >>> > > ------------------------------------------------------------------------------ > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB > _______________________________________________ > Vim-latex-devel mailing list > Vim...@li... > https://lists.sourceforge.net/lists/listinfo/vim-latex-devel > -- Ted Pavlic <te...@te...> Please visit my ALS association page: http://web.alsa.org/goto/tedpavlic My family appreciates your support in the fight to defeat ALS. |
From: Ted P. <te...@te...> - 2009-01-09 17:51:04
|
Additionally, it's very important to check for a comment. That is, you don't want to gwap with comments in your selection. So I added a ^\s*% to get what's at: http://pastebin.com/f4015755d Here it is here, with possible wrapping: " Section: Paragraph formatting (autofill) {{{ " Correctly format paragraphs in LaTeX. " The exec command should be one line: watch out if the e-mail client " or server inserts any line breaks. function! g:Tex_SelectParagraph () exec "normal ?^$\\|^\s*%\\|^\s*\\\\\\(begin\\|end\\|\\(new\\|renew\\|provide\\)com\\|def\\|[ls]et\\|label\\|item\\)?1\<cr>v//-1\<cr>$" endfunction omap <buffer> lp :call g:Tex_SelectParagraph()<cr> vmap <buffer> lp <esc>:call g:Tex_SelectParagraph()<cr> " }}} --Ted On 1/7/09 10:23 PM, Mike Richman wrote: > " Section: Paragraph formatting (autofill) {{{ > " Correctly format paragraphs in LaTeX. > " The exec command should be one line: watch out if the e-mail client > " or server inserts any line breaks. > function! g:Tex_SelectParagraph () > exec "normal ?^$\\|^\s*\\(\\\\begin\\|\\\\end\\|\\\\renewcommand\\|\\\\label\\|\\\\item\\)?1\<cr>v//-1\<cr>$" > endfunction > omap<buffer> lp :call g:Tex_SelectParagraph()<cr> > vmap<buffer> lp<esc>:call g:Tex_SelectParagraph()<cr> > " }}} -- Ted Pavlic <te...@te...> Please visit my ALS association page: http://web.alsa.org/goto/tedpavlic My family appreciates your support in the fight to defeat ALS. |
From: Ted P. <te...@te...> - 2009-01-09 18:00:44
|
In fact, even lines with comments at the end of them should be included... So another amendment: http://pastebin.com/f2f6e5633 " Section: Paragraph formatting (autofill) {{{ " Correctly format paragraphs in LaTeX. " The exec command should be one line: watch out if the e-mail client " or server inserts any line breaks. function! g:Tex_SelectParagraph () exec "normal ?^$\\|^.*\\([^\\\\]\\|\\)%\\|^\s*\\\\\\(begin\\|end\\|\\(new\\|renew\\|provide\\)com\\|def\\|[ls]et\\|label\\|item\\)?1\<cr>v//-1\<cr>$" endfunction omap <buffer> lp :call g:Tex_SelectParagraph()<cr> vmap <buffer> lp <esc>:call g:Tex_SelectParagraph()<cr> " }}} TODO: Find the top/bottom of a commented block. On 1/9/09 12:50 PM, Ted Pavlic wrote: > Additionally, it's very important to check for a comment. That is, you > don't want to > > gwap > > with comments in your selection. So I added a ^\s*% to get what's at: > > http://pastebin.com/f4015755d > > Here it is here, with possible wrapping: > > " Section: Paragraph formatting (autofill) {{{ > " Correctly format paragraphs in LaTeX. > " The exec command should be one line: watch out if the e-mail client > " or server inserts any line breaks. > function! g:Tex_SelectParagraph () > exec "normal > ?^$\\|^\s*%\\|^\s*\\\\\\(begin\\|end\\|\\(new\\|renew\\|provide\\)com\\|def\\|[ls]et\\|label\\|item\\)?1\<cr>v//-1\<cr>$" > endfunction > omap<buffer> lp :call g:Tex_SelectParagraph()<cr> > vmap<buffer> lp<esc>:call g:Tex_SelectParagraph()<cr> > " }}} > > --Ted > > On 1/7/09 10:23 PM, Mike Richman wrote: >> " Section: Paragraph formatting (autofill) {{{ >> " Correctly format paragraphs in LaTeX. >> " The exec command should be one line: watch out if the e-mail client >> " or server inserts any line breaks. >> function! g:Tex_SelectParagraph () >> exec "normal ?^$\\|^\s*\\(\\\\begin\\|\\\\end\\|\\\\renewcommand\\|\\\\label\\|\\\\item\\)?1\<cr>v//-1\<cr>$" >> endfunction >> omap<buffer> lp :call g:Tex_SelectParagraph()<cr> >> vmap<buffer> lp<esc>:call g:Tex_SelectParagraph()<cr> >> " }}} > -- Ted Pavlic <te...@te...> Please visit my ALS association page: http://web.alsa.org/goto/tedpavlic My family appreciates your support in the fight to defeat ALS. |
From: Ted P. <te...@te...> - 2009-01-11 05:20:56
|
Several more updates: http://pastebin.com/f24e40568 This version should work within comments as well, and it should not cause a block to cross from comment to non-comment (so you don't accidentally comment out good content with gwlp). It's best to access from the link above, but I'll paste here too: ==== " Section: Paragraph formatting (autofill) {{{ " Correctly format paragraphs in LaTeX. function! g:Tex_SelectParagraph () " TeX and LaTeX blocks common to both start and beginning of lp blocks let l:tex_search = "\\\\\\(begin\\|end\\|label\\|item\\|\\(new\\|renew\\|provide\\)\\(command\\|environment\\)\\|\\(new\\|set\\)\\(length\\|counter\\)\\|\\(def\\|let\\)[^\\w\\d]\\)" " 0.) Move to beginning of line to prevent selecting the NEXT line " THIS line is the one we want exec "normal 0" " 1.) Search UPWARDS for the start of a block and go one line DOWN exec "normal ?" . l:tex_search . "\\|^$\\|\\%^\\|.*\\S\\+.*\\\\\\@<!%\\|^\\s*%.*\\n\\(\\s*[^%]\\+\\)\\@=\\|\\(^\\s*%.*\\)\\@<!\\n\\s*%.*" . "?1\<cr>" " 2.) Move into visual mode exec "normal v" " 3.) Search DOWNWARDS for the end of a block and go one line UP exec "normal /" . l:tex_search . "\\|^$\\|\\%$\\|.*\\S\\+.*\\\\\\@<!%\\|\\(^\\s*[^%]\\+\\n\\)\\@<=\\s*%.*\\|\\(^\\s*%.*\\n\\)\\@<=\\s*[^%]\\+\\|\\(.*\\S\\+.*\\\\\\@<!%.*\\n\\)\\@<=" . "/-1\<cr>" " 4.) Move to the end of the line exec "normal $" endfunction " We set noshowcmd and noruler in order to suppress enter-prompt " (see :help enter-prompt) omap <silent> <buffer> lp :try \| let b:saved_showcmd=&l:showcmd \| let b:saved_ruler=&l:ruler \| :setlocal noshowcmd noruler \| silent! call g:Tex_SelectParagraph() \| finally \| let &l:showcmd=b:saved_showcmd \| let &l:ruler=b:saved_ruler \| unlet b:saved_showcmd \| unlet b:saved_ruler \| endtry<cr> vmap <silent> <buffer> lp <esc>:try \| let b:saved_showcmd=&l:showcmd \| let b:saved_ruler=&l:ruler \| :setlocal noshowcmd noruler \| silent! call g:Tex_SelectParagraph() \| finally \| let &l:showcmd=b:saved_showcmd \| let &l:ruler=b:saved_ruler \| unlet b:saved_showcmd \| unlet b:saved_ruler \| endtry<cr> " }}} ==== On 1/9/09 1:00 PM, Ted Pavlic wrote: > In fact, even lines with comments at the end of them should be > included... So another amendment: ... > TODO: Find the top/bottom of a commented block. -- Ted Pavlic <te...@te...> Please visit my ALS association page: http://web.alsa.org/goto/tedpavlic My family appreciates your support in the fight to defeat ALS. |
From: Mike R. <ri...@um...> - 2009-01-09 19:00:37
|
These are all very useful additions. I've just written some code for two new text objects: 'ae': an environment; and 'ie': inner environment. As far as I know, these should work as long as your file is nicely indented. " Section: an environment {{{ function! g:Tex_SelectAnEnvironment () let i1 = indent('.') while ! (getline('.') =~ "\\\\begin" && indent('.') <= i1) exec "normal k0" endwhile exec "normal v" let i2 = indent('.') while ! (getline('.') =~ "\\\\end" && indent('.') == i2) exec "normal j$h" endwhile endfunction omap <buffer> ae :call g:Tex_SelectAnEnvironment()<cr> vmap <buffer> ae <esc>:call g:Tex_SelectAnEnvironment()<cr> " }}} " Section: inner environment {{{ function! g:Tex_SelectInnerEnvironment () let i1 = indent('.') while ! (getline('.') =~ "\\\\begin" && indent('.') <= i1) exec "normal k0" endwhile let i2 = indent('.') exec "normal jv" while ! (getline('.') =~ "\\\\end" && indent('.') == i2) exec "normal j$h" endwhile exec "normal k$h" endfunction omap <buffer> ie :call g:Tex_SelectInnerEnvironment()<cr> vmap <buffer> ie <esc>:call g:Tex_SelectInnerEnvironment()<cr> " }}} I know the question has come up on this list before, but... if these prove to be very useful additions to Latex-Suite (as I believe they will) can they be added upstream as new features? On Fri, Jan 9, 2009 at 1:00 PM, Ted Pavlic <te...@te...> wrote: > In fact, even lines with comments at the end of them should be included... > So another amendment: > > http://pastebin.com/f2f6e5633 > > " Section: Paragraph formatting (autofill) {{{ > " Correctly format paragraphs in LaTeX. > " The exec command should be one line: watch out if the e-mail client > " or server inserts any line breaks. > function! g:Tex_SelectParagraph () > exec "normal > ?^$\\|^.*\\([^\\\\]\\|\\)%\\|^\s*\\\\\\(begin\\|end\\|\\(new\\|renew\\|provide\\)com\\|def\\|[ls]et\\|label\\|item\\)?1\<cr>v//-1\<cr>$" > endfunction > omap <buffer> lp :call g:Tex_SelectParagraph()<cr> > vmap <buffer> lp <esc>:call g:Tex_SelectParagraph()<cr> > " }}} > > TODO: Find the top/bottom of a commented block. > > On 1/9/09 12:50 PM, Ted Pavlic wrote: >> >> Additionally, it's very important to check for a comment. That is, you >> don't want to >> >> gwap >> >> with comments in your selection. So I added a ^\s*% to get what's at: >> >> http://pastebin.com/f4015755d >> >> Here it is here, with possible wrapping: >> >> " Section: Paragraph formatting (autofill) {{{ >> " Correctly format paragraphs in LaTeX. >> " The exec command should be one line: watch out if the e-mail client >> " or server inserts any line breaks. >> function! g:Tex_SelectParagraph () >> exec "normal >> >> ?^$\\|^\s*%\\|^\s*\\\\\\(begin\\|end\\|\\(new\\|renew\\|provide\\)com\\|def\\|[ls]et\\|label\\|item\\)?1\<cr>v//-1\<cr>$" >> endfunction >> omap<buffer> lp :call g:Tex_SelectParagraph()<cr> >> vmap<buffer> lp<esc>:call g:Tex_SelectParagraph()<cr> >> " }}} >> >> --Ted >> >> On 1/7/09 10:23 PM, Mike Richman wrote: >>> >>> " Section: Paragraph formatting (autofill) {{{ >>> " Correctly format paragraphs in LaTeX. >>> " The exec command should be one line: watch out if the e-mail client >>> " or server inserts any line breaks. >>> function! g:Tex_SelectParagraph () >>> exec "normal >>> ?^$\\|^\s*\\(\\\\begin\\|\\\\end\\|\\\\renewcommand\\|\\\\label\\|\\\\item\\)?1\<cr>v//-1\<cr>$" >>> endfunction >>> omap<buffer> lp :call g:Tex_SelectParagraph()<cr> >>> vmap<buffer> lp<esc>:call g:Tex_SelectParagraph()<cr> >>> " }}} >> > > -- > Ted Pavlic <te...@te...> > > Please visit my ALS association page: > http://web.alsa.org/goto/tedpavlic > My family appreciates your support in the fight to defeat ALS. > |
From: Ted P. <te...@te...> - 2009-01-11 05:39:40
|
> omap<buffer> ae :call g:Tex_SelectAnEnvironment()<cr> > vmap<buffer> ae<esc>:call g:Tex_SelectAnEnvironment()<cr> That's nice, but in most cases when I want to do that, I use [%v%$ That is: *) [% gets me to the start of the environment *) v turns on visual mode *) % gets me to the end of the environment *) gets me to the end of the line Nevertheless "vae" is quicker than "[%v%$" for several reasons. :) > omap<buffer> ie :call g:Tex_SelectInnerEnvironment()<cr> > vmap<buffer> ie<esc>:call g:Tex_SelectInnerEnvironment()<cr> Now I can't think of any existing quick way to do that. --Ted -- Ted Pavlic <te...@te...> Please visit my ALS association page: http://web.alsa.org/goto/tedpavlic My family appreciates your support in the fight to defeat ALS. |
From: Ted P. <te...@te...> - 2009-01-09 20:38:17
|
Vim-LaTeX's source is managed via SVN: http://sourceforge.net/svn/?group_id=52322 > I know the question has come up on this list before, but... if these > prove to be very useful additions to Latex-Suite (as I believe they > will) can they be added upstream as new features? --Ted -- Ted Pavlic <te...@te...> Please visit my ALS association page: http://web.alsa.org/goto/tedpavlic My family appreciates your support in the fight to defeat ALS. |
From: Ted P. <te...@te...> - 2009-01-11 06:00:20
|
Mike -- Sorry that I was so terse in the last message. Here's more specific information: http://sourceforge.net/project/memberlist.php?group_id=52322 Till Maas posts to the list occasionally. It's my guess that he could set you up with an SVN account and you could check in your changes. Either that or you could submit a diff to him so he could apply it. Best -- Ted On 1/9/09 3:38 PM, Ted Pavlic wrote: > Vim-LaTeX's source is managed via SVN: > > http://sourceforge.net/svn/?group_id=52322 > >> I know the question has come up on this list before, but... if these >> prove to be very useful additions to Latex-Suite (as I believe they >> will) can they be added upstream as new features? > > --Ted > > -- Ted Pavlic <te...@te...> Please visit my ALS association page: http://web.alsa.org/goto/tedpavlic My family appreciates your support in the fight to defeat ALS. |
From: Till M. <ope...@ti...> - 2009-01-12 12:21:10
|
On Sunday 11 January 2009 07:00:10 Ted Pavlic wrote: > Till Maas posts to the list occasionally. It's my guess that he could > set you up with an SVN account and you could check in your changes. > Either that or you could submit a diff to him so he could apply it. I will happily apply any patches to vim-latex that come with an explanation and are tested. But it is always better to start a new thread with [PATCH] in the subject to get my attention. Regards, Till |