LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-24-2013, 11:31 AM   #1
Ariven
LQ Newbie
 
Registered: Apr 2013
Posts: 1

Rep: Reputation: Disabled
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)
 
Old 04-24-2013, 11:35 AM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200
Hi and welcome to LQ.

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

Code:
yum install vim
 
1 members found this post helpful.
Old 04-24-2013, 11:48 AM   #3
mddnix
Member
 
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 516

Rep: Reputation: 139Reputation: 139
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 

Last edited by mddnix; 04-24-2013 at 12:45 PM.
 
1 members found this post helpful.
Old 04-24-2013, 12:39 PM   #4
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
Quote:
Originally Posted by Ariven View Post
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.
 
1 members found this post helpful.
Old 04-24-2013, 01:25 PM   #5
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by mddesai View Post
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.
 
1 members found this post helpful.
Old 04-24-2013, 02:04 PM   #6
mddnix
Member
 
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 516

Rep: Reputation: 139Reputation: 139
Quote:
Originally Posted by shivaa View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] How do you write <Esc> in the vim command line (:vim command). stf92 Linux - General 6 06-26-2011 06:33 AM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 05:26 PM
vi / vim command shahed Linux - Newbie 1 12-07-2006 12:10 AM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-28-2006 12:57 AM
vi/vim command xviddivxoggmp3 Linux - Software 4 06-13-2004 11:07 PM


All times are GMT -5. The time now is 11:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration