LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-15-2013, 03:17 PM   #1
fisherman2
LQ Newbie
 
Registered: Aug 2013
Posts: 2

Rep: Reputation: Disabled
Editing files without vi Editor


Hello. I am trying to learn how to use Linux and the vi editor. I have tried using vi and some of the commands. Can I edit files without the vi editor?
 
Old 08-15-2013, 03:34 PM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,686
Blog Entries: 23

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Sure you can, use Nano (see your repo, it's bound to be in there...), I use that one mostly myself. Combine that with MidnightCommander...just a tip - both should be in the repo...
If you run from a DE (XFCE, LXDE, Gnome or the like) you can (should) use the graphical editor, as it would be more untuitive if you've not been "outside' the desktop much

By the way, welcome here, thanks for this question, it hilites the main thing about Linux : choice...

Thor

Edit

Quote:
One thing we're not short of in Linux: text editors.
Yup...

Last edited by ButterflyMelissa; 08-15-2013 at 03:37 PM.
 
1 members found this post helpful.
Old 08-15-2013, 03:34 PM   #3
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
Of course. There's nano for use in the terminal and console (CLI stuff); Kate, KWrite, Gedit, and even more, for use in X (GUI stuff). One thing we're not short of in Linux: text editors.
 
1 members found this post helpful.
Old 08-15-2013, 03:46 PM   #4
fisherman2
LQ Newbie
 
Registered: Aug 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you both.
 
Old 08-15-2013, 04:02 PM   #5
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,686
Blog Entries: 23

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
Thank you both
Nooooooooooo sweat! We enjoy doing this, really we do

Thor
 
Old 08-15-2013, 04:07 PM   #6
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
Yeah. Gives us a sense of purpose in our otherwise pointless existence.
 
Old 08-15-2013, 04:08 PM   #7
JWJones
Member
 
Registered: Jun 2009
Location: Cascadia
Distribution: Slackware
Posts: 922

Rep: Reputation: 276Reputation: 276Reputation: 276
But of course. There's emacs!

http://linuxbbq.org/wiki/index.php?title=Emacs
 
Old 08-15-2013, 04:21 PM   #8
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
cat > mypost << "EOF"
hmm, well if no vi then I would go for vim
but I guess that is cheating
so I vote sed
or cat with sed to fix the inevitable smelling mistakes.
EOF


sed -i -e 's/smel/spel/' mypost
 
Old 08-16-2013, 06:06 AM   #9
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,686
Blog Entries: 23

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398


Dont throw OP off the track, gang...

Emacs, Nano, Gedit, Mousepad, whatever...it depends on what your starting point and experience is...
 
Old 08-16-2013, 01:37 PM   #10
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
Sorry

Back 'on topic'

Yes lots of editor available in Linux

emacs.. I've never really used it myself, vi got hold of me first.
but again I think that has a steep learning curve.

I imagine Nano would be more 'familiar' editor..
If you need to 'get things done' go with that.

coming back to vim, there is a tutor built in
on console/terminal type
vimtutor
Code:
===============================================================================
=    W e l c o m e   t o   t h e   V I M   T u t o r    -    Version 1.7      =
===============================================================================

     Vim is a very powerful editor that has many commands, too many to
     explain in a tutor such as this.  This tutor is designed to describe
     enough of the commands that you will be able to easily use Vim as
     an all-purpose editor.

     The approximate time required to complete the tutor is 25-30 minutes,
     depending upon how much time is spent with experimentation.

     ATTENTION:
     The commands in the lessons will modify the text.  Make a copy of this
     file to practise on (if you started "vimtutor" this is already a copy).

     It is important to remember that this tutor is set up to teach by
     use.  That means that you need to execute the commands to learn them
     properly.  If you only read the text, you will forget the commands!

     Now, make sure that your Shift-Lock key is NOT depressed and press
     the   j   key enough times to move the cursor so that Lesson 1.1
     completely fills the screen.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        Lesson 1.1:  MOVING THE CURSOR
I wish I could offer 'balance' with emacs tutor, but I don't know of one.
I hope an emacs user can make some suggestions ( I might give it a go again myself )

on the GUI side, I like kate ( one of KDE's editors ), you can even get that to behave like vim
 
Old 08-16-2013, 04:40 PM   #11
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,087
Blog Entries: 10

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
I'm a huge proponent of gnuemacs, but to be honest I stick with one and use it forever. I've used gedit a bit because it's integrated with the GNOME desktop so if I go to open certain types of files from the Linux explorer, it loads them in gedit. I like it.

A recommendation though is to get sufficient experience with vi. Because vi is pretty much part of any Linux system as well as part of grub. If you find yourself in a command line and need to modify a file, knowing how to edit that file with vi is important if you happen to have no other editor available from the given command line you're at, at the time. Another case is on embedded targets, we do that a lot and we usually don't have an XServer or even a screen; hence we're in terminal mode via ssh to the target. Therefore if we need to change one line of a file, we do that with vi.

Here's a good online cheat sheet http://www.lagmonster.org/docs/vi.html.

I don't know all those listed on that sheet and don't recommend that you try to become a master at it. I've learned the basics I've needed and stuck with those. Insert, Append, Delete, Write, Quit, how to move around the file, how to exit without writing if you screwed it up too much "q!". The idea is to be able to make a few changes and save the file, mainly because you're in a situation where you have no other editor options.
 
1 members found this post helpful.
Old 08-16-2013, 05:09 PM   #12
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37
Posts: 290

Rep: Reputation: 55
In a console I use JED because I program and it recognizes file formats and hilights the language syntax. I custom program it to a version I call zxcv (uses CTRL-Z, CNTL-X, CNTL-C, and CNTL-V). It can be customized because much of its editing functionality is in scripts in a share library. It comes with EDT, emacs, and other editor emulations (which keys do what). It has a top line pull down menus and built-in help. You can change what style it uses, select the hilight colors, and highly configure it.
It will let you open at least 20 files at once, cut and paste between them, and multiple files editing on the screen in panes at the same time. You can escape to a shell like emacs too.

JED is a pain to get working in an X11 console window (X11-console has the wrong console emulator keyboard translations) so I many times use KWrite.

I keep JOE around as a backup.

KWrite behaves like Win stuff and will be familiar.

Kate is probably next best to JED for programming, but there are others for specific tasks.

There are also the Office editors which are for text composition. They are found under the Office tools.

I never touch vi (on purpose).
You have to learn some vi, because you will be trapped if you do not know how to quit it.
It is the Linux default, but many tools will let you change that to some other editor (on an individual basis).

The Pico editor appeared recently. I used to program database translations use pico editor commands input from the shell. Can edit directly or use it like sed (a stream editor). Pico is much more powerful than sed. It even has goto's.

EMACS: it started as an editor. They started adding functions, and if you can think of it there probably is a three keystroke invocation of it in EMACS, including shell functions, and for some people it will make coffee (www.northbound-train.com/emacs-hosted/coffee.el‎).
It has editing keystrokes totally unlike anything else. Do not invoke it unless you are prepared to spend considerable time finding your way back out. I am serious, you only get deeper and deeper into sub-functions.

The X11 main menu can be edited. I create an editor entry and put all the editors together in the menu. You can move the editor menu entry, or have a entry copy.

Last edited by selfprogrammed; 08-16-2013 at 05:23 PM.
 
Old 08-16-2013, 06:54 PM   #13
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
I always install mc (as referenced by Thor 2.0, above, in post #2) so I have a simple GUI and editor available when I get bounced to the command line after a failed boot. mcedit (part of the mc package) is intuitive to use from the console, and works quite well in a terminal window, although I prefer kate for most of my editing under X.
 
Old 08-17-2013, 11:22 PM   #14
Darth Maul
LQ Newbie
 
Registered: Aug 2013
Distribution: PClinuxOS 2013.7 KDE
Posts: 28

Rep: Reputation: Disabled
It's funny but I prefer to use vi as I use it about 97% over other editors. When I use nano or other text editors, I keep thinking vi commands and sometimes I press those letters.

Last edited by Darth Maul; 08-17-2013 at 11:26 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
is there an html editor with remote files editing capabilities? odysseus.lost Linux - Software 2 06-16-2005 08:23 AM
editing files zexter Linux - Software 2 11-05-2004 12:27 PM
editing files clemrick Linux - Newbie 4 11-02-2004 12:14 AM
Editing files Hone101 Linux - General 3 03-22-2003 01:47 PM
Editing files nicomon Linux - General 3 12-02-2002 11:43 PM


All times are GMT -5. The time now is 04:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration