Results 1 to 1 of 1

Thread: HOWTO: Edit text files in Ubuntu

  1. #1
    Join Date
    Oct 2004
    Location
    Mobile, AL, USA
    Beans
    337
    Distro
    Ubuntu 8.10 Intrepid Ibex

    HOWTO: Edit text files in Ubuntu

    Graphical

    When Ubuntu is booted into the graphical environment (X), you can use gedit as your text editor. Gedit is a small, lightweight text editor similar to Windows' WordPad. It has a very easy to use graphical interface. To access it, navigate to Applications -> Accessories -> Text Editor.



    Console

    For those who would prefer (or for situations when you can't get X to start!), there are many text editors you can use from within the console.


    nano

    Nano is a very easy-to-use free pico clone that comes installed by default in Ubuntu. This is definitely a great console text editor for those who are unfamiliar with more advanced ones such as vim.

    To use nano to edit a file, do the following in a terminal, where 'filename' is the name of the file you want create or modify:

    Code:
    nano filename
    The important command shortcuts are displayed at the bottom of nano's screen, denoted by a ^ and a shortcut character. The ^ stands for the Ctrl character on your keyboard. For example, the exit shortcut on nano is ^X, so to exit nano you would hold down Ctrl and press x.

    For more information on this editor, please see the documentation.


    ee and aee

    ee (Easy-Edit) and aee (Advanced Easy Editor) are two similar very easy to use console text editors. Like nano, keyboard shortcuts are performed by holding Ctrl and pressing the correct shortcut keys. Common shortcuts are listed at the top of the screen. There is also a handy menu system that can be accessed by pressing Esc.

    Of the two, I prefer aee simply because the main menu loads slightly faster. Apart from that, their keyboard shortcut sequences are slightly different, but all the shortcuts are listed at the top of the screen. ee is the default text editor of FreeBSD.

    To install these editors, you will need to enable the Universe repository.

    After doing so, open a terminal and do the following to install ee:

    Code:
    sudo apt-get install ee
    Or, for aee:

    Code:
    sudo apt-get install aee
    To create or modify a file with these editors, do the following in a terminal, where 'filename' is the name of the file you want to edit or create:

    Code:
    ee filename
    Or, for aee:

    Code:
    aee filename

    vim

    This powerful vi clone is installed by default on nearly all Linux systems, including Ubuntu. It has many advanced features such as syntax highlighting (a feature that color codes key words in programming languages and configuration files). If you prefer a more feature-packed text editor than nano and the rest, this is a good one.

    To use vim to edit a file, do the following in a terminal, where 'filename' is the name of the file you want to create or modify:

    Code:
    vi filename
    or

    Code:
    vim filename
    To get syntax highlighting to work, do the following in a terminal:

    Code:
    cp /usr/share/vim/vim63/vimrc_example.vim ~/.vimrc
    For more information on how to use vim, please see The Vim Documentation. Vim is a very powerful and complicated tool, so be sure to read over the documentation.
    Last edited by HungSquirrel; November 9th, 2004 at 01:10 PM.
    $ whatis themeaningoflife
    themeaningoflife: not found

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
  •