vimrc files

This is a discussion on vimrc files within the Tech Board forums, part of the Community Boards category; Hey I've been reading somewhat about these files and tried to edit one myself but it didn't work. For example ...

  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    109

    vimrc files

    Hey I've been reading somewhat about these files and tried to edit one myself but it didn't work. For example i set the tab to be 4 spaces and such. Also i wanted to know if anyone had a good vimrc file for c++ programming they could share with me. Sorry for the incoherent thoughts just to sum it up real fast;

    can someone tell me how to get the file working and
    does anyone have a good vimrc file for c++ coding they could share with me.

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    Code:
    source $VIM/_vimrc
    
    set ts=3 sw=3 cindent ruler expandtab fo=cql fileformat=unix bg=dark
    color darkblue
    syn on
    A brief explanation of the sets:
    • source $VIM/_vimrc - Avoid skipping the default vimrc
    • ts=3 sw=3 - Sets my tabs to 3 spaces big.
    • cindent - Uses C-style indenting for C-type files
    • ruler - shows a little position information at the bottom of the window
    • expandtab - Convert tabs to spaces.
    • bg = dark - Affects colors.
    • color darkblue - To see all the possible colors, ls $VIMRUNTIME/colors
    • syn on - Enables syntax highlighting


    In general, vim looks for a directory specified by the environment variable $HOME (or %HOME%), and looks for the vimrc file in that directory. If you have trouble getting your vimrc file to work, you should definately give :help vimrc a read.
    Callou collei we'll code the way
    Of prime numbers and pings!

  3. #3
    Registered User
    Join Date
    Mar 2007
    Posts
    109
    can someone specifically tell me where to put this file, as well as the entire file that you might have for c++ programming

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    It depends largely on your system.
    Windows or Linux?
    gvim (windowed mode) or vim (console mode)?
    Callou collei we'll code the way
    Of prime numbers and pings!

  5. #5
    Registered User divineleft's Avatar
    Join Date
    Jul 2006
    Posts
    158
    here's mine:
    Code:
    set scrolloff=3 		"space between cursor and terminal bottom
    set nocompatible 		"VIM over Vi
    set undolevels=1500 	"how many times the user can undo
    set sidescrolloff=3 	"space between cursor and terminal side
    set ic! 				"ignore case for searching
    set title 				"sets terminal title
    set tabstop=4 			"tab width
    set nowrap 				"no wrapping
    set number 				"line number
    set nobackup 			"no default backup
    
    map <End> G 			"<End> brings vim to the end of the file
    map <Home> gg 			"<Home> brings vim to the beggining of file
    
    if has("gui_running")
    	colorscheme chela_light 
    	set gfn=Bitstream\ Vera\ Sans\ Mono\ 9
    else
    	colorscheme elflord
    endif
    the gvim color scheme you might not have

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ressources files
    By mikahell in forum Windows Programming
    Replies: 4
    Last Post: 06-19-2006, 06:50 AM
  2. add source files to embedded VC 4.0
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2006, 03:28 AM
  3. *.cpp and *.h files understanding
    By ElastoManiac in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2006, 04:45 AM
  4. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 10:46 AM
  5. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 01:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21