LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 01-18-2004, 04:38 AM   #1
usr
Member
 
Registered: Oct 2003
Posts: 44

Rep: Reputation: 15
insert mode in vim


I have a problem in vim. After I press i it doesn't appear --INSERT-- in the left corner of the screen and if I type something and I want to erase using Backspace the cursor moves backward but it doesn't erase the text. A second problem is with syntax highlighting. I work in C++ and I need this. How could I activate it?

Thanks!
 
Old 01-18-2004, 01:25 PM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 56
You are probably using vim in compatible mode. This means it behaves exactly like the traditional vi editor.

First make sure you have the full vim installed. If you have problems locating the packages for your distribution I suggest you do an AAP install of vim. It works great for me and you'll get the very latest version.

When in vim, to enable syntax highlighting type these commands:
:set nocompatible <enter>
:syntax on <enter>


You can set your default preferences in ~/.vimrc and ~/.gvimrc. The latter is loaded by vim-gtk (if you use the GTK+ interface). I have my .vimrc sourced from .gvimrc so I set all my preferences in ~/.vimrc and only the graphical ones in ~/.gvimrc.

My .vimrc:
Code:
set hlsearch    
set ignorecase
set softtabstop=4
set shiftwidth=4
set showmatch

" Make program (javac for compiling Java code, use :cl to list errors, :cn to jump to next error
set makeprg=javac\ %
set errorformat=%A%f:%l:\ %m,%-Z%p^,%-C%.%# 

" Map smart stuff
nmap <silent> <C-N> :silent noh<CR>  " Maps Ctrl+N to :nohls
My .gvimrc:
Code:
"Source (parse) the .vimrc file
so ~/.vimrc
"Set color scheme downloaded from www.vim.org
colo oceanblack
" Set font to use in GUI mode, if you don't use the GTK2 version you need to use classic X font names
set guifont=Andale\ Mono\ 8

Håkan
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VIM insert before a visual block... pld Linux - Software 0 06-22-2005 11:36 AM
arrow keys in vi insert mode sanjeev.naik Linux - Software 6 09-04-2004 12:21 PM
moving around in vim while in insert mode cleff Linux - Software 3 06-14-2004 10:26 PM
VIM Setup- No 'insert' mode uveraser Linux - Software 1 05-25-2004 10:44 AM
vim: coding mode and doc writing mode? miknight Linux - Software 2 03-07-2004 08:51 PM


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

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration