Skip to content

Instantly share code, notes, and snippets.

@arysom
Last active December 29, 2015 02:18
Show Gist options
  • Select an option

  • Save arysom/7599065 to your computer and use it in GitHub Desktop.

Select an option

Save arysom/7599065 to your computer and use it in GitHub Desktop.
gvim portable enchanced vimrc plus minor addings
set nocompatible " not compatible with the old-fashion vi mode
set bs=2 " allow backspacing over everything in insert mode
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set autoread " auto read when file is changed from outside
set nu " show line numbers
filetype on " Enable filetype detection
filetype indent on " Enable filetype-specific indenting
filetype plugin on " Enable filetype-specific plugins
" auto reload vimrc when editing it
autocmd! bufwritepost .vimrc source ~/.vimrc
syntax on " syntax highlight
set hlsearch " search highlighting
set clipboard=unnamed " yank to the system register (*) by default
set showmatch " Cursor shows matching ) and }
set showmode " Show current mode
set wildchar=<TAB> " start wild expansion in the command line using <TAB>
set wildmenu " wild char completion menu
" ignore these files while expanding wild chars
set wildignore=*.o,*.class,*.pyc
set autoindent " auto indentation
set incsearch " incremental search
set dir=~/.vim/tmp " tell vim where to put swap files
set copyindent " copy the previous indentation on autoindenting
set ignorecase " ignore case when searching
set smartcase " ignore case if search pattern is all lowercase,case-sensitive otherwise
set smarttab " insert tabs on the start of a line according to context
" disable sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" TAB setting{
set expandtab "replace <TAB> with spaces
set softtabstop=4
set shiftwidth=4
" Tab Usage
map <M-Right> :tabnext<CR>
map <M-Left> :tabprev<CR>
function! Tab_Or_Complete()
if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
return "\<C-N>"
else
return "\<Tab>"
endif
endfunction
:inoremap <Tab> <C-R>=Tab_Or_Complete()<CR>
:set dictionary="/usr/dict/words"
"au FileType Makefile set noexpandtab
"}
set laststatus=2
let g:airline#extensions#tabline#enabled = 0
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
syntax enable
set background=dark
set guifont=Consolas:h16
set guioptions-=m "remove menu bar
set guioptions-=T "remove toolbar
set guioptions-=r "remove right-hand scroll bar
set guioptions-=L "remove left-hand scroll bar
au GUIEnter * simalt ~x "maxminze windowns
set t_Co=256
colorscheme yowish
let g:airline_theme='papercolor'
"
"---------------------------------------------------------------------------
" ENCODING SETTINGS
"---------------------------------------------------------------------------
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,big5,gb2312,latin1
fun! ViewUTF8()
set encoding=utf-8
set termencoding=big5
endfun
fun! UTF8()
set encoding=utf-8
set termencoding=big5
set fileencoding=utf-8
set fileencodings=ucs-bom,big5,utf-8,latin1
endfun
fun! Big5()
set encoding=big5
set fileencoding=big5
endfun
map <F5> <Esc>:EnableFastPHPFolds<Cr>
map <F6> <Esc>:EnablePHPFolds<Cr>
map <F7> <Esc>:DisablePHPFolds<Cr>
let g:DisableAutoPHPFolding = 1
let g:netrw_altv = 1
let g:netrw_fastbrowse = 2
let g:netrw_keepdir = 0
let g:netrw_liststyle = 1
let g:netrw_retmap = 1
let g:netrw_silent = 1
let g:netrw_special_syntax= 1
"taglist
let Tlist_Ctags_Cmd= $VIMRUNTIME.'\ctags.exe'
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
map <F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
"http://stackoverflow.com/questions/13232262/how-to-disable-tab-completion-for-tags-in-vim
"The default value of complete option is .,w,b,u,t,i, which means to scan:
". the current buffer
"w buffers in other windows
"b other loaded buffers
"u unloaded buffers
"t tags
"i included files
set cpt-=t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment