On Fri, Jan 25, 2008 at 09:41:59AM -0500, Brian McKee wrote: > On 25-Jan-08, at 5:45 AM, Sridhar M.A. wrote: > >> I have set up vim to add these lines >> automatically whenever I create a php/tex/c/whatever file I create. >> > Share details please.... :-) > You asked for it :-)
Here is a snippet of my ~/.vimrc. "Open a new tab map <f12> <esc>:tabnew<cr> set tabpagemax=5 set tw=72 et sw=2 ts=2 set pastetoggle=<f11> set ruler set fo+=n " Format numbered lists automagically syntax on set modeline set viminfo='10,\"100,:20,%,n~/.viminfo au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif " Add some skeletal structure au BufNewFile *.tex 0read ~/.vim/skel.tex au BufNewFile *.html 0read ~/.vim/skel.html au BufNewFile *.php 0read ~/.vim/skel.php Create a directory ~/.vim and put the above files there. I will just paste the tex and php files for your reference : skel.tex \documentclass{article} % \usepackage[body={6in,9in}]{geometry} \usepackage[dvips]{graphicx} \usepackage{enumerate} \usepackage{pifont} \usepackage{textcomp} \usepackage{hyperref} \usepackage{comment} \usepackage{booktabs} %\usepackage{chemsym} %\usepackage{setspace} \voffset-.5in \hoffset-.5in \newcommand{\hb}[2]{\mbox{#1$\cdots$#2}} \newcommand{\Deg}{$^\circ$} \newcommand{\ml}[2]{\multicolumn{#1}{l}{#2}} \newcommand{\mr}[2]{\multicolumn{#1}{r}{#2}} \newcommand{\mc}[2]{\multicolumn{#1}{c}{#2}} \begin{document} \end{document} % vim:tw=72:et:sw=2:ts=2:fdm=marker skel.php <?php // vim: tw=0:nowrap:fdm=marker: ?> With those lines, whenever you open a new tex/php file, these things get pasted/inserted. Please add stuff that you might want in addition to what I have. Regards, -- Sridhar M.A. GPG KeyID : F6A35935 Fingerprint: D172 22C4 7CDC D9CD 62B5 55C1 2A69 D5D8 F6A3 5935 A woman, especially if she have the misfortune of knowing anything, should conceal it as well as she can. -- Jane Austen
signature.asc
Description: Digital signature