Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set nocompatible
- set mouse=a
- " Pathogen vim manager
- execute pathogen#infect()
- " You complete me
- let g:ycm_global_ycm_extra_conf = '.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
- let g:ycm_confirm_extra_conf = 0
- syntax enable " Turn on syntax highlighting
- set hidden " Leave hidden buffers open set history=100 "by default Vim saves your last 8 commands. We can handle more
- " No annoying sound on errors
- set noerrorbells
- set novisualbell
- set t_vb=
- set tm=500
- set magic " For regexes set magic on
- " Configure backspace so it acts as it should act
- set backspace=eol,start,indent
- set whichwrap+=<,>,h,l
- " Ignore compiled files
- set wildignore=*.o,*~,*.pyc
- if has("win16") || has("win32")
- set wildignore+=.git\*,.hg\*,.svn\*
- else
- set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
- endif
- set hlsearch
- " Save on make
- set autowrite
- "COLORS!
- colorscheme thayer
- highlight Normal ctermfg=grey
- set t_Co=256
- " Rebind keys
- nnoremap ; l
- noremap <S-Enter> o<Esc>
- noremap <silent> <C-S> :update<CR>
- vnoremap <silent> <C-S> <C-C>:update<CR>
- inoremap <silent> <C-S> <C-O>:update<CR>
- " Close NERDTree if only window
- autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
- " Tabs and spaces!
- set tabstop=4
- set expandtab
- set shiftwidth=4
- set smarttab
- set autoindent
- " If coding in C change spaces and tabs
- autocmd BufNewFile,BufRead *.c setlocal tabstop=8
- autocmd BufNewFile,BufRead *.c setlocal shiftwidth=8
- autocmd BufNewFile,Bufread FileType make setlocal noexpandtab
- " Line numbers
- set number
- " Whitespace
- function! <SID>StripTrailingWhitespaces()
- let l = line(".")
- let c = col(".")
- %s/\s\+$//e
- call cursor(l, c)
- endfun
- autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
- " gvim changes
- if has("gui_running")
- " Allow Ctrl-Shift-V to paste
- noremap <C-S-v> "+p
- inoremap <C-S-v> "+p
- " Allow Ctrl-S to save
- noremap <C-s> :w
- endif
- if has("gui_running")
- autocmd VimEnter * NERDTree ~/Codes/
- autocmd BufWinEnter * NERDTreeMirror
- endif
- " Tab shortcuts
- noremap <C-Tab> :tabn<CR>
- inoremap <C-Tab> :tabn<CR>
- noremap <C-S-Tab> :tabp<CR>
- inoremap <C-S-Tab> :tabp<CR>
- noremap <C-t> :tabnew<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement