From f6c1a78f35eedc6333195f57f5a0a983cf370164 Mon Sep 17 00:00:00 2001 From: ZeLibertineGamer Date: Fri, 10 Jun 2016 15:52:29 -0700 Subject: Initial commit --- .gitignore | 9 ++ .gitmodules | 0 colors/zlg.vim | 79 ++++++++++++++++++ gvimrc | 7 ++ update-plugins | 28 +++++++ vimrc | 260 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ vopher.list | 8 ++ 7 files changed, 391 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 colors/zlg.vim create mode 100644 gvimrc create mode 100755 update-plugins create mode 100644 vimrc create mode 100644 vopher.list diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5eb075c --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +autoload +after +bundle +spell +tags +.netrwhist +*.swp +*.bak +vopher.log diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e69de29 diff --git a/colors/zlg.vim b/colors/zlg.vim new file mode 100644 index 0000000..49fc086 --- /dev/null +++ b/colors/zlg.vim @@ -0,0 +1,79 @@ +" Color scheme "zlg" +" by zlg + +set background=dark +hi clear +if exists("syntax on") + syntax reset +endif +let g:colors_name = "zlg" + +hi ModeMsg ctermfg=green ctermbg=NONE gui=bold guifg=#00cc00 guibg=NONE + +" I can't stand it when the cursor is lost on matching braces. +hi MatchParen cterm=NONE ctermfg=yellow ctermbg=magenta gui=NONE guifg=#ffffff guibg=#0044aa + +" The current file should be obvious; the others can be faded. +hi StatusLineNC cterm=inverse ctermbg=NONE ctermfg=darkblue gui=NONE guifg=#000000 guibg=#1f4e6e +hi StatusLine cterm=inverse ctermbg=NONE ctermfg=white gui=bold guifg=#000000 guibg=#ffffff + +" Tabs should be styled, too! +hi TabLine cterm=NONE ctermbg=blue ctermfg=cyan +hi TabLineSel cterm=bold,inverse ctermbg=blue ctermfg=white +hi TabLineFill cterm=NONE ctermbg=darkblue ctermfg=NONE + +" Line numbers should be just-visible, not bright. +hi LineNr ctermfg=magenta cterm=NONE ctermbg=darkgray gui=NONE guifg=#a99c7f guibg=#292012 +hi Visual ctermfg=NONE cterm=inverse ctermbg=black gui=inverse guifg=NONE guibg=#000000 +hi VisualNOS ctermfg=NONE cterm=inverse ctermbg=black gui=inverse guifg=NONE guibg=#000000 + +" My splits should not be bright +hi VertSplit cterm=NONE ctermfg=blue ctermbg=NONE gui=bold guifg=#000000 guibg=#1f4e6e + +" Folds are kind of a big deal +hi Folded cterm=NONE ctermfg=blue ctermbg=black gui=NONE guifg=NONE guibg=NONE + +" Proceed with the generic highlight types +hi Constant cterm=NONE ctermfg=magenta ctermbg=NONE gui=NONE guifg=#d667c7 guibg=NONE +hi Comment cterm=NONE ctermfg=darkgreen ctermbg=NONE gui=NONE guifg=#009922 guibg=NONE +hi Delimiter cterm=NONE ctermfg=red ctermbg=NONE gui=NONE guifg=#bb0000 guibg=NONE +hi DiffDelete cterm=NONE ctermfg=gray ctermbg=red gui=bold guifg=#000000 guibg=#880000 +hi Define cterm=NONE ctermfg=darkmagenta ctermbg=NONE gui=NONE guifg=#9d5db0 guibg=NONE +hi Error cterm=NONE ctermfg=white ctermbg=red gui=bold guifg=#ffffff guibg=#ff0000 +hi Function cterm=NONE ctermfg=yellow ctermbg=NONE gui=bold guifg=#ffff00 guibg=NONE +hi Include cterm=NONE ctermfg=darkyellow ctermbg=NONE gui=NONE guifg=#d7c667 guibg=NONE +hi Macro cterm=NONE ctermfg=darkmagenta ctermbg=NONE gui=NONE guifg=#8a67ac guibg=NONE +hi NonText cterm=NONE ctermfg=darkgray ctermbg=NONE gui=NONE guifg=#333333 guibg=NONE +hi Normal cterm=NONE ctermfg=NONE ctermbg=NONE gui=NONE guifg=#ffffff guibg=#071013 +hi PreProc cterm=NONE ctermfg=magenta ctermbg=NONE gui=bold guifg=#a249a2 guibg=NONE +hi Search cterm=inverse ctermfg=yellow ctermbg=NONE gui=NONE guifg=#000000 guibg=#ffff00 +hi SpecialKey cterm=NONE ctermfg=darkgray ctermbg=NONE gui=NONE guifg=#333333 guibg=NONE +hi SpecialChar cterm=NONE ctermfg=red ctermbg=NONE gui=bold guifg=#dd5500 guibg=NONE +hi Statement cterm=NONE ctermfg=white ctermbg=NONE gui=NONE guifg=#999999 guibg=NONE +hi String cterm=NONE ctermfg=darkcyan ctermbg=NONE gui=NONE guifg=#568cd1 guibg=NONE +hi Todo cterm=NONE ctermfg=yellow ctermbg=darkgreen gui=NONE guifg=#ffff00 guibg=#008800 +hi Type cterm=NONE ctermfg=green ctermbg=NONE gui=bold guifg=#5f7dc3 guibg=NONE +hi Number cterm=NONE ctermfg=white ctermbg=NONE gui=bold guifg=#ffffff guibg=NONE +hi Operator cterm=NONE ctermfg=darkyellow ctermbg=NONE gui=NONE guifg=#a99c7f guibg=NONE +hi Identifier cterm=NONE ctermfg=cyan ctermbg=NONE gui=NONE guifg=#00ccff guibg=NONE + +" Linked highlights +hi link Structure Define +hi link Conditional Function +hi link Repeat Function +hi link Float Number + +" PHP Styles {{{ +hi link phpIdentifier Identifier +hi link phpVarSelector Identifier +hi link phpStringDouble String +hi link phpStringSingle String +hi link phpComparison Operator +hi link phpParent Normal +" }}} + +" Markdown Styles {{{ +hi Title cterm=bold ctermfg=white ctermbg=NONE gui=bold guifg=#ffffff guibg=NONE +" }}} + +" vim: fdm=marker diff --git a/gvimrc b/gvimrc new file mode 100644 index 0000000..8c50d9c --- /dev/null +++ b/gvimrc @@ -0,0 +1,7 @@ +" Options for the GUI + +set gfn=Envy\ Code\ R\ 12 +set columns=100 +set lines=30 +set window=48 +set guioptions=aLM diff --git a/update-plugins b/update-plugins new file mode 100755 index 0000000..856f85a --- /dev/null +++ b/update-plugins @@ -0,0 +1,28 @@ +#!/bin/sh +# This is a simple front-end to vopher that will update all your plugins, +# clean up plugins that aren't in PLUGIN_LIST, and prune all .zip files. +# What more could you ask for from a wrapper? + +die() { + echo "$1" && exit +} + +PLUGIN_PATH="$HOME/projects/vimrc/bundle" +PLUGIN_LIST="$HOME/projects/vimrc/vopher.list" +_has_sparkup=$(grep -c sparkup ${PLUGIN_LIST}) +_tmp=$(pwd) +if [ "$_has_sparkup" -a -d ./bundle/sparkup ]; then + cd bundle/sparkup + unlink doc + unlink ftplugin + cd "$_tmp" +fi +_cmd="vopher -f "$PLUGIN_LIST" -dir "$PLUGIN_PATH" -ui=simple" +$_cmd -force update 2>vopher.log 1>/dev/null || die "Could not update! Consult vopher.log for details." +$_cmd -force -all prune 2>>vopher.log 1>/dev/null || die "Could not prune! Consult vopher.log for details." +if [ $_has_sparkup ]; then + cd "${PLUGIN_PATH}/sparkup" + make vim-pathogen --quiet + cd "$_tmp" +fi +echo "Plugins successfully updated." diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..cff34ab --- /dev/null +++ b/vimrc @@ -0,0 +1,260 @@ +" General {{{1 +set nocompatible +let g:use_dvorak = 1 +let g:leave_my_cursor_position_alone = '' +let PHP_vintage_case_default_indent = 1 +let c_no_comment_fold = 1 +set fileformats=unix,dos,mac +set spelllang=en_us +set switchbuf=useopen + +" Colors and Syntax {{{1 +set background=dark +colorscheme zlg +if has('syntax') && !exists('g:syntax_on') + syntax enable +endif + +" Plugin-Specific {{{1 +call pathogen#infect('bundle/{}') +Helptags + +" Formatting {{{1 +set formatprg=par-format\ w80 +set printoptions=paper:letter,top:0.5in,left:0.5in,right:0.5in,bottom:0.5in,syntax:n,header:0 +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set noexpandtab +set formatoptions=tcqn + +" Usability {{{1 +set whichwrap=<,>,[,],h,l +set scrolloff=2 +set backspace=indent,eol,start +set ttimeout +set ttimeoutlen=50 +set timeoutlen=3000 +set incsearch +set number +set numberwidth=5 +set hidden +set mouse=n + +" Interface {{{1 +set display+=lastline +set list +"set listchars=tab:⇥\ ,trail:␣,extends:⇉,precedes:⇇,nbsp:⚭,eol:¬ +if &listchars ==# 'eol:$' + set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+ + if &termencoding ==# 'utf-8' || &encoding ==# 'utf-8' + let &listchars = "tab:\u21e5 ,trail:\u2423,extends:\u21c9,precedes:\u21c7,nbsp:\u26ad,eol:\u00ac" + endif +endif +set splitright +set splitbelow +set laststatus=2 +" Example: (1) .vimrc [vim][+] 48,22 123L 0x20 +set statusline=(%n)\ %f\ %y%r%m\ %l,%v\ %LL\ 0x%B +set fillchars=fold:\ ,vert:\| +set wrap +set linebreak + +" Anti-Annoyance {{{1 +set nostartofline +set novisualbell +set noautoindent + +" Folding {{{1 +set foldmethod=expr +set foldtext=MyFoldText() + +function! MyFoldText() + let line = getline(v:foldstart) + let folded_lines = v:foldend - v:foldstart + return line . ' (' . folded_lines . 'L)' +endfunction + +" Autocommands {{{1 +if has("autocmd") + filetype plugin indent on + autocmd BufNewFile,BufRead /media/sd/Games/*.[0123456789].txt setfiletype sctxt + autocmd BufNewFile,BufRead *.txt setfiletype text + " All Markdown and TXT files need to be hard wrapped to 80 characters. + autocmd FileType text,markdown setlocal nonumber tabstop=4 softtabstop=4 shiftwidth=4 expandtab formatoptions=tcqwn textwidth=80 nolist colorcolumn=81 + autocmd FileType python setlocal expandtab + autocmd BufNewFile,BufRead *.ledger setlocal nonumber iskeyword+=: filetype=ledger + autocmd FileType help setlocal colorcolumn=0 + autocmd FileType vim setlocal keywordprg=:help + autocmd FileType c setlocal foldmethod=syntax + " Needed for game guides on the SuperCard DSTWO; this is also true of + " homebrew apps that use monospace fonts at normal scale. The DSTWO throws + " up on linebreaks if it's not DOS, iso8859-1 text. The limit is set to + " allow for a character or two that might be wider than an M or W. + autocmd FileType sctxt setlocal enc=latin1 ff=dos tw=30 cc=31 fo=tcqwn nolist et ts=4 sts=4 sw=4 +endif + +" Key Bindings {{{1 +nnoremap i :call SynStack() +nnoremap l :set list! +nnoremap n :set number! +nnoremap t :setfiletype text +nnoremap s :set spell! +nnoremap c :call CountCodeLines() +nnoremap d :call InsertDOW() +nnoremap D "=strftime("%Y-%m-%d %H:%M", localtime())p +nnoremap za +nnoremap :call StripTrailingWhitespaces() + +" Thanks to /u/spupy for these short and sweet mappings that replace the +" simpler functions of tpope's surround.vim plugin. Each of these will +" surround the current (or last) visual selection with the specified +" character. +noremap w" `>a"` +noremap w' `>a'` +noremap w( `>a)` +noremap w[ `>a]` +noremap w{ `>a}` +noremap w< `>a>` +noremap w` `>a`` + + +" Dvorak Hackery {{{1 +if (exists("g:use_dvorak") && g:use_dvorak == 1) + " I use a Dvorak keyboard, so standard vim movement keys are a hassle. + " Since mnemonics are helpful all around, I need a mapping that gives me + " pain-free file navigation without screwing up mnemonics (too much). + " + " Thus: + " (D)elete is now (K)ill: d2w == k2w "kill 2 words" + " Un(T)il is now (J)ump-To: dt( == kj( "kill, jump-to paren" + " (N)ext is now (L)eap: cn == cl "change up to leap point" + + " Standard movement, which is the true focus of this hack. + " Mnemonics are awesome, so let's preserve as much as possible. + noremap d h + noremap h j + noremap t k + noremap n l + noremap D H + noremap H J + noremap T K + noremap N L + + noremap gh gj + noremap gt gk + + " I work with tabs every now and then. No, I don't have a mnemonic, so + " stfu. + noremap gj gt + noremap gJ gT + + " Window movement, equally important + noremap d h + noremap h j + noremap t k + noremap n l + + nnoremap + nnoremap + nnoremap + nnoremap + + nnoremap h + nnoremap j + nnoremap k + nnoremap l + + " Account for tag jumping + nnoremap + + " Remappings for the D key + noremap k d + noremap K D + + " Remappings for the T key + noremap j t + noremap J T + + " Remapping for the L key + noremap l n + noremap L N + + " General purpose help; the originals remain for convenience + noremap - 0 + noremap _ $ + + " Fold-related keybindings + noremap zh zj + noremap zt zk + +endif + +" Functions {{{1 +" Credit to Drew Neil of vimcasts.org +function! StripTrailingWhitespaces() " {{{2 + " Save last search and cursor position + let _s=@/ + let l = line(".") + let c = col(".") + " Do the business: + %s/\s\+$//e + " Restore previous search history and cursor position + let @/=_s + call cursor(l, c) +endfunction + +" Credit to Drew Neil of vimcasts.org +function! SynStack() " {{{2 + if !exists("*synstack") + return + endif + echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') +endfunction + +function! CountCodeLines() " {{{2 + let code_count = 0 + for line in getbufline("%", 1, "$") + if (len(line) > 0 && match(line, '\S\+') > -1) + if (s:IsCommentLine(line) == 1) + continue + endif + let code_count += 1 + endif + endfor + echo code_count . ' lines of code.' +endfunction + +function! s:IsCommentLine(line) " {{{2 + let l:comtypes = [] + let l:comlist = split(&comments, ',') + for i in comlist + let l:type = split(i, ':') + if len(type) > 1 + let l:opt = type[1] + else + let l:opt = type[0] + endif + call add(comtypes, opt) + endfor + let i = 0 + while i < len(comtypes) + if match(a:line, '^\s*' . escape(comtypes[i], '/*')) > -1 + return 1 + endif + let i += 1 + endwhile + return 0 +endfunction + +function! InsertDOW() " {{{2 + " Let's backup a random register + let tmpx = @x + let @x = system("date +\"%a \" -d" . strftime("%Y") . "-" . substitute(expand(""), ":", "", "")) + normal "xP + " Join, since it apparently is on a line instead of just a string + j 1 + " Return the value in the x register + let @x = tmpx +endfunction +" vim: foldmethod=marker diff --git a/vopher.list b/vopher.list new file mode 100644 index 0000000..2085a79 --- /dev/null +++ b/vopher.list @@ -0,0 +1,8 @@ +commentary http://github.com/tpope/vim-commentary +fugitive http://github.com/tpope/vim-fugitive +gnupg http://github.com/jamessan/vim-gnupg +goyo http://github.com/junegunn/goyo.vim +ledger http://github.com/ledger/vim-ledger +pathogen http://github.com/tpope/vim-pathogen +sparkup http://github.com/rstacruz/sparkup +tabular http://github.com/godlygeek/tabular -- cgit v1.2.3-54-g00ecf