LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Configuring (g)vim-tab with C++/Java (https://www.linuxquestions.org/questions/programming-9/configuring-g-vim-tab-with-c-java-138866/)

Mega Man X 01-26-2004 12:22 PM

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

and

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:

main()
{
<tab><tab>mycode
}

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).

deiussum 01-27-2004 04:58 PM

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:

/usr/share/vim/vim62/syntax/*.vim

and colors in

/usr/share/vim/vim62/colors/*.vim

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:
http://www.eandem.co.uk/mrw/vim/usr_doc/doc_a4c.pdf

Mega Man X 01-28-2004 06:27 AM

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!


All times are GMT -5. The time now is 04:31 PM.