Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "Vundle Plugins
- set nocompatible
- filetype off
- set rtp+=~/.vim/bundle/Vundle.vim
- call vundle#begin()
- source $VIMRUNTIME/vimrc_example.vim
- source $VIMRUNTIME/mswin.vim
- behave mswin
- " Vundle plugins
- "Plugin 'ranger/ranger'
- Plugin 'ctrlpvim/ctrlp.vim'
- Plugin 'scrooloose/syntastic'
- Plugin 'vim-scripts/Conque-Shell'
- "Plugin 'vim-airline/vim-airline'
- "Plugin 'vim-airline/vim-airline-themes'
- Plugin 'tpope/vim-fugitive'
- Plugin 'Valloric/YouCompleteMe.git'
- Plugin 'tpope/vim-markdown'
- Plugin 'tpope/vim-projectionist'
- Plugin 'tpope/vim-ragtag'
- Plugin 'tpope/vim-repeat'
- Plugin 'tpope/vim-surround'
- Plugin 'Shouguo/Unite.vim'
- Plugin 'Shougo/vimfiler.vim'
- Plugin 'scrooloose/nerdcommenter'
- Plugin 'mtth/scratch.vim'
- Plugin 'JamshedVesuna/vim-markdown-preview'
- Plugin 'davidhalter/jedi-vim'
- call vundle#end() " required
- filetype plugin indent on
- filetype on
- let g:ackprg = 'ag --vimgrep'
- "Default customizations
- " GUI
- set noruler
- set laststatus=2
- set nu
- colorscheme molokai
- set guifont=Consolas:h9:cANSI
- set guioptions-=T "toolbar
- set guioptions-=r "scrollbr
- set listchars=tab:*>,eol:$,precedes:^ "custom whitespace display
- set fillchars=stlnc:_,stl:\|
- " Editor
- " Editor
- " Folding settings
- set foldenable
- set foldmethod=indent
- set foldlevelstart=2
- " http://stevelosh.com/blog/2010/09/coming-home-to-vim/#why-i-came-back-to-vim
- set encoding=utf-8
- set scrolloff=3
- set autoindent
- set showmode
- set showcmd
- set hidden
- set wildmenu
- set wildmode=list:longest
- set cursorline
- set ttyfast
- set ruler
- set backspace=indent,eol,start
- set laststatus=2
- set relativenumber
- set undofile
- " Tabs
- set tabstop=4
- set shiftwidth=4
- set softtabstop=4
- set expandtab
- " line wrapping
- set nowrap
- set textwidth=0
- set wrapmargin=0
- " Search settings
- set ignorecase
- set smartcase
- set gdefault
- set incsearch
- set showmatch
- set hlsearch
- " File backup
- " backup file location remapping
- if !isdirectory("$TEMP")
- call mkdir("$TEMP")
- endif
- set backup
- set backupdir=$TEMP
- set backupskip=g$TEMP
- set directory=$TEMP
- set writebackup
- set undodir=$TEMP
- " Custom functions
- " Used for file size
- "set statusline=......%{FileSize()}.....
- let g:word_count=""
- function! WordCount()
- return g:word_count
- endfunction
- function! UpdateWordCount()
- let lnum = 1
- let n = 0
- while lnum <= line('$')
- let n = n + len(split(getline(lnum)))
- let lnum = lnum + 1
- endwhile
- let g:word_count = n
- endfunction
- " Update the count when cursor is idle in command or insert mode.
- " Update when idle for 1000 msec (default is 4000 msec).
- set updatetime=1000
- augroup WordCounter
- au! CursorHold,CursorHoldI * call UpdateWordCount()
- augroup END
- function! LineWordCount()
- return len(split(getline(".")))
- endfunction
- function! RemainLineWordCount()
- return len(split(strprt(getline("."),col(".")-1)))
- endfunction
- function! FileSize()
- let bytes = getfsize(expand("%:p"))
- if bytes <= 0
- return ""
- endif
- if bytes > 1048576
- let x = bytes / 1048576.0
- return printf("%.4s",x) . " MB"
- endif
- if bytes > 1024
- let x = bytes / 1024.0
- return printf("%.3s",x) . " KB"
- endif
- return bytes
- endfunction
- "Region for out-of-the-box customizatins
- " Dim inactive windows using 'colorcolumn' setting
- " This tends to slow down redrawing, but is very useful.
- " Based on https://groups.google.com/d/msg/vim_use/IJU-Vk-QLJE/xz4hjPjCRBUJ
- " XXX: this will only work with lines containing text (i.e. not '~')
- " from
- if exists('+colorcolumn')
- function! s:DimInactiveWindows()
- for i in range(1, tabpagewinnr(tabpagenr(), '$'))
- let l:range = ""
- if i != winnr()
- if &wrap
- " HACK: when wrapping lines is enabled, we use the maximum number
- " of columns getting highlighted. This might get calculated by
- " looking for the longest visible line and using a multiple of
- " winwidth().
- let l:width=256 " max
- else
- let l:width=winwidth(i)
- endif
- let l:range = join(range(1, l:width), ',')
- endif
- call setwinvar(i, '&colorcolumn', l:range)
- endfor
- endfunction
- augroup DimInactiveWindows
- au!
- au WinEnter * call s:DimInactiveWindows()
- au WinEnter * set cursorline
- au WinLeave * set nocursorline
- augroup END
- endif
- augroup BgHighlight
- autocmd WinLeave * set number
- autocmd WinEnter * set number
- augroup END
- " Auto functions
- " automatically reloads any saved .vimrc changes
- augroup myvimrc
- au!
- au BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc so $MYVIMRC
- augroup END
- function! NumberToggle()
- if(&relativenumber == 1)
- set rnu!
- else
- set rnu
- endif
- endfunc
- function! Wnht()
- return winheight(winnr())
- endfunction
- function! Wnwt()
- return winwidth(winnr())
- endfunction
- function! Menu()
- if (match(&guioptions,'m') != 0 )
- set guioptions+=m
- else
- set guioptions-=m
- endif
- endfunction
- function! NrBufs()
- let i = bufnr('$')
- let j = 0
- while i >= 1
- if buflisted(i)
- let j+=1
- endif
- let i-=1
- endwhile
- return j
- endfunction
- " http://stevelosh.com/blog/2010/09/coming-home-to-vim/#why-i-came-back-to-vim
- nnoremap H : set cursorcolumn!<CR>
- nnoremap <C-n> :call NumberToggle()<CR>
- nnoremap / /\v
- vnoremap / /\v
- nnoremap <leader><space> :noh<cr>
- nnoremap <tab> %
- vnoremap <tab> %
- nnoremap <up> <nop>
- nnoremap <down> <nop>
- nnoremap <left> <nop>
- nnoremap <right> <nop>
- inoremap <up> <nop>
- inoremap <down> <nop>
- inoremap <left> <nop>
- inoremap <right> <nop>
- nnoremap j gj
- nnoremap k gk
- inoremap <F1> <ESC>
- nnoremap <F1> <ESC>
- vnoremap <F1> <ESC>
- nnoremap ; :
- nnoremap <leader>a :Ack
- nnoremap <Leader>M : call Menu()<CR>
- " StatusLine
- hi User1 guibg=#2F4F4F guifg=green
- hi User2 guibg=#708090 guifg=yellow
- hi User3 guibg=white guifg=teal
- hi User4 guibg=white guifg=red
- hi User5 guibg=black guifg=red
- hi User6 guibg=#2F4F4F guifg=yellow
- hi User7 guibg=#708090 guifg=red
- hi User8 guibg=#708090 guifg=blue
- hi User9 guibg=#708090 guifg=orange
- set statusline=""
- set statusline+=%5*%{winnr()}\ \%m%2*
- set statusline+=[%{toupper(&fileformat)}\| " file format
- set statusline+=\.%{strlen(&ft)?toupper(&ft):'none'}\| " filetype
- set statusline+=%{strlen(&fenc)?toupper(&fenc):toupper(&enc)}\]%1*\ " encoding
- set statusline+=\C\:\(%c\|%{strwidth(getline('.'))})\
- set statusline+=\R\:\(%l\|%L\)\
- set statusline+=\WC\:\(%{LineWordCount()}\|%{WordCount()})
- set statusline+=\ \ B:\(%n\,\?\)\ \
- set statusline+=\(H\|W\)\ %{Wnht()}\ \%{Wnwt()}\ \ \ \ \ \ \ \ \ \ \ \%9*
- set statusline+=%{synIDattr(synID(line('.'),col('.'),1),'name')}\%1* " highlight
- set statusline+=%= "left/right separator
- set statusline+=%1*
- set statusline+=\\\\%{hostname()}\ \|\
- set statusline+=%F\ \|\ "Full file path
- set statusline+=%{strftime('%m-%d-%y',getftime(expand('%')))}
- set statusline+=%6*\T%{strftime('%H:%M:%S',getftime(expand('%')))}%8*
- set statusline+=\ \ %{FileSize()}\ \
- set statusline+=\ %P "percent through fil
- set title titlestring=""
- set title titlestring+=\Window\ %{winnr()}\ \|
- set title titlestring+=\|\ Buffer\ \(%n\|%{NrBufs()}\)\]\
- set title titlestring+=\(H\|W\)\ \(%{Wnht()}\ \%{Wnwt()}\)\
- set title titlestring+=\(r\|R\:\ %l\|%L}\)\
- set title titlestring=\_\_%{getpid()}\_\_
- set title titlestring+=\\\\%{hostname()}\ \|\
- set title titlestring+=\ \(%{strpart(expand(\"%:p:h\"),stridx(expand(\"%:p:h\"),\"/\",strlen(expand(\"%:p:h\"))-12))}\)
- set title titlestring+=%{expand(\"%:t:r\")}\
- set title titlestring+=%{strftime('%m-%d-%y',getftime(expand('%')))}
- set title titlestring+=\T%{strftime('%H:%M:%S',getftime(expand('%')))}%8*
- set title titlestring+=\ %m\
- set title titlestring+=%Y\
- let $LINUX_BASH = 'C:\Windows\SysWOW64\bash.exe'
- cmap ~e : e $MYVIMRC
- cmap ~E : e! $MYVIMRC
- cmap Q : q!
- cmap ~p2: !C:\Python27\python.exe %
- cmap ~p3 : !python %
- cmap ~cq : ConqueTerm
- cmap ~b :+ConqueTerm\ bash
- cmap ~c +ConqueTerm\ cmd
- cmap ~g +ConqueTerm\ git-bash.exe
- cmap ~l +ConqueTerm\ bash
- "set title titlestring+=\(%{strftime('%c',getftime(expand('%')))}\)\
- "set title titlestring+=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)\ -\ %{v:servername}%{strftime('%c',getftime(expand('%')))}
- cmap ~e : e $MYVIMRC
- cmap ~E : e! $MYVIMRC
- cmap Q : q!
- cmap ~p2: !C:\Python27\python.exe %
- cmap ~p3 : !python %
- cmap ~cq : ConqueTerm
- cmap ~b :+ConqueTerm\ bash
- cmap ~c +ConqueTerm\ cmd
- cmap ~g +ConqueTerm\ git-bash.exe
- cmap ~l +ConqueTerm\ $LINUX_BASH
- nmap <Leader>s :Scratch<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement