LinuxQuestions.org
Visit Jeremy's Blog.
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 12-12-2010, 03:05 PM   #1
molossus
Member
 
Registered: Nov 2010
Location: US
Distribution: Ubuntu 12.04
Posts: 49

Rep: Reputation: 0
Exclamation slackware 13.1 doesnt not recognize vim


here is my /etc/profile file:

Code:
# /etc/profile: This file contains system-wide defaults used by
# all Bourne (and related) shells.

# Set the values for some environment variables:
export MINICOM="-c on"
export MANPATH=/usr/local/man:/usr/man
export HOSTNAME="`cat /etc/HOSTNAME`"
export LESSOPEN="|lesspipe.sh %s"
export LESS="-M"
export EDITOR="/usr/bin/vim"
# If the user doesn't have a .inputrc, use the one in /etc.
if [ ! -r "$HOME/.inputrc" ]; then
  export INPUTRC=/etc/inputrc
fi

# Set the default system $PATH:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"

# For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in
# the $PATH.  Some means of connection don't add these by default (sshd comes
# to mind).
if [ "`id -u`" = "0" ]; then
  echo $PATH | grep /usr/local/sbin 1> /dev/null 2> /dev/null
  if [ ! $? = 0 ]; then
    PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
  fi
fi

# I had problems with the backspace key using 'eval tset' instead of 'TERM=',
# but you might want to try it anyway instead of the section below it.  I
# think with the right /etc/termcap it would work.
# eval `tset -sQ "$TERM"`

# Set TERM to linux for unknown type or unset variable:
if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
 TERM=linux
fi

# Set ksh93 visual editing mode:
if [ "$SHELL" = "/bin/ksh" ]; then
  VISUAL=emacs
#  VISUAL=gmacs
#  VISUAL=vim
fi


# Set a default shell prompt:
#PS1='`hostname`:`pwd`# '
if [ "$SHELL" = "/bin/pdksh" ]; then
 PS1='! $ '
elif [ "$SHELL" = "/bin/ksh" ]; then
 PS1='! ${PWD/#$HOME/~}$ '
elif [ "$SHELL" = "/bin/zsh" ]; then
 PS1='%n@%m:%~%# '
elif [ "$SHELL" = "/bin/ash" ]; then
 PS1='$ '
else
 PS1='\u@\h:\w\$ '
fi
PS2='> '
export PATH DISPLAY LESS TERM PS1 PS2

# Default umask.  A umask of 022 prevents new files from being created group
# and world writable.
umask 022

# Notify user of incoming mail.  This can be overridden in the user's
# local startup file (~/.bash.login or whatever, depending on the shell)
if [ -x /usr/bin/biff ]; then
 biff y 2> /dev/null
fi

# Append any additional sh scripts found in /etc/profile.d/:
for profile_script in /etc/profile.d/*.sh ; do
  if [ -x $profile_script ]; then
    . $profile_script
  fi
done
unset profile_script

# For non-root users, add the current directory to the search path:
if [ ! "`id -u`" = "0" ]; then
 PATH="$PATH:."
fi
export EDITOR="/usr/bin/vim"
i inserted export EDITOR="/usr/bin/vim" a the beginning of the file and at the end, the first time at the beginning didnt work , my .bashrc also has :
export EDITOR="/usr/bin/vim" , nothing, everytime i invoke vim , i just get vi which sucks really hard.
the only time i am able to call the real vim,is by:
Code:
$ /usr/bin/vim
whe i do :
$ echo $EDITOR
i get:
/usr/bin/vim

so why doesnt slackware calls vim???
it just defaults to the really wacky vi.

Note: i downloaded the tar.gz package vim, and did :configure, make , make install, all went well.
what else can i do ?

Last edited by molossus; 12-12-2010 at 03:10 PM.
 
Old 12-12-2010, 03:10 PM   #2
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Post the output of
Code:
$ which vim
$ alias vim
$ echo $PATH
$ ls -l /usr/bin/vim
$EDITOR only controls the default application used for editing something (for example, the default editor when you issue `crontab -e`). If you call vim explicitly it doesn't matter what $EDITOR is set to -- it should open vim (unless you have an alias or a path problem).
 
Old 12-12-2010, 03:15 PM   #3
molossus
Member
 
Registered: Nov 2010
Location: US
Distribution: Ubuntu 12.04
Posts: 49

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by T3slider View Post
Post the output of
Code:
$ which vim
$ alias vim
$ echo $PATH
$ ls -l /usr/bin/vim
$EDITOR only controls the default application used for editing something (for example, the default editor when you issue `crontab -e`). If you call vim explicitly it doesn't matter what $EDITOR is set to -- it should open vim (unless you have an alias or a path problem).
Code:
$ which vim
/usr/local/bin/vim
Code:
$ alias vim                                                                      
bash: alias: vim: not found
Code:
$ echo $PATH                                                                      
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/lib/java/bin:/usr/lib/kde4/libexec:/usr/lib/qt/bin:/usr/share/texmf/bin:.
Code:
$ ls -l /usr/bin/vim                                                               
-rwxr-xr-x 1 root root 4280520 2010-05-12 02:38 /usr/bin/vim*
when i put alias vim ="/usr/bin/vim" in .bashrc it works only for my user
not when i editing a system file like fstab
su-c 'vim /etc/fstab' does not calls vim, just vi

Last edited by molossus; 12-12-2010 at 03:21 PM.
 
Old 12-12-2010, 03:16 PM   #4
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 699
Blog Entries: 1

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
Hi

<snip>

> so why doesnt slackware calls vim???
what does this mean ? Is there a specific
application you are talking about ?
Some apps use $VISUAL instead of $EDITOR

<snip>

regards,
John
 
Old 12-12-2010, 03:26 PM   #5
molossus
Member
 
Registered: Nov 2010
Location: US
Distribution: Ubuntu 12.04
Posts: 49

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jmccue View Post
Hi

<snip>

> so why doesnt slackware calls vim???
what does this mean ? Is there a specific
application you are talking about ?
Some apps use $VISUAL instead of $EDITOR

<snip>

regards,
John
i just want to be able to edit files by using vim , not vi
for example su -c 'vim /etc/fstab'
does not calls vim, just vi, eventhough with what i have in profile and .bashrc
 
Old 12-12-2010, 03:29 PM   #6
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
You have a copy of vim (which may just be vi) in /usr/local/bin, which is run instead of vim in /usr/bin (according to your PATH). Why do you have a duplicate copy of vim installed in /usr/local?
 
Old 12-12-2010, 03:46 PM   #7
molossus
Member
 
Registered: Nov 2010
Location: US
Distribution: Ubuntu 12.04
Posts: 49

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by T3slider View Post
You have a copy of vim (which may just be vi) in /usr/local/bin, which is run instead of vim in /usr/bin (according to your PATH). Why do you have a duplicate copy of vim installed in /usr/local?
i dont know, i am confused, i downloaded vim from the vim official site. is that vi?
that can't be vi because vi doesnt have colored syntax, and it doesnt even show "INSERT" at the bottom.
i have VIM on /usr/bin/vim

/usr/local/bin/vim is vi
/usr/bin/vim is VIM

i just tested it

Last edited by molossus; 12-12-2010 at 04:11 PM.
 
Old 12-12-2010, 04:32 PM   #8
molossus
Member
 
Registered: Nov 2010
Location: US
Distribution: Ubuntu 12.04
Posts: 49

Original Poster
Rep: Reputation: 0
problem solved found in another LQ question forum.
what i just did was
Code:
rm /usr/local/bin/vim
then
Code:
ln -s /usr/bin/vim /usr/local/bin/vim
/usr/local/bin/vim was the wacky vi
/usr/bin/vim is vim

what would another solution for this problem be other than deleting the vi link and then making a soft link to where vim is ?
 
Old 12-12-2010, 04:45 PM   #9
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
You shouldn't need the symlink at all...it should look in /usr/bin if vim is not found in /usr/local/bin. In a default Slackware install vim is already included, and there is no vim in /usr/local/bin. If you downloaded vim from its official site and installed it, it placed another copy of vim (with different configure options) in /usr/local/bin. The 'solution' was not to install vim into /usr/local in the first place (ie stick to Slackware's vim instead of downloading and installing vim separately), but removing all traces of vim from /usr/local/bin should be enough to solve your problem. I don't know how you installed vim (`./configure; make; make install`?), but uninstalling it (aside from just deleting everything vim-related in /usr/local) would depend on how you installed it (`make uninstall` in the source directory, perhaps?).
 
Old 12-12-2010, 05:00 PM   #10
molossus
Member
 
Registered: Nov 2010
Location: US
Distribution: Ubuntu 12.04
Posts: 49

Original Poster
Rep: Reputation: 0
Question

Quote:
Originally Posted by T3slider View Post
You shouldn't need the symlink at all...it should look in /usr/bin if vim is not found in /usr/local/bin. In a default Slackware install vim is already included, and there is no vim in /usr/local/bin. If you downloaded vim from its official site and installed it, it placed another copy of vim (with different configure options) in /usr/local/bin. The 'solution' was not to install vim into /usr/local in the first place (ie stick to Slackware's vim instead of downloading and installing vim separately), but removing all traces of vim from /usr/local/bin should be enough to solve your problem. I don't know how you installed vim (`./configure; make; make install`?), but uninstalling it (aside from just deleting everything vim-related in /usr/local) would depend on how you installed it (`make uninstall` in the source directory, perhaps?).
i dont quite understand " In a default Slackware install vim is already included"
in my install of slackware 13.1 ( about 5GB) when i called vim , it called vi , i mean for example i called vim .bashrc it created the file but no colors, no indication below that i was in INSERT mode or command mode, also when i try to go up or down instead it printed weird letters ^A , B ... etc.

that is why i downloaded vim from the official site and configured , make, make install, but still it called vi.
when i called vim from /usr/bin/vim , then i was able to see INSERT, and i didnt print weird characters when i pressed the up key or down key. that is vim , not vi.
so i dont think slackware ships with vim, even though gvim is installed by default, which makes it even more confusing.

note: i deleted /usr/local/bin/vim ,and this is what is get :
Code:
bash: /usr/local/bin/vim: No such file or directory
so , no , slackware didn't look in /usr/bin/vim

Last edited by molossus; 12-12-2010 at 05:02 PM.
 
Old 12-12-2010, 05:25 PM   #11
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Quote:
Originally Posted by molossus View Post
i dont quite understand " In a default Slackware install vim is already included"
in my install of slackware 13.1 ( about 5GB) when i called vim , it called vi , i mean for example i called vim .bashrc it created the file but no colors, no indication below that i was in INSERT mode or command mode, also when i try to go up or down instead it printed weird letters ^A , B ... etc.

that is why i downloaded vim from the official site and configured , make, make install, but still it called vi.
when i called vim from /usr/bin/vim , then i was able to see INSERT, and i didnt print weird characters when i pressed the up key or down key. that is vim , not vi.
so i dont think slackware ships with vim, even though gvim is installed by default, which makes it even more confusing.
On Slackware64-13.1:
Code:
/var/log/packages/vim-7.2.416-x86_64-1
/var/log/packages/vim-gvim-7.2.416-x86_64-1
Issuing `vim` gets the coloured vim as expected. Issuing `vi` or `elvis` gets the uncoloured vi. I don't know what was wrong with your Slackware installation or what (if anything) you were doing incorrectly, but vim is included with a full Slackware installation and works as expected. vi (in the form of elvis) is a required package in Slackware, but in a full installation vim is included as well. There are no aliases to vi by default, so issuing `vim` should get the expected behaviour. I have two 13.1 upgrades (both 32-bit and 64-bit) as well as a fresh 13.1 server (without X), and vim works as expected in all of them without installing an unofficial package. See here for 32-bit vim (in the ap/ series of Slackware) and here for the 64-bit package.
Quote:
Originally Posted by molossus View Post
note: i deleted /usr/local/bin/vim ,and this is what is get :
Code:
bash: /usr/local/bin/vim: No such file or directory
so , no , slackware didn't look in /usr/bin/vim
What command did you issue to get that error? Without the symlink in place, what is the output of
Code:
$ which vim
$ file /usr/bin/vim
Your PATH above indicates that it should search in /usr/local/bin first, and then /usr/bin if it doesn't find it. If there is no vim in /usr/local/bin then it should find the one in /usr/bin whenever you issue `vim`.

[edit] Just as a thought, bash's hash table could be remembering /usr/local/bin/vim. Try issuing
Code:
hash -d vim
I'm not sure if the hash table is regenerated when bash is restarted, but you could try logging out and logging back in as well.
[/edit]

Last edited by T3slider; 12-12-2010 at 05:31 PM.
 
Old 12-12-2010, 05:42 PM   #12
molossus
Member
 
Registered: Nov 2010
Location: US
Distribution: Ubuntu 12.04
Posts: 49

Original Poster
Rep: Reputation: 0
after deleting /usr/local/bin/vim and invoking vim again i got:
Code:
bash: /usr/local/bin/vim: No such file or directory
making the ln -s link to /usr/bin/vim , makes vim work and vi is gone.


the ouput of
$ which vim
Code:
/usr/local/bin/vim
$ file /usr/bin/vim
Code:
/usr/bin/vim: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
 dynamically linked (uses shared libs), stripped
hash -d vim
Code:
bash: hash: vim: not found
i installed the the vim .tgz from the link you provided , and now vim is called even when i call vi, nice.
still hash -d vim shows nothing and then if i execute again , it shows hash:vim not found
anyways i learned a lot of new things today.

Last edited by molossus; 12-12-2010 at 05:57 PM.
 
Old 12-12-2010, 06:00 PM   #13
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hi molossus,

in a default Slackwareinstallation you'll only have to
Code:
cp /usr/share/vim/vim73/vimrc_example.vim ~/.vimrc
in order to get colord vim.
Explanation: the colors are devined in the .vimrc in your homedirectory. The default vimrc is found as vimrc_example.vim in the /usr/share/vim/vim73 directory.

Markus
 
  


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
help!slackware 12.1 doesnt recognize my usb hardrive? rixtr66 Slackware - Installation 4 08-17-2008 09:32 PM
slackware doesnt recognize usb drive? rixtr66 Linux - Newbie 1 08-17-2008 06:59 PM
Slackware doesnt recognize working HD STCistheGreatest Slackware - Installation 12 05-30-2007 12:43 PM
slackware 10 doesnt recognize my cdrom ddaas Slackware 4 12-09-2004 11:28 PM

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

All times are GMT -5. The time now is 03:38 AM.

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