LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Error with VI (https://www.linuxquestions.org/questions/slackware-14/error-with-vi-892827/)

gonzalezeb 07-20-2011 08:04 PM

Error with VI
 
I'm getting an awkward error with VI...


skipping 1 old session file
reading {file name}
Read {filename}, 160 lines, 3724 chars


Now this only comes up when I ssh into my system and run vi. If I run vi from the console I do not get this error.

Any suggestions would be appreciative

flamelord 07-20-2011 08:46 PM

take a look at http://www.linuxquestions.org/questi...n-file-133190/, I don't know about why it only happens over ssh, but this thread is related to the same error message.

gonzalezeb 07-20-2011 09:00 PM

So, I actually tried that first...removing the elvis files did get rid of the "1 old session" error, but not the next two lines....

Here's is what I get, when I vi:



reading monthly_bgp_report.sh-2
Read monthly_bgp_report.sh-2, 42 lines, 1663 chars
#!/bin/bash

Note the first line in my script (#!/bin/bash) is indented....and that is all I can see. Can't even navigate the file.

Gavin Harper 07-21-2011 02:27 PM

Not being picky as I am sure you have your reasons, but why not Vim instead?

I am also assuming Vi and Vim are not being used interchangably.

gonzalezeb 07-21-2011 07:41 PM

That is correct.

Though, I have started to use vim, due to the issues with vi - unfortunately, crontab -e defaults to vi and not vim...so this is a real pain...

sycamorex 07-21-2011 07:51 PM

Quote:

Originally Posted by gonzalezeb (Post 4421851)
... unfortunately, crontab -e defaults to vi and not vim...so this is a real pain...

see this:
http://www.linuxquestions.org/questi...editor-395750/

Diantre 07-21-2011 08:49 PM

Quote:

Originally Posted by gonzalezeb (Post 4421851)
Though, I have started to use vim, due to the issues with vi - unfortunately, crontab -e defaults to vi and not vim...so this is a real pain...

Have a look at the crontab manpage:


Code:

Generally  the  -e  option is used to edit your crontab.  crontab will use the
editor  specified  by  your  EDITOR  or  VISUAL  environment  variable  (or
/usr/bin/vi) to edit the crontab.

I set vim as the default editor in my ~/.bashrc:

Code:

EDITOR=vim
VISUAL=$EDITOR
export EDITOR VISUAL


gonzalezeb 07-21-2011 09:07 PM

I've pretty much given up....

and have started to restore my system. Prior to deciding to rebuild, I kept running into other applications that use vi for their editor (i.e. mutt)...which ultimately was the deciding point to rebuild.

Upon rebuilding this system, I'll likely try Diantre suggestion in my bashrc file...I've never really played with vim, tell this occurred...I could definitely get used to it.

Thanks for all the help.

(BTW, I figured it out...at first I thought it was my 4yr old - early i caught him banging on the keyboard - But it turns out after upgrading my mac to OSX Lion yesterday, I needed to change the default terminal settings...)

gapan 07-22-2011 03:20 AM

vi is just a symlink to elvis. You can just point the symlink to vim instead.
Code:

# cd /usr/bin
# ln -sf vim vi



All times are GMT -5. The time now is 08:05 PM.