Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-26-2004, 01:22 PM   #1
Mega Man X
LQ Guru
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Configuring (g)vim-tab with C++/Java

Hello all!

I'm trying to configure vim to use as C++/java programming. I've been always using vim, and, before I started coding anything, I always typed:

esc: set tabstop=4


set vb

to make the tab spaces equivalent to 4 spacebars and to use a visual bell instead of the annoying beep's. The thing is, whenever I try to add the line set tabstop=4 to .vimrc (to make it as default tabstop), when I code in C it does:


What I mean is, always after a "}" or "{" vim auto-places two tabspaces, when I want only one tab equivalent to 4 spaces. Using the vim command "esc: set tabstop=4" makes it work just fine, but not when added to .vimrc. This is hard to describe, I hope you can understand what I mean . The very same happens with gvim.

1 - Any ideas about fixing this?

2 - Another question, is it possible to edit vim syntax-highlight colors? (Only vim, not gvim).
Old 01-27-2004, 05:58 PM   #2
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
I was just looking through the vim documentation and found this. Perhaps it is what you are looking for.

:set cindent shiftwidth=4

Edit: As for editing the colors, I haven't done anything with this, but I believe that all the syntax stuff is in a directory like:


and colors in


Look around at some of those files and you may find what you want

Edit, edit, edit... Why can't I ever get everything I mean to say in the post the first time... Geesh...

BTW, I found the above command in a manual here:

Last edited by deiussum; 01-27-2004 at 06:02 PM.
Old 01-28-2004, 07:27 AM   #3
Mega Man X
LQ Guru
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Original Poster
Rep: Reputation: 64
Thanks mate!

I will give it a try. By the way, sweet 229 pages of vim manual. That editor surely has a lot of functions . The colors I've already tried and you are right. The command

:colorscheme <color name>

sets the color. I will take a look better at those files and see if I can make some custom ones

Thanks once again!


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
how to make a tab is 4 spaces width in vim? ICO SUSE / openSUSE 8 03-05-2013 11:24 AM
configuring Vim Fulkan Linux - Newbie 5 07-22-2010 02:20 PM
VIM doesn't complete filenames on pressing Tab The Scientist Linux - Software 2 10-13-2004 11:15 AM
Extremely stupid question about tab key (specifically in Vim) Imek Linux - Newbie 1 03-08-2004 06:11 PM
Java syntax highlighting in vim Phantomas Linux - Software 0 08-16-2003 05:34 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:33 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration