Thread: [Vim-latex-devel] change vim-latex expansion
Brought to you by:
srinathava,
tmaas
|
From: Rudra B. <rud...@ao...> - 2013-07-08 10:39:18
|
Hello friends,
in vim-latex, EFI expands as
\begin{figure}[<+htpb+>]
\centering
\psfig{figure=<+eps file+>}
\caption{<+caption text+>}
\label{fig:<+label+>}
\end{figure}<++>
I want to change this as
\begin{figure}[<+htpb+>]
\centering
\includegraphics[scale=<++>]{<+figure+>}
\caption{<+caption text+>}
\label{fig:<+label+>}
\end{figure}<++>
%since I generally do pdflatex, and use \includegraphics, rather then
psfig.
Any way to achieve it?
--
Rudra
|
|
From: Ruthard B. <rut...@we...> - 2013-07-09 13:15:31
|
Just redefine EFI in .vim/after/ftplugin/tex.vim or in .vimrc:
call IMAP ( 'EFI', "\\begin{figure}[<+htpb+>]\<CR> \\centering\<CR> \\includegraphics[scale=<++>]{<+figure+>}\<CR> \\caption{<+caption text+>}\<CR> \\label{fig:<+label+>}\<CR>\\end{figure}<++>", 'tex')
The files in .vim/after are loaded after the normal plugin processing
took place, and are intended to override plugin code locally.
As .vimrc is loaded as last file, this code could be placed there, too.
Normally it was a bad idea to override a filetype plugin in .vimrc,
as the definitions here affect all file types, but IMAP has the
third parameter filetype, thus this redefinition in the .vimrc will
affect only .tex files.
For a deeper understanding of IMAP try :help IMAP.
Take care to escape all "\" and the first "<" of the vim keycode for
"Enter" (<CR>), and to use " for the second string.
There is one problem left: if you use this code, the formatting will be
shifted one space each line. I think this might be due to the default
"nopaste" mode of vim, and don't know how vim-latex solves this.
Either, if they shifted the default mode to "paste", it should work, or
you will have to take a look on vim-latex's code to solve it.
Greetings,
Ruthard
|
|
From: Gerd W. <ger...@ma...> - 2013-07-09 14:12:29
|
One should rather define Tex_Env_figure or add the code
if !exists("g:Tex_package_detected")
let g:Tex_package_detected = 'graphicx'
elseif g:Tex_package_detected !~ '\<graphicx\>'
let g:Tex_package_detected = g:Tex_package_detected.',graphicx'
endif
to .vim/after/ftplugin/tex.vim.
Read the manual.
http://vim-latex.sourceforge.net/documentation/latex-suite.html#customizing-macros
On 07/09/2013 02:50 PM, Ruthard Baudach wrote:
>
> Just redefine EFI in .vim/after/ftplugin/tex.vim or in .vimrc:
>
>
> call IMAP ( 'EFI', "\\begin{figure}[<+htpb+>]\<CR> \\centering\<CR> \\includegraphics[scale=<++>]{<+figure+>}\<CR> \\caption{<+caption text+>}\<CR> \\label{fig:<+label+>}\<CR>\\end{figure}<++>", 'tex')
>
>
> The files in .vim/after are loaded after the normal plugin processing
> took place, and are intended to override plugin code locally.
>
> As .vimrc is loaded as last file, this code could be placed there, too.
>
> Normally it was a bad idea to override a filetype plugin in .vimrc,
> as the definitions here affect all file types, but IMAP has the
> third parameter filetype, thus this redefinition in the .vimrc will
> affect only .tex files.
>
> For a deeper understanding of IMAP try :help IMAP.
>
> Take care to escape all "\" and the first "<" of the vim keycode for
> "Enter" (<CR>), and to use " for the second string.
>
> There is one problem left: if you use this code, the formatting will be
> shifted one space each line. I think this might be due to the default
> "nopaste" mode of vim, and don't know how vim-latex solves this.
>
> Either, if they shifted the default mode to "paste", it should work, or
> you will have to take a look on vim-latex's code to solve it.
>
> Greetings,
>
> Ruthard
>
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> Vim-latex-devel mailing list
> Vim...@li...
> https://lists.sourceforge.net/lists/listinfo/vim-latex-devel
>
|
|
From: Rudra B. <rud...@ao...> - 2013-07-10 15:57:22
|
Thanks. its solved.
main problem was to find the correct file to edit(which is
envmacros.vim).
On Tue, 2013-07-09 at 14:50 +0200, Ruthard Baudach wrote:
> Just redefine EFI in .vim/after/ftplugin/tex.vim or in .vimrc:
>
>
> call IMAP ( 'EFI', "\\begin{figure}[<+htpb+>]\<CR> \\centering\<CR> \\includegraphics[scale=<++>]{<+figure+>}\<CR> \\caption{<+caption text+>}\<CR> \\label{fig:<+label+>}\<CR>\\end{figure}<++>", 'tex')
>
>
> The files in .vim/after are loaded after the normal plugin processing
> took place, and are intended to override plugin code locally.
>
> As .vimrc is loaded as last file, this code could be placed there, too.
>
> Normally it was a bad idea to override a filetype plugin in .vimrc,
> as the definitions here affect all file types, but IMAP has the
> third parameter filetype, thus this redefinition in the .vimrc will
> affect only .tex files.
>
> For a deeper understanding of IMAP try :help IMAP.
>
> Take care to escape all "\" and the first "<" of the vim keycode for
> "Enter" (<CR>), and to use " for the second string.
>
> There is one problem left: if you use this code, the formatting will be
> shifted one space each line. I think this might be due to the default
> "nopaste" mode of vim, and don't know how vim-latex solves this.
>
> Either, if they shifted the default mode to "paste", it should work, or
> you will have to take a look on vim-latex's code to solve it.
>
> Greetings,
>
> Ruthard
>
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> Vim-latex-devel mailing list
> Vim...@li...
> https://lists.sourceforge.net/lists/listinfo/vim-latex-devel
|