From 39dffa159a1e19d1aae0c73508a9c5d683bba340 Mon Sep 17 00:00:00 2001 From: "Mike D. Lowis" Date: Tue, 21 Feb 2012 16:57:47 -0500 Subject: [PATCH] Tweaked omnicomplete and added fast switch between c and h files --- README.md | 0 vimrc | 14 ++++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 README.md 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 "============================================================================== -- 2.54.0