Results 1 to 5 of 5

Thread: Nano

Hybrid View

  1. #1

    Nano

    Hmm.. Not many people know of this either, and I find it funny, because it's definately not necessary to learn something like vim just to edit a simple file.

    My editor of choice is nano, an editor based on pico (comes with pine), but it's got a lot more to offer, and it's so simple, too! How does syntax highlighting and auto indentation sound? Not to mention mouse support?

    Ok, first of all, download the nano sources from their site (http://www.nano-editor.org/). Unpack it. Now, run the following command:

    ./configure --prefix=/usr --enable-colors --enable-extra
    (change prefix to whatever you prefer)

    --enable-colors will enable color-highlighting, and --enable-extra enables some small, nifty features people most likely will appreciate.
    Make and install as usual (make && make install for you newbies out there )

    Ok, now that we've got it installed, let's enable those fun features, shall we?

    Look in the source-dir. There's a file there called nanorc.sample. This contains a few nice options we'd like to turn on. Just uncomment whatever you like.

    Something to take notice of, as well, is that the syntax highlighting specifications lie there as well. These utilizes regexp for definition. Just uncomment whatever sections you find interesting.

    Personally, I like no word-wrapping, auto-indentation and a tabsize at 4, as well as PHP syntax highlighting (look further down for that).

    Now, after saving it, copy it to your home-dir as .nanorc. All changes will now work.

    To add more definitions for syntax highlighting, simply append to the end of the file. Here's a link to a nice PHP-highlighter: http://www.37com.net/junk/php_syntax

    That's it.

    Hope this helps someone

  2. #2
    Associate
    Join Date
    Jun 2004
    Location
    The Matrix
    Posts
    34
    Nice tip
    Nano is very easy to learn, and very usable indeed. Problem is that since I use vim I'm kinda crippled with these kind of text editors - I press Esc very often with no use and j's, k's, l's and h's appear everywhere in my files
    I think the best is just to get used to one thing which is good for you - if you do a lot of developing/web design learning vim or emacs is really worth the time. (For vim use "vimtutor" to learn)
    If you only edit configuration files now and then, nano is definitely the way to go.
    Sam

  3. #3
    Senior Member
    Join Date
    Apr 2004
    Location
    Atlanta GA
    Posts
    373
    Thank you Gentoo for introducing me to nano, its light fast,and gets the job done, kinda fits for linux I think.

  4. #4
    Senior Member comtux's Avatar
    Join Date
    Sep 2004
    Location
    Wilkes Barre Pa
    Posts
    342
    I use to use nano untill i found jed.
    <http://www.jedsoft.org/jed/>

  5. #5
    Ooh, I forgot to add the part about mouse support. I don't really see the point in using it, since navigating using the keys is more than sufficient.

    Alt+m enables it.

    and yeah, I agree. There's not point in switching from vim to nano over this, but it's still very handy when just making that quick edit.

    Not to mention, oh the shame!, I don't know vim. I've tried learning it, but I've never bothered actually using it that much. Maybe I should, since nano's highlighting may get a bit slow on big files.

Similar Threads

  1. nano editor symbolic links vulnerability
    By Kernel_Killer in forum Security
    Replies: 0
    Last Post: 06-02-2010, 04:43 PM

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
  •