SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
# /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 ?
$ 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).
$ 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).
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
> 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
> 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
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?
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
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?).
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
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.
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
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]
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.