Skip to content

Instantly share code, notes, and snippets.

@VincentTam
Last active April 5, 2017 09:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save VincentTam/9639b489b89fd8d56a15 to your computer and use it in GitHub Desktop.
My VIMRC for Vim in Git for Windows
" Vundle settings
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=$HOME/vimfiles/bundle/Vundle.vim
"call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
call vundle#begin('$HOME/vimfiles/bundle/')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
Plugin 'scrooloose/nerdtree'
Plugin 'tomtom/tlib_vim'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'junegunn/vim-easy-align'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'vim-latex/vim-latex'
Plugin 'plasticboy/vim-markdown'
Plugin 'xolox/vim-misc'
Plugin 'tangledhelix/vim-octopress'
Plugin 'tpope/vim-repeat'
"Plugin 'xolox/vim-session'
Plugin 'garbas/vim-snipmate'
Plugin 'honza/vim-snippets'
Plugin 'tpope/vim-surround'
Plugin 'kana/vim-textobj-lastpat'
Plugin 'kana/vim-textobj-user'
Plugin 'rbonvall/vim-textobj-latex'
Plugin 'tpope/vim-unimpaired'
Plugin 'bronson/vim-visual-star-search'
Plugin 'mattn/webapi-vim'
Plugin 'mattn/gist-vim'
Plugin 'sgur/vim-textobj-parameter'
Plugin 'thinca/vim-textobj-between'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'DrawIt'
Plugin 'FuzzyFinder'
Plugin 'L9'
Plugin 'loremipsum'
Plugin 'visualrepeat'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" End of Vundle settings
" General settings
set hlsearch " highlight search
set incsearch " incremental search
set ignorecase " ignorecase
set textwidth=70
set smartindent
set expandtab " use whitespaces instead of tabs
set shiftwidth=4 " indent 4 space char
set tabstop=8 " 140228: changing tabstop isn't good
set softtabstop=4 " 140228
set encoding=utf-8
set fileformat=unix
set history=200 " memory has become much cheaper
set mousehide " Hide the mouse when typing text
set sessionoptions+=resize,unix,slash
set sessionoptions-=options
augroup textCompletion
au!
au Filetype html,markdown,text inoremap <buffer> ( ()<++><Left><Left><Left><Left><Left>
au Filetype html,markdown,text inoremap <buffer> (( (
au Filetype html,markdown,text inoremap <buffer> () ()<++><Left><Left><Left><Left><Left>
au Filetype html,markdown,text inoremap <buffer> [ []<++><Left><Left><Left><Left><Left>
au Filetype html,markdown,text inoremap <buffer> [[ [
au Filetype html,markdown,text inoremap <buffer> [] []<++><Left><Left><Left><Left><Left>
au Filetype html,markdown,text inoremap <buffer> { {}<++><Left><Left><Left><Left><Left>
au Filetype html,markdown,text inoremap <buffer> {{ {
au Filetype html,markdown,text inoremap <buffer> {} {}<++><Left><Left><Left><Left><Left>
au Filetype html,markdown,text inoremap <buffer> '' ''<++><Left><Left><Left><Left><Left>
au Filetype html,markdown,text inoremap <buffer> "" ""<++><Left><Left><Left><Left><Left>
au Filetype html,markdown,text inoremap <buffer> < <<Left><Right>><++><Left><Left><Left><Left><Left>
au Filetype html,markdown,text inoremap <buffer> << <
au Filetype markdown inoremap <buffer> `` ``<++><Left><Left><Left><Left><Left>
au Filetype markdown inoremap <buffer> ** **<++><Left><Left><Left><Left><Left>
augroup END
augroup specIndent
au!
au Filetype tex,markdown,css,scss,html,javascript,vim setlocal shiftwidth=2
augroup END
nnoremap <F3> :NERDTreeToggle %:p:h<CR>
set pastetoggle=<F5> " Practical Vim Tip 63
nnoremap <F12> :TlistToggle<CR>
" Press Space to turn off highlighting and clear any message already displayed.
nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
" Practical Vim Tip 34: Avoid cursors when rcl'g cmd from hist
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
" LaTeX-Suite settings
" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
"filetype plugin on
" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
" can be called correctly.
set shellslash
" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*
" OPTIONAL: This enables automatic indentation as you type.
"filetype indent on
" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'
" 131001: change default output format
" http://superuser.com/questions/186283/compile-tex-files-to-pdf-as-default-in-gvim-with-latexsuite-plugin
let g:Tex_DefaultTargetFormat='pdf'
let g:Tex_MultipleCompileFormats='pdf'
" 131212: add dir to $PATH for runtime to avoid too long $PATH in other prog
let $PATH .= ';C:\Program Files\SumatraPDF'
let g:Tex_ViewRule_pdf='SumatraPDF'
" 131204: For better Chin and Unicode support
let g:Tex_CompileRule_pdf='xelatex -interaction=nonstopmode $*'
" LaTeX-Suite settings end
" Gist settings start
let g:github_user = 'VincentTam'
let g:gist_clip_command = 'putclip'
let g:gist_detect_filetype = 1
let g:gist_get_multiplefile = 1
" Gist settings end
" vim-easy-algin settings start
" Start interactive EasyAlign in visual mode
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign with a Vim movement
nmap ga <Plug>(EasyAlign)
" vim-easy-algin settings end
" http://superuser.com/a/634327
let &t_ti.="\e[1 q"
let &t_SI.="\e[5 q"
let &t_EI.="\e[1 q"
let &t_te.="\e[0 q"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment