LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-06-2011, 02:17 PM   #1
riwi
Member
 
Registered: Jul 2011
Location: Netherlands
Distribution: Slackware64 14.2
Posts: 64

Rep: Reputation: Disabled
vi command mode Home - ESCape?


Since 13.37 I notice that vi needs the 'home' key to switch from input to command mode.
I think this is only when I connect via Putty to the machine. When I am on local console it is still ESCape like it used to be.

Does anyone know how to set it so that vi will switch from input to command mode using the ESCAPE key when using Putty?

Another vi question :
When you edit htm files, vi goes automagically into some sort of html display mode. Ofcourse I never want that since all I do is edit the html in vi. So I need to go to command mode and type :normal everytime I want to edit html files. Where can you configure that vi (or vim) default to normal mode allways?

Thanks for any help!

<I see that vi links to elvis : >
# ls -al /usr/bin/vi lrwxrwxrwx 1 root root 5 Oct 3 2009 /usr/bin/vi -> elvis*

Last edited by riwi; 07-06-2011 at 05:51 PM. Reason: added elvis remark
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 07-06-2011, 03:52 PM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello riwi,

your first issue has nothing to do with the editor but with the configuration of putty or the terminal respectively.

To your second question: the standard-editor on Slackware is not vim but elvis. elvis is executed (by default) if you use the vi command. elvis can display html and I think this is what you mean. There should be a file ~/.elvisrc in your homedirectory, in this file insert a line with the command you described
Code:
normal
I hope this works for you.

Markus
 
2 members found this post helpful.
Old 07-06-2011, 04:56 PM   #3
riwi
Member
 
Registered: Jul 2011
Location: Netherlands
Distribution: Slackware64 14.2
Posts: 64

Original Poster
Rep: Reputation: Disabled
Hi Markush,

Thanks for responding.

I tried your suggestion. I added .elvisrc under /root with the command in it. It does not seem to read it or the result gets overwritten later.
I googled more and found that elvis.arf is used to guess what display mode the user wants.
Since there is no way anyone can guess what I want I renamed the elvis.arf file.
Now html mode does not kick in.
Maybe I'll try to modify it later so I will not get html mode but will get syntax mode for when I edit bash or perl scripts. Syntax highlighting could be handy.

root@riwilinux:/usr/share/elvis-2.2_0# mv elvis.arf elvis.old.arf

Last edited by riwi; 07-06-2011 at 04:57 PM.
 
1 members found this post helpful.
Old 07-06-2011, 04:58 PM   #4
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
If you want syntax hilighting why not use vim?
 
Old 07-06-2011, 05:02 PM   #5
riwi
Member
 
Registered: Jul 2011
Location: Netherlands
Distribution: Slackware64 14.2
Posts: 64

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dive View Post
If you want syntax hilighting why not use vim?
I'll give it a go. Looks a lot more colorful (rainbow like) when opening a htm file
:wq
 
Old 07-06-2011, 05:49 PM   #6
riwi
Member
 
Registered: Jul 2011
Location: Netherlands
Distribution: Slackware64 14.2
Posts: 64

Original Poster
Rep: Reputation: Disabled
Ok, I found a package ex-vi-050325-i486-1sl.txz
That gives me plain standard vi the way I like it.

Also the annoying <home> instead of ESCape is fixed when I use standard vi

For people who do want elvis :
to get syntax mode for html files :

create ~/.exrc
and put the line :
set prefersyntax=writable

logout / login before this is effective.

Last edited by riwi; 07-06-2011 at 05:57 PM. Reason: added elvis tip
 
1 members found this post helpful.
Old 07-07-2011, 04:55 AM   #7
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by riwi View Post
For people who do want elvis :
to get syntax mode for html files :
Just a tip for future reference...
When you open an html file in elvis you can toggle between modes with
^wd
(Hold CTRL then type wd)

Last edited by mRgOBLIN; 07-07-2011 at 05:28 AM. Reason: Fixed typo
 
2 members found this post helpful.
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
escape string in bash script so it can be used in command line BuckRogers01 Linux - Software 15 08-12-2010 09:38 AM
Escape command for remote ssh execution brianmcgee Linux - Software 2 06-14-2010 06:34 AM
escape characters in watch command .:neogeo:. Linux - General 2 10-21-2009 02:23 AM
passing escape characters along with lp command zita Linux - General 0 10-05-2005 01:58 PM
Using escape string error in MySQL select command, any one can help me? myunicom Linux - General 2 02-16-2004 09:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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