Skip to content

Instantly share code, notes, and snippets.

@dcao
Last active November 3, 2015 03:03
Show Gist options
  • Save dcao/aa66f7d53ca599c4f995 to your computer and use it in GitHub Desktop.
Save dcao/aa66f7d53ca599c4f995 to your computer and use it in GitHub Desktop.
vimrc.win
" .vimrc
" See: http://vimdoc.sourceforge.net/htmldoc/options.html for details
" For multi-byte character support (CJK support, for example):
"set fileencodings=ucs-bom,utf-8,cp936,big5,euc-jp,euc-kr,gb18030,latin1
" Vim Plug
set nocompatible " Be iMproved
call plug#begin('C:\Users\David\vimfiles\plugged')
Plug 'E:\dev\vim\essay.vim'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'LaTeX-Box-Team/LaTeX-Box'
Plug 'flazz/vim-colorschemes'
Plug 'yamafaktory/lumberjack.vim'
Plug 'bling/vim-airline'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
Plug 'chriskempson/base16-vim'
Plug 'dag/vim2hs'
Plug 'scrooloose/syntastic'
Plug 'SirVer/UltiSnips'
Plug 'honza/vim-snippets'
Plug 'zenorocha/dracula-theme', {'rtp': 'vim/'}
Plug 'mattn/emmet-vim'
" Plug 'Shougo/neocomplete.vim'
" Plug 'Shougo/unite.vim'
" Plug 'Shougo/neomru.vim'
" Plug 'Valloric/YouCompleteMe'
" Plug 'coot/atp_vim'
" Plug 'vim-latex/vim-latex'
" Required:
call plug#end()
" End Plug
set background=dark
set nocompatible
set encoding=utf-8
set tabstop=2 " Number of spaces that a <Tab> in the file counts for.
set shiftwidth=2 " Number of spaces to use for each step of (auto)indent.
set expandtab " Use the appropriate number of spaces to insert a <Tab>.
" Spaces are used in indents with the '>' and '<' commands
" and when 'autoindent' is on. To insert a real tab when
" 'expandtab' is on, use CTRL-V <Tab>.
set smarttab " When on, a <Tab> in front of a line inserts blanks
" according to 'shiftwidth'. 'tabstop' is used in other
" places. A <BS> will delete a 'shiftwidth' worth of space
" at the start of the line.
set showcmd " Show (partial) command in status line.
set number " Show line numbers.
set relativenumber
set showmatch " When a bracket is inserted, briefly jump to the matching
" one. The jump is only done if the match can be seen on the
" screen. The time to show the match can be set with
" 'matchtime'.
" set hlsearch " When there is a previous search pattern, highlight all
" its matches.
set incsearch " While typing a search command, show immediately where the
" so far typed pattern matches.
set ignorecase " Ignore case in search patterns.
set smartcase " Override the 'ignorecase' option if the search pattern
" contains upper case characters.
set backspace=2 " Influences the working of <BS>, <Del>, CTRL-W
" and CTRL-U in Insert mode. This is a list of items,
" separated by commas. Each item allows a way to backspace
" over something.
set autoindent " Copy indent from current line when starting a new line
" (typing <CR> in Insert mode or when using the "o" or "O"
" command).
set textwidth=79 " Maximum width of text that is being inserted. A longer
" line will be broken after white space to get this width.
set formatoptions=c,q,r,t " This is a sequence of letters which describes how
" automatic formatting is to be done.
"
" letter meaning when present in 'formatoptions'
" ------ ---------------------------------------
" c Auto-wrap comments using textwidth, inserting
" the current comment leader automatically.
" q Allow formatting of comments with "gq".
" r Automatically insert the current comment leader
" after hitting <Enter> in Insert mode.
" t Auto-wrap text using textwidth (does not apply
" to comments)
set ruler " Show the line and column number of the cursor position,
" separated by a comma.
" set background=light" When set to "dark", Vim will try to use colors that look
" good on a dark background. When set to "light", Vim will
" try to use colors that look good on a light background.
" Any other value is illegal.
set mouse=a " Enable the use of the mouse.
set noshowmode
let mapleader = ","
" Markdown = .md, damnit
autocmd BufNewFile,BufRead *.md setlocal filetype=markdown
augroup pythonFileType
autocmd!
autocmd FileType python call BigTabs()
augroup END
" augroup haskellFileType
" autocmd FileType haskell :call HaskellInit()
" augroup END
" Set default window size
set lines=30 columns=145
set laststatus=2
" AIRLINE
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline#extensions#branch#enabled = 1
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.space = "\ua0"
let g:airline_left_sep = ''
let g:airline_right_sep = ''
let g:airline_symbols.linenr = ' l'
let g:airline_symbols.readonly = 'RO'
let g:airline_mode_map = {
\ '__' : '-',
\ 'n' : 'N',
\ 'i' : 'I',
\ 'R' : 'R',
\ 'c' : 'C',
\ 'v' : 'V',
\ 'V' : 'V',
\ '' : 'V',
\ 's' : 'S',
\ 'S' : 'S',
\ '' : 'S',
\ }
" Font
" Set this to h10.5 if using MacType DefaultPlus preset on Windows
" Set this to h10 if all else
set guifont=Meslo_LG_L_DZ:h10.5:cANSI
" Colorscheme
let base16colorspace=256
colorscheme base16-ocean
set t_Co=256
let t:goyo_disabled_airline = 0
" Remove any delay from entering normal mode
set timeoutlen=1000 ttimeoutlen=0
" Show syntax highlighting groups for word under cursor
nnoremap <leader>cp :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
" Source the vimrc file after saving it
if has("autocmd")
autocmd bufwritepost _vimrc source $MYVIMRC
endif
" Shortcut for opening vimrc
nnoremap <leader>ev :vsplit $MYVIMRC<CR>
let g:limelight_conceal_ctermfg = 243
" Minimalism is cool; Hide menu bar, toolbar, and right-hand scrollbar
set guioptions-=T
set guioptions-=L
set guioptions-=m
set guioptions-=r
" Linespace
" Set to 5 if using Inconsolata
set linespace=4
command! SynTog SyntasticToggleMode
" Unite.vim
" call unite#filters#matcher_default#use(['matcher_fuzzy'])
" call unite#custom#source('source',
" \ 'sorters', 'sorter_selecta')
"" call unite#filters#sorter_default#use(['sorter_selecta'])
" nnoremap <leader>f :<C-u>Unite -start-insert file_rec/async
" nnoremap <leader>\ :<C-u>Unite -start-insert<CR>
" nnoremap <leader>] :<C-u>UniteClose<CR>
" nnoremap <leader>[ :<C-u>UniteResume<CR>
function! s:goyo_enter()
Limelight
endfunction!
function! s:goyo_leave()
Limelight!!
endfunction
autocmd! User GoyoEnter
autocmd! User GoyoLeave
autocmd User GoyoEnter nested call <SID>goyo_enter()
autocmd User GoyoLeave nester call <SID>goyo_leave()
function! BigTabs()
setlocal tabstop=8
setlocal expandtab
setlocal softtabstop=4
setlocal shiftwidth=4
endfunction!
set foldenable
set foldcolumn=0
nnoremap <leader>fc :hi FoldColumn ctermbg=bg<CR>
" nnoremap ; :
" nnoremap : ;
nnoremap <leader>zz :let &scrolloff=999-&scrolloff<CR>
let hlstate=0
nnoremap <leader>zc :if (hlstate == 0) \| nohlsearch \| else \| set hlsearch \| endif \| let hlstate=1-hlstate<cr>
" NeoComplete
" imap <expr><TAB> neosnippet#expandable() ?
" \ "\<Plug>(neosnippet_expand_or_jump)" : pumvisible ? "\<C-n>" : "\<TAB>"
" Ultisnips
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
" Emmet
let g:user_emmet_leader_key = '<C-e>'
" CtrlP
nnoremap <silent> <leader>ff :CtrlP<CR>
nnoremap <silent> <leader>fb :CtrlPBuffer<CR>
nnoremap <silent> <leader>fg :CtrlPMixed<CR>
nnoremap <silent> <leader>fr :CtrlPMRU<CR>
let g:ctrlp_show_hidden = 1
let g:tex_flavor='latex'
nnoremap <leader>gf :<C-u>CtrlPMRU<CR>
set clipboard=unnamedplus
filetype plugin indent on
syntax on
" I hate windows
set directory=.,$TEMP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment