]> git.mdlowis.com Git - archive/vim_config.git/commitdiff
Tweaked omnicomplete and added fast switch between c and h files
authorMike D. Lowis <mike@mdlowis.com>
Tue, 21 Feb 2012 21:57:47 +0000 (16:57 -0500)
committerMike D. Lowis <mike@mdlowis.com>
Tue, 21 Feb 2012 21:57:47 +0000 (16:57 -0500)
README.md [new file with mode: 0644]
vimrc

diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/vimrc b/vimrc
index 9d6facfd4db8dbd0800c18690e54f5a83e7caab7..c305f98ec0eb1fbfbae5688ae33968406dd04190 100644 (file)
--- 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 <Leader>h :nohl<CR>
 
 " ---- Omni Complete ----
-inoremap <S-tab> <C-n>
+inoremap <C-Space> <C-n>
 
 " ---- Nerd Tree Toggle ----
 map <Leader>t :NERDTreeToggle<CR>
@@ -132,6 +135,9 @@ map <Leader>fe :cs find e <cword><CR>
 map <Leader>ff :cs find f <cword><CR>
 map <Leader>fi :cs find i <cword><CR>
 
+" ---- Switch between header and C file ----
+map <F5> <ESC>:e %:p:s,.h$,.X123X,:s,.c$,.h,:s,.X123X$,.c,<CR>
+
 "==============================================================================
 " Abbreviations
 "==============================================================================