[SOLVED] How do I use .tex files as templates in vim?

I finally got vim just the way I like it, and I plan to write papers using LaTeX now that I have seen the light. I created a .tex file called documentTemplate.tex with all the options set up for the title, author, font, margins, etc. just the way I like it. What I would like to do is be able to execute a command that opens this document with vim and then be forced to save it as a different file name. I have made my documentTemplate.tex read-only, and when I open it with vim, it gives me the usual warning and then allows me to edit the document without actually writing over it.
The problem I have experienced is after writing the file with a new name using ":w ~/Documents/<filename>", I am not able to save over that document with ":w". Every subsequent ":w" tries to save what I have over documentTemplate.tex, but not the new file name. How can I make this work correctly?
If there is a better way to use .tex documents as templates with vim please let me know. I am not using vim-latex because it seems to be dying/not that good/unnecessary/whatever. What are the other LaTeXers doing? At least some of you guys must use vim!
Thanks,
Allamgir
Last edited by Allamgir (2009-08-17 16:19:22)

Or add something like this in your .vimrc (much cleaner imo):
if has('autocmd')
autocmd BufNewFile * silent! 0r $HOME/.vim/templates/%:e.tpl
endif
Where in this case $HOME/.vim/templates/tex.tpl is your latex template.  Now everytime you open a file that has a .tex extension (or possibly filetype, I'm not sure what is used here) your template will be loaded.  You can obviously modify it to whatever suits you the best.
Note that this is taken straight out of my .vimrc, and it is set up to handle multiple template languages, not just tex files.  Adding a $HOME/.vim/templates/py.tpl automatically adds python templates too.
Last edited by rson451 (2009-08-17 16:33:42)

Similar Messages

  • How can i use JS files in ADF for language translation.

    Hi,
    I have JS for different languages and dn't want to convert them to property files(resource bundle files). How can i use JS files in ADF for language translation.
    Thanks

    Hi ILya Cyclone,
    Thanks alotfor the reply. Can you tell me where should i include this in the jspx page.
    Step 1)
    I have the js file as js/ifl_messages_US.js and i created a resource file as you mentioned: JS_FILE_PATH=js/ifl_messages_US.js
    Step 2)
    Then added the entry in faces-config.xml for the resource file as follow:
    <resource-bundle>
    <base-name>resource_en.properties</base-name>
    <var>resource</var>
    </resource-bundle>
    <locale-config>
    <supported-locale>en</supported-locale>
    </locale-config>
    Step 3) This is my jspx page. In which a table is dynamically created on page load. Can you help me where should i enter the "#{resource.JS_FILE_PATH}"
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:messages id="m1"/>
    <af:resource type="javascript" source="/js/pdfFile.js"/>
    <af:form id="f1">
    <input type="hidden" name="checkRadio" id="checkRadio" value=""/>
    <af:panelGroupLayout id="pgl1" halign="left" layout="vertical">
    <af:image source="/images/BRAND_IMAGE.gif" id="i1"/>
    </af:panelGroupLayout>
    <af:spacer width="10" height="10" id="s1"/>
    <af:table varStatus="rowStat" summary="table"
    value="#{backingBeanScope.DummyBean.collectionModel}"
    rows="#{backingBeanScope.DummyBean.collectionModel.rowCount}"
    rowSelection="none" contentDelivery="immediate" var="row"
    rendered="true" id="t1" styleClass="AFStretchWidth"
    binding="#{backingBeanScope.DummyBean.myTableBinding}"
    columnResizing="disabled">
    <af:column id="c2" headerText="Actions">
    <af:activeOutputText value="#{row.Actions}" id="aot2"/>
    <af:goLink text="#{row.Actions}" id="gl1"
    clientComponent="true" visible="false"/>
    <af:selectBooleanRadio text="" id="sbr1"
    valueChangeListener="#{backingBeanScope.DummyBean.checkselectbox}">
    <af:clientListener method="selectCheckBox" type="click"/>
    </af:selectBooleanRadio>
    </af:column>
    <af:forEach items="#{backingBeanScope.DummyBean.columnNames}" end="#{backingBeanScope.DummyBean.columnSize}"
    var="name" begin="1">
    <af:column sortable="false" sortProperty="#{name}"
    rowHeader="unstyled" headerText="#{name}"
    inlineStyle="width:100px;" id="c1">
    <af:activeOutputText value="#{row[name]}" id="aot1" escape="false">
    </af:activeOutputText>
    <!-- <af:outputFormatted value="#{row[name]}" id="of1"/>-->
    <!--<af:goLink text="goLink 1" id="gl1"
    destination="#{row.bindings.url.inputvalue}"/>-->
    </af:column>
    </af:forEach>
    </af:table>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Thanks in advance

  • I had a data migration done from old iMac to new iMac, how do I use that file to find my old email contacts, Safari bookmarks, etc ?

    I recently had a data migration from old iMac to new iMac 11.2
    How do I use that data file to get old email contacts, Safari bookmarks, etc ?

    FireWire cables are dirt cheap and that's how you should be doing the migration. You might have to start over, wiping the new machine's HD, and restoring the software as described in the Everything Mac manual that came with it. See Best Practices and Setup new Mac for more details.

  • Hi, I am using USB 8476s to communicat​e to a slave unit in LIN network using LabVIEW7.1​. Can anyone tell me how i can send a header file plus 1 byte of data to the slave in a LIN network. or how do i use ldf file. i want to read responses from the slave

    Hi,   I am using USB 8476s to communicate to a slave unit in LIN network. Can anyone tell me how i can send a header frame plus 1 byte of data to the slave in a LIN network. or how do I communictae with slave using LabVIEW7.1.
    I want to read responses from the slave. When i tried with labview exapmle programs or even using MAX also, while doing some switching action in my slave, i am getting response as Device inactive with timestamp but there is no data format. 
    And I have Lin Description File. Can you suggest me how to use ldf file.
    I am at customer place and It would be great help from you if you can suggest me at the earliest. Thank you

    you may use the LDF Starter Kit to use LDF informations in your application
    http://joule.ni.com/nidu/cds/view/p/id/665/lang/en

  • How can I use a file in Eclipse?

    Hi mates,
    I dnt know how I can use Eclipse to operate a file, like the sample input file. I try to set a file name in "Argument" tab and create a file in the project, but it 's not working.
    CHEERS,
    Elton

    Look around in the CDT Forum, this is a common question (and I'm not up to date with recent developments)

  • How do i use raw files on photoshop elements 11

    i cant work out how to use raw files on pse11

    Select a raw thumbnail in Organizer and click the Editor button on the bottom toolbar or go to a folder on your hard drive and right-click on a raw file and choose open in Adobe Photoshop Elements 11.
    A raw file opens automatically in the camera raw dialog so you can use the sliders, e.g. white balance, contrast etc. Try pushing the highlights slider to the left and the shadows slider to the right to open up the tonal range of your raw image. You can also use those not available in the regular editor such as clarity and vibrance. Vibrance is a more subtle form of saturation. It’s good for boosting landscape images and pops the green and blue tones more than other colors.
    In addition to the settings under the basic tab you have a detail tab (triangle symbol) and a calibration tab (camera symbol) where you can make further tweaks. The detail tab has tools for sharpening and noise reduction. The calibration tab has drop down presets for camera styles which you can experiment with but I always leave it set to Adobe Standard. For best results the Process should be 2012. Earlier process versions will give some different sliders in the basic tab such as fill light and recovery, but they are not as effective as the latest controls.
    When you have finished your raw editing you can send the image into the regular editor. Ensure the dropdown menu for depth (at the bottom of the dialog) is set to 8 Bit/Channel as 16 bit editing in elements is very restricted. Then click the Open Image button (bottom right) and when your image opens in Expert Mode you can use the tools pallet to make any further adjustments you want. To create a jpeg use File >> Save As and choose jpeg from the file formats pull down list. There is nothing to save in a raw file. PSE remembers your slider settings next time you open the file.

  • How does labview use nce files

    I have been using MAX sometime ago but did not make full use of it.
    - How can I use labview to communicate with nce files?
    - Does Labview communicate with MAX?
    And I cannot find the document knowledge base to using MAX?
    Only I can find in the help files but not enough. I need more info, 
    regards,
    Clement

    astroboy,
    Here is a knowledge
    base article discussing the possible reasons for your error. 
    Also, try and start
    with some of our shipping examples. 
    After importing your MAX configuration I used Cont Acq&Graph Voltage-Int Clk.vi and everything ran just fine.  You can get to this example by
    going to Help>Find Examples.  Then go
    to Hardware Input and Output > DAQmx > Analog Measurment > Voltage.
    Ryan N
    National Instruments
    Application Engineer
    ni.com/support

  • How can i use my files(apps,media) from my main os to another os in one mac?

    When yosemite was released, i was excited to install it but the problem is that i don't want my main os to be compromised because i think that yosemite is kinda new and it's only 10.0 version and Dota 2 does not work on Yosemite and it's very unstable according to Steam forums and many other sites. My main OSX is still mountain lion and the only os x version that makes dots 2 stable. What i did is I partitioned my hard drive into two one for my main os and one for yosemite. Now i have two os x on my macbook pro. Now the problem is i don't want to install Logic Pro X again and re-download many samples and stuff. When i open the finder in Yosemite, i can see my mountain lion disk where all my files located at? Can i use those files without copying it because my yosemite disk is only 40 gb and my projects and sample audios is 60 gb and open apps from that disk to yosemite? Thanks. Sorry for the long text. I just want to give you the background.

    If you live near an Apple Store, make a Genius Bar appointment to have the computer tested. Supposedly there is no charge for testing. They can also give you an estimate.
    Genius Bar Reservation US

  • How can java used in file net technology

    hi technocrats,
    i want to know how java was used in filenet technology.now i want to learn filenet.
    can any body suggest the best sites for that?
    thank you all
    bye

    Note: This thread was originally posted in the [Java Media Framework|http://forums.sun.com/forum.jspa?forumID=28] forum, but moved to this forum for closer topic alignment.

  • How can I use the WebDynpro tutorial  template in APAB workbench?

    Hi,
    I have downloaded the tutorial template zip file from sdn (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on creating trees in web dynpro - 12.htm), but I don't know how to use it in ABAP workbench.
    Is that only for Java environment and can be used in Eclipse?
    If not, How can it be used in APAB workbench?
    Thank you.
    Swee Hu

    Hi,
    Its a template used in NDS(NetWeaver Developer Studio),in Webdynpro perspective.
    what do u mean by how can i use it in ABAP workbench?
    Sorry u cant use tat existing template.
    if u need the same feature u have to develop ur own...:)
    Regards,
    Sirisha.R.S

  • How do I use the alternate list template when rendering web app items to a page?

    I need to have the ability to use the main list template on particular pages, but then use different markup for other pages - is there a way that I can specify the alternate list template within the module tag?

    Hi Matt, You should read about web apps here:
    http://helpx.adobe.com/content/help/en/business-catalyst/partner/web-apps-module-create-cu stom.html
    And module reference here:
    http://helpx.adobe.com/business-catalyst/kb/modules-quick-reference.html
    If you insert through the admin and click customise you will see the option to use listbackup. You will also see that layout availible via FTP and in the admin or DW.
    Here you can see where in the module paramaters the option to choose listbackup occurs:
    http://helpx.adobe.com/business-catalyst/kb/modules-quick-reference.html#id_65138

  • [SOLVED]How to totally remove configuration files that pacman uses?

    Hi,
    Playing with Arch linux with a view to ditching windows completely, but came across one very small issue. One where I have tried to find the answer on the wiki and using the forum search
    Anyway, I installed firefox using pacman, no problems. Then I discovered Yaught (can never spell it right) and found a proper branded firefox package on there.
    I run:
    sudo pacman -R firefox
    and it is rightly removed. The issue is it still seems to keep the installation files on the system.
    How do I completely remove all the installation files?
    Last edited by oxymoron (2009-03-16 14:06:34)

    Dont need a -y to clean your cache. Also -Scc will wipe the whole thing if you dont want them taking room.
    Some thoughts on making use of the cache...
    '-Sc' keeps the currently installed pkges and cleans only uninstalled/old pkges from cache, its a good practise to do it everytime *before* you upgrade. Doing that ensures youll always be able to downgrade to a working set of pkges if theres something wrong with an upgrade.

  • Beginner - How to log using multiple files

    I am in trouble when I try to record the produced data into multiple files. There is a Rec button that is used to start to log the data that is produced by the system.
    As you can see in the attached image.
    The problem is that the user can stop the data logger and then start it again. And so, I need to create a new file. I configured the "write to measurement file" to save data into multiple files, but, it is appending the data into the file created before.
    How can I solve this?
    Thank you in advance.
    Attachments:
    screen2.JPG ‏36 KB
    lab.JPG ‏17 KB
    screen1.JPG ‏53 KB

    You could do something like this.
    This creating a filename based on the hour and minute of the day then passing that as a parameter into the Write Measurement File function. Watch out its possible to get duplicate filenames with this method. Consider adding date elements to make the filename more unique.
    David
    Message Edited by David Crawford on 06-29-2006 03:48 PM
    Attachments:
    lvm file name.jpg ‏21 KB

  • How do you use zip files?

    Hello all,
    I have always stayed away from ZIP files (as in doing it myself, to my own files), since my days in Windows, after all the countless corrupt ZIP files I received from others, that simply would not UNzip...
    But recently I've come across references to them again, and I realised I might be missing a trick or two....
    Any comments on the following would be appreciated:
    1.) What can I use them for?
    As in - could I ZIP my entire folder of holiday pictures - all 13GB's of them?
    Or is there some sort of size limit, where anything over, and things become problematic?
    Are some file types Zipped better than others?
    2.) How does it actually work?
    As in - what happens to my original files?
    Assume the holiday pics are Zipped - do the orginals get compressed, or can I select it so that copies are Zipped, as a kind of backup?
    3.) How safe is it?
    As in - assuming my hardware and software are all OK, nothing buggy etc. - if I create the ZIP file, pop it somewhere on a USB/External/the same laptop, and then Unzip it later, when I need them again - am I correct in assuming that the chances of the file being corrupted, are relatively slim?
    And coming back to those holiday pics - could the compression process result in a loss in picture quality/resolution, were I to then unzip the file? Or - assuming everything works as planned - will the quality of the pictures/file emerge exactly the same as they were prior to being compressed?
    I realise all of the above are ridiculously simple questions - but googling this doesn't really help, as most sites simply explain the how to, not the WHY...
    The WHY articles were probably all written 15 years ago already... I'm just very, very far behind....
    Thanks in advance!
    [Mid-2012 MBP 8GB Ram; OSX ML]

    Zipping an image file should have no effect on image quality, as the image data is not actually changed.
    Note that there's very little point in zipping a folder full of images, unless the images are not a compressed file type. You can't compress data that is already compressed - in fact, trying to do so often increases the file size - and JPEG images, for example, are already compressed.
    For the most part, you don't need to use zip at all. I absolutely DO NOT recommend storing your files and/or folders on the hard drive in compressed form as a space-saving measure. It doesn't save enough space to be worth the time needed to compress files large enough to warrant it on a modern drive. Accessing zipped files is a pain, too, since you basically have to decompress the whole thing in order to access a file inside a zip file.
    Zip becomes useful if you need to attach a large number of files to an e-mail message (zip the files, then attach the single zip file) or want to create an archive of multiple files to download from a web site through a single link. In other words, in situations where you need to transmit many files over the internet, especially where Windows users may be involved, zipping files can be either important or a convenience.

  • How can I use a file in flash cs6 that I made in flash cs5.5 air for android

    I have made an app in in air for android in flash cs5.5 air for android, and I want to edit it in cs6 and play it in cs6.
    But if I put Ctrl+Enter I got an error: createWin process failed with error 2: system couldn't find the file. I think the problem is that I'am using air for android 2.6 version in flash cs5.5 and version 3.2 in flash cs6. I have searched the web and found out that you can add older air versions using the sdk manager and I have tried it but first I get the error that the version of the sdk I am trying to install is not valid and after some files that I added to the sdk folder I get this error:Only SDK higher than version 3.4.2540 may be added.
    I there a possible way to update the air for android for an fla or apk? Or how can I let my originally file work fine in flash cs6??

    system couldn't find the file
    If you can´t get a more specific hint why your project can´t compile then I can think of some reasons theis error might occur
    1.You had files included besides the swf, like videos, audio files, xml files, that are not present in the place air expects them to be
    2.somewhere in your createWin functions there is a class import needed that isn`t present in 3.2 anymore, for example some classes or functions from classes that were valid in 2.6 are not any more in 3.2
    3. to achieve better eror logging, allow for debugging in the publishing options and see what specific lines in your code throw the error
    4.any air app needs a cert file, this needs to be created once, if you migrated to e new system it might be you never created that file which air expects to even begin the compiling process
    once you isolate the problem, report back

Maybe you are looking for

  • Re: [iPlanet-JATO] Tomcat 3.2 serving images and html?

    First of all David you are faster responding to email than I am. Thanks. We tried your scheme with no luck. You are using "ROOT" as your war file name ROOT, correct? Are you sure the jsp would reference "/images/MyProject/nppnback.gif"? Why is "MyPro

  • Brand new Yoga 2 11 - Super slow web browsing

    We got a new Yoga 2 11 this morning, and the web browsing is excruciatingly slow, whether using IE, FireFox or Chrome.  The only downloads or installs of any kind have been IE & FF. Based on searching this forum, I increased the minimum processor pow

  • Compensation handler and compensate activity doesn't work

    Hi! i'm trying to build process with compensation handlers and it doesn't work .. to test it i made the following example: in scope_1 there is simple assign_1 and in compensation handler there is assign_2. after scope_1 i throw error and in catchAll

  • Legit Download or Scam

    Greetings, I am interested in purchasing a new version of cs6 master collection, and have found one being offered online for 800 euro, with the download being advertised as off of the adobe site. More clearly, after the download, it appears the purch

  • Mass change with Reason for Rejection.

    Dear Gurus, Pl tell me the process to close all the open orders at one go. I have tried with the t.code MASS, but I was unable to do that. Pl give the step by step process. Regds, Sreehari