From: Mike D. Lowis Date: Tue, 21 Feb 2012 21:57:47 +0000 (-0500) Subject: Tweaked omnicomplete and added fast switch between c and h files X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=39dffa159a1e19d1aae0c73508a9c5d683bba340;p=archive%2Fvim_config.git Tweaked omnicomplete and added fast switch between c and h files --- diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/vimrc b/vimrc index 9d6facf..c305f98 100644 --- a/vimrc +++ b/vimrc @@ -2,11 +2,11 @@ " General Settings "============================================================================== syntax enable " Turn on syntax highlighting -filetype plugin indent off " Turn off plugin indent to make indent follow previous line (This makes indenting consistent across filetypes) +filetype plugin indent off " Turn off plugin indent to use custom indent settings colorscheme torte " Set default color scheme set nocompatible " Disable VI compatibility set backspace=indent,eol,start " Makes backspace work as expected -set whichwrap+=<,>,[,],h,l " Make cursor keys wrap lines +set whichwrap+=<,>,[,],h,l " Make cursor keys wrap line set autoindent " turn on auto indent set copyindent " Indent follows previous line set tabstop=4 " Tabs equivalent to 4 spaces @@ -46,6 +46,10 @@ set listchars=tab:>-,trail:- " Show only trailing spaces and tabs set lazyredraw " Don't redraw unless we need to set formatoptions+=r " Enable continuation of comments after a newline +filetype plugin on +set omnifunc=syntaxcomplete#Complete +set completeopt=menu,preview + "============================================================================== " Function and Command Definitions "============================================================================== @@ -66,7 +70,6 @@ function! ReformatWhiteSpace() if &modifiable retab silent! exec("%s/\\s\\+$//") - exec("=") endif endfunction @@ -94,7 +97,7 @@ vnoremap > >gv map h :nohl " ---- Omni Complete ---- -inoremap +inoremap " ---- Nerd Tree Toggle ---- map t :NERDTreeToggle @@ -132,6 +135,9 @@ map fe :cs find e map ff :cs find f map fi :cs find i +" ---- Switch between header and C file ---- +map :e %:p:s,.h$,.X123X,:s,.c$,.h,:s,.X123X$,.c, + "============================================================================== " Abbreviations "==============================================================================