LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-10-2006, 01:54 PM   #1
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Tip for non-Power Users: Moving from "less" directly into an editor


Real power users and gurus already know this, but I just ran across it yesterday, and thought it was worth sharing. To scan thru a medium to large size file most people use "less" rather than "more" because you can move backwards as well as forward. The "v" key used in "less" automatically opens the file in the editor of your choice. Make changes, and exit the editor, and you are returned to "less."

This action is dependent on the environment variables EDITOR, or VISUAL. Some distros come with those variables loaded (usually with vi or vim), and in others, such as Debian, you have to load them yourself. Try
Code:
debian64:~$ echo $EDITOR
vim
debian64:~$
or
Code:
debian64:~$ echo $VISUAL
vim
debian64:~$
If you come up blank there,
Code:
$ EDITOR=vim
$ VISUAL=vim
$ export EDITOR VISUAL
If you like it, add those lines to your /etc/profile file.

You could, of course, choose to use nano, pico, emacs, or any other editor.

Last edited by rickh; 10-10-2006 at 03:25 PM.
 
Old 10-11-2006, 10:16 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Thanks for the tip. I knew it could be done but had forgotten how and have been too lazy to go looking for istructions.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Disabling hardware detection of "reboot" and "power" buttons Sabinou Linux - General 3 08-21-2006 07:03 PM
Tip: handling "cannot open shared object file..." sundialsvcs Linux - Newbie 1 03-06-2006 12:57 PM
What "kernel opts" allow PC to power down with "turning energy off"? kornerr Linux - General 1 03-10-2005 12:07 PM
"adduser" not adding users to default group "users" PunkPT Slackware 2 09-23-2004 11:50 AM
"perl Makefile.PL" complains about cc & gcc (self solved tip) Raptor Ramjet Slackware 2 09-13-2004 02:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:02 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
Open Source Consulting | Domain Registration