set nocompatible
filetype off
call plug#begin('~/.vim/bundle')
Plug 'scrooloose/syntastic'
Plug 'tpope/vim-fugitive'
Plug 'vim-scripts/closetag.vim'
Plug 'vim-scripts/visSum.vim'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'tpope/vim-surround'
Plug 'rking/ag.vim', { 'for': 'Ag' }
Plug 'junegunn/goyo.vim', { 'on': 'Goyo' }
Plug 'jamessan/vim-gnupg'
Plug 'groenewege/vim-less'
Plug 'tpope/vim-vinegar'
Plug 'wincent/command-t', { 'do': 'cd ruby/command-t; ruby extconf.rb && make' }
Plug 'a.vim'
Plug 'shime/vim-livedown', { 'on': 'LivedownPreview' }
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': 'yes \| ./install' }
Plug 'kchmck/vim-coffee-script', { 'for': 'coffee' }
Plug 'tpope/vim-markdown', { 'for': 'markdown' }
Plug 'ledger/vim-ledger', { 'for': 'ledger' }
Plug 'PotatoesMaster/i3-vim-syntax', { 'for': 'i3' }
Plug 'tkztmk/vim-vala', { 'for': 'vala' }
Plug 'othree/html5.vim', { 'for': 'html5' }
Plug 'cakebaker/scss-syntax.vim', { 'for': 'scss' }
Plug 'hail2u/vim-css3-syntax', { 'for': 'css' }
Plug 'biskark/vim-ultimate-colorscheme-utility'
Plug 'altercation/vim-colors-solarized'
Plug 'noahfrederick/vim-hemisu'
Plug 'junegunn/seoul256.vim'
Plug 'Lokaltog/vim-distinguished'
Plug 'zeis/vim-kolor'
Plug 'nanotech/jellybeans.vim'
Plug 'nice/sweater'
Plug 'tomasr/molokai'
Plug 'fmoralesc/molokayo'
call plug#end()
set modeline modelines=5
set mouse=a
set wildmenu
set wildmode=list:longest
set ignorecase
set smartcase
set hlsearch
set incsearch
set wrap
set sidescroll=1
set sidescrolloff=10
set autoread
set noexpandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set shiftround
set autoindent
set smartindent
set runtimepath^=/usr/share/vim/addons
filetype plugin indent on
set formatoptions+=r
set formatoptions+=o
set formatoptions+=n
set formatoptions+=l
set textwidth=79
if exists("&colorcolumn")
set colorcolumn=+1
endif
set splitright
set splitbelow
set equalalways
"normal! \<c-w>="
set laststatus=2
set ruler
set showcmd
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
vnoremap <C-j> :m+1<cr>gv
vnoremap <C-k> :m-2<cr>gv
nmap <Right> :bn<cr>
nmap <Left> :bp<cr>
nmap [a :N<cr>
nmap ]a :n<cr>
nnoremap <leader>b :buffers<CR>:b<space>
nmap + <c-a>
nmap - <c-x>
","
","
let g:ulti_color_always_random=2
nmap <leader>w :w!<cr>
command! W :wa
com! Wsudo :w !sudo tee % >/dev/null
nmap <leader>d :bd<cr>
nnoremap <leader>l :redraw!<cr>
nmap <leader>k :set list!<CR>
set listchars=tab:▸\ ,eol:¬
noremap <c-s> :nbs<cr>
function! LedgerPrint() range
execute a:firstline.",".a:lastline."!ledger -f - print"
endfunction
noremap <leader>g :call LedgerPrint()<cr>
set hidden
map Q gq
silent! call pathogen#infect()
function! HourColor()
let hr = str2nr(strftime('%H'))
if hr <= 5
colo molokai
elseif hr <= 9
colo calmar256-dark
elseif hr <= 14
colo moria
elseif hr <= 16
colo calmar256-light
else
colo jellybeans
endif
endfunction
syntax on
if has('gui_running')
else
endif
if !exists("g:colors_name")
call HourColor()
endif
map gf :e <cfile><CR>
set ffs=unix,mac,dos
noremap <leader>x :!chmod +x %<cr><cr>
noremap <leader>X :0norm O#!/bin/sh<cr>:w<cr>:!chmod +x %<cr>:e<cr>
noremap <leader>; :tabe ~/.vimrc<cr>
noremap <leader>. :w<cr>:so ~/.vimrc<cr>
let g:syntastic_java_javac_autoload_maven_classpath = 0
let g:syntastic_java_javac_config_file_enabled = 1
let g:syntastic_always_populate_loc_list=1
let g:syntastic_c_config_file = '.syntastic_c_config'
com! Standard let g:syntastic_javascript_checkers = ['standard']
map [l :lprev<cr>
map ]l :lnext<cr>
map [e :cprev<cr>
map ]e :cnext<cr>
map [E :cfirst<cr>
map ]E :clast<cr>
vmap <Leader>y "+y
vmap <Leader>d "+d
nmap <Leader>p "+p
nmap <Leader>P "+P
vmap <Leader>p "+p
vmap <Leader>P "+P
noremap <leader>p :wa<cr>:!mdp -f %<cr><cr>
augroup celstuff
au!
au Filetype html,xml,xsl source ~/.vim/bundle/closetag.vim/plugin/closetag.vim
au BufReadPost * :DetectIndent
au BufWritePost *.sieve silent !sievec %
au BufWritePost /etc/bind/db.* !/usr/sbin/rndc reload %:t:s?db.??
au BufNewFile,BufRead ~/.claws-mail/tmp/tmpmsg.* set ft=mail
au BufNewFile,BufRead ~/.sylpheed-2.0/tmp/tmpmsg-* set ft=mail
au BufNewFile,BufRead ~/Mail/* set ft=mail
au BufNewFile,BufRead dunstrc set ft=dosini
let b:comment_leader = '// '
au FileType haskell,vhdl,ada let b:comment_leader = '-- '
au FileType vim let b:comment_leader = '" '
au FileType c,cpp,java let b:comment_leader = '// '
au FileType sh,make,perl let b:comment_leader = '# '
au FileType tex let b:comment_leader = '% '
au BufWritePost ~/.vimrc so %
au BufWritePost ~/.files/i3/config silent !i3-msg reload >&-
augroup END
function! CommentOut() range
if getline('.') =~ '^\s*' . escape(b:comment_leader,'\/')
execute a:firstline.",".a:lastline." normal ^" . strlen(b:comment_leader) . "x"
else
execute a:firstline.",".a:lastline." normal I" . b:comment_leader
endif
endfunction
vnoremap # :call CommentOut()<cr>
set wildmenu
set wildmode=longest,list
set wildignore+=*.a,*.o,*.bmp,*.gif,*.ico,*.jpg,*.png,*~,*.swp,*.tmp,*.class
set laststatus=2
set statusline=%f%m%r\ %l:%c
set linebreak
nmap <leader>n :setlocal number!<cr>
nmap <leader>o :set paste!<cr>
set pastetoggle=<C-g>
nmap <leader>q :set hlsearch!<cr>:set incsearch!<cr>
nmap <leader>h :noh<return><esc>
nmap <leader>a :Ag <cword><cr>
:inoremap <S-CR> <Esc>
nnoremap <Leader>z :LiteDFMToggle<CR>i<Esc>`^
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_match_window_bottom = 0
let g:ctrlp_match_window_reversed = 0
let g:ctrlp_custom_ignore = '\v\~$|\.(o|swp|pyc|wav|mp3|ogg|blend)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])|__init__\.py'
let g:ctrlp_working_path_mode = 0
let g:ctrlp_dotfiles = 0
let g:ctrlp_switch_buffer = 0
:nmap <leader>e :NERDTreeToggle<CR>
if $TERM == "xterm-256color" || $TERM == "screen-256color" || $COLORTERM == "gnome-terminal"
set t_Co=256
endif
nmap <leader>m8 :set noexpandtab tabstop=8 shiftwidth=8 softtabstop=4<cr>
nmap <leader>M8 :set expandtab tabstop=8 shiftwidth=8 softtabstop=4<cr>
nmap <leader>mn :set noexpandtab tabstop=8 softtabstop=4 shiftwidth=4<cr>
nmap <leader>M4 :set expandtab tabstop=4 shiftwidth=4 softtabstop=4<cr>
nmap <leader>m4 :set noexpandtab tabstop=4 shiftwidth=4 softtabstop=4<cr>
nmap <leader>M2 :set expandtab tabstop=2 shiftwidth=2 softtabstop=2<cr>
nmap <leader>m2 :set noexpandtab tabstop=2 shiftwidth=2 softtabstop=2<cr>
nmap <leader>r :setlocal wrap!<cr>:setlocal wrap?<cr>
if v:version
set nofoldenable
set foldmethod=indent
endif
nmap <leader>c :CoffeeCompile<cr>
nmap <leader>j :wa<cr>:exe "!" . &makeprg<cr>
nmap <leader>J :wa<cr>:!make<cr><cr>
nmap <leader>J :!make 2>&1 >/dev/null &<cr><cr>
nmap <leader>ec :e %:r.c<cr>
nmap <leader>eh :e %:r.h<cr>
nmap <leader>eC :view %:r.c<cr>
nmap <leader>eH :view %:r.h<cr>
com! MM :au BufWritePost <buffer> silent make |cwindow|redraw!
com! Mpdftex :au BufWritePost <buffer> exe ":!pdftex %:r" |redraw!
com! Mpdflatex :au BufWritePost <buffer> exe ":!pdflatex %:r" |redraw!
function! CloseHiddenBuffers()
let visible = {}
for t in range(1, tabpagenr('$'))
for b in tabpagebuflist(t)
let visible[b] = 1
endfor
endfor
for b in range(1, bufnr('$'))
if bufexists(b) && !has_key(visible, b)
execute 'bwipeout' b
endif
endfor
endfun
command! Bdi :call CloseHiddenBuffers()
com! -range=% HtmlPaste <line1>,<line2>call HtmlPaste()
noremap <silent> gH :HtmlPaste<cr>
fun! HtmlPaste() range
let localPaste = "~/www/paste"
let remotePublic = "cel:www/paste"
let remotePasteUrl = "https://celehner.com/paste/"
let hasRN = &relativenumber
let hasNumber = &number
let oldBackground = &background
let oldColorScheme = g:colors_name
set norelativenumber
set nonumber
colors github
set bg=light
exe a:firstline.",".a:lastline."TOhtml"
let pasteName = system("cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 4 | head -n 1 | perl -ne 'chomp and print'")
exe "silent !mkdir -p " . localPaste
exe "w! " . localPaste . "/" . pasteName
exe "bwipeout!"
"silent !rsync -a --exclude=.*.swp ""/ "
exe "silent !rsync -a " . localPaste . "/" . pasteName . " " . remotePublic . "/" . pasteName . ".html"
exe "silent !echo -n '" . remotePasteUrl . pasteName . ".html' | xsel"
if hasRN
set relativenumber
endif
if hasNumber
set number
endif
exe "set bg=" . oldBackground
exe "colors " . oldColorScheme
endfun
let g:ledger_detailed_first = 1
set thesaurus +=~/Downloads/mobythes.aur
set dictionary+=/usr/share/dict/words
let g:GPGDefaultRecipients=['3413F006']
let g:GPGUsePipes=1
function! Rename(new_name)
if expand("%") != ""
write
silent execute "Git mv % " . a:new_name
silent execute "!mv -f % " . a:new_name
execute "file " . a:new_name
write!
redraw!
endif
endfunction
command! -nargs=1 Rename :call Rename(<f-args>)
nnoremap <Leader><Space> :Goyo<CR>
set printheader=\
set printexpr=PrintFile(v:fname_in,v:cmdarg)
function! PrintFile(fname_in, cmdarg)
if a:cmdarg == ""
call system('ps2pdf ' . a:fname_in . ' ' . a:fname_in . '.pdf && ' .
\'( evince ' . a:fname_in . '.pdf && rm ' . a:fname_in . '.pdf ) &')
else
call system('ps2pdf ' . a:fname_in . ' ' . a:cmdarg)
endif
return v:shell_error
endfunc
nmap <leader>so Vip:sort<cr>
nmap <leader><leader>c :colo<cr>
set wildignore=*.a,*.o,*.bmp,*.gif,*.ico,*.jpg,*.png,*~,*.swp,*.tmp,*.class,*.d
set mouse=a
silent! dig -. 8230
"r! /tmp/foo; true"