Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: The <CR> button?

  1. #1
    Join Date
    Jan 2011
    Location
    Boonesville Kentucky
    Beans
    41
    Distro
    Ubuntu 12.04 Precise Pangolin

    The <CR> button?

    Sorry for my noobness in advance: I was wondering what <CR> stands for in various Vim manuals, etc. I keep seeing <CR>, but have no idea if that is a key sequence or abbreviation or what!

  2. #2
    Join Date
    Nov 2009
    Location
    Lesotho
    Beans
    53
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: The <CR> button?

    Carriage Return if i am not mistaken

  3. #3
    Join Date
    May 2007
    Location
    USA
    Beans
    318
    Distro
    Kubuntu 8.04 Hardy Heron

    Re: The <CR> button?

    Possibly refers to carriage return, aka enter. Just guessing though.

    edit

    I think maybe it refers strictly to the ASCII character for carriage return. Depending on your operating system, this may or may not be the same as the code(s) generated by pressing the Enter key.

    Quote Originally Posted by VIM USER MANUAL v7.3
    *23.1* DOS, Mac and Unix files
    Back in the early days, the old Teletype machines used two characters to
    start a new line. One to move the carriage back to the first position
    (carriage return, <CR>), another to move the paper up (line feed, <LF>).
    When computers came out, storage was expensive. Some people decided that
    they did not need two characters for end−of−line. The UNIX people decided
    they could use <Line Feed> only for end−of−line. The Apple people
    standardized on <CR>. The MS−DOS (and Microsoft Windows) folks decided to
    keep the old <CR><LF>.
    http://www.eandem.co.uk/mrw/vim/usr_doc/index.html
    Last edited by Telengard C64; October 31st, 2011 at 07:27 PM.

  4. #4
    Join Date
    Jan 2009
    Beans
    163
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: The <CR> button?

    Yes, CR = Carraige Return. It basically means press the <enter> or <return> key.

    UNIX distinguishes because lines are ended with just a CR on UNIX, but Windows uses CR followed by LF (Line Feed).

  5. #5
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: The <CR> button?

    Yep, it's Carriage Return (ASCII 13). Often written as ^M or \r. CRs are found just before newlines in text files generated by DOS/Windows apps.

    In vim, type :help keycodes.

  6. #6
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: The <CR> button?

    Quote Originally Posted by dave0109 View Post
    Yes, CR = Carraige Return. It basically means press the <enter> or <return> key.

    UNIX distinguishes because lines are ended with just a CR on UNIX, but Windows uses CR followed by LF (Line Feed).
    Hmmm, there are three different kinds of line endings in common use:

    • Unix systems use Line Feeds (LFs) only.
    • MS-DOS and Windows systems use CR-LF pairs.
    • Old Macintosh systems use CRs only.

  7. #7
    Join Date
    Jan 2011
    Location
    Boonesville Kentucky
    Beans
    41
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: The <CR> button?

    Ah ha. Yes. You are right. You are "all" right. Thank you!!

  8. #8
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,435
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink Re: The <CR> button?

    And where does it come from? A typewriter. In the manual days you actually had to return the carriage back manually in order to start typing at the beginning. A line feed was accomplished in conjunction with this depending on how you did the return. When typewriters went electric, eventually the carriage no longer moved, just the print head. They needed something for everyone to understand who was used to the old way. CR was introduced as the abbreviation for a carriage return. When this is stored in a file at that time CR also represents an actual character. LF was introduced as the abbreviation for a line feed. Some OS's, when dealing with text files, take a CR as a CR/LF combination, others as just a CR. CR or a null was sometimes used to indicate the end of a "line" record in a text file as well.

    Just part of what it's all about - all of that for a simple pair of characters, eh?

    Dave

  9. #9
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

  10. #10
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,435
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink Re: The <CR> button?

    Admittedly that last carriage return is backwards, but it is hilarious!

    Thanks for a good laugh!

    Dave

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •