LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   vim : command not found (https://www.linuxquestions.org/questions/linux-newbie-8/vim-command-not-found-4175459441/)

Ariven 04-24-2013 10:31 AM

vim : command not found
 
I am trying to run cpp program in fedora but it gives the error " vim command not found" (I am using fedora through Virtual Box)

sycamorex 04-24-2013 10:35 AM

Hi and welcome to LQ.

Not sure if vim is installed by default. Try (as root):

Code:

yum install vim

Madhu Desai 04-24-2013 10:48 AM

You can install vim by:
Code:

# yum install vim-X11 vim-common vim-enhanced vim-minimal
then, its good idea to set alias to vi
Code:

# echo "alias vi=vim" >> /etc/profile
# echo "alias vi=vim" >> /etc/bashrc
# source /etc/profile
# source /etc/bashrc

and then, if you wish, you can use following codes in vimrc file for coloring and indention: (insert at bottom of file)
Code:

# vi /etc/vimrc
PHP Code:

syntax on
set ruler
set number
set tabstop
=4
set shiftwidth
=4
set autoindent
set smartindent
set showmatch
set nocompatible
set incsearch
set hlsearch 


lleb 04-24-2013 11:39 AM

Quote:

Originally Posted by Ariven (Post 4938047)
I am trying to run cpp program in fedora but it gives the error " vim command not found" (I am using fedora through Virtual Box)

you might also want to run alias at the $ prompt to see if fedora, as most of the newer vs of fedora, will pair vi with vim as a default install.

shivaa 04-24-2013 12:25 PM

Quote:

Originally Posted by mddesai (Post 4938060)
Code:

# echo "alias vi=vim" >> /etc/profile
# echo "alias vi=vim" >> /etc/bashrc
# source /etc/profile
# source /etc/bashrc


Minor correction: User should add alias in his own files i.e. ~/.bashrc and ~/.profile, not in general files. Same should be done with ~/.vimrc not /etc/vimrc.

Madhu Desai 04-24-2013 01:04 PM

Quote:

Originally Posted by shivaa (Post 4938099)
Minor correction: User should add alias in his own files i.e. ~/.bashrc and ~/.profile, not in general files. Same should be done with ~/.vimrc not /etc/vimrc.

You are right. users should customize their own files. as admin i usually customize environment for all users. forgot that most users will not have access to edit admin files. Thanks.


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