Re: [Vim-latex-devel] Templates require set paste on
Brought to you by:
srinathava,
tmaas
From: Ruthard B. <rut...@we...> - 2013-11-29 21:47:57
|
>== Auszüge aus der Nachricht von John Reid vom 2013-11-05 10:18: > Hi, > > If I don't do ':set paste on' before using ':TTemplate', the indentation > of the template is all messed up. Is it possible to get vim-latex to > turn this on when using templates? To convince vim-latex to do that you have to hack the source -- and every update would make your efforts worthless ;-( BUT... it is possible to define functions and commands in your .vimrc, or better in a .vim/after/ftplugin/tex.vim file that would be loaded as filetype plugin after vim-latex has been loaded. You have to create the "after/ftplugin" directories and the "tex.vim" file if they do not exist yet. In vim a function is defined like this (confere to :help function): ------------------->%----------------------- function SetPasteTTemplate() set paste TTemplate set nopaste endfunction ------------------->%----------------------- and is called: :call SetPasteTTemplate() Typing all this is a bit tedious over the time and not a lot better than typing :set paste, :TTTemplate, :set nopaste, so let's define a handy command (cf. :help command) in our .vimrc or .vim/after/ftplugin/tex.vim! ------------------->%----------------------- command TT call SetPasteTTemplate() ------------------->%----------------------- et voilà -- type :TT in command mode and you've got it. Thank you for asking -- I wanted to figure this out for years, and just didn't have the idea of using .vimrc instead of the vim-latex source. This way it's easy, works, and won't be messed up by the next vim-latex update :-) Greetings, Ruthard |