Skip to content

Instantly share code, notes, and snippets.

@widnyana
Created June 15, 2014 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save widnyana/6e9999486b32d1ff7395 to your computer and use it in GitHub Desktop.
Save widnyana/6e9999486b32d1ff7395 to your computer and use it in GitHub Desktop.
vimrc for windows with vundle
set nocompatible
filetype off " required by Vundle
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
" begin vundle {
let path='F:\PLAYGROUND\APPS\Vim\vimfiles\bundle'
call vundle#begin(path)
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" Vim Fugitive
Bundle 'tpope/vim-fugitive'
Bundle 'tpope/vim-sensible'
Bundle 'altercation/vim-colors-solarized'
Bundle 'nanotech/jellybeans.vim'
Bundle 'Lokaltog/vim-powerline'
" Nerdtree {
Bundle 'scrooloose/nerdtree'
" Show the Bookmarks
let g:NERDTreeShowBookmarks=1
" }
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" }
" settinf added by widnyana {
set modifiable
set cursorline
set smartindent
set ruler
set tabstop=4
set shiftwidth=4
set expandtab
set number
set encoding=utf-8
set ignorecase
set smartcase
" No backup and swap {
set nobackup
set noswapfile
"}
" better line wrapping {
set nowrap
set textwidth=80
set formatoptions=qrnl
" }
" shortcut {
noremap <tab> <c-w><c-w>
nnoremap <f2> :NERDTreeToggle<cr>
" }
" Color scheme {
syntax on
set background=dark
colorscheme solarized
" }
" Switching window {
nmap <silent> <A-Up> :wincmd k<CR>
nmap <silent> <A-Down> :wincmd j<CR>
nmap <silent> <A-Left> :wincmd h<CR>
nmap <silent> <A-Right> :wincmd l<CR>
" }
"}
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment