(SOLVED) How to automagically add X number of line to new file in vim?

Basicly I want to add X number of predefined lines of text to every new file I create in vim; if I create file.cpp I want some text, if I create file.sh I want another text.
I'm sure this is do-able?
Last edited by dmz (2009-07-07 17:51:41)

Brilliant! Thanks.

Similar Messages

  • How do you find the number of lines in a file?

    I need to count how many lines there are in a file, I am using a BufferedReader to read in the data, but how can I find the number of lines?
    Thanks

    That depends. How do you define a line? Is it a specific number of
    characters, a String that's terminated by a newline character or some
    combination thereof?

  • How do I add a number on my call log to my contacts on the iPhone?

    How do I add a number on my call log to my contacts?
    I browsed through the forum and didn't see this question.
    Thanks in advance

    If I understand the question correctly, you should be able to just touch the blue arrow icon to the right of the entry on the screen. That should take you to an "Info" screen. There you can choose to call the number, text the number, create a new contact, add the number to an existing contact, or share the contact.

  • How do I add a number to my Send Read Receipts for iMessage

    How do i add a number to my Send Read Receipts for iMessage. It says I can add a email just not a number!

    Link phone number and Apple ID with FaceTime and iMessage
    http://support.apple.com/kb/HT5538

  • How do i add a number to my account?

    how do i add my number to my account ?

    What could you mean?
    Do you have an Apple ID of the form "1234" and you want to change it to "12345"?
    Do you have a credit card listed with a digit missing?
    Do you want to add a telephone number to Contacts?
    I cannot imagine what you mean.

  • TS4006 how do I add another number to my icloud?

    I need to locate another phone that is not listed on my icloud how do I add another number?

    hi,you have to sign-in into the icloud setting  on your device with your apple id  to turn on that "FIND MY IPHONE" function....

  • How do i add a number in a cell which is already formatted

    how do i add a number in a cell which is already formatted

    IT seems that my orginal query has been corrupted
    the orginal question was how to preserve  rows and columns in numbers automatically.ie the cells are not consecutivecell a1 a3 etc
    working on a league table when sorting the league table ,I need to preserve the row and column I can preserve row and column by using the drop down menu on every cell,but would like to do it automatically…

  • How can i add page number?

    how can i add page number in pages...???

    Maybe reading Pages User Guide would be a good idea.
    Yvan KOENIG (VALLAURIS, France) dimanche 26 février 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

  • How can I find anothe IPhone ( my daughter) how could I add her number to my find my iPhone account or using my Apple ID and account. Basically how could I add more then 1

    I would like to know if I can have more then 1 line on find my I phone app. Basically I need to locate my teenage daughter and if she is telling the truth where she is at. How can I add her number on my app obviously with my apple id and passcode. And do this from my device?

    You can download Apple free Find My iPhone app.
    Click this link: https://itunes.apple.com/au/app/find-my-iphone/id376101648?mt=8
    With that you can use your daughter Apple ID & password to locate her iPhone.
    You can of course locate any other Apple devices.

  • [Solved] How to: Automatically add Semicolons at end of line

    Q. Is it possible to set JDeveloper to automatically add Semicolons to the end of a line of code?
    A. "While there is nothing that does this in batch mode to all your lines, while you are writing a line you can press the CTRL+SHIFT+Enter (complete statement in the source menu) shortcut and it will complete your line for you including the semicolon." [Solved] How to: Automatically add Semicolons at end of line
    Original Message:
    I'm spoiled from using Basic and similar programming languages, adding semicolons manually is something that'll take me time to get used to
    Thanks in advance,
    Abdulla
    Tags (for search engines):
    Jdeveloper automatic semicolon
    Message was edited by:
    Abdulla

    While there is nothing that does this in batch mode to all your lines, while you are writing a line you can press the CTRL+SHIFT+Enter (complete statement in the source menu) shortcut and it will complete your line for you including the semicolon.

  • How to count number of lines in a file?

    I am using a BufferedReader to read my file, but I like to know how to count the number of lines in a file is there a way to do that in Buffered Reader or do I have to use FileInputLineStream?

    Well, if you know how to read one line with a Buffered reader, and you know how to keep reading lines until you run out, then all you have to to is initialize a counter to zero before you start reading, add 1 to it each time you read a line, and then examine its value when you're done.
    Try that, and post again if you get stuck.
    Just be careful how you construct your loop. "Off by one" errors are a common way to get bitten. It could happen if you count what you think is the last line, but you've actually already counted all the lines and you end up counting one extra for "there are no more lines".

  • How do I add e-mail addesses to my new ipad mini or can I import them from my PC - e-mail otherwise working OK?

    How do I add e-mail addresses on my new ipad mini or can I import them from my PC - e-mail othwise working OK?

    You have to manually add:
    Settings > Mail, Contacts, Calendars > add here
    Read here: http://help.apple.com/ipad/7/#/iPad995bb603

  • How do i add a music zipfile to the new itunes?

    how do i add a music zipfile to the new itunes?

    Unzip the folder first (extract all).
    Right-click the folder and from the menu, choose Extract All and follow the prompts. You then import the extracted files.

  • How do I increase the number of lines presented in a drop down list?

    When I am entering a single character/number for each of a random selection of three letters in a password verification, I get a drop down list from A to S only, the first 20. Accessing letter T to number 9 means scrolling down. How can I increase the number of lines in a drop down box to 36?

    Hi canddski,
    If you are taking about an interface on a website, this is up to the ui designer. But there is a reflow that depends on screensize for the Firefox UI.
    You can use asp to control the list:
    [http://forums.asp.net/t/1970301.aspx?How+can+i+display+selected+no+of+records+from+datatable+using+dropdown+list+without+database+]
    but also try asking on stackoverflow.com

  • Using the value "Image/*" for the accept attribute of the HTML input Element, how can I add .pdf to the array of preconfigured file types (.jpe, .jpg, .jpeg, .?

    On a form, using the value "image/*" for the accept attribute of the HTML input Element, how can I add .pdf to the array of pre-configured file types (.jpe, .jpg, .jpeg, .gif, .png, .bmp, .ico, .svg, .svgz, .tif, .tiff, .ai, .drw, .pct, .psp, .xcf, .psd, .raw)?
    Say I wanted to add .gif, .jfif or .ico. I find this array limited, how can I add types to image?
    <input type="file" name="file" accept="image/*" id="file" />
    mimeTypes.rdf does not seem to allow this.

    ''mimeTypes.rdf'' has nothing to do with web development. It's a file that stores your file handling preferences (e.g. if you want ZIP files automatically saved or opened).
    You can't change the file types of the pre-defined content specifiers (audio/*, video/*, image/*), but you can specify additional MIME types. To add PDF to your above example,
    <pre><nowiki><input type="file" name="file" accept="image/*,application/pdf" id="file" /></nowiki></pre>
    For details, see
    * [https://developer.mozilla.org/En/HTML/Element/Input developer.mozilla.org/En/HTML/Element/Input]

Maybe you are looking for

  • Runtime error in COR6N

    hI PP guys, I am getting runtime error in COR6N.i AM GETTING this message. "MESSAGE_TYPE_X" " " "SAPLKAID" or "LKAIDF0B" "MESSAGE_SEND" Kindly tell me pl. do ineed to apply any notes or patch for this What is the note is avilable? Regards Laxmikanth

  • Adding PayPal's WS doesn't work

    When I try to add PayPal's sandbox Web Service to SJSC via the "Add Web Service" dialog, the Web Service's information is correctly displayed, but when I press the "Add" button, SJSC tells me: "Error occurred while creating the proxy!" This occurs ev

  • Main Computer infected with virus

    My Son has a Dell running Windows XP2 Home Edition. Fortunately he has not connected his ipod since the virus appeared. The dell is in the shop but is an old unit and the virus cannot be cleaned without a system complete restore to original. I have p

  • SQRESUS.DLL Error

    I have a visual basic application that uses odbc to connect to an oracle database. However, I when I try to connect I receive the error "Error cannot load resource file sqresus.dll" I am running windows nt 4.0 sp6 and oracle 8.1.7.5 odbc drivers. If

  • Creating user for Enterprise Manager

    Hi, As you know there is an admin user called ias_admin which can login to OracleAS Enterprise Manager and do all tasks. Can we define another user with less privileges? We want to give our developers the ability to view each instance logs by using t