bgneal@0: set nocompatible bgneal@0: "source $VIMRUNTIME/vimrc_example.vim bgneal@0: "source $VIMRUNTIME/mswin.vim bgneal@0: "behave mswin bgneal@0: bgneal@0: set nobackup bgneal@0: set tabstop=3 bgneal@0: set shiftwidth=3 bgneal@0: set backspace=indent,eol,start bgneal@0: set expandtab bgneal1@9: set textwidth=79 bgneal@0: set number bgneal@0: set ruler bgneal@0: set history=1000 bgneal@0: set encoding=utf-8 bgneal@4: set showcmd bgneal@0: bgneal@0: " CtrlP related settings bgneal1@9: " set wildignore+=.git\*,.hg\*,.svn\*,*.d,*.dbo,*.o,*.ti,*.ii,*.swp,*.pyc bgneal@4: set wildignore+=*/.git/*,*/.hg/*,*/.svn/* bgneal@4: let g:ctrlp_working_path_mode = 2 bgneal@0: bgneal@0: " This allows % to toggle on if/elsif/else/end, XML tags, & more bgneal@0: runtime macros/matchit.vim bgneal@0: bgneal@0: " These two options make /-style searching case-sensitive only if there bgneal@0: " is a capital letter in the search expression. bgneal@0: set ignorecase bgneal@0: set smartcase bgneal@0: bgneal@0: " Sets the terminal title when run in an xterm bgneal@0: set title bgneal@0: bgneal@0: " This puts more context around the cursor when scrolling bgneal@0: set scrolloff=3 bgneal@0: bgneal1@9: let g:netrw_sort_sequence = "[\/]$,*,\.bak$,\.o$,\.info$,\.swp$,\.obj$" bgneal@0: bgneal@0: syntax on bgneal@0: filetype on bgneal@0: filetype plugin on bgneal@0: filetype indent on bgneal@0: set hlsearch bgneal@0: set incsearch bgneal@0: bgneal@0: " highlight trailing spaces bgneal@0: let c_space_errors = 1 bgneal1@9: let python_space_error_highlight = 1 bgneal@0: bgneal@2: set background=dark bgneal@2: colorscheme peaksea2 bgneal@2: " colorscheme Dark bgneal@0: bgneal@0: " shortcut for word completion in insert mode bgneal@0: imap bgneal@0: bgneal@0: " buffer next and previous commands bgneal@0: nnoremap :bnext bgneal@0: nnoremap :bprevious bgneal@0: bgneal@0: " Remove extra trailing spaces bgneal@0: nnoremap :%s/\s\+$// bgneal@0: bgneal@4: " setlocal spell spelllang=en_us bgneal@0: bgneal@0: let mapleader="," bgneal@0: bgneal@0: " NERD tree plugin bgneal@0: " nmap ,n :NERDTreeToggle bgneal@0: " let g:NERDTreeQuitOnOpen=1 bgneal@6: bgneal1@9: " ctags support bgneal1@9: bgneal1@9: function BgnCtags() bgneal1@9: let d = fnamemodify(findfile("root.dir", ";"), ":p:h") bgneal1@9: let tags = d . "\\tags" bgneal1@9: let s = "ctags -R --c++-kinds=+p --fields=+iaS --extra=+q --exclude=Coe_prune --exclude=Opnet --languages=-all --languages=+c,c++,python -f " . tags . " " . d bgneal1@9: echo s bgneal1@9: call system(s) bgneal1@9: endfunction bgneal1@9: bgneal1@9: nnoremap :call BgnCtags() bgneal1@9: nnoremap :tn bgneal1@9: nnoremap :tp bgneal1@9: nnoremap :tj bgneal1@9: set tags=tags;/ bgneal1@9: bgneal1@9: " Trial settings bgneal1@9: set wildmenu bgneal1@9: set wildmode=list:longest bgneal1@9: set laststatus=2 bgneal1@9: set gdefault bgneal1@9: set showmatch bgneal@10: set formatoptions=tcqrn1 bgneal1@9: nnoremap ,/ :noh bgneal1@9: " nnoremap / /\v bgneal1@9: " vnoremap / /\v bgneal1@9: bgneal1@9: " Splitting windows and moving around between them: bgneal1@9: nnoremap ,v vl bgneal1@9: nnoremap h bgneal1@9: nnoremap j bgneal1@9: nnoremap k bgneal1@9: nnoremap l bgneal1@9: bgneal1@9: " Absolute vs relative line numbers: bgneal1@9: nnoremap ,na :set norelativenumber:set number bgneal1@9: nnoremap ,nr :set relativenumber bgneal1@9: bgneal1@9: " Format paragraph bgneal1@9: nnoremap ,p gqip bgneal1@9: bgneal1@11: function BgnSwitchPart() bgneal1@11: python << EOF bgneal1@11: import vim, os.path, sys bgneal1@11: fname = vim.current.buffer.name bgneal1@11: base, ext = os.path.splitext(fname) bgneal1@11: headers = ['.h', '.hxx'] bgneal1@11: impls = ['.cpp', '.cxx', '.cc', '.c'] bgneal1@11: new_exts = None bgneal1@11: if ext in headers: bgneal1@11: new_exts = impls bgneal1@11: elif ext in impls: bgneal1@11: new_exts = headers bgneal1@11: bgneal1@11: if new_exts: bgneal1@11: for ext in new_exts: bgneal1@11: new_fname = base + ext bgneal1@11: if os.path.exists(new_fname): bgneal1@11: vim.command(":e %s" % new_fname) bgneal1@11: break bgneal1@11: else: bgneal1@11: sys.stderr.write("Could not find other part\n") bgneal1@11: else: bgneal1@11: sys.stderr.write("Uknown extension %s" % ext) bgneal1@11: EOF bgneal1@11: endfunction bgneal1@11: bgneal1@11: nnoremap ,s :call BgnSwitchPart() bgneal1@11: bgneal@6: " Pathogen support bgneal@6: call pathogen#infect()