Initial Commit
This commit is contained in:
commit
39327ef9ac
2
home/.vim/.netrwhist
Normal file
2
home/.vim/.netrwhist
Normal file
@ -0,0 +1,2 @@
|
||||
let g:netrw_dirhistmax =10
|
||||
let g:netrw_dirhist_cnt =0
|
1006
home/.vim/autoload/gist.vim
Normal file
1006
home/.vim/autoload/gist.vim
Normal file
File diff suppressed because it is too large
Load Diff
250
home/.vim/autoload/pathogen.vim
Normal file
250
home/.vim/autoload/pathogen.vim
Normal file
@ -0,0 +1,250 @@
|
||||
" pathogen.vim - path option manipulation
|
||||
" Maintainer: Tim Pope <http://tpo.pe/>
|
||||
" Version: 2.0
|
||||
|
||||
" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
|
||||
"
|
||||
" For management of individually installed plugins in ~/.vim/bundle (or
|
||||
" ~\vimfiles\bundle), adding `call pathogen#infect()` to your .vimrc
|
||||
" prior to `filetype plugin indent on` is the only other setup necessary.
|
||||
"
|
||||
" The API is documented inline below. For maximum ease of reading,
|
||||
" :set foldmethod=marker
|
||||
|
||||
if exists("g:loaded_pathogen") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_pathogen = 1
|
||||
|
||||
" Point of entry for basic default usage. Give a directory name to invoke
|
||||
" pathogen#runtime_append_all_bundles() (defaults to "bundle"), or a full path
|
||||
" to invoke pathogen#runtime_prepend_subdirectories(). Afterwards,
|
||||
" pathogen#cycle_filetype() is invoked.
|
||||
function! pathogen#infect(...) abort " {{{1
|
||||
let source_path = a:0 ? a:1 : 'bundle'
|
||||
if source_path =~# '[\\/]'
|
||||
call pathogen#runtime_prepend_subdirectories(source_path)
|
||||
else
|
||||
call pathogen#runtime_append_all_bundles(source_path)
|
||||
endif
|
||||
call pathogen#cycle_filetype()
|
||||
endfunction " }}}1
|
||||
|
||||
" Split a path into a list.
|
||||
function! pathogen#split(path) abort " {{{1
|
||||
if type(a:path) == type([]) | return a:path | endif
|
||||
let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
|
||||
return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
|
||||
endfunction " }}}1
|
||||
|
||||
" Convert a list to a path.
|
||||
function! pathogen#join(...) abort " {{{1
|
||||
if type(a:1) == type(1) && a:1
|
||||
let i = 1
|
||||
let space = ' '
|
||||
else
|
||||
let i = 0
|
||||
let space = ''
|
||||
endif
|
||||
let path = ""
|
||||
while i < a:0
|
||||
if type(a:000[i]) == type([])
|
||||
let list = a:000[i]
|
||||
let j = 0
|
||||
while j < len(list)
|
||||
let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
|
||||
let path .= ',' . escaped
|
||||
let j += 1
|
||||
endwhile
|
||||
else
|
||||
let path .= "," . a:000[i]
|
||||
endif
|
||||
let i += 1
|
||||
endwhile
|
||||
return substitute(path,'^,','','')
|
||||
endfunction " }}}1
|
||||
|
||||
" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
|
||||
function! pathogen#legacyjoin(...) abort " {{{1
|
||||
return call('pathogen#join',[1] + a:000)
|
||||
endfunction " }}}1
|
||||
|
||||
" Remove duplicates from a list.
|
||||
function! pathogen#uniq(list) abort " {{{1
|
||||
let i = 0
|
||||
let seen = {}
|
||||
while i < len(a:list)
|
||||
if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
|
||||
call remove(a:list,i)
|
||||
elseif a:list[i] ==# ''
|
||||
let i += 1
|
||||
let empty = 1
|
||||
else
|
||||
let seen[a:list[i]] = 1
|
||||
let i += 1
|
||||
endif
|
||||
endwhile
|
||||
return a:list
|
||||
endfunction " }}}1
|
||||
|
||||
" \ on Windows unless shellslash is set, / everywhere else.
|
||||
function! pathogen#separator() abort " {{{1
|
||||
return !exists("+shellslash") || &shellslash ? '/' : '\'
|
||||
endfunction " }}}1
|
||||
|
||||
" Convenience wrapper around glob() which returns a list.
|
||||
function! pathogen#glob(pattern) abort " {{{1
|
||||
let files = split(glob(a:pattern),"\n")
|
||||
return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
|
||||
endfunction "}}}1
|
||||
|
||||
" Like pathogen#glob(), only limit the results to directories.
|
||||
function! pathogen#glob_directories(pattern) abort " {{{1
|
||||
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
|
||||
endfunction "}}}1
|
||||
|
||||
" Turn filetype detection off and back on again if it was already enabled.
|
||||
function! pathogen#cycle_filetype() " {{{1
|
||||
if exists('g:did_load_filetypes')
|
||||
filetype off
|
||||
filetype on
|
||||
endif
|
||||
endfunction " }}}1
|
||||
|
||||
" Checks if a bundle is 'disabled'. A bundle is considered 'disabled' if
|
||||
" its 'basename()' is included in g:pathogen_disabled[]' or ends in a tilde.
|
||||
function! pathogen#is_disabled(path) " {{{1
|
||||
if a:path =~# '\~$'
|
||||
return 1
|
||||
elseif !exists("g:pathogen_disabled")
|
||||
return 0
|
||||
endif
|
||||
let sep = pathogen#separator()
|
||||
return index(g:pathogen_disabled, strpart(a:path, strridx(a:path, sep)+1)) != -1
|
||||
endfunction "}}}1
|
||||
|
||||
" Prepend all subdirectories of path to the rtp, and append all 'after'
|
||||
" directories in those subdirectories.
|
||||
function! pathogen#runtime_prepend_subdirectories(path) " {{{1
|
||||
let sep = pathogen#separator()
|
||||
let before = filter(pathogen#glob_directories(a:path.sep."*"), '!pathogen#is_disabled(v:val)')
|
||||
let after = filter(pathogen#glob_directories(a:path.sep."*".sep."after"), '!pathogen#is_disabled(v:val[0:-7])')
|
||||
let rtp = pathogen#split(&rtp)
|
||||
let path = expand(a:path)
|
||||
call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
|
||||
let &rtp = pathogen#join(pathogen#uniq(before + rtp + after))
|
||||
return &rtp
|
||||
endfunction " }}}1
|
||||
|
||||
" For each directory in rtp, check for a subdirectory named dir. If it
|
||||
" exists, add all subdirectories of that subdirectory to the rtp, immediately
|
||||
" after the original directory. If no argument is given, 'bundle' is used.
|
||||
" Repeated calls with the same arguments are ignored.
|
||||
function! pathogen#runtime_append_all_bundles(...) " {{{1
|
||||
let sep = pathogen#separator()
|
||||
let name = a:0 ? a:1 : 'bundle'
|
||||
if "\n".s:done_bundles =~# "\\M\n".name."\n"
|
||||
return ""
|
||||
endif
|
||||
let s:done_bundles .= name . "\n"
|
||||
let list = []
|
||||
for dir in pathogen#split(&rtp)
|
||||
if dir =~# '\<after$'
|
||||
let list += filter(pathogen#glob_directories(substitute(dir,'after$',name,'').sep.'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir]
|
||||
else
|
||||
let list += [dir] + filter(pathogen#glob_directories(dir.sep.name.sep.'*[^~]'), '!pathogen#is_disabled(v:val)')
|
||||
endif
|
||||
endfor
|
||||
let &rtp = pathogen#join(pathogen#uniq(list))
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
let s:done_bundles = ''
|
||||
" }}}1
|
||||
|
||||
" Invoke :helptags on all non-$VIM doc directories in runtimepath.
|
||||
function! pathogen#helptags() " {{{1
|
||||
let sep = pathogen#separator()
|
||||
for dir in pathogen#split(&rtp)
|
||||
if (dir.sep)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir.sep.'doc') == 2 && !empty(filter(split(glob(dir.sep.'doc'.sep.'*'),"\n>"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags'))
|
||||
helptags `=dir.'/doc'`
|
||||
endif
|
||||
endfor
|
||||
endfunction " }}}1
|
||||
|
||||
command! -bar Helptags :call pathogen#helptags()
|
||||
|
||||
" Like findfile(), but hardcoded to use the runtimepath.
|
||||
function! pathogen#runtime_findfile(file,count) "{{{1
|
||||
let rtp = pathogen#join(1,pathogen#split(&rtp))
|
||||
let file = findfile(a:file,rtp,a:count)
|
||||
if file ==# ''
|
||||
return ''
|
||||
else
|
||||
return fnamemodify(file,':p')
|
||||
endif
|
||||
endfunction " }}}1
|
||||
|
||||
" Backport of fnameescape().
|
||||
function! pathogen#fnameescape(string) " {{{1
|
||||
if exists('*fnameescape')
|
||||
return fnameescape(a:string)
|
||||
elseif a:string ==# '-'
|
||||
return '\-'
|
||||
else
|
||||
return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
|
||||
endif
|
||||
endfunction " }}}1
|
||||
|
||||
function! s:find(count,cmd,file,lcd) " {{{1
|
||||
let rtp = pathogen#join(1,pathogen#split(&runtimepath))
|
||||
let file = pathogen#runtime_findfile(a:file,a:count)
|
||||
if file ==# ''
|
||||
return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
|
||||
elseif a:lcd
|
||||
let path = file[0:-strlen(a:file)-2]
|
||||
execute 'lcd `=path`'
|
||||
return a:cmd.' '.pathogen#fnameescape(a:file)
|
||||
else
|
||||
return a:cmd.' '.pathogen#fnameescape(file)
|
||||
endif
|
||||
endfunction " }}}1
|
||||
|
||||
function! s:Findcomplete(A,L,P) " {{{1
|
||||
let sep = pathogen#separator()
|
||||
let cheats = {
|
||||
\'a': 'autoload',
|
||||
\'d': 'doc',
|
||||
\'f': 'ftplugin',
|
||||
\'i': 'indent',
|
||||
\'p': 'plugin',
|
||||
\'s': 'syntax'}
|
||||
if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
|
||||
let request = cheats[a:A[0]].a:A[1:-1]
|
||||
else
|
||||
let request = a:A
|
||||
endif
|
||||
let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
|
||||
let found = {}
|
||||
for path in pathogen#split(&runtimepath)
|
||||
let path = expand(path, ':p')
|
||||
let matches = split(glob(path.sep.pattern),"\n")
|
||||
call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
|
||||
call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
|
||||
for match in matches
|
||||
let found[match] = 1
|
||||
endfor
|
||||
endfor
|
||||
return sort(keys(found))
|
||||
endfunction " }}}1
|
||||
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
|
||||
|
||||
" vim:set ft=vim ts=8 sw=2 sts=2:
|
435
home/.vim/autoload/recover.vim
Normal file
435
home/.vim/autoload/recover.vim
Normal file
@ -0,0 +1,435 @@
|
||||
" Vim plugin for diffing when swap file was found
|
||||
" ---------------------------------------------------------------
|
||||
" Author: Christian Brabandt <cb@256bit.org>
|
||||
" Version: 0.18
|
||||
" Last Change: Wed, 14 Aug 2013 22:39:13 +0200
|
||||
" Script: http://www.vim.org/scripts/script.php?script_id=3068
|
||||
" License: VIM License
|
||||
" GetLatestVimScripts: 3068 18 :AutoInstall: recover.vim
|
||||
"
|
||||
fu! recover#Recover(on) "{{{1
|
||||
if a:on
|
||||
call s:ModifySTL(1)
|
||||
if !exists("s:old_vsc")
|
||||
let s:old_vsc = v:swapchoice
|
||||
endif
|
||||
augroup Swap
|
||||
au!
|
||||
au SwapExists * nested :call recover#ConfirmSwapDiff()
|
||||
au BufWinEnter,InsertEnter,InsertLeave,FocusGained *
|
||||
\ call <sid>CheckSwapFileExists()
|
||||
augroup END
|
||||
else
|
||||
augroup Swap
|
||||
au!
|
||||
augroup end
|
||||
if exists("s:old_vsc")
|
||||
let v:swapchoice=s:old_vsc
|
||||
endif
|
||||
endif
|
||||
endfu
|
||||
|
||||
fu! s:Swapname() "{{{1
|
||||
" Use sil! so a failing redir (e.g. recursive redir call)
|
||||
" won't hurt. (https://github.com/chrisbra/Recover.vim/pull/8)
|
||||
sil! redir => a |sil swapname|redir end
|
||||
if a[1:] == 'No swap file'
|
||||
return ''
|
||||
else
|
||||
return a[1:]
|
||||
endif
|
||||
endfu
|
||||
|
||||
fu! s:CheckSwapFileExists() "{{{1
|
||||
if !&swapfile
|
||||
return
|
||||
endif
|
||||
|
||||
let swap = s:Swapname()
|
||||
if !empty(swap) && !filereadable(swap)
|
||||
" previous SwapExists autocommand deleted our swapfile,
|
||||
" recreate it and avoid E325 Message
|
||||
call s:SetSwapfile()
|
||||
endif
|
||||
endfu
|
||||
|
||||
fu! s:CheckRecover() "{{{1
|
||||
if exists("b:swapname") && !exists("b:did_recovery")
|
||||
let t = tempname()
|
||||
" Doing manual recovery, otherwise, BufRead autocmd seems to
|
||||
" get into the way of the recovery
|
||||
try
|
||||
exe 'recover' fnameescape(expand('%:p'))
|
||||
catch /^Vim\%((\a\+)\)\=:E/
|
||||
" Prevent any recovery error from disrupting the diff-split.
|
||||
endtry
|
||||
exe ':sil w' t
|
||||
call system('diff '. shellescape(expand('%:p'),1).
|
||||
\ ' '. shellescape(t,1))
|
||||
call delete(t)
|
||||
if !v:shell_error
|
||||
call inputsave()
|
||||
redraw! " prevent overwriting of 'Select File to use for recovery dialog'
|
||||
let p = confirm("No differences: Delete old swap file '".b:swapname."'?",
|
||||
\ "&No\n&Yes", 2)
|
||||
call inputrestore()
|
||||
if p == 2
|
||||
" Workaround for E305 error
|
||||
let v:swapchoice=''
|
||||
call delete(b:swapname)
|
||||
" can trigger SwapExists autocommands again!
|
||||
call s:SetSwapfile()
|
||||
endif
|
||||
call recover#AutoCmdBRP(0)
|
||||
else
|
||||
echo "Found Swapfile '". b:swapname. "', showing diff!"
|
||||
call recover#DiffRecoveredFile()
|
||||
" Not sure, why this needs feedkeys
|
||||
" Sometimes cursor is wrong, I hate when this happens
|
||||
" Cursor is wrong only when there is a single buffer open, a simple
|
||||
" workaround for that is to check if bufnr('') is 1 and total number
|
||||
" of windows in current tab is less than 3 (i.e. no windows were
|
||||
" autoopen): in this case ':wincmd l\n:0\n' must be fed to
|
||||
" feedkeys
|
||||
if bufnr('') == 1 && winnr('$') < 3
|
||||
call feedkeys(":wincmd l\<cr>", 't')
|
||||
endif
|
||||
if !(v:version > 703 || (v:version == 703 && has("patch708")))
|
||||
call feedkeys(":0\<cr>", 't')
|
||||
endif
|
||||
endif
|
||||
let b:did_recovery = 1
|
||||
if get(s:, 'fencview_autodetect', 0)
|
||||
setl buftype=
|
||||
endif
|
||||
" Don't delete the auto command yet.
|
||||
"call recover#AutoCmdBRP(0)
|
||||
endif
|
||||
endfun
|
||||
|
||||
fu! recover#ConfirmSwapDiff() "{{{1
|
||||
if exists("b:swapchoice")
|
||||
let v:swapchoice = b:swapchoice
|
||||
return
|
||||
endif
|
||||
let delete = 0
|
||||
let do_modification_check = exists("g:RecoverPlugin_Edit_Unmodified") ? g:RecoverPlugin_Edit_Unmodified : 0
|
||||
let not_modified = 0
|
||||
let msg = ""
|
||||
let bufname = s:isWin() ? fnamemodify(expand('%'), ':p:8') : shellescape(expand('%'))
|
||||
let tfile = tempname()
|
||||
if executable('vim') && !s:isWin()
|
||||
" Doesn't work on windows (system() won't be able to fetch the output)
|
||||
" Capture E325 Warning message
|
||||
" Leave English output, so parsing will be easier
|
||||
" TODO: make it work on windows.
|
||||
if s:isWin()
|
||||
let wincmd = printf('-c "redir > %s|1d|:q!" ', tfile)
|
||||
let wincmd = printf('-c "call feedkeys(\"o\n\e:q!\n\")"')
|
||||
endif
|
||||
let cmd = printf("%svim -u NONE -es -V %s %s",
|
||||
\ (s:isWin() ? '' : 'TERM=vt100 LC_ALL=C '),
|
||||
\ (s:isWin() ? wincmd : ''),
|
||||
\ bufname)
|
||||
let msg = system(cmd)
|
||||
let msg = substitute(msg, '.*\(E325.*process ID:.\{-}\)\%x0d.*', '\1', '')
|
||||
let msg = substitute(msg, "\e\\[\\d\\+C", "", "g")
|
||||
if do_modification_check
|
||||
let not_modified = (match(msg, "modified: no") > -1)
|
||||
endif
|
||||
endif
|
||||
if has("unix") && !empty(msg) && system("uname") =~? "linux"
|
||||
" try to get process name from pid
|
||||
" This is Linux specific.
|
||||
" TODO Is there a portable way to retrive this info for at least unix?
|
||||
let pid_pat = 'process ID:\s*\zs\d\+'
|
||||
let pid = matchstr(msg, pid_pat)+0
|
||||
if !empty(pid) && isdirectory('/proc')
|
||||
let pname = 'not existing'
|
||||
let proc = '/proc/'. pid. '/status'
|
||||
if filereadable(proc)
|
||||
let pname = matchstr(readfile(proc)[0], '^Name:\s*\zs.*')
|
||||
endif
|
||||
let msg = substitute(msg, pid_pat, '& ['.pname."]\n", '')
|
||||
if not_modified && pname !~? 'vim'
|
||||
let not_modified = 0
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
if executable('vim') && executable('diff') "&& s:isWin()
|
||||
" Check, whether the files differ issue #7
|
||||
" doesn't work on Windows? (cmd is ok, should be executable)
|
||||
if s:isWin()
|
||||
let tfile = substitute(tfile, '/', '\\', 'g')
|
||||
endif
|
||||
let cmd = printf("vim -u NONE -N %s -r %s -c \":w %s|:q!\" %s diff %s %s",
|
||||
\ (s:isWin() ? '' : '-es'),
|
||||
\ (s:isWin() ? fnamemodify(v:swapname, ':p:8') : shellescape(v:swapname)),
|
||||
\ tfile, (s:isWin() ? '&' : '&&'),
|
||||
\ bufname, tfile)
|
||||
call system(cmd)
|
||||
" if return code of diff is zero, files are identical
|
||||
let delete = !v:shell_error
|
||||
if !do_modification_check
|
||||
echo msg
|
||||
endif
|
||||
endif
|
||||
call delete(tfile)
|
||||
if delete && !do_modification_check
|
||||
echomsg "Swap and on-disk file seem to be identical"
|
||||
endif
|
||||
let cmd = printf("D&iff\n&Open Read-Only\n&Edit anyway\n&Recover\n&Quit\n&Abort%s",
|
||||
\ ( (delete || !empty(msg)) ? "\n&Delete" : ""))
|
||||
if !empty(msg)
|
||||
let info = 'Please choose: '
|
||||
else
|
||||
let info = "Swap File '". v:swapname. "' found: "
|
||||
endif
|
||||
" if has("gui_running") && &go !~ 'c'
|
||||
" call inputsave()
|
||||
" let p = confirm(info, cmd, (modified ? 3 : delete ? 7 : 1), 'I')
|
||||
" else
|
||||
" echo info
|
||||
" call s:Output(cmd)
|
||||
if not_modified
|
||||
let p = 3
|
||||
else
|
||||
call inputsave()
|
||||
let p = confirm(info, cmd, (delete ? 7 : 1), 'I')
|
||||
" endif
|
||||
call inputrestore()
|
||||
endif
|
||||
let b:swapname=v:swapname
|
||||
if p == 1 || p == 3
|
||||
" Diff or Edit Anyway
|
||||
call s:SwapChoice('e')
|
||||
" postpone recovering until later, for now, we are opening anyways...
|
||||
" (this is done by s:CheckRecover()
|
||||
" in an BufReadPost autocommand
|
||||
if (p == 1)
|
||||
call recover#AutoCmdBRP(1)
|
||||
endif
|
||||
" disable fencview (issue #23)
|
||||
" This is a hack, fencview doesn't allow to selectively disable it :(
|
||||
let s:fencview_autodetect = get(g:, 'fencview_autodetect', 0)
|
||||
if s:fencview_autodetect
|
||||
setl buftype=help
|
||||
endif
|
||||
elseif p == 2
|
||||
" Open Read-Only
|
||||
" Don't show the Recovery dialog
|
||||
let v:swapchoice='o'
|
||||
call <sid>EchoMsg("Found SwapFile, opening file readonly!")
|
||||
sleep 2
|
||||
elseif p == 4
|
||||
" Recover
|
||||
let v:swapchoice='r'
|
||||
elseif p == 5
|
||||
" Quit
|
||||
let v:swapchoice='q'
|
||||
elseif p == 6
|
||||
" Abort
|
||||
let v:swapchoice='a'
|
||||
elseif p == 7
|
||||
" Delete Swap file, if not different
|
||||
call s:SwapChoice('d')
|
||||
call <sid>EchoMsg("Found SwapFile, deleting...")
|
||||
" might trigger SwapExists again!
|
||||
call s:SetSwapfile()
|
||||
else
|
||||
" Show default menu from vim
|
||||
return
|
||||
endif
|
||||
endfun
|
||||
|
||||
fu! s:Output(msg) "{{{1
|
||||
" Display as one string, without linebreaks
|
||||
let msg = substitute(a:msg, '\n', '/', 'g')
|
||||
for item in split(msg, '&')
|
||||
echohl WarningMsg
|
||||
echon item[0]
|
||||
echohl Normal
|
||||
echon item[1:]
|
||||
endfor
|
||||
endfun
|
||||
|
||||
fu! s:SwapChoice(char) "{{{1
|
||||
let v:swapchoice = a:char
|
||||
let b:swapchoice = a:char
|
||||
endfu
|
||||
|
||||
fu! recover#DiffRecoveredFile() "{{{1
|
||||
" recovered version
|
||||
diffthis
|
||||
let b:mod='recovered version'
|
||||
let l:filetype = &ft
|
||||
if has("balloon_eval")
|
||||
set ballooneval
|
||||
setl bexpr=recover#BalloonExprRecover()
|
||||
endif
|
||||
" saved version
|
||||
let curspr = &spr
|
||||
set nospr
|
||||
noa vert new
|
||||
let &l:spr = curspr
|
||||
if !empty(glob(fnameescape(expand('#'))))
|
||||
0r #
|
||||
$d _
|
||||
endif
|
||||
if l:filetype != ""
|
||||
exe "setl filetype=".l:filetype
|
||||
endif
|
||||
exe "f! " . escape(expand("<afile>")," ") .
|
||||
\ escape(' (on-disk version)', ' ')
|
||||
diffthis
|
||||
setl noswapfile buftype=nowrite bufhidden=delete nobuflisted
|
||||
let b:mod='unmodified version on-disk'
|
||||
let swapbufnr=bufnr('')
|
||||
if has("balloon_eval")
|
||||
set ballooneval
|
||||
setl bexpr=recover#BalloonExprRecover()
|
||||
endif
|
||||
noa wincmd l
|
||||
let b:swapbufnr = swapbufnr
|
||||
command! -buffer RecoverPluginFinish :FinishRecovery
|
||||
command! -buffer FinishRecovery :call recover#RecoverFinish()
|
||||
setl modified
|
||||
endfu
|
||||
|
||||
fu! recover#Help() "{{{1
|
||||
echohl Title
|
||||
echo "Diff key mappings\n".
|
||||
\ "-----------------\n"
|
||||
echo "Normal mode commands:\n"
|
||||
echohl Normal
|
||||
echo "]c - next diff\n".
|
||||
\ "[c - prev diff\n".
|
||||
\ "do - diff obtain - get change from other window\n".
|
||||
\ "dp - diff put - put change into other window\n"
|
||||
echohl Title
|
||||
echo "Ex-commands:\n"
|
||||
echohl Normal
|
||||
echo ":[range]diffget - get changes from other window\n".
|
||||
\ ":[range]diffput - put changes into other window\n".
|
||||
\ ":RecoverPluginDisable - DisablePlugin\n".
|
||||
\ ":RecoverPluginEnable - EnablePlugin\n".
|
||||
\ ":RecoverPluginHelp - this help"
|
||||
if exists(":RecoverPluginFinish")
|
||||
echo ":RecoverPluginFinish - finish recovery"
|
||||
endif
|
||||
endfun
|
||||
|
||||
|
||||
|
||||
fu! s:EchoMsg(msg) "{{{1
|
||||
echohl WarningMsg
|
||||
uns echomsg a:msg
|
||||
echohl Normal
|
||||
endfu
|
||||
|
||||
fu! s:ModifySTL(enable) "{{{1
|
||||
if a:enable
|
||||
" Inject some info into the statusline
|
||||
let s:ostl = &stl
|
||||
let s:nstl = substitute(&stl, '%f',
|
||||
\ "\\0 %{exists('b:mod')?('['.b:mod.']') : ''}", 'g')
|
||||
let &l:stl = s:nstl
|
||||
else
|
||||
" Restore old statusline setting
|
||||
if exists("s:ostl") && s:nstl == &stl
|
||||
let &stl=s:ostl
|
||||
endif
|
||||
endif
|
||||
endfu
|
||||
|
||||
fu! s:SetSwapfile() "{{{1
|
||||
if &l:swf
|
||||
" Reset swapfile to use .swp extension
|
||||
sil setl noswapfile swapfile
|
||||
endif
|
||||
endfu
|
||||
|
||||
fu! s:isWin() "{{{1
|
||||
return has("win32") || has("win16") || has("win64")
|
||||
endfu
|
||||
fu! recover#BalloonExprRecover() "{{{1
|
||||
" Set up a balloon expr.
|
||||
if exists("b:swapbufnr") && v:beval_bufnr!=?b:swapbufnr
|
||||
return "This buffer shows the recovered and modified version of your file"
|
||||
else
|
||||
return "This buffer shows the unmodified version of your file as it is stored on disk"
|
||||
endif
|
||||
endfun
|
||||
|
||||
fu! recover#RecoverFinish() abort "{{{1
|
||||
let swapname = b:swapname
|
||||
let curbufnr = bufnr('')
|
||||
delcommand FinishRecovery
|
||||
exe bufwinnr(b:swapbufnr) " wincmd w"
|
||||
diffoff
|
||||
bd!
|
||||
call delete(swapname)
|
||||
diffoff
|
||||
call s:ModifySTL(0)
|
||||
exe bufwinnr(curbufnr) " wincmd w"
|
||||
call s:SetSwapfile()
|
||||
unlet! b:swapname b:did_recovery b:swapbufnr b:swapchoice
|
||||
endfun
|
||||
|
||||
fu! recover#AutoCmdBRP(on) "{{{1
|
||||
if a:on && !exists("#SwapBRP")
|
||||
augroup SwapBRP
|
||||
au!
|
||||
au BufNewFile,BufReadPost <buffer> :call s:CheckRecover()
|
||||
augroup END
|
||||
elseif !a:on && exists('#SwapBRP')
|
||||
augroup SwapBRP
|
||||
au!
|
||||
augroup END
|
||||
augroup! SwapBRP
|
||||
endif
|
||||
endfu
|
||||
" Old functions, not used anymore "{{{1
|
||||
finish
|
||||
|
||||
fu! recover#DiffRecoveredFileOld() "{{{2
|
||||
" For some reason, this only works with feedkeys.
|
||||
" I am not sure why.
|
||||
let histnr = histnr('cmd')+1
|
||||
call feedkeys(":diffthis\n", 't')
|
||||
call feedkeys(":setl modified\n", 't')
|
||||
call feedkeys(":let b:mod='recovered version'\n", 't')
|
||||
call feedkeys(":let g:recover_bufnr=bufnr('%')\n", 't')
|
||||
let l:filetype = &ft
|
||||
call feedkeys(":vert new\n", 't')
|
||||
call feedkeys(":0r #\n", 't')
|
||||
call feedkeys(":$delete _\n", 't')
|
||||
if l:filetype != ""
|
||||
call feedkeys(":setl filetype=".l:filetype."\n", 't')
|
||||
endif
|
||||
call feedkeys(":f! " . escape(expand("<afile>")," ") . "\\ (on-disk\\ version)\n", 't')
|
||||
call feedkeys(":let swapbufnr = bufnr('')\n", 't')
|
||||
call feedkeys(":diffthis\n", 't')
|
||||
call feedkeys(":setl noswapfile buftype=nowrite bufhidden=delete nobuflisted\n", 't')
|
||||
call feedkeys(":let b:mod='unmodified version on-disk'\n", 't')
|
||||
call feedkeys(":exe bufwinnr(g:recover_bufnr) ' wincmd w'"."\n", 't')
|
||||
call feedkeys(":let b:swapbufnr=swapbufnr\n", 't')
|
||||
"call feedkeys(":command! -buffer DeleteSwapFile :call delete(b:swapname)|delcommand DeleteSwapFile\n", 't')
|
||||
call feedkeys(":command! -buffer RecoverPluginFinish :FinishRecovery\n", 't')
|
||||
call feedkeys(":command! -buffer FinishRecovery :call recover#RecoverFinish()\n", 't')
|
||||
call feedkeys(":0\n", 't')
|
||||
if has("balloon_eval")
|
||||
"call feedkeys(':if has("balloon_eval")|:set ballooneval|setl bexpr=recover#BalloonExprRecover()|endif'."\n", 't')
|
||||
call feedkeys(":set ballooneval|setl bexpr=recover#BalloonExprRecover()\n", 't')
|
||||
endif
|
||||
"call feedkeys(":redraw!\n", 't')
|
||||
call feedkeys(":for i in range(".histnr.", histnr('cmd'), 1)|:call histdel('cmd',i)|:endfor\n",'t')
|
||||
call feedkeys(":echo 'Found Swapfile '.b:swapname . ', showing diff!'\n", 'm')
|
||||
" Delete Autocommand
|
||||
call recover#AutoCmdBRP(0)
|
||||
"endif
|
||||
endfu
|
||||
|
||||
|
||||
" Modeline "{{{1
|
||||
" vim:fdl=0
|
1
home/.vim/bundle/vim-go
Submodule
1
home/.vim/bundle/vim-go
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 7aaded14ff2a175a6e57adb0d9e5e90a33924a0c
|
1
home/.vim/bundle/vimwiki
Submodule
1
home/.vim/bundle/vimwiki
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 2c03d82a0e4662adf1e347487d73a9bf4bf6fdac
|
192
home/.vim/colors/vividchalk.vim
Normal file
192
home/.vim/colors/vividchalk.vim
Normal file
@ -0,0 +1,192 @@
|
||||
" Vim color scheme
|
||||
" Name: vividchalk.vim
|
||||
" Author: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" Version: 2.0
|
||||
" GetLatestVimScripts: 1891 1 :AutoInstall: vividchalk.vim
|
||||
|
||||
" Based on the Vibrank Ink theme for TextMate
|
||||
" Distributable under the same terms as Vim itself (see :help license)
|
||||
|
||||
if has("gui_running")
|
||||
set background=dark
|
||||
endif
|
||||
hi clear
|
||||
if exists("syntax_on")
|
||||
syntax reset
|
||||
endif
|
||||
|
||||
let colors_name = "vividchalk"
|
||||
|
||||
" First two functions adapted from inkpot.vim
|
||||
|
||||
" map a urxvt cube number to an xterm-256 cube number
|
||||
fun! s:M(a)
|
||||
return strpart("0245", a:a, 1) + 0
|
||||
endfun
|
||||
|
||||
" map a urxvt colour to an xterm-256 colour
|
||||
fun! s:X(a)
|
||||
if &t_Co == 88
|
||||
return a:a
|
||||
else
|
||||
if a:a == 8
|
||||
return 237
|
||||
elseif a:a < 16
|
||||
return a:a
|
||||
elseif a:a > 79
|
||||
return 232 + (3 * (a:a - 80))
|
||||
else
|
||||
let l:b = a:a - 16
|
||||
let l:x = l:b % 4
|
||||
let l:y = (l:b / 4) % 4
|
||||
let l:z = (l:b / 16)
|
||||
return 16 + s:M(l:x) + (6 * s:M(l:y)) + (36 * s:M(l:z))
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
function! E2T(a)
|
||||
return s:X(a:a)
|
||||
endfunction
|
||||
|
||||
function! s:choose(mediocre,good)
|
||||
if &t_Co != 88 && &t_Co != 256
|
||||
return a:mediocre
|
||||
else
|
||||
return s:X(a:good)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:hifg(group,guifg,first,second,...)
|
||||
if a:0 && &t_Co == 256
|
||||
let ctermfg = a:1
|
||||
else
|
||||
let ctermfg = s:choose(a:first,a:second)
|
||||
endif
|
||||
exe "highlight ".a:group." guifg=".a:guifg." ctermfg=".ctermfg
|
||||
endfunction
|
||||
|
||||
function! s:hibg(group,guibg,first,second)
|
||||
let ctermbg = s:choose(a:first,a:second)
|
||||
exe "highlight ".a:group." guibg=".a:guibg." ctermbg=".ctermbg
|
||||
endfunction
|
||||
|
||||
hi link railsMethod PreProc
|
||||
hi link rubyDefine Keyword
|
||||
hi link rubySymbol Constant
|
||||
hi link rubyAccess rubyMethod
|
||||
hi link rubyAttribute rubyMethod
|
||||
hi link rubyEval rubyMethod
|
||||
hi link rubyException rubyMethod
|
||||
hi link rubyInclude rubyMethod
|
||||
hi link rubyStringDelimiter rubyString
|
||||
hi link rubyRegexp Regexp
|
||||
hi link rubyRegexpDelimiter rubyRegexp
|
||||
"hi link rubyConstant Variable
|
||||
"hi link rubyGlobalVariable Variable
|
||||
"hi link rubyClassVariable Variable
|
||||
"hi link rubyInstanceVariable Variable
|
||||
hi link javascriptRegexpString Regexp
|
||||
hi link javascriptNumber Number
|
||||
hi link javascriptNull Constant
|
||||
highlight link diffAdded String
|
||||
highlight link diffRemoved Statement
|
||||
highlight link diffLine PreProc
|
||||
highlight link diffSubname Comment
|
||||
|
||||
call s:hifg("Normal","#EEEEEE","White",87)
|
||||
if &background == "light" || has("gui_running")
|
||||
hi Normal guibg=Black ctermbg=Black
|
||||
else
|
||||
hi Normal guibg=Black ctermbg=NONE
|
||||
endif
|
||||
highlight StatusLine guifg=Black guibg=#aabbee gui=bold ctermfg=Black ctermbg=White cterm=bold
|
||||
highlight StatusLineNC guifg=#444444 guibg=#aaaaaa gui=none ctermfg=Black ctermbg=Grey cterm=none
|
||||
"if &t_Co == 256
|
||||
"highlight StatusLine ctermbg=117
|
||||
"else
|
||||
"highlight StatusLine ctermbg=43
|
||||
"endif
|
||||
|
||||
highlight Ignore ctermfg=Black
|
||||
highlight WildMenu guifg=Black guibg=#ffff00 gui=bold ctermfg=Black ctermbg=Yellow cterm=bold
|
||||
highlight Cursor guifg=Black guibg=White ctermfg=Black ctermbg=White
|
||||
call s:hibg("ColorColumn","#333333","DarkGrey",81)
|
||||
call s:hibg("CursorLine","#333333","DarkGrey",81)
|
||||
call s:hibg("CursorColumn","#333333","DarkGrey",81)
|
||||
highlight NonText guifg=#404040 ctermfg=8
|
||||
highlight SpecialKey guifg=#404040 ctermfg=8
|
||||
highlight Directory none
|
||||
high link Directory Identifier
|
||||
highlight ErrorMsg guibg=Red ctermbg=DarkRed guifg=NONE ctermfg=NONE
|
||||
highlight Search guifg=NONE ctermfg=NONE gui=none cterm=none
|
||||
call s:hibg("Search" ,"#555555","DarkBlue",81)
|
||||
highlight IncSearch guifg=White guibg=Black ctermfg=White ctermbg=Black
|
||||
highlight MoreMsg guifg=#00AA00 ctermfg=Green
|
||||
highlight LineNr guifg=#DDEEFF ctermfg=White
|
||||
call s:hibg("LineNr" ,"#222222","DarkBlue",80)
|
||||
highlight Question none
|
||||
high link Question MoreMsg
|
||||
highlight Title guifg=Magenta ctermfg=Magenta
|
||||
highlight VisualNOS gui=none cterm=none
|
||||
call s:hibg("Visual" ,"#555577","LightBlue",83)
|
||||
call s:hibg("VisualNOS" ,"#444444","DarkBlue",81)
|
||||
call s:hibg("MatchParen","#1100AA","DarkBlue",18)
|
||||
highlight WarningMsg guifg=Red ctermfg=Red
|
||||
highlight Error ctermbg=DarkRed
|
||||
highlight SpellBad ctermbg=DarkRed
|
||||
" FIXME: Comments
|
||||
highlight SpellRare ctermbg=DarkMagenta
|
||||
highlight SpellCap ctermbg=DarkBlue
|
||||
highlight SpellLocal ctermbg=DarkCyan
|
||||
|
||||
call s:hibg("Folded" ,"#110077","DarkBlue",17)
|
||||
call s:hifg("Folded" ,"#aaddee","LightCyan",63)
|
||||
highlight FoldColumn none
|
||||
high link FoldColumn Folded
|
||||
highlight DiffAdd ctermbg=4 guibg=DarkBlue
|
||||
highlight DiffChange ctermbg=5 guibg=DarkMagenta
|
||||
highlight DiffDelete ctermfg=12 ctermbg=6 gui=bold guifg=Blue guibg=DarkCyan
|
||||
highlight DiffText ctermbg=DarkRed
|
||||
highlight DiffText cterm=bold ctermbg=9 gui=bold guibg=Red
|
||||
|
||||
highlight Pmenu guifg=White ctermfg=White gui=bold cterm=bold
|
||||
highlight PmenuSel guifg=White ctermfg=White gui=bold cterm=bold
|
||||
call s:hibg("Pmenu" ,"#000099","Blue",18)
|
||||
call s:hibg("PmenuSel" ,"#5555ff","DarkCyan",39)
|
||||
highlight PmenuSbar guibg=Grey ctermbg=Grey
|
||||
highlight PmenuThumb guibg=White ctermbg=White
|
||||
highlight TabLine gui=underline cterm=underline
|
||||
call s:hifg("TabLine" ,"#bbbbbb","LightGrey",85)
|
||||
call s:hibg("TabLine" ,"#333333","DarkGrey",80)
|
||||
highlight TabLineSel guifg=White guibg=Black ctermfg=White ctermbg=Black
|
||||
highlight TabLineFill gui=underline cterm=underline
|
||||
call s:hifg("TabLineFill","#bbbbbb","LightGrey",85)
|
||||
call s:hibg("TabLineFill","#808080","Grey",83)
|
||||
|
||||
hi Type gui=none
|
||||
hi Statement gui=none
|
||||
if !has("gui_mac")
|
||||
" Mac GUI degrades italics to ugly underlining.
|
||||
hi Comment gui=italic
|
||||
hi railsUserClass gui=italic
|
||||
hi railsUserMethod gui=italic
|
||||
endif
|
||||
hi Identifier cterm=none
|
||||
" Commented numbers at the end are *old* 256 color values
|
||||
"highlight PreProc guifg=#EDF8F9
|
||||
call s:hifg("Comment" ,"#9933CC","DarkMagenta",34) " 92
|
||||
" 26 instead?
|
||||
call s:hifg("Constant" ,"#339999","DarkCyan",21) " 30
|
||||
call s:hifg("rubyNumber" ,"#CCFF33","Yellow",60) " 190
|
||||
call s:hifg("String" ,"#66FF00","LightGreen",44,82) " 82
|
||||
call s:hifg("Identifier" ,"#FFCC00","Yellow",72) " 220
|
||||
call s:hifg("Statement" ,"#FF6600","Brown",68) " 202
|
||||
call s:hifg("PreProc" ,"#AAFFFF","LightCyan",47) " 213
|
||||
call s:hifg("railsUserMethod","#AACCFF","LightCyan",27)
|
||||
call s:hifg("Type" ,"#AAAA77","Grey",57) " 101
|
||||
call s:hifg("railsUserClass" ,"#AAAAAA","Grey",7) " 101
|
||||
call s:hifg("Special" ,"#33AA00","DarkGreen",24) " 7
|
||||
call s:hifg("Regexp" ,"#44B4CC","DarkCyan",21) " 74
|
||||
call s:hifg("rubyMethod" ,"#DDE93D","Yellow",77) " 191
|
||||
"highlight railsMethod guifg=#EE1122 ctermfg=1
|
64
home/.vim/colors/wombat256.vim
Normal file
64
home/.vim/colors/wombat256.vim
Normal file
@ -0,0 +1,64 @@
|
||||
" Vim color file
|
||||
" Original Maintainer: Lars H. Nielsen (dengmao@gmail.com)
|
||||
" Last Change: 2010-07-23
|
||||
"
|
||||
" Converting for 256-color terminals by
|
||||
" Danila Bespalov (danila.bespalov@gmail.com)
|
||||
" with great help of tool by Wolfgang Frisch (xororand@frexx.de)
|
||||
" inspired by David Liang's version (bmdavll@gmail.com)
|
||||
|
||||
set background=dark
|
||||
|
||||
hi clear
|
||||
|
||||
if exists("syntax_on")
|
||||
syntax reset
|
||||
endif
|
||||
|
||||
let colors_name = "wombat256"
|
||||
|
||||
|
||||
" General colors
|
||||
hi Normal ctermfg=254 ctermbg=234 cterm=none guifg=#f6f3e8 guibg=#242424 gui=none
|
||||
hi Cursor ctermfg=none ctermbg=241 cterm=none guifg=NONE guibg=#656565 gui=none
|
||||
hi Visual ctermfg=7 ctermbg=238 cterm=none guifg=#f6f3e8 guibg=#444444 gui=none
|
||||
" hi VisualNOS
|
||||
" hi Search
|
||||
hi Folded ctermfg=103 ctermbg=238 cterm=none guifg=#a0a8b0 guibg=#384048 gui=none
|
||||
hi Title ctermfg=7 ctermbg=none cterm=bold guifg=#f6f3e8 guibg=NONE gui=bold
|
||||
hi StatusLine ctermfg=7 ctermbg=238 cterm=none guifg=#f6f3e8 guibg=#444444 gui=italic
|
||||
hi VertSplit ctermfg=238 ctermbg=238 cterm=none guifg=#444444 guibg=#444444 gui=none
|
||||
hi StatusLineNC ctermfg=243 ctermbg=238 cterm=none guifg=#857b6f guibg=#444444 gui=none
|
||||
hi LineNr ctermfg=243 ctermbg=0 cterm=none guifg=#857b6f guibg=#000000 gui=none
|
||||
hi SpecialKey ctermfg=244 ctermbg=236 cterm=none guifg=#808080 guibg=#343434 gui=none
|
||||
hi NonText ctermfg=244 ctermbg=236 cterm=none guifg=#808080 guibg=#303030 gui=none
|
||||
|
||||
" Vim >= 7.0 specific colors
|
||||
if version >= 700
|
||||
hi CursorLine ctermbg=236 cterm=none guibg=#2d2d2d
|
||||
hi MatchParen ctermfg=7 ctermbg=243 cterm=bold guifg=#f6f3e8 guibg=#857b6f gui=bold
|
||||
hi Pmenu ctermfg=7 ctermbg=238 guifg=#f6f3e8 guibg=#444444
|
||||
hi PmenuSel ctermfg=0 ctermbg=192 guifg=#000000 guibg=#cae682
|
||||
endif
|
||||
|
||||
|
||||
" Syntax highlighting
|
||||
hi Keyword ctermfg=111 cterm=none guifg=#8ac6f2 gui=none
|
||||
hi Statement ctermfg=111 cterm=none guifg=#8ac6f2 gui=none
|
||||
hi Constant ctermfg=173 cterm=none guifg=#e5786d gui=none
|
||||
hi Number ctermfg=173 cterm=none guifg=#e5786d gui=none
|
||||
hi PreProc ctermfg=173 cterm=none guifg=#e5786d gui=none
|
||||
hi Function ctermfg=192 cterm=none guifg=#cae682 gui=none
|
||||
hi Identifier ctermfg=192 cterm=none guifg=#cae682 gui=none
|
||||
hi Type ctermfg=192 cterm=none guifg=#cae682 gui=none
|
||||
hi Special ctermfg=194 cterm=none guifg=#e7f6da gui=none
|
||||
hi String ctermfg=113 cterm=none guifg=#95e454 gui=italic
|
||||
hi Comment ctermfg=246 cterm=none guifg=#99968b gui=italic
|
||||
hi Todo ctermfg=245 cterm=none guifg=#8f8f8f gui=italic
|
||||
|
||||
|
||||
" Links
|
||||
hi! link FoldColumn Folded
|
||||
hi! link CursorColumn CursorLine
|
||||
|
||||
" vim:set ts=4 sw=4 noet:
|
96
home/.vim/colors/wombat256mod.vim
Normal file
96
home/.vim/colors/wombat256mod.vim
Normal file
@ -0,0 +1,96 @@
|
||||
" Vim color file
|
||||
" Original Maintainer: Lars H. Nielsen (dengmao@gmail.com)
|
||||
" Last Change: 2010-07-23
|
||||
"
|
||||
" Modified version of wombat for 256-color terminals by
|
||||
" David Liang (bmdavll@gmail.com)
|
||||
" based on version by
|
||||
" Danila Bespalov (danila.bespalov@gmail.com)
|
||||
|
||||
set background=dark
|
||||
|
||||
if version > 580
|
||||
hi clear
|
||||
if exists("syntax_on")
|
||||
syntax reset
|
||||
endif
|
||||
endif
|
||||
|
||||
let colors_name = "wombat256mod"
|
||||
|
||||
|
||||
" General colors
|
||||
hi Normal ctermfg=252 ctermbg=234 cterm=none guifg=#e3e0d7 guibg=#242424 gui=none
|
||||
hi Cursor ctermfg=234 ctermbg=228 cterm=none guifg=#242424 guibg=#eae788 gui=none
|
||||
hi Visual ctermfg=251 ctermbg=239 cterm=none guifg=#c3c6ca guibg=#554d4b gui=none
|
||||
hi VisualNOS ctermfg=251 ctermbg=236 cterm=none guifg=#c3c6ca guibg=#303030 gui=none
|
||||
hi Search ctermfg=177 ctermbg=241 cterm=none guifg=#d787ff guibg=#636066 gui=none
|
||||
hi Folded ctermfg=103 ctermbg=237 cterm=none guifg=#a0a8b0 guibg=#3a4046 gui=none
|
||||
hi Title ctermfg=230 cterm=bold guifg=#ffffd7 gui=bold
|
||||
hi StatusLine ctermfg=230 ctermbg=238 cterm=none guifg=#ffffd7 guibg=#444444 gui=italic
|
||||
hi VertSplit ctermfg=238 ctermbg=238 cterm=none guifg=#444444 guibg=#444444 gui=none
|
||||
hi StatusLineNC ctermfg=241 ctermbg=238 cterm=none guifg=#857b6f guibg=#444444 gui=none
|
||||
hi LineNr ctermfg=241 ctermbg=232 cterm=none guifg=#857b6f guibg=#080808 gui=none
|
||||
hi SpecialKey ctermfg=241 ctermbg=235 cterm=none guifg=#626262 guibg=#2b2b2b gui=none
|
||||
hi WarningMsg ctermfg=203 guifg=#ff5f55
|
||||
hi ErrorMsg ctermfg=196 ctermbg=236 cterm=bold guifg=#ff2026 guibg=#3a3a3a gui=bold
|
||||
|
||||
" Vim >= 7.0 specific colors
|
||||
if version >= 700
|
||||
hi CursorLine ctermbg=236 cterm=none guibg=#32322f
|
||||
hi MatchParen ctermfg=228 ctermbg=101 cterm=bold guifg=#eae788 guibg=#857b6f gui=bold
|
||||
hi Pmenu ctermfg=230 ctermbg=238 guifg=#ffffd7 guibg=#444444
|
||||
hi PmenuSel ctermfg=232 ctermbg=192 guifg=#080808 guibg=#cae982
|
||||
endif
|
||||
|
||||
" Diff highlighting
|
||||
hi DiffAdd ctermbg=17 guibg=#2a0d6a
|
||||
hi DiffDelete ctermfg=234 ctermbg=60 cterm=none guifg=#242424 guibg=#3e3969 gui=none
|
||||
hi DiffText ctermbg=53 cterm=none guibg=#73186e gui=none
|
||||
hi DiffChange ctermbg=237 guibg=#382a37
|
||||
|
||||
"hi CursorIM
|
||||
"hi Directory
|
||||
"hi IncSearch
|
||||
"hi Menu
|
||||
"hi ModeMsg
|
||||
"hi MoreMsg
|
||||
"hi PmenuSbar
|
||||
"hi PmenuThumb
|
||||
"hi Question
|
||||
"hi Scrollbar
|
||||
"hi SignColumn
|
||||
"hi SpellBad
|
||||
"hi SpellCap
|
||||
"hi SpellLocal
|
||||
"hi SpellRare
|
||||
"hi TabLine
|
||||
"hi TabLineFill
|
||||
"hi TabLineSel
|
||||
"hi Tooltip
|
||||
"hi User1
|
||||
"hi User9
|
||||
"hi WildMenu
|
||||
|
||||
|
||||
" Syntax highlighting
|
||||
hi Keyword ctermfg=111 cterm=none guifg=#88b8f6 gui=none
|
||||
hi Statement ctermfg=111 cterm=none guifg=#88b8f6 gui=none
|
||||
hi Constant ctermfg=173 cterm=none guifg=#e5786d gui=none
|
||||
hi Number ctermfg=173 cterm=none guifg=#e5786d gui=none
|
||||
hi PreProc ctermfg=173 cterm=none guifg=#e5786d gui=none
|
||||
hi Function ctermfg=192 cterm=none guifg=#cae982 gui=none
|
||||
hi Identifier ctermfg=192 cterm=none guifg=#cae982 gui=none
|
||||
hi Type ctermfg=186 cterm=none guifg=#d4d987 gui=none
|
||||
hi Special ctermfg=229 cterm=none guifg=#eadead gui=none
|
||||
hi String ctermfg=113 cterm=none guifg=#95e454 gui=italic
|
||||
hi Comment ctermfg=246 cterm=none guifg=#9c998e gui=italic
|
||||
hi Todo ctermfg=101 cterm=none guifg=#857b6f gui=italic
|
||||
|
||||
|
||||
" Links
|
||||
hi! link FoldColumn Folded
|
||||
hi! link CursorColumn CursorLine
|
||||
hi! link NonText LineNr
|
||||
|
||||
" vim:set ts=4 sw=4 noet:
|
142
home/.vim/colors/xoria256.vim
Normal file
142
home/.vim/colors/xoria256.vim
Normal file
@ -0,0 +1,142 @@
|
||||
" Vim color file
|
||||
"
|
||||
" Name: xoria256.vim
|
||||
" Version: 1.5
|
||||
" Maintainer: Dmitriy Y. Zotikov (xio) <xio@ungrund.org>
|
||||
"
|
||||
" Should work in recent 256 color terminals. 88-color terms like urxvt are
|
||||
" NOT supported.
|
||||
"
|
||||
" Don't forget to install 'ncurses-term' and set TERM to xterm-256color or
|
||||
" similar value.
|
||||
"
|
||||
" Color numbers (0-255) see:
|
||||
" http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
|
||||
"
|
||||
" For a specific filetype highlighting rules issue :syntax list when a file of
|
||||
" that type is opened.
|
||||
|
||||
" Initialization {{{
|
||||
if &t_Co != 256 && ! has("gui_running")
|
||||
echomsg ""
|
||||
echomsg "err: please use GUI or a 256-color terminal (so that t_Co=256 could be set)"
|
||||
echomsg ""
|
||||
finish
|
||||
endif
|
||||
|
||||
set background=dark
|
||||
|
||||
hi clear
|
||||
|
||||
if exists("syntax_on")
|
||||
syntax reset
|
||||
endif
|
||||
|
||||
let colors_name = "xoria256"
|
||||
"}}}
|
||||
" Colours {{{1
|
||||
"" General {{{2
|
||||
hi Normal ctermfg=252 guifg=#d0d0d0 ctermbg=234 guibg=#1c1c1c cterm=none gui=none
|
||||
hi Cursor ctermbg=214 guibg=#ffaf00
|
||||
hi CursorColumn ctermbg=238 guibg=#444444
|
||||
hi CursorLine ctermbg=237 guibg=#3a3a3a cterm=none gui=none
|
||||
hi Error ctermfg=15 guifg=#ffffff ctermbg=1 guibg=#800000
|
||||
hi ErrorMsg ctermfg=15 guifg=#ffffff ctermbg=1 guibg=#800000
|
||||
hi FoldColumn ctermfg=247 guifg=#9e9e9e ctermbg=233 guibg=#121212
|
||||
hi Folded ctermfg=255 guifg=#eeeeee ctermbg=60 guibg=#5f5f87
|
||||
hi IncSearch ctermfg=0 guifg=#000000 ctermbg=223 guibg=#ffdfaf cterm=none gui=none
|
||||
hi LineNr ctermfg=247 guifg=#9e9e9e ctermbg=233 guibg=#121212
|
||||
hi MatchParen ctermfg=188 guifg=#dfdfdf ctermbg=68 guibg=#5f87df cterm=bold gui=bold
|
||||
" TODO
|
||||
" hi MoreMsg
|
||||
hi NonText ctermfg=247 guifg=#9e9e9e ctermbg=233 guibg=#121212 cterm=bold gui=bold
|
||||
hi Pmenu ctermfg=0 guifg=#000000 ctermbg=250 guibg=#bcbcbc
|
||||
hi PmenuSel ctermfg=255 guifg=#eeeeee ctermbg=243 guibg=#767676
|
||||
hi PmenuSbar ctermbg=252 guibg=#d0d0d0
|
||||
hi PmenuThumb ctermfg=243 guifg=#767676
|
||||
hi Search ctermfg=0 guifg=#000000 ctermbg=149 guibg=#afdf5f
|
||||
hi SignColumn ctermfg=248 guifg=#a8a8a8
|
||||
hi SpecialKey ctermfg=77 guifg=#5fdf5f
|
||||
hi SpellBad ctermfg=160 guifg=fg ctermbg=bg cterm=underline guisp=#df0000
|
||||
hi SpellCap ctermfg=189 guifg=#dfdfff ctermbg=bg guibg=bg cterm=underline gui=underline
|
||||
hi SpellRare ctermfg=168 guifg=#df5f87 ctermbg=bg guibg=bg cterm=underline gui=underline
|
||||
hi SpellLocal ctermfg=98 guifg=#875fdf ctermbg=bg guibg=bg cterm=underline gui=underline
|
||||
hi StatusLine ctermfg=15 guifg=#ffffff ctermbg=239 guibg=#4e4e4e cterm=bold gui=bold
|
||||
hi StatusLineNC ctermfg=249 guifg=#b2b2b2 ctermbg=237 guibg=#3a3a3a cterm=none gui=none
|
||||
hi TabLine ctermfg=fg guifg=fg ctermbg=242 guibg=#666666 cterm=none gui=none
|
||||
hi TabLineFill ctermfg=fg guifg=fg ctermbg=237 guibg=#3a3a3a cterm=none gui=none
|
||||
" FIXME
|
||||
hi Title ctermfg=225 guifg=#ffdfff
|
||||
hi Todo ctermfg=0 guifg=#000000 ctermbg=184 guibg=#dfdf00
|
||||
hi Underlined ctermfg=39 guifg=#00afff cterm=underline gui=underline
|
||||
hi VertSplit ctermfg=237 guifg=#3a3a3a ctermbg=237 guibg=#3a3a3a cterm=none gui=none
|
||||
" hi VIsualNOS ctermfg=24 guifg=#005f87 ctermbg=153 guibg=#afdfff cterm=none gui=none
|
||||
" hi Visual ctermfg=24 guifg=#005f87 ctermbg=153 guibg=#afdfff
|
||||
hi Visual ctermfg=255 guifg=#eeeeee ctermbg=96 guibg=#875f87
|
||||
" hi Visual ctermfg=255 guifg=#eeeeee ctermbg=24 guibg=#005f87
|
||||
hi VisualNOS ctermfg=255 guifg=#eeeeee ctermbg=60 guibg=#5f5f87
|
||||
hi WildMenu ctermfg=0 guifg=#000000 ctermbg=150 guibg=#afdf87 cterm=bold gui=bold
|
||||
|
||||
"" Syntax highlighting {{{2
|
||||
hi Comment ctermfg=244 guifg=#808080
|
||||
hi Constant ctermfg=229 guifg=#ffffaf
|
||||
hi Identifier ctermfg=182 guifg=#dfafdf cterm=none
|
||||
hi Ignore ctermfg=238 guifg=#444444
|
||||
hi Number ctermfg=180 guifg=#dfaf87
|
||||
hi PreProc ctermfg=150 guifg=#afdf87
|
||||
hi Special ctermfg=174 guifg=#df8787
|
||||
hi Statement ctermfg=110 guifg=#87afdf cterm=none gui=none
|
||||
hi Type ctermfg=146 guifg=#afafdf cterm=none gui=none
|
||||
|
||||
"" Special {{{2
|
||||
""" .diff {{{3
|
||||
hi diffAdded ctermfg=150 guifg=#afdf87
|
||||
hi diffRemoved ctermfg=174 guifg=#df8787
|
||||
""" vimdiff {{{3
|
||||
hi diffAdd ctermfg=bg guifg=bg ctermbg=151 guibg=#afdfaf
|
||||
"hi diffDelete ctermfg=bg guifg=bg ctermbg=186 guibg=#dfdf87 cterm=none gui=none
|
||||
hi diffDelete ctermfg=bg guifg=bg ctermbg=246 guibg=#949494 cterm=none gui=none
|
||||
hi diffChange ctermfg=bg guifg=bg ctermbg=181 guibg=#dfafaf
|
||||
hi diffText ctermfg=bg guifg=bg ctermbg=174 guibg=#df8787 cterm=none gui=none
|
||||
""" HTML {{{3
|
||||
" hi htmlTag ctermfg=146 guifg=#afafdf
|
||||
" hi htmlEndTag ctermfg=146 guifg=#afafdf
|
||||
hi htmlTag ctermfg=244
|
||||
hi htmlEndTag ctermfg=244
|
||||
hi htmlArg ctermfg=182 guifg=#dfafdf
|
||||
hi htmlValue ctermfg=187 guifg=#dfdfaf
|
||||
hi htmlTitle ctermfg=254 ctermbg=95
|
||||
" hi htmlArg ctermfg=146
|
||||
" hi htmlTagName ctermfg=146
|
||||
" hi htmlString ctermfg=187
|
||||
""" django {{{3
|
||||
hi djangoVarBlock ctermfg=180
|
||||
hi djangoTagBlock ctermfg=150
|
||||
hi djangoStatement ctermfg=146
|
||||
hi djangoFilter ctermfg=174
|
||||
""" python {{{3
|
||||
hi pythonExceptions ctermfg=174
|
||||
""" NERDTree {{{3
|
||||
hi Directory ctermfg=110 guifg=#87afdf
|
||||
hi treeCWD ctermfg=180 guifg=#dfaf87
|
||||
hi treeClosable ctermfg=174 guifg=#df8787
|
||||
hi treeOpenable ctermfg=150 guifg=#afdf87
|
||||
hi treePart ctermfg=244 guifg=#808080
|
||||
hi treeDirSlash ctermfg=244 guifg=#808080
|
||||
hi treeLink ctermfg=182 guifg=#dfafdf
|
||||
|
||||
""" VimDebug {{{3
|
||||
" FIXME
|
||||
" you may want to set SignColumn highlight in your .vimrc
|
||||
" :help sign
|
||||
" :help SignColumn
|
||||
|
||||
" hi currentLine term=reverse cterm=reverse gui=reverse
|
||||
" hi breakPoint term=NONE cterm=NONE gui=NONE
|
||||
" hi empty term=NONE cterm=NONE gui=NONE
|
||||
|
||||
" sign define currentLine linehl=currentLine
|
||||
" sign define breakPoint linehl=breakPoint text=>>
|
||||
" sign define both linehl=currentLine text=>>
|
||||
" sign define empty linehl=empty
|
||||
|
294
home/.vim/doc/gist-vim.txt
Normal file
294
home/.vim/doc/gist-vim.txt
Normal file
@ -0,0 +1,294 @@
|
||||
*Gist.vim* Vimscript for creating gists (http://gist.github.com)
|
||||
|
||||
Usage |gist-vim-usage|
|
||||
Tips |gist-vim-tips|
|
||||
License |gist-vim-license|
|
||||
Install |gist-vim-install|
|
||||
Requirements |gist-vim-requirements|
|
||||
Setup |gist-vim-setup|
|
||||
FAQ |gist-vim-faq|
|
||||
|
||||
This is a vimscript for creating gists (http://gist.github.com)
|
||||
|
||||
For the latest version please see https://github.com/mattn/gist-vim.
|
||||
|
||||
==============================================================================
|
||||
USAGE *:Gist* *gist-vim-usage*
|
||||
|
||||
- Post current buffer to gist, using default privacy option. >
|
||||
|
||||
:Gist
|
||||
<
|
||||
- Post selected text to gist, using default privacy option.
|
||||
This applies to all permutations listed below (except multi). >
|
||||
|
||||
:'<,'>Gist
|
||||
<
|
||||
- Create a private gist. >
|
||||
|
||||
:Gist -p
|
||||
<
|
||||
- Create a public gist.
|
||||
(Only relevant if you've set gists to be private by default.) >
|
||||
|
||||
:Gist -P
|
||||
<
|
||||
- Post whole text to gist as public.
|
||||
This is only relevant if you've set gists to be private by default.
|
||||
>
|
||||
:Gist -P
|
||||
<
|
||||
- Create a gist anonymously. >
|
||||
|
||||
:Gist -a
|
||||
<
|
||||
- Create a gist with all open buffers. >
|
||||
|
||||
:Gist -m
|
||||
<
|
||||
- Edit the gist (you need to have opened the gist buffer first).
|
||||
You can update the gist with the {:w} command within the gist buffer. >
|
||||
|
||||
:Gist -e
|
||||
<
|
||||
- Edit the gist with name "foo.js" (you need to have opened the gist buffer
|
||||
first). >
|
||||
|
||||
:Gist -e foo.js
|
||||
<
|
||||
- Post/Edit with the description " (you need to have opened the gist buffer
|
||||
first). >
|
||||
|
||||
:Gist -s something
|
||||
:Gist -e -s something
|
||||
<
|
||||
- Delete the gist (you need to have opened the gist buffer first).
|
||||
Password authentication is needed. >
|
||||
|
||||
:Gist -d
|
||||
<
|
||||
- Fork the gist (you need to have opened the gist buffer first).
|
||||
Password authentication is needed. >
|
||||
|
||||
:Gist -f
|
||||
<
|
||||
- Star the gist (you need to have opened the gist buffer first).
|
||||
Password authentication is needed.
|
||||
>
|
||||
:Gist +1
|
||||
<
|
||||
- Unstar the gist (you need to have opened the gist buffer first).
|
||||
Password authentication is needed.
|
||||
>
|
||||
:Gist -1
|
||||
<
|
||||
- Get gist XXXXX. >
|
||||
|
||||
:Gist XXXXX
|
||||
<
|
||||
- Get gist XXXXX and add to clipboard. >
|
||||
|
||||
:Gist -c XXXXX
|
||||
<
|
||||
- List your public gists. >
|
||||
|
||||
:Gist -l
|
||||
<
|
||||
- List gists from user "mattn". >
|
||||
|
||||
:Gist -l mattn
|
||||
<
|
||||
- List everyone's gists. >
|
||||
|
||||
:Gist -la
|
||||
<
|
||||
- List gists from your starred gists.
|
||||
>
|
||||
:Gist -ls
|
||||
<
|
||||
==============================================================================
|
||||
TIPS *gist-vim-tips*
|
||||
|
||||
If you set "g:gist_clip_command", gist.vim will copy the gist code with option
|
||||
"-c".
|
||||
|
||||
- Mac: >
|
||||
let g:gist_clip_command = 'pbcopy'
|
||||
<
|
||||
- Linux: >
|
||||
let g:gist_clip_command = 'xclip -selection clipboard'
|
||||
<
|
||||
- Others (cygwin?): >
|
||||
let g:gist_clip_command = 'putclip'
|
||||
<
|
||||
If you want to detect filetype from the filename: >
|
||||
|
||||
let g:gist_detect_filetype = 1
|
||||
<
|
||||
If you want to open the browser after the post: >
|
||||
|
||||
let g:gist_open_browser_after_post = 1
|
||||
<
|
||||
If you want to change the browser: >
|
||||
|
||||
let g:gist_browser_command = 'w3m %URL%'
|
||||
<
|
||||
or: >
|
||||
|
||||
let g:gist_browser_command = 'opera %URL% &'
|
||||
<
|
||||
On windows, this should work with your user settings.
|
||||
|
||||
If you want to show your private gists with ":Gist -l": >
|
||||
|
||||
let g:gist_show_privates = 1
|
||||
<
|
||||
If you want your gist to be private by default: >
|
||||
|
||||
let g:gist_post_private = 1
|
||||
|
||||
<
|
||||
If you want to edit all files for gists containing more than one: >
|
||||
|
||||
let g:gist_get_multiplefile = 1
|
||||
<
|
||||
|
||||
If you want to use on GitHub Enterprise: >
|
||||
|
||||
let g:gist_api_url = 'http://your-github-enterprise-domain/api/v3'
|
||||
<
|
||||
|
||||
If you want to update a gist, embed >
|
||||
|
||||
GistID: xxxxx
|
||||
>
|
||||
in your local file, then call >
|
||||
|
||||
:Gist
|
||||
>
|
||||
|
||||
If you want to update a gist when only |:w!|: >
|
||||
|
||||
" :w and :w! update a gist.
|
||||
let g:gist_update_on_write = 1
|
||||
|
||||
" Only :w! updates a gist.
|
||||
let g:gist_update_on_write = 2
|
||||
>
|
||||
All other values are treated as 1.
|
||||
This variable's value is 1 by default.
|
||||
|
||||
==============================================================================
|
||||
LICENSE *gist-vim-license*
|
||||
|
||||
|
||||
Copyright 2010 by Yasuhiro Matsumoto
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
==============================================================================
|
||||
INSTALL *gist-vim-install*
|
||||
|
||||
Copy following files into your plugin directory.
|
||||
|
||||
rtp:
|
||||
- autoload/gist.vim
|
||||
- plugin/gist.vim
|
||||
|
||||
If you want to uninstall gist.vim, remember to also remove `~/.gist-vim`.
|
||||
|
||||
You need to install webapi-vim also:
|
||||
|
||||
http://www.vim.org/scripts/script.php?script_id=4019
|
||||
|
||||
If you want to use latest one:
|
||||
|
||||
https://github.com/mattn/webapi-vim
|
||||
|
||||
==============================================================================
|
||||
REQUIREMENTS *gist-vim-requirements*
|
||||
|
||||
- curl command (http://curl.haxx.se/)
|
||||
- webapi-vim (https://github.com/mattn/webapi-vim)
|
||||
- and, if you want to use your git profile, the git command-line client.
|
||||
|
||||
==============================================================================
|
||||
SETUP *gist-vim-setup*
|
||||
|
||||
This plugin uses GitHub API v3. Setting value is stored in `~/.gist-vim`.
|
||||
gist-vim have two ways to access APIs.
|
||||
|
||||
First, you need to set your GitHub username in global git config:
|
||||
>
|
||||
$ git config --global github.user Username
|
||||
<
|
||||
Then, gist.vim will ask for your password to create an authorization when you
|
||||
first use it. The password is not stored and only the OAuth access token will
|
||||
be kept for later use. You can revoke the token at any time from the list of
|
||||
"Authorized applications" on GitHub's "Account Settings" page.
|
||||
(https://github.com/settings/applications)
|
||||
|
||||
If you have two-factor authentication enabled on GitHub, you'll see the message
|
||||
"Must specify two-factor authentication OTP code." In this case, you need to
|
||||
create a "Personal Access Token" on GitHub's "Account Settings" page
|
||||
(https://github.com/settings/applications) and place it in a file
|
||||
named ~/.gist-vim like this:
|
||||
>
|
||||
token xxxxx
|
||||
<
|
||||
If you happen to have your password already written in ~/.gitconfig like
|
||||
below:
|
||||
>
|
||||
[github]
|
||||
password = xxxxx
|
||||
<
|
||||
Then, add following into your ~/.vimrc
|
||||
>
|
||||
let g:gist_use_password_in_gitconfig = 1
|
||||
<
|
||||
This is not secure at all, so strongly discouraged.
|
||||
|
||||
==============================================================================
|
||||
FAQ *gist-vim-faq*
|
||||
|
||||
Q. :Gist give Forbidden error
|
||||
A. Try to delete ~/.gist-vim. And authenticate again.
|
||||
|
||||
==============================================================================
|
||||
THANKS *gist-vim-thanks*
|
||||
|
||||
AD7six
|
||||
Bruno Bigras
|
||||
c9s
|
||||
Daniel Bretoi
|
||||
Jeremy Michael Cantrell
|
||||
Kien N
|
||||
kongo2002
|
||||
MATSUU Takuto
|
||||
Matthew Weier O'Phinney
|
||||
ornicar
|
||||
Roland Schilter
|
||||
steve
|
||||
tyru
|
||||
Will Gray
|
||||
netj
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
260
home/.vim/doc/recoverPlugin.txt
Normal file
260
home/.vim/doc/recoverPlugin.txt
Normal file
@ -0,0 +1,260 @@
|
||||
*recover.vim* Show differences for recovered files
|
||||
|
||||
Author: Christian Brabandt <cb@256bit.org>
|
||||
Version: 0.18 Wed, 14 Aug 2013 22:39:13 +0200
|
||||
Copyright: (c) 2009, 2010, 2011, 2012, 2013 by Christian Brabandt
|
||||
The VIM LICENSE applies to recoverPlugin.vim and recoverPlugin.txt
|
||||
(see |copyright|) except use recoverPlugin instead of "Vim".
|
||||
NO WARRANTY, EXPRESS OR IMPLIED. USE AT-YOUR-OWN-RISK.
|
||||
|
||||
|
||||
==============================================================================
|
||||
1. Contents *RecoverPlugin*
|
||||
|
||||
1. Contents.....................................: |recoverPlugin|
|
||||
2. recover Manual...............................: |recover-manual|
|
||||
3. recover Feedback.............................: |recover-feedback|
|
||||
4. recover History..............................: |recover-history|
|
||||
|
||||
==============================================================================
|
||||
*RecoverPlugin-manual*
|
||||
2. RecoverPlugin Manual *recover-manual*
|
||||
|
||||
Functionality
|
||||
|
||||
When using |recovery|, it is hard to tell, what has been changed between the
|
||||
recovered file and the actual on disk version. The aim of this plugin is, to
|
||||
have an easy way to see differences, between the recovered files and the files
|
||||
stored on disk.
|
||||
|
||||
Therefore this plugin sets up an auto command, that will create a diff buffer
|
||||
between the recovered file and the on-disk version of the same file. You can
|
||||
easily see, what has been changed and save your recovered work back to the
|
||||
file on disk.
|
||||
|
||||
By default this plugin is enabled. To disable it, use >
|
||||
:RecoverPluginDisable
|
||||
<
|
||||
To enable this plugin again, use >
|
||||
:RecoverPluginEnable
|
||||
<
|
||||
When you open a file and vim detects, that an |swap-file| already exists for a
|
||||
buffer, the plugin presents the default Swap-Exists dialog from Vim adding one
|
||||
additional option for Diffing (but leaves out the lengthy explanation about
|
||||
handling Swapfiles that Vim by default shows): >
|
||||
|
||||
Found a swap file by the name "test/normal/.testfile.swp"
|
||||
owned by: chrisbra dated: Wed Nov 28 16:26:42 2012
|
||||
file name: ~chrisbra/code/git/vim/Recover/test/normal/testfile
|
||||
modified: YES
|
||||
user name: chrisbra host name: R500
|
||||
process ID: 4878 [not existing]
|
||||
While opening file "test/normal/testfile"
|
||||
dated: Tue Nov 6 20:11:55 2012
|
||||
Please choose:
|
||||
D[i]ff, (O)pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort, (D)elete:
|
||||
|
||||
|
||||
(Note, that additionally, it shows in the process ID row the name of the
|
||||
process that has the process id or [not existing] if that process doesn't
|
||||
exist.) Simply use the key, that is highlighted to chose the option. If you
|
||||
press Ctrl-C, the default dialog of Vim will be shown.
|
||||
|
||||
If you have said 'Diff', the plugin opens a new vertical splitt buffer. On the
|
||||
left side, you'll find the file as it is stored on disk and the right side
|
||||
will contain your recovered version of the file (using the found swap file).
|
||||
|
||||
You can now use the |merge| commands to copy the contents to the buffer that
|
||||
holds your recovered version. If you are finished, you can close the diff
|
||||
version and close the window, by issuing |:diffoff!| and |:close| in the
|
||||
window, that contains the on-disk version of the file. Be sure to save the
|
||||
recovered version of you file and afterwards you can safely remove the swap
|
||||
file.
|
||||
*RecoverPluginFinish* *FinishRecovery*
|
||||
In the recovered window, the command >
|
||||
:FinishRecovery
|
||||
<
|
||||
deletes the swapfile closes the diff window and finishes everything up.
|
||||
|
||||
Alternatively you can also use the command >
|
||||
:RecoveryPluginFinish
|
||||
<
|
||||
*RecoverPluginHelp*
|
||||
The command >
|
||||
:RecoverPluginHelp
|
||||
<
|
||||
show a small message, on what keys can be used to move to the next different
|
||||
region and how to merge the changes from one windo into the other.
|
||||
|
||||
*RecovePlugin-config*
|
||||
If you want Vim to automatically edit any file that is open in another Vim
|
||||
instance but is unmodified there, you need to set the configuration variable:
|
||||
g:RecoverPlugin_Edit_Unmodified to 1 like this in your |.vimrc| >
|
||||
|
||||
:let g:RecoverPlugin_Edit_Unmodified = 1
|
||||
<
|
||||
Note: This only works on Linux.
|
||||
|
||||
*RecoverPlugin-misc*
|
||||
If your Vim was built with |+balloon_eval|, recover.vim will also set up an
|
||||
balloon expression, that shows you, which buffer contains the recovered
|
||||
version of your file and which buffer contains the unmodified on-disk version
|
||||
of your file, if you move the mouse of the buffer. (See |balloon-eval|).
|
||||
|
||||
If you have setup your 'statusline', recover.vim will also inject some info
|
||||
(which buffer contains the on-disk version and which buffer contains the
|
||||
modified, recovered version). Additionally the buffer that is read-only, will
|
||||
have a filename (|:f|) of something like 'original file (on disk-version)'. If
|
||||
you want to save that version, use |:saveas|.
|
||||
|
||||
==============================================================================
|
||||
3. Plugin Feedback *recover-feedback*
|
||||
|
||||
Feedback is always welcome. If you like the plugin, please rate it at the
|
||||
vim-page:
|
||||
http://www.vim.org/scripts/script.php?script_id=3068
|
||||
|
||||
You can also follow the development of the plugin at github:
|
||||
http://github.com/chrisbra/Recover.vim
|
||||
|
||||
Please don't hesitate to report any bugs to the maintainer, mentioned in the
|
||||
third line of this document.
|
||||
|
||||
==============================================================================
|
||||
4. recover History *recover-history*
|
||||
|
||||
0.18: Aug 14, 2013 "{{{1
|
||||
|
||||
- fix issue 19 (https://github.com/chrisbra/Recover.vim/issues/19, by
|
||||
replacing feedkeys("...\n") by feedkeys("...\<cr>", reported by vlmarek,
|
||||
thanks!)
|
||||
- fix issue 20 (https://github.com/chrisbra/Recover.vim/issues/20,
|
||||
(let vim automatically edit a file, that is unmodified in another vim
|
||||
instance, suggested by rking, thanks!)
|
||||
- merge issue 21 (https://github.com/chrisbra/Recover.vim/pull/21, create more
|
||||
usefule README.md file, contribted by Shubham Rao, thanks!)
|
||||
- merge issue 22 (https://github.com/chrisbra/Recover.vim/pull/22, delete BufReadPost autocommand
|
||||
contributed by Marcin Szamotulski, thanks!)
|
||||
|
||||
0.17: Feb 16, 2013 "{{{1
|
||||
|
||||
- fix issue 17 (https://github.com/chrisbra/Recover.vim/issues/17 patch by
|
||||
lyokha, thanks!)
|
||||
- Use default key combinations in the dialog of the normal Vim dialog (adding
|
||||
only the Diff option)
|
||||
- Make sure, the process ID is shown
|
||||
|
||||
0.16: Nov 21, 2012 "{{{1
|
||||
|
||||
- Recovery did not work, when original file did not exists (issue 11
|
||||
https://github.com/chrisbra/Recover.vim/issues/11
|
||||
reported by Rking, thanks!)
|
||||
- By default, delete swapfile, if no differences found (issue 15
|
||||
https://github.com/chrisbra/Recover.vim/issues/15
|
||||
reported by Rking, thanks!)
|
||||
- reset 'swapfile' option, so that Vim by default creates .swp files
|
||||
(idea and patch by Marcin Szamotulski, thanks!)
|
||||
- capture and display |E325| message (and also try to figure out the name of
|
||||
the pid (issue 12 https://github.com/chrisbra/Recover.vim/issues/12)
|
||||
|
||||
0.15: Aug 20, 2012 "{{{1
|
||||
|
||||
- fix issue 5 (https://github.com/chrisbra/Recover.vim/issues/5 patch by
|
||||
lyokha, thanks!)
|
||||
- CheckSwapFileExists() hangs, when a swap file was not found, make sure,
|
||||
s:Swapname() returns a valid file name
|
||||
- fix issue 6 (https://github.com/chrisbra/Recover.vim/issues/6 patch by
|
||||
lyokha, thanks!)
|
||||
- Avoid recursive :redir call (https://github.com/chrisbra/Recover.vim/pull/8
|
||||
patch by Ingo Karkat, thanks!)
|
||||
- Do not set 'bexpr' for unrelated buffers (
|
||||
https://github.com/chrisbra/Recover.vim/pull/9 patch by Ingo Karkat,
|
||||
thanks!)
|
||||
- Avoid aborting the diff (https://github.com/chrisbra/Recover.vim/pull/10
|
||||
patch by Ingo Karkat, thanks!)
|
||||
- Allow to directly delete the swapfile (
|
||||
https://github.com/chrisbra/Recover.vim/issues/7 suggested by jgandt,
|
||||
thanks!)
|
||||
|
||||
0.14: Mar 31, 2012 "{{{1
|
||||
|
||||
- still some problems with issue #4
|
||||
|
||||
0.13: Mar 29, 2012 "{{{1
|
||||
|
||||
- fix issue 3 (https://github.com/chrisbra/Recover.vim/issues/3 reported by
|
||||
lyokha, thanks!)
|
||||
- Ask the user to delete the swapfile (issue
|
||||
https://github.com/chrisbra/Recover.vim/issues/4 reported by lyokha,
|
||||
thanks!)
|
||||
|
||||
0.12: Mar 25, 2012 "{{{1
|
||||
|
||||
- minor documentation update
|
||||
- delete swap files, if no difference found (issue
|
||||
https://github.com/chrisbra/Recover.vim/issues/1 reported by y, thanks!)
|
||||
- fix some small issues, that prevented the development versions from working
|
||||
(https://github.com/chrisbra/Recover.vim/issues/2 reported by Rahul Kumar,
|
||||
thanks!)
|
||||
|
||||
0.11: Oct 19, 2010 "{{{1
|
||||
|
||||
- use confirm() instead of inputdialog() (suggested by D.Fishburn, thanks!)
|
||||
|
||||
0.9: Jun 02, 2010 "{{{1
|
||||
|
||||
- use feedkeys(...,'t') instead of feedkeys() (this works more reliable,
|
||||
although it pollutes the history), so delete those spurious history entries
|
||||
- |RecoverPluginHelp| shows a small help message, about diff commands
|
||||
(suggested by David Fishburn, thanks!)
|
||||
- |RecoverPluginFinish| is a shortcut for |FinishRecovery|
|
||||
|
||||
0.8: Jun 01, 2010 "{{{1
|
||||
|
||||
- make :FinishRecovery more robust
|
||||
|
||||
0.7: Jun 01, 2010 "{{{1
|
||||
|
||||
- |FinishRecovery| closes the diff-window and cleans everything up (suggestion
|
||||
by David Fishburn)
|
||||
- DeleteSwapFile is not needed anymore
|
||||
|
||||
0.6: May 31, 2010 "{{{1
|
||||
|
||||
- |recover-feedback|
|
||||
- Ask to really open a diff buffer for a file (suggestion: David Fishburn,
|
||||
thanks!)
|
||||
- DeleteSwapFile to delete the swap file, that was used to create the diff
|
||||
buffer
|
||||
- change feedkeys(...,'t') to feedkeys('..') so that not every command appears
|
||||
in the history.
|
||||
|
||||
0.5: May 04, 2010 "{{{1
|
||||
|
||||
- 0r command in recover plugin adds extra \n
|
||||
Patch by Sergey Khorev (Thanks!)
|
||||
- generate help file with 'et' set, so the README at github looks prettier
|
||||
|
||||
0.4: Apr 26, 2010 "{{{1
|
||||
|
||||
- handle Windows and Unix path differently
|
||||
- Code cleanup
|
||||
- Enabled |:GLVS|
|
||||
|
||||
0.3: Apr 20, 2010 "{{{1
|
||||
|
||||
- first public verion
|
||||
- put plugin on a public repository
|
||||
(http://github.com/chrisbra/Recover.vim)
|
||||
|
||||
0.2: Apr 18, 2010 "{{{1
|
||||
|
||||
- Internal version, some cleanup, bugfixes for windows
|
||||
|
||||
0.1: Apr 17, 2010 "{{{1
|
||||
|
||||
- Internal version, First working version, using simple commands
|
||||
|
||||
==============================================================================
|
||||
Modeline: "{{{1
|
||||
vim:tw=78:ts=8:ft=help:et:fdm=marker:fdl=0:norl
|
40
home/.vim/doc/tags
Normal file
40
home/.vim/doc/tags
Normal file
@ -0,0 +1,40 @@
|
||||
FinishRecovery recoverPlugin.txt /*FinishRecovery*
|
||||
RecovePlugin-config recoverPlugin.txt /*RecovePlugin-config*
|
||||
RecoverPlugin recoverPlugin.txt /*RecoverPlugin*
|
||||
RecoverPlugin-manual recoverPlugin.txt /*RecoverPlugin-manual*
|
||||
RecoverPlugin-misc recoverPlugin.txt /*RecoverPlugin-misc*
|
||||
RecoverPluginFinish recoverPlugin.txt /*RecoverPluginFinish*
|
||||
RecoverPluginHelp recoverPlugin.txt /*RecoverPluginHelp*
|
||||
bufexplorer bufexplorer.txt /*bufexplorer*
|
||||
bufexplorer-changelog bufexplorer.txt /*bufexplorer-changelog*
|
||||
bufexplorer-copyright bufexplorer.txt /*bufexplorer-copyright*
|
||||
bufexplorer-credits bufexplorer.txt /*bufexplorer-credits*
|
||||
bufexplorer-customization bufexplorer.txt /*bufexplorer-customization*
|
||||
bufexplorer-installation bufexplorer.txt /*bufexplorer-installation*
|
||||
bufexplorer-todo bufexplorer.txt /*bufexplorer-todo*
|
||||
bufexplorer-usage bufexplorer.txt /*bufexplorer-usage*
|
||||
bufexplorer-windowlayout bufexplorer.txt /*bufexplorer-windowlayout*
|
||||
bufexplorer.txt bufexplorer.txt /*bufexplorer.txt*
|
||||
buffer-explorer bufexplorer.txt /*buffer-explorer*
|
||||
g:bufExplorerChgWin bufexplorer.txt /*g:bufExplorerChgWin*
|
||||
g:bufExplorerDefaultHelp bufexplorer.txt /*g:bufExplorerDefaultHelp*
|
||||
g:bufExplorerDetailedHelp bufexplorer.txt /*g:bufExplorerDetailedHelp*
|
||||
g:bufExplorerDisableDefaultKeyMapping bufexplorer.txt /*g:bufExplorerDisableDefaultKeyMapping*
|
||||
g:bufExplorerFindActive bufexplorer.txt /*g:bufExplorerFindActive*
|
||||
g:bufExplorerFuncRef bufexplorer.txt /*g:bufExplorerFuncRef*
|
||||
g:bufExplorerReverseSort bufexplorer.txt /*g:bufExplorerReverseSort*
|
||||
g:bufExplorerShowDirectories bufexplorer.txt /*g:bufExplorerShowDirectories*
|
||||
g:bufExplorerShowNoName bufexplorer.txt /*g:bufExplorerShowNoName*
|
||||
g:bufExplorerShowRelativePath bufexplorer.txt /*g:bufExplorerShowRelativePath*
|
||||
g:bufExplorerShowTabBuffer bufexplorer.txt /*g:bufExplorerShowTabBuffer*
|
||||
g:bufExplorerShowUnlisted bufexplorer.txt /*g:bufExplorerShowUnlisted*
|
||||
g:bufExplorerSortBy bufexplorer.txt /*g:bufExplorerSortBy*
|
||||
g:bufExplorerSplitBelow bufexplorer.txt /*g:bufExplorerSplitBelow*
|
||||
g:bufExplorerSplitHorzSize bufexplorer.txt /*g:bufExplorerSplitHorzSize*
|
||||
g:bufExplorerSplitOutPathName bufexplorer.txt /*g:bufExplorerSplitOutPathName*
|
||||
g:bufExplorerSplitRight bufexplorer.txt /*g:bufExplorerSplitRight*
|
||||
g:bufExplorerSplitVertSize bufexplorer.txt /*g:bufExplorerSplitVertSize*
|
||||
recover-feedback recoverPlugin.txt /*recover-feedback*
|
||||
recover-history recoverPlugin.txt /*recover-history*
|
||||
recover-manual recoverPlugin.txt /*recover-manual*
|
||||
recover.vim recoverPlugin.txt /*recover.vim*
|
6
home/.vim/ftdetect/markdown.vim
Normal file
6
home/.vim/ftdetect/markdown.vim
Normal file
@ -0,0 +1,6 @@
|
||||
autocmd BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mkd,*.mkdn
|
||||
\ if &ft =~# '^\%(conf\|modula2\)$' |
|
||||
\ set ft=markdown |
|
||||
\ else |
|
||||
\ setf markdown |
|
||||
\ endif
|
22
home/.vim/ftplugin/markdown.vim
Normal file
22
home/.vim/ftplugin/markdown.vim
Normal file
@ -0,0 +1,22 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Markdown
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2013 May 30
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
|
||||
|
||||
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s
|
||||
setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
|
||||
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+
|
||||
|
||||
if exists('b:undo_ftplugin')
|
||||
let b:undo_ftplugin .= "|setl cms< com< fo< flp<"
|
||||
else
|
||||
let b:undo_ftplugin = "setl cms< com< fo< flp<"
|
||||
endif
|
||||
|
||||
" vim:set sw=2:
|
23
home/.vim/plugin/gist.vim
Normal file
23
home/.vim/plugin/gist.vim
Normal file
@ -0,0 +1,23 @@
|
||||
"=============================================================================
|
||||
" File: gist.vim
|
||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||
" WebPage: http://github.com/mattn/gist-vim
|
||||
" License: BSD
|
||||
" GetLatestVimScripts: 2423 1 :AutoInstall: gist.vim
|
||||
" script type: plugin
|
||||
|
||||
if &cp || (exists('g:loaded_gist_vim') && g:loaded_gist_vim)
|
||||
finish
|
||||
endif
|
||||
let g:loaded_gist_vim = 1
|
||||
|
||||
function! s:CompleteArgs(arg_lead,cmdline,cursor_pos)
|
||||
return ["-p", "-P", "-a", "-m", "-e", "-s", "-d", "+1", "-1", "-f", "-c", "-l", "-la", "-ls",
|
||||
\ "--listall", "--liststar", "--list", "--multibuffer", "--private", "--public", "--anonymous", "--description", "--clipboard",
|
||||
\ "--rawurl", "--delete", "--edit", "--star", "--unstar", "--fork"
|
||||
\ ]
|
||||
endfunction
|
||||
|
||||
command! -nargs=? -range=% -complete=customlist,s:CompleteArgs Gist :call gist#Gist(<count>, <line1>, <line2>, <f-args>)
|
||||
|
||||
" vim:set et:
|
34
home/.vim/plugin/recover.vim
Normal file
34
home/.vim/plugin/recover.vim
Normal file
@ -0,0 +1,34 @@
|
||||
" Vim plugin for diffing when swap file was found
|
||||
" Last Change: Wed, 14 Aug 2013 22:39:13 +0200
|
||||
" Version: 0.18
|
||||
" Author: Christian Brabandt <cb@256bit.org>
|
||||
" Script: http://www.vim.org/scripts/script.php?script_id=3068
|
||||
" License: VIM License
|
||||
" GetLatestVimScripts: 3068 17 :AutoInstall: recover.vim
|
||||
" Documentation: see :h recoverPlugin.txt
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Load Once: {{{1
|
||||
if exists("g:loaded_recover") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_recover = 1"}}}
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Public Interface {{{1
|
||||
" Define User-Commands and Autocommand "{{{
|
||||
call recover#Recover(1)
|
||||
|
||||
com! RecoverPluginEnable :call recover#Recover(1)
|
||||
com! RecoverPluginDisable :call recover#Recover(0)
|
||||
com! RecoverPluginHelp :call recover#Help()
|
||||
|
||||
" =====================================================================
|
||||
" Restoration And Modelines: {{{1
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" Modeline {{{1
|
||||
" vim: fdm=marker sw=2 sts=2 ts=8 fdl=0
|
375
home/.vim/plugin/tasklist.vim
Normal file
375
home/.vim/plugin/tasklist.vim
Normal file
@ -0,0 +1,375 @@
|
||||
"------------------------------------------------------------------------------
|
||||
" Name Of File: tasklist.vim
|
||||
"
|
||||
" Description: Vim plugin to search for a list of tokens and display a
|
||||
" window with matches.
|
||||
"
|
||||
" Author: Juan Frias (juandfrias at gmail.com)
|
||||
"
|
||||
" Last Change: 2009 Apr 11
|
||||
" Version: 1.0.1
|
||||
"
|
||||
" Copyright: Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this header
|
||||
" is included with it.
|
||||
"
|
||||
" This script is to be distributed freely in the hope that it
|
||||
" will be useful, but is provided 'as is' and without warranties
|
||||
" as to performance of merchantability or any other warranties
|
||||
" whether expressed or implied. Because of the various hardware
|
||||
" and software environments into which this script may be put,
|
||||
" no warranty of fitness for a particular purpose is offered.
|
||||
"
|
||||
" GOOD DATA PROCESSING PROCEDURE DICTATES THAT ANY SCRIPT BE
|
||||
" THOROUGHLY TESTED WITH NON-CRITICAL DATA BEFORE RELYING ON IT.
|
||||
"
|
||||
" THE USER MUST ASSUME THE ENTIRE RISK OF USING THE SCRIPT.
|
||||
"
|
||||
" The author does not retain any liability on any damage caused
|
||||
" through the use of this script.
|
||||
"
|
||||
" Install: 1. Read the section titled 'Options'
|
||||
" 2. Setup any variables need in your vimrc file
|
||||
" 3. Copy 'tasklist.vim' to your plugin directory.
|
||||
"
|
||||
" Mapped Keys: <Leader>t Display list.
|
||||
"
|
||||
" Usage: Start the script with the mapped key, a new window appears
|
||||
" with the matches found, moving around the window will also
|
||||
" update the position of the current document.
|
||||
"
|
||||
" The following keys are mapped to the results window:
|
||||
"
|
||||
" q - Quit, and restore original cursor position.
|
||||
"
|
||||
" e - Exit, and keep results window open note that
|
||||
" movements on the result window will no longer be
|
||||
" updated.
|
||||
"
|
||||
" <cr> - Quit and place the cursor on the selected line.
|
||||
"
|
||||
" Aknowledgments: Many thanks to Zhang Shuhan for taking the time to beta
|
||||
" test and suggest many of the improvements and features
|
||||
" found in the script. I don't think I would have
|
||||
" implemented it wihout his help. Thanks!
|
||||
"
|
||||
"------------------------------------------------------------------------------
|
||||
" Please send me any bugs you find, so I can keep the script up to date.
|
||||
"------------------------------------------------------------------------------
|
||||
|
||||
" History: {{{1
|
||||
"------------------------------------------------------------------------------
|
||||
"
|
||||
" 1.00 Initial version.
|
||||
"
|
||||
" User Options: {{{1
|
||||
"------------------------------------------------------------------------------
|
||||
"
|
||||
" <Leader>t
|
||||
" This is the default key map to view the task list.
|
||||
" to overwrite use something like:
|
||||
" map <leader>v <Plug>TaskList
|
||||
" in your vimrc file
|
||||
"
|
||||
" g:tlWindowPosition
|
||||
" This is specifies the position of the window to be opened. By
|
||||
" default it will open at on top. To overwrite use:
|
||||
" let g:tlWindowPosition = 1
|
||||
" in your vimrc file, options are as follows:
|
||||
" 0 = Open on top
|
||||
" 1 = Open on the bottom
|
||||
"
|
||||
" g:tlTokenList
|
||||
" This is the list of tokens to search for default is
|
||||
" 'FIXME TODO XXX'. The results are groupped and displayed in the
|
||||
" order that they appear. to overwrite use:
|
||||
" let g:tlTokenList = ['TOKEN1', 'TOKEN2', 'TOKEN3']
|
||||
" in your vimrc file
|
||||
"
|
||||
" g:tlRememberPosition
|
||||
" If this is set to 1 then the script will try to get back to the
|
||||
" position where it last was closed. By default it will find the line
|
||||
" closest to the current cursor position.
|
||||
" to overwrite use:
|
||||
" let g:tlRememberPosition = 1
|
||||
" in your vimrc file
|
||||
"
|
||||
|
||||
" Global variables: {{{1
|
||||
"------------------------------------------------------------------------------
|
||||
|
||||
" Load script once
|
||||
"------------------------------------------------------------------------------
|
||||
if exists("g:loaded_tasklist") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_tasklist = 1
|
||||
|
||||
" Set where the window opens
|
||||
"------------------------------------------------------------------------------
|
||||
if !exists('g:tlWindowPosition')
|
||||
" 0 = Open at top
|
||||
let g:tlWindowPosition = 0
|
||||
endif
|
||||
|
||||
" Set the token list
|
||||
"------------------------------------------------------------------------------
|
||||
if !exists('g:tlTokenList')
|
||||
" default list of tokens
|
||||
let g:tlTokenList = ["FIXME", "TODO", "XXX"]
|
||||
endif
|
||||
|
||||
" Remember position
|
||||
"------------------------------------------------------------------------------
|
||||
if !exists('g:tlRememberPosition')
|
||||
" 0 = Donot remember, find closest match
|
||||
let g:tlRememberPosition = 0
|
||||
endif
|
||||
|
||||
" Script variables: {{{1
|
||||
"------------------------------------------------------------------------------
|
||||
|
||||
" Function: Open Window {{{1
|
||||
"--------------------------------------------------------------------------
|
||||
function! s:OpenWindow(buffnr, lineno)
|
||||
" Open results window and place items there.
|
||||
if g:tlWindowPosition == 0
|
||||
execute 'sp -TaskList_'.a:buffnr.'-'
|
||||
else
|
||||
execute 'botright sp -TaskList_'.a:buffnr.'-'
|
||||
endif
|
||||
|
||||
let b:original_buffnr = a:buffnr
|
||||
let b:original_line = a:lineno
|
||||
|
||||
set noswapfile
|
||||
set modifiable
|
||||
normal! "zPGddgg
|
||||
set fde=getline(v:lnum)[0]=='L'
|
||||
set foldmethod=expr
|
||||
set foldlevel=0
|
||||
normal! zR
|
||||
|
||||
" Resize line if too big.
|
||||
let l:hits = line("$")
|
||||
if l:hits < winheight(0)
|
||||
sil! exe "resize ".l:hits
|
||||
endif
|
||||
|
||||
" Clean up.
|
||||
let @z = ""
|
||||
set nomodified
|
||||
endfunction
|
||||
|
||||
" Function: Search file {{{1
|
||||
"--------------------------------------------------------------------------
|
||||
function! s:SearchFile(hits, word)
|
||||
" Search at the beginning and keep adding them to the register
|
||||
let l:match_count = 0
|
||||
normal! gg0
|
||||
let l:max = strlen(line('$'))
|
||||
let l:last_match = -1
|
||||
let l:div = 0
|
||||
while search(a:word, "Wc") > 0
|
||||
let l:curr_line = line('.')
|
||||
if l:last_match == l:curr_line
|
||||
if l:curr_line == line('$')
|
||||
break
|
||||
endif
|
||||
normal! j0
|
||||
continue
|
||||
endif
|
||||
let l:last_match = l:curr_line
|
||||
if foldlevel(l:curr_line) != 0
|
||||
normal! 99zo
|
||||
endif
|
||||
if l:div == 0
|
||||
if a:hits != 0
|
||||
let @z = @z."\n"
|
||||
endif
|
||||
let l:div = 1
|
||||
endif
|
||||
normal! 0
|
||||
let l:lineno = ' '.l:curr_line
|
||||
let @z = @z.'Ln '.strpart(l:lineno, strlen(l:lineno) - l:max).': '
|
||||
let l:text = getline(".")
|
||||
let @z = @z.strpart(l:text, stridx(l:text, a:word))
|
||||
let @z = @z."\n"
|
||||
normal! $
|
||||
let l:match_count = l:match_count + 1
|
||||
endwhile
|
||||
return l:match_count
|
||||
endfunction
|
||||
|
||||
" Function: Get line number {{{1
|
||||
"--------------------------------------------------------------------------
|
||||
function! s:LineNumber()
|
||||
let l:text = getline(".")
|
||||
if strpart(l:text, 0, 5) == "File:"
|
||||
return 0
|
||||
endif
|
||||
if strlen(l:text) == 0
|
||||
return -1
|
||||
endif
|
||||
let l:num = matchstr(l:text, '[0-9]\+')
|
||||
if l:num == ''
|
||||
return -1
|
||||
endif
|
||||
return l:num
|
||||
endfunction
|
||||
|
||||
" Function: Update document position {{{1
|
||||
"--------------------------------------------------------------------------
|
||||
function! s:UpdateDoc()
|
||||
let l:line_hit = <sid>LineNumber()
|
||||
|
||||
match none
|
||||
if l:line_hit == -1
|
||||
redraw
|
||||
return
|
||||
endif
|
||||
|
||||
let l:buffnr = b:original_buffnr
|
||||
exe 'match Search /\%'.line(".").'l.*/'
|
||||
if line(".") < (line("$") - (winheight(0) / 2)) + 1
|
||||
normal! zz
|
||||
endif
|
||||
execute bufwinnr(l:buffnr)." wincmd w"
|
||||
match none
|
||||
if l:line_hit == 0
|
||||
normal! 1G
|
||||
else
|
||||
exe "normal! ".l:line_hit."Gzz"
|
||||
exe 'match Search /\%'.line(".").'l.*/'
|
||||
endif
|
||||
execute bufwinnr('-TaskList_'.l:buffnr.'-')." wincmd w"
|
||||
redraw
|
||||
endfunction
|
||||
|
||||
" Function: Clean up on exit {{{1
|
||||
"--------------------------------------------------------------------------
|
||||
function! s:Exit(key)
|
||||
|
||||
call <sid>UpdateDoc()
|
||||
match none
|
||||
|
||||
let l:original_line = b:original_line
|
||||
let l:last_position = line('.')
|
||||
|
||||
if a:key == -1
|
||||
nunmap <buffer> e
|
||||
nunmap <buffer> q
|
||||
nunmap <buffer> <cr>
|
||||
execute bufwinnr(b:original_buffnr)." wincmd w"
|
||||
else
|
||||
bd!
|
||||
endif
|
||||
|
||||
let b:last_position = l:last_position
|
||||
|
||||
if a:key == 0
|
||||
exe "normal! ".l:original_line."G"
|
||||
endif
|
||||
|
||||
match none
|
||||
normal! zz
|
||||
|
||||
execute "set updatetime=".s:old_updatetime
|
||||
endfunction
|
||||
|
||||
" Function: Check for screen update {{{1
|
||||
"--------------------------------------------------------------------------
|
||||
function! s:CheckForUpdate()
|
||||
if stridx(expand("%:t"), '-TaskList_') == -1
|
||||
return
|
||||
endif
|
||||
if b:selected_line != line(".")
|
||||
call <sid>UpdateDoc()
|
||||
let b:selected_line = line(".")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Function: Start the search. {{{1
|
||||
"--------------------------------------------------------------------------
|
||||
function! s:TaskList()
|
||||
let l:original_buffnr = bufnr('%')
|
||||
let l:original_line = line(".")
|
||||
|
||||
" last position
|
||||
if !exists('b:last_position')
|
||||
let b:last_position = 1
|
||||
endif
|
||||
let l:last_position = b:last_position
|
||||
|
||||
|
||||
" get file name
|
||||
let @z = "File:".expand("%:p")."\n\n"
|
||||
|
||||
" search file
|
||||
let l:index = 0
|
||||
let l:count = 0
|
||||
let l:hits = 0
|
||||
while l:index < len(g:tlTokenList)
|
||||
let l:search_word = g:tlTokenList[l:index]
|
||||
let l:hits = s:SearchFile(l:hits, l:search_word)
|
||||
let l:count = l:count + l:hits
|
||||
let l:index = l:index + 1
|
||||
endwhile
|
||||
|
||||
" Make sure we at least have one hit.
|
||||
if l:count == 0
|
||||
echohl Search
|
||||
echo "tasklist.vim: No task information found."
|
||||
echohl None
|
||||
execute 'normal! '.l:original_line.'G'
|
||||
return
|
||||
endif
|
||||
|
||||
" display window
|
||||
call s:OpenWindow(l:original_buffnr, l:original_line)
|
||||
|
||||
" restore the cursor position
|
||||
if g:tlRememberPosition != 0
|
||||
exec 'normal! '.l:last_position.'G'
|
||||
else
|
||||
normal! gg
|
||||
endif
|
||||
|
||||
" Map exit keys
|
||||
nnoremap <buffer> <silent> q :call <sid>Exit(0)<cr>
|
||||
nnoremap <buffer> <silent> <cr> :call <sid>Exit(1)<cr>
|
||||
nnoremap <buffer> <silent> e :call <sid>Exit(-1)<cr>
|
||||
|
||||
" Setup syntax highlight {{{
|
||||
syntax match tasklistFileDivider /^File:.*$/
|
||||
syntax match tasklistLineNumber /^Ln\s\+\d\+:/
|
||||
|
||||
highlight def link tasklistFileDivider Title
|
||||
highlight def link tasklistLineNumber LineNr
|
||||
highlight def link tasklistSearchWord Search
|
||||
" }}}
|
||||
|
||||
" Save globals and change updatetime
|
||||
let b:selected_line = line(".")
|
||||
let s:old_updatetime = &updatetime
|
||||
set updatetime=350
|
||||
|
||||
" update the doc and hook the CheckForUpdate function.
|
||||
call <sid>UpdateDoc()
|
||||
au! CursorHold <buffer> nested call <sid>CheckForUpdate()
|
||||
|
||||
endfunction
|
||||
"}}}
|
||||
|
||||
" Command
|
||||
command! TaskList call s:TaskList()
|
||||
|
||||
" Default key map
|
||||
if !hasmapto('<Plug>TaskList')
|
||||
map <unique> <Leader>t <Plug>TaskList
|
||||
endif
|
||||
|
||||
" Key map to Command
|
||||
nnoremap <unique> <script> <Plug>TaskList :TaskList<CR>
|
||||
|
||||
" vim:fdm=marker:tw=75:ff=unix:
|
246
home/.vim/syntax/javascript.vim
Normal file
246
home/.vim/syntax/javascript.vim
Normal file
@ -0,0 +1,246 @@
|
||||
" Vim syntax file
|
||||
" Language: JavaScript
|
||||
" Maintainer: Yi Zhao (ZHAOYI) <zzlinux AT hotmail DOT com>
|
||||
" Last Change: June 4, 2009
|
||||
" Version: 0.7.7
|
||||
" Changes: Add "undefined" as a type keyword
|
||||
"
|
||||
" TODO:
|
||||
" - Add the HTML syntax inside the JSDoc
|
||||
|
||||
if !exists("main_syntax")
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let main_syntax = 'javascript'
|
||||
endif
|
||||
|
||||
"" Drop fold if it set but VIM doesn't support it.
|
||||
let b:javascript_fold='true'
|
||||
if version < 600 " Don't support the old version
|
||||
unlet! b:javascript_fold
|
||||
endif
|
||||
|
||||
"" dollar sigh is permittd anywhere in an identifier
|
||||
setlocal iskeyword+=$
|
||||
|
||||
syntax sync fromstart
|
||||
|
||||
"" JavaScript comments
|
||||
syntax keyword javaScriptCommentTodo TODO FIXME XXX TBD contained
|
||||
syntax region javaScriptLineComment start=+\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell
|
||||
syntax region javaScriptLineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell fold
|
||||
syntax region javaScriptCvsTag start="\$\cid:" end="\$" oneline contained
|
||||
syntax region javaScriptComment start="/\*" end="\*/" contains=javaScriptCommentTodo,javaScriptCvsTag,@Spell fold
|
||||
|
||||
"" JSDoc support start
|
||||
if !exists("javascript_ignore_javaScriptdoc")
|
||||
syntax case ignore
|
||||
|
||||
"" syntax coloring for javadoc comments (HTML)
|
||||
"syntax include @javaHtml <sfile>:p:h/html.vim
|
||||
"unlet b:current_syntax
|
||||
|
||||
syntax region javaScriptDocComment matchgroup=javaScriptComment start="/\*\*\s*$" end="\*/" contains=javaScriptDocTags,javaScriptCommentTodo,javaScriptCvsTag,@javaScriptHtml,@Spell fold
|
||||
syntax match javaScriptDocTags contained "@\(param\|argument\|requires\|exception\|throws\|type\|class\|extends\|see\|link\|member\|module\|method\|title\|namespace\|optional\|default\|base\|file\)\>" nextgroup=javaScriptDocParam,javaScriptDocSeeTag skipwhite
|
||||
syntax match javaScriptDocTags contained "@\(beta\|deprecated\|description\|fileoverview\|author\|license\|version\|returns\=\|constructor\|private\|protected\|final\|ignore\|addon\|exec\)\>"
|
||||
syntax match javaScriptDocParam contained "\%(#\|\w\|\.\|:\|\/\)\+"
|
||||
syntax region javaScriptDocSeeTag contained matchgroup=javaScriptDocSeeTag start="{" end="}" contains=javaScriptDocTags
|
||||
|
||||
syntax case match
|
||||
endif "" JSDoc end
|
||||
|
||||
syntax case match
|
||||
|
||||
"" Syntax in the JavaScript code
|
||||
syntax match javaScriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\."
|
||||
syntax region javaScriptStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=javaScriptSpecial,@htmlPreproc
|
||||
syntax region javaScriptStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=javaScriptSpecial,@htmlPreproc
|
||||
syntax region javaScriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=javaScriptSpecial,@htmlPreproc oneline
|
||||
syntax match javaScriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
|
||||
syntax match javaScriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
||||
syntax match javaScriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
|
||||
|
||||
"" JavaScript Prototype
|
||||
syntax keyword javaScriptPrototype prototype
|
||||
|
||||
"" Programm Keywords
|
||||
syntax keyword javaScriptSource import export
|
||||
syntax keyword javaScriptType const this undefined var void yield
|
||||
syntax keyword javaScriptOperator delete new in instanceof let typeof
|
||||
syntax keyword javaScriptBoolean true false
|
||||
syntax keyword javaScriptNull null
|
||||
|
||||
"" Statement Keywords
|
||||
syntax keyword javaScriptConditional if else
|
||||
syntax keyword javaScriptRepeat do while for
|
||||
syntax keyword javaScriptBranch break continue switch case default return
|
||||
syntax keyword javaScriptStatement try catch throw with finally
|
||||
|
||||
syntax keyword javaScriptGlobalObjects Array Boolean Date Function Infinity JavaArray JavaClass JavaObject JavaPackage Math Number NaN Object Packages RegExp String Undefined java netscape sun
|
||||
|
||||
syntax keyword javaScriptExceptions Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
|
||||
|
||||
syntax keyword javaScriptFutureKeys abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public
|
||||
|
||||
"" DOM/HTML/CSS specified things
|
||||
|
||||
" DOM2 Objects
|
||||
syntax keyword javaScriptGlobalObjects DOMImplementation DocumentFragment Document Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction
|
||||
syntax keyword javaScriptExceptions DOMException
|
||||
|
||||
" DOM2 CONSTANT
|
||||
syntax keyword javaScriptDomErrNo INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR
|
||||
syntax keyword javaScriptDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE
|
||||
|
||||
" HTML events and internal variables
|
||||
syntax case ignore
|
||||
syntax keyword javaScriptHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize
|
||||
syntax case match
|
||||
|
||||
" Follow stuff should be highligh within a special context
|
||||
" While it can't be handled with context depended with Regex based highlight
|
||||
" So, turn it off by default
|
||||
if exists("javascript_enable_domhtmlcss")
|
||||
|
||||
" DOM2 things
|
||||
syntax match javaScriptDomElemAttrs contained /\%(nodeName\|nodeValue\|nodeType\|parentNode\|childNodes\|firstChild\|lastChild\|previousSibling\|nextSibling\|attributes\|ownerDocument\|namespaceURI\|prefix\|localName\|tagName\)\>/
|
||||
syntax match javaScriptDomElemFuncs contained /\%(insertBefore\|replaceChild\|removeChild\|appendChild\|hasChildNodes\|cloneNode\|normalize\|isSupported\|hasAttributes\|getAttribute\|setAttribute\|removeAttribute\|getAttributeNode\|setAttributeNode\|removeAttributeNode\|getElementsByTagName\|getAttributeNS\|setAttributeNS\|removeAttributeNS\|getAttributeNodeNS\|setAttributeNodeNS\|getElementsByTagNameNS\|hasAttribute\|hasAttributeNS\)\>/ nextgroup=javaScriptParen skipwhite
|
||||
" HTML things
|
||||
syntax match javaScriptHtmlElemAttrs contained /\%(className\|clientHeight\|clientLeft\|clientTop\|clientWidth\|dir\|id\|innerHTML\|lang\|length\|offsetHeight\|offsetLeft\|offsetParent\|offsetTop\|offsetWidth\|scrollHeight\|scrollLeft\|scrollTop\|scrollWidth\|style\|tabIndex\|title\)\>/
|
||||
syntax match javaScriptHtmlElemFuncs contained /\%(blur\|click\|focus\|scrollIntoView\|addEventListener\|dispatchEvent\|removeEventListener\|item\)\>/ nextgroup=javaScriptParen skipwhite
|
||||
|
||||
" CSS Styles in JavaScript
|
||||
syntax keyword javaScriptCssStyles contained color font fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight letterSpacing lineBreak lineHeight quotes rubyAlign rubyOverhang rubyPosition
|
||||
syntax keyword javaScriptCssStyles contained textAlign textAlignLast textAutospace textDecoration textIndent textJustify textJustifyTrim textKashidaSpace textOverflowW6 textShadow textTransform textUnderlinePosition
|
||||
syntax keyword javaScriptCssStyles contained unicodeBidi whiteSpace wordBreak wordSpacing wordWrap writingMode
|
||||
syntax keyword javaScriptCssStyles contained bottom height left position right top width zIndex
|
||||
syntax keyword javaScriptCssStyles contained border borderBottom borderLeft borderRight borderTop borderBottomColor borderLeftColor borderTopColor borderBottomStyle borderLeftStyle borderRightStyle borderTopStyle borderBottomWidth borderLeftWidth borderRightWidth borderTopWidth borderColor borderStyle borderWidth borderCollapse borderSpacing captionSide emptyCells tableLayout
|
||||
syntax keyword javaScriptCssStyles contained margin marginBottom marginLeft marginRight marginTop outline outlineColor outlineStyle outlineWidth padding paddingBottom paddingLeft paddingRight paddingTop
|
||||
syntax keyword javaScriptCssStyles contained listStyle listStyleImage listStylePosition listStyleType
|
||||
syntax keyword javaScriptCssStyles contained background backgroundAttachment backgroundColor backgroundImage gackgroundPosition backgroundPositionX backgroundPositionY backgroundRepeat
|
||||
syntax keyword javaScriptCssStyles contained clear clip clipBottom clipLeft clipRight clipTop content counterIncrement counterReset cssFloat cursor direction display filter layoutGrid layoutGridChar layoutGridLine layoutGridMode layoutGridType
|
||||
syntax keyword javaScriptCssStyles contained marks maxHeight maxWidth minHeight minWidth opacity MozOpacity overflow overflowX overflowY verticalAlign visibility zoom cssText
|
||||
syntax keyword javaScriptCssStyles contained scrollbar3dLightColor scrollbarArrowColor scrollbarBaseColor scrollbarDarkShadowColor scrollbarFaceColor scrollbarHighlightColor scrollbarShadowColor scrollbarTrackColor
|
||||
|
||||
" Highlight ways
|
||||
syntax match javaScriptDotNotation "\." nextgroup=javaScriptPrototype,javaScriptDomElemAttrs,javaScriptDomElemFuncs,javaScriptHtmlElemAttrs,javaScriptHtmlElemFuncs
|
||||
syntax match javaScriptDotNotation "\.style\." nextgroup=javaScriptCssStyles
|
||||
|
||||
endif "DOM/HTML/CSS
|
||||
|
||||
"" end DOM/HTML/CSS specified things
|
||||
|
||||
|
||||
"" Code blocks
|
||||
syntax cluster javaScriptAll contains=javaScriptComment,javaScriptLineComment,javaScriptDocComment,javaScriptStringD,javaScriptStringS,javaScriptRegexpString,javaScriptNumber,javaScriptFloat,javaScriptLabel,javaScriptSource,javaScriptType,javaScriptOperator,javaScriptBoolean,javaScriptNull,javaScriptFunction,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptStatement,javaScriptGlobalObjects,javaScriptExceptions,javaScriptFutureKeys,javaScriptDomErrNo,javaScriptDomNodeConsts,javaScriptHtmlEvents,javaScriptDotNotation
|
||||
syntax region javaScriptBracket matchgroup=javaScriptBracket transparent start="\[" end="\]" contains=@javaScriptAll,javaScriptParensErrB,javaScriptParensErrC,javaScriptBracket,javaScriptParen,javaScriptBlock,@htmlPreproc
|
||||
syntax region javaScriptParen matchgroup=javaScriptParen transparent start="(" end=")" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrC,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc
|
||||
syntax region javaScriptBlock matchgroup=javaScriptBlock transparent start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc
|
||||
|
||||
"" catch errors caused by wrong parenthesis
|
||||
syntax match javaScriptParensError ")\|}\|\]"
|
||||
syntax match javaScriptParensErrA contained "\]"
|
||||
syntax match javaScriptParensErrB contained ")"
|
||||
syntax match javaScriptParensErrC contained "}"
|
||||
|
||||
if main_syntax == "javascript"
|
||||
syntax sync clear
|
||||
syntax sync ccomment javaScriptComment minlines=200
|
||||
syntax sync match javaScriptHighlight grouphere javaScriptBlock /{/
|
||||
endif
|
||||
|
||||
"" Fold control
|
||||
if exists("b:javascript_fold")
|
||||
syntax match javaScriptFunction /\<function\>/ nextgroup=javaScriptFuncName skipwhite
|
||||
syntax match javaScriptOpAssign /=\@<!=/ nextgroup=javaScriptFuncBlock skipwhite skipempty
|
||||
syntax region javaScriptFuncName contained matchgroup=javaScriptFuncName start=/\%(\$\|\w\)*\s*(/ end=/)/ contains=javaScriptLineComment,javaScriptComment nextgroup=javaScriptFuncBlock skipwhite skipempty
|
||||
syntax region javaScriptFuncBlock contained matchgroup=javaScriptFuncBlock start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock fold
|
||||
|
||||
if &l:filetype=='javascript' && !&diff
|
||||
" Fold setting
|
||||
" Redefine the foldtext (to show a JS function outline) and foldlevel
|
||||
" only if the entire buffer is JavaScript, but not if JavaScript syntax
|
||||
" is embedded in another syntax (e.g. HTML).
|
||||
setlocal foldmethod=syntax
|
||||
setlocal foldlevel=4
|
||||
endif
|
||||
else
|
||||
syntax keyword javaScriptFunction function
|
||||
setlocal foldmethod<
|
||||
setlocal foldlevel<
|
||||
endif
|
||||
|
||||
" Define the default highlighting.
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||
if version < 508
|
||||
let did_javascript_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
HiLink javaScriptComment Comment
|
||||
HiLink javaScriptLineComment Comment
|
||||
HiLink javaScriptDocComment Comment
|
||||
HiLink javaScriptCommentTodo Todo
|
||||
HiLink javaScriptCvsTag Function
|
||||
HiLink javaScriptDocTags Special
|
||||
HiLink javaScriptDocSeeTag Function
|
||||
HiLink javaScriptDocParam Function
|
||||
HiLink javaScriptStringS String
|
||||
HiLink javaScriptStringD String
|
||||
HiLink javaScriptRegexpString String
|
||||
HiLink javaScriptCharacter Character
|
||||
HiLink javaScriptPrototype Type
|
||||
HiLink javaScriptConditional Conditional
|
||||
HiLink javaScriptBranch Conditional
|
||||
HiLink javaScriptRepeat Repeat
|
||||
HiLink javaScriptStatement Statement
|
||||
HiLink javaScriptFunction Function
|
||||
HiLink javaScriptError Error
|
||||
HiLink javaScriptParensError Error
|
||||
HiLink javaScriptParensErrA Error
|
||||
HiLink javaScriptParensErrB Error
|
||||
HiLink javaScriptParensErrC Error
|
||||
HiLink javaScriptOperator Operator
|
||||
HiLink javaScriptType Type
|
||||
HiLink javaScriptNull Type
|
||||
HiLink javaScriptNumber Number
|
||||
HiLink javaScriptFloat Number
|
||||
HiLink javaScriptBoolean Boolean
|
||||
HiLink javaScriptLabel Label
|
||||
HiLink javaScriptSpecial Special
|
||||
HiLink javaScriptSource Special
|
||||
HiLink javaScriptGlobalObjects Special
|
||||
HiLink javaScriptExceptions Special
|
||||
|
||||
HiLink javaScriptDomErrNo Constant
|
||||
HiLink javaScriptDomNodeConsts Constant
|
||||
HiLink javaScriptDomElemAttrs Label
|
||||
HiLink javaScriptDomElemFuncs PreProc
|
||||
|
||||
HiLink javaScriptHtmlEvents Special
|
||||
HiLink javaScriptHtmlElemAttrs Label
|
||||
HiLink javaScriptHtmlElemFuncs PreProc
|
||||
|
||||
HiLink javaScriptCssStyles Label
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
" Define the htmlJavaScript for HTML syntax html.vim
|
||||
"syntax clear htmlJavaScript
|
||||
"syntax clear javaScriptExpression
|
||||
syntax cluster htmlJavaScript contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError
|
||||
syntax cluster javaScriptExpression contains=@javaScriptAll,javaScriptBracket,javaScriptParen,javaScriptBlock,javaScriptParenError,@htmlPreproc
|
||||
|
||||
let b:current_syntax = "javascript"
|
||||
if main_syntax == 'javascript'
|
||||
unlet main_syntax
|
||||
endif
|
||||
|
||||
" vim: ts=4
|
134
home/.vim/syntax/markdown.vim
Normal file
134
home/.vim/syntax/markdown.vim
Normal file
@ -0,0 +1,134 @@
|
||||
" Vim syntax file
|
||||
" Language: Markdown
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: *.markdown
|
||||
" Last Change: 2013 May 30
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists('main_syntax')
|
||||
let main_syntax = 'markdown'
|
||||
endif
|
||||
|
||||
runtime! syntax/html.vim
|
||||
unlet! b:current_syntax
|
||||
|
||||
if !exists('g:markdown_fenced_languages')
|
||||
let g:markdown_fenced_languages = []
|
||||
endif
|
||||
for s:type in map(copy(g:markdown_fenced_languages),'matchstr(v:val,"[^=]*$")')
|
||||
if s:type =~ '\.'
|
||||
let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*')
|
||||
endif
|
||||
exe 'syn include @markdownHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim'
|
||||
unlet! b:current_syntax
|
||||
endfor
|
||||
unlet! s:type
|
||||
|
||||
syn sync minlines=10
|
||||
syn case ignore
|
||||
|
||||
syn match markdownValid '[<>]\c[a-z/$!]\@!'
|
||||
syn match markdownValid '&\%(#\=\w*;\)\@!'
|
||||
|
||||
syn match markdownLineStart "^[<@]\@!" nextgroup=@markdownBlock,htmlSpecialChar
|
||||
|
||||
syn cluster markdownBlock contains=markdownH1,markdownH2,markdownH3,markdownH4,markdownH5,markdownH6,markdownBlockquote,markdownListMarker,markdownOrderedListMarker,markdownCodeBlock,markdownRule
|
||||
syn cluster markdownInline contains=markdownLineBreak,markdownLinkText,markdownItalic,markdownBold,markdownCode,markdownEscape,@htmlTop,markdownError
|
||||
|
||||
syn match markdownH1 "^.\+\n=\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink
|
||||
syn match markdownH2 "^.\+\n-\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink
|
||||
|
||||
syn match markdownHeadingRule "^[=-]\+$" contained
|
||||
|
||||
syn region markdownH1 matchgroup=markdownHeadingDelimiter start="##\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
|
||||
syn region markdownH2 matchgroup=markdownHeadingDelimiter start="###\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
|
||||
syn region markdownH3 matchgroup=markdownHeadingDelimiter start="####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
|
||||
syn region markdownH4 matchgroup=markdownHeadingDelimiter start="#####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
|
||||
syn region markdownH5 matchgroup=markdownHeadingDelimiter start="######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
|
||||
syn region markdownH6 matchgroup=markdownHeadingDelimiter start="#######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
|
||||
|
||||
syn match markdownBlockquote ">\%(\s\|$\)" contained nextgroup=@markdownBlock
|
||||
|
||||
syn region markdownCodeBlock start=" \|\t" end="$" contained
|
||||
|
||||
" TODO: real nesting
|
||||
syn match markdownListMarker "\%(\t\| \{0,4\}\)[-*+]\%(\s\+\S\)\@=" contained
|
||||
syn match markdownOrderedListMarker "\%(\t\| \{0,4}\)\<\d\+\.\%(\s\+\S\)\@=" contained
|
||||
|
||||
syn match markdownRule "\* *\* *\*[ *]*$" contained
|
||||
syn match markdownRule "- *- *-[ -]*$" contained
|
||||
|
||||
syn match markdownLineBreak " \{2,\}$"
|
||||
|
||||
syn region markdownIdDeclaration matchgroup=markdownLinkDelimiter start="^ \{0,3\}!\=\[" end="\]:" oneline keepend nextgroup=markdownUrl skipwhite
|
||||
syn match markdownUrl "\S\+" nextgroup=markdownUrlTitle skipwhite contained
|
||||
syn region markdownUrl matchgroup=markdownUrlDelimiter start="<" end=">" oneline keepend nextgroup=markdownUrlTitle skipwhite contained
|
||||
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+"+ keepend contained
|
||||
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained
|
||||
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained
|
||||
|
||||
syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart
|
||||
syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained
|
||||
syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained
|
||||
syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline
|
||||
|
||||
syn region markdownItalic start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart
|
||||
syn region markdownItalic start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart
|
||||
syn region markdownBold start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic
|
||||
syn region markdownBold start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend contains=markdownLineStart,markdownItalic
|
||||
syn region markdownBoldItalic start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=markdownLineStart
|
||||
syn region markdownBoldItalic start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend contains=markdownLineStart
|
||||
syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart
|
||||
syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart
|
||||
syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*```.*$" end="^\s*```\ze\s*$" keepend
|
||||
|
||||
if main_syntax ==# 'markdown'
|
||||
for s:type in g:markdown_fenced_languages
|
||||
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*```\s*'.matchstr(s:type,'[^=]*').'\>.*$" end="^\s*```\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g')
|
||||
endfor
|
||||
unlet! s:type
|
||||
endif
|
||||
|
||||
syn match markdownEscape "\\[][\\`*_{}()#+.!-]"
|
||||
syn match markdownError "\w\@<=_\w\@="
|
||||
|
||||
hi def link markdownH1 htmlH1
|
||||
hi def link markdownH2 htmlH2
|
||||
hi def link markdownH3 htmlH3
|
||||
hi def link markdownH4 htmlH4
|
||||
hi def link markdownH5 htmlH5
|
||||
hi def link markdownH6 htmlH6
|
||||
hi def link markdownHeadingRule markdownRule
|
||||
hi def link markdownHeadingDelimiter Delimiter
|
||||
hi def link markdownOrderedListMarker markdownListMarker
|
||||
hi def link markdownListMarker htmlTagName
|
||||
hi def link markdownBlockquote Comment
|
||||
hi def link markdownRule PreProc
|
||||
|
||||
hi def link markdownLinkText htmlLink
|
||||
hi def link markdownIdDeclaration Typedef
|
||||
hi def link markdownId Type
|
||||
hi def link markdownAutomaticLink markdownUrl
|
||||
hi def link markdownUrl Float
|
||||
hi def link markdownUrlTitle String
|
||||
hi def link markdownIdDelimiter markdownLinkDelimiter
|
||||
hi def link markdownUrlDelimiter htmlTag
|
||||
hi def link markdownUrlTitleDelimiter Delimiter
|
||||
|
||||
hi def link markdownItalic htmlItalic
|
||||
hi def link markdownBold htmlBold
|
||||
hi def link markdownBoldItalic htmlBoldItalic
|
||||
hi def link markdownCodeDelimiter Delimiter
|
||||
|
||||
hi def link markdownEscape Special
|
||||
hi def link markdownError Error
|
||||
|
||||
let b:current_syntax = "markdown"
|
||||
if main_syntax ==# 'markdown'
|
||||
unlet main_syntax
|
||||
endif
|
||||
|
||||
" vim:set sw=2:
|
45
home/.vimrc
Normal file
45
home/.vimrc
Normal file
@ -0,0 +1,45 @@
|
||||
call pathogen#infect()
|
||||
set noai
|
||||
set vb
|
||||
set binary noeol
|
||||
set tabstop=2
|
||||
set shiftwidth=2
|
||||
set softtabstop=2
|
||||
set expandtab
|
||||
set ruler
|
||||
set incsearch
|
||||
set hlsearch
|
||||
set backspace=indent,eol,start
|
||||
set nocompatible
|
||||
set nobackup
|
||||
syntax on
|
||||
filetype plugin on
|
||||
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
|
||||
au BufRead *.html set filetype=htmlm4
|
||||
au BufRead *.md set filetype=markdown
|
||||
set laststatus=2
|
||||
syntax enable
|
||||
set background=dark
|
||||
|
||||
let g:airline_powerline_fonts = 1
|
||||
|
||||
if filereadable(glob("./.vimrc.local"))
|
||||
source ./.vimrc.local
|
||||
endif
|
||||
|
||||
nnoremap Q <nop>
|
||||
let g:ctrlp_custom_ignore = {
|
||||
\ 'dir': '\v[\/](\.git|build)$',
|
||||
\ }
|
||||
|
||||
" Vimwiki {{
|
||||
let g:vimwiki_list = [{'path': '~/Google Drive/vimwiki/vimwiki', 'path_html': '~/Google Drive/vimwiki/vimwiki_html/', 'auto_export':'1'}]
|
||||
nnoremap <Leader>wb :Vimwiki2HTMLBrowse<CR><CR>
|
||||
" }}
|
||||
|
||||
" Gist {{
|
||||
let g:gist_detect_filetype = 1
|
||||
let g:gist_open_browser_after_post = 1
|
||||
let g:gist_post_private = 1
|
||||
" }}
|
||||
|
Loading…
Reference in New Issue
Block a user