updating .vim dir
This commit is contained in:
parent
c78e80ecd9
commit
72c7a6011e
105
.vim/autoload/sonictemplate.vim
Normal file
105
.vim/autoload/sonictemplate.vim
Normal file
@ -0,0 +1,105 @@
|
||||
"=============================================================================
|
||||
" sonictemplate.vim
|
||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||
" Last Change: 08-Nov-2011.
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists('g:sonictemplate_vim_template_dir')
|
||||
let s:tmpldir = g:sonictemplate_vim_template_dir
|
||||
else
|
||||
let s:tmpldir = expand('<sfile>:p:h:h') . '/template/'
|
||||
endif
|
||||
|
||||
function! sonictemplate#select(mode) abort
|
||||
let name = input(':Template ', '', 'customlist,sonictemplate#complete')
|
||||
if name == ''
|
||||
return
|
||||
endif
|
||||
call sonictemplate#apply(name, a:mode)
|
||||
endfunction
|
||||
|
||||
function! sonictemplate#complete(lead, cmdline, curpos) abort
|
||||
if search('[^ \t]', 'wn')
|
||||
return map(split(globpath(join([s:tmpldir, &ft], '/'), 'snip-' . a:lead . '*.*'), "\n"), 'fnamemodify(v:val, ":t:r")[5:]')
|
||||
else
|
||||
return map(split(globpath(join([s:tmpldir, &ft], '/'), 'base-' . a:lead . '*.*'), "\n"), 'fnamemodify(v:val, ":t:r")[5:]')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! sonictemplate#apply(name, mode) abort
|
||||
let buffer_is_not_empty = search('[^ \t]', 'wn')
|
||||
if search('[^ \t]', 'wn')
|
||||
let fs = split(globpath(join([s:tmpldir, &ft], '/'), 'snip-' . a:name . '.*'), "\n")
|
||||
else
|
||||
let fs = split(globpath(join([s:tmpldir, &ft], '/'), 'base-' . a:name . '.*'), "\n")
|
||||
endif
|
||||
if len(fs) == 0
|
||||
echomsg 'Template '.a:name.' is not exists.'
|
||||
return
|
||||
endif
|
||||
let f = fs[0]
|
||||
if !filereadable(f)
|
||||
echomsg 'Template '.a:name.' is not exists.'
|
||||
return
|
||||
endif
|
||||
let c = join(readfile(f, "b"), "\n")
|
||||
let c = substitute(c, '{{_name_}}', expand('%:t:r:'), 'g')
|
||||
let tmp = c
|
||||
let mx = '{{_input_:\(.\{-}\)}}'
|
||||
let vars = []
|
||||
while 1
|
||||
let match = matchstr(tmp, mx)
|
||||
if len(match) == 0
|
||||
break
|
||||
endif
|
||||
let var = substitute(match, mx, '\1', 'ig')
|
||||
if index(vars, var) == -1
|
||||
call add(vars, var)
|
||||
endif
|
||||
let tmp = tmp[stridx(tmp, match) + len(match):]
|
||||
endwhile
|
||||
for var in vars
|
||||
let val = input(var . ":")
|
||||
let c = substitute(c, '\V{{_input_:'.var.'}}', '\=val', 'g')
|
||||
endfor
|
||||
sandbox let c = substitute(c, '{{_if_:\(.\{-}\);\(.\{-}\)\(;\(.\{-}\)\)\{-}}}', '\=eval(submatch(1))?submatch(2):submatch(4)', 'g')
|
||||
sandbox let c = substitute(c, '{{_expr_:\(.\{-}\)}}', '\=eval(submatch(1))', 'g')
|
||||
if len(c) == 0
|
||||
return
|
||||
endif
|
||||
if !buffer_is_not_empty
|
||||
silent! %d _
|
||||
silent! put = c
|
||||
silent! normal! ggdd
|
||||
else
|
||||
if c[len(c)-1] == "\n"
|
||||
let c = c[:-2]
|
||||
endif
|
||||
let line = getline('.')
|
||||
let indent = matchstr(line, '^\(\s*\)')
|
||||
if line =~ '^\s*$' && line('.') != line('$')
|
||||
silent! normal dd
|
||||
endif
|
||||
let c = indent . substitute(c, "\n", "\n".indent, 'g')
|
||||
if len(indent) && (&expandtab || indent =~ '^ \+$')
|
||||
let c = substitute(c, "\t", repeat(' ', min([len(indent), &tabstop])), 'g')
|
||||
endif
|
||||
silent! put! = c
|
||||
endif
|
||||
if stridx(c, '{{_cursor_}}') != -1
|
||||
if a:mode == 'n'
|
||||
silent! call search('\zs{{_cursor_}}', 'w')
|
||||
silent! exe "normal ".repeat("x", 12)
|
||||
else
|
||||
silent! call search('{{_cursor_}}\zs', 'w')
|
||||
call feedkeys(repeat("\<bs>", 12))
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim:set et:
|
1291
.vim/doc/NERD_tree.txt
Normal file
1291
.vim/doc/NERD_tree.txt
Normal file
File diff suppressed because it is too large
Load Diff
41
.vim/nerdtree_plugin/exec_menuitem.vim
Normal file
41
.vim/nerdtree_plugin/exec_menuitem.vim
Normal file
@ -0,0 +1,41 @@
|
||||
" ============================================================================
|
||||
" File: exec_menuitem.vim
|
||||
" Description: plugin for NERD Tree that provides an execute file menu item
|
||||
" Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
|
||||
" Last Change: 22 July, 2009
|
||||
" License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
" ============================================================================
|
||||
if exists("g:loaded_nerdtree_exec_menuitem")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_nerdtree_exec_menuitem = 1
|
||||
|
||||
call NERDTreeAddMenuItem({
|
||||
\ 'text': '(!)Execute file',
|
||||
\ 'shortcut': '!',
|
||||
\ 'callback': 'NERDTreeExecFile',
|
||||
\ 'isActiveCallback': 'NERDTreeExecFileActive' })
|
||||
|
||||
function! NERDTreeExecFileActive()
|
||||
let node = g:NERDTreeFileNode.GetSelected()
|
||||
return !node.path.isDirectory && node.path.isExecutable
|
||||
endfunction
|
||||
|
||||
function! NERDTreeExecFile()
|
||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
||||
echo "==========================================================\n"
|
||||
echo "Complete the command to execute (add arguments etc):\n"
|
||||
let cmd = treenode.path.str({'escape': 1})
|
||||
let cmd = input(':!', cmd . ' ')
|
||||
|
||||
if cmd != ''
|
||||
exec ':!' . cmd
|
||||
else
|
||||
echo "Aborted"
|
||||
endif
|
||||
endfunction
|
224
.vim/nerdtree_plugin/fs_menu.vim
Normal file
224
.vim/nerdtree_plugin/fs_menu.vim
Normal file
@ -0,0 +1,224 @@
|
||||
" ============================================================================
|
||||
" File: fs_menu.vim
|
||||
" Description: plugin for the NERD Tree that provides a file system menu
|
||||
" Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
|
||||
" Last Change: 17 July, 2009
|
||||
" License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
" ============================================================================
|
||||
if exists("g:loaded_nerdtree_fs_menu")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_nerdtree_fs_menu = 1
|
||||
|
||||
call NERDTreeAddMenuItem({'text': '(a)dd a childnode', 'shortcut': 'a', 'callback': 'NERDTreeAddNode'})
|
||||
call NERDTreeAddMenuItem({'text': '(m)ove the current node', 'shortcut': 'm', 'callback': 'NERDTreeMoveNode'})
|
||||
call NERDTreeAddMenuItem({'text': '(d)elete the current node', 'shortcut': 'd', 'callback': 'NERDTreeDeleteNode'})
|
||||
|
||||
if has("gui_mac") || has("gui_macvim")
|
||||
call NERDTreeAddMenuItem({'text': '(r)eveal in Finder the current node', 'shortcut': 'r', 'callback': 'NERDTreeRevealInFinder'})
|
||||
call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFile'})
|
||||
call NERDTreeAddMenuItem({'text': '(q)uicklook the current node', 'shortcut': 'q', 'callback': 'NERDTreeQuickLook'})
|
||||
endif
|
||||
|
||||
if g:NERDTreePath.CopyingSupported()
|
||||
call NERDTreeAddMenuItem({'text': '(c)copy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
|
||||
endif
|
||||
|
||||
"FUNCTION: s:echo(msg){{{1
|
||||
function! s:echo(msg)
|
||||
redraw
|
||||
echomsg "NERDTree: " . a:msg
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:echoWarning(msg){{{1
|
||||
function! s:echoWarning(msg)
|
||||
echohl warningmsg
|
||||
call s:echo(a:msg)
|
||||
echohl normal
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:promptToDelBuffer(bufnum, msg){{{1
|
||||
"prints out the given msg and, if the user responds by pushing 'y' then the
|
||||
"buffer with the given bufnum is deleted
|
||||
"
|
||||
"Args:
|
||||
"bufnum: the buffer that may be deleted
|
||||
"msg: a message that will be echoed to the user asking them if they wish to
|
||||
" del the buffer
|
||||
function! s:promptToDelBuffer(bufnum, msg)
|
||||
echo a:msg
|
||||
if nr2char(getchar()) ==# 'y'
|
||||
exec "silent bdelete! " . a:bufnum
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"FUNCTION: NERDTreeAddNode(){{{1
|
||||
function! NERDTreeAddNode()
|
||||
let curDirNode = g:NERDTreeDirNode.GetSelected()
|
||||
|
||||
let newNodeName = input("Add a childnode\n".
|
||||
\ "==========================================================\n".
|
||||
\ "Enter the dir/file name to be created. Dirs end with a '/'\n" .
|
||||
\ "", curDirNode.path.str() . g:NERDTreePath.Slash(), "file")
|
||||
|
||||
if newNodeName ==# ''
|
||||
call s:echo("Node Creation Aborted.")
|
||||
return
|
||||
endif
|
||||
|
||||
try
|
||||
let newPath = g:NERDTreePath.Create(newNodeName)
|
||||
let parentNode = b:NERDTreeRoot.findNode(newPath.getParent())
|
||||
|
||||
let newTreeNode = g:NERDTreeFileNode.New(newPath)
|
||||
if parentNode.isOpen || !empty(parentNode.children)
|
||||
call parentNode.addChild(newTreeNode, 1)
|
||||
call NERDTreeRender()
|
||||
call newTreeNode.putCursorHere(1, 0)
|
||||
endif
|
||||
catch /^NERDTree/
|
||||
call s:echoWarning("Node Not Created.")
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
"FUNCTION: NERDTreeMoveNode(){{{1
|
||||
function! NERDTreeMoveNode()
|
||||
let curNode = g:NERDTreeFileNode.GetSelected()
|
||||
let newNodePath = input("Rename the current node\n" .
|
||||
\ "==========================================================\n" .
|
||||
\ "Enter the new path for the node: \n" .
|
||||
\ "", curNode.path.str(), "file")
|
||||
|
||||
if newNodePath ==# ''
|
||||
call s:echo("Node Renaming Aborted.")
|
||||
return
|
||||
endif
|
||||
|
||||
try
|
||||
let bufnum = bufnr(curNode.path.str())
|
||||
|
||||
call curNode.rename(newNodePath)
|
||||
call NERDTreeRender()
|
||||
|
||||
"if the node is open in a buffer, ask the user if they want to
|
||||
"close that buffer
|
||||
if bufnum != -1
|
||||
let prompt = "\nNode renamed.\n\nThe old file is open in buffer ". bufnum . (bufwinnr(bufnum) ==# -1 ? " (hidden)" : "") .". Delete this buffer? (yN)"
|
||||
call s:promptToDelBuffer(bufnum, prompt)
|
||||
endif
|
||||
|
||||
call curNode.putCursorHere(1, 0)
|
||||
|
||||
redraw
|
||||
catch /^NERDTree/
|
||||
call s:echoWarning("Node Not Renamed.")
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" FUNCTION: NERDTreeDeleteNode() {{{1
|
||||
function! NERDTreeDeleteNode()
|
||||
let currentNode = g:NERDTreeFileNode.GetSelected()
|
||||
let confirmed = 0
|
||||
|
||||
if currentNode.path.isDirectory
|
||||
let choice =input("Delete the current node\n" .
|
||||
\ "==========================================================\n" .
|
||||
\ "STOP! To delete this entire directory, type 'yes'\n" .
|
||||
\ "" . currentNode.path.str() . ": ")
|
||||
let confirmed = choice ==# 'yes'
|
||||
else
|
||||
echo "Delete the current node\n" .
|
||||
\ "==========================================================\n".
|
||||
\ "Are you sure you wish to delete the node:\n" .
|
||||
\ "" . currentNode.path.str() . " (yN):"
|
||||
let choice = nr2char(getchar())
|
||||
let confirmed = choice ==# 'y'
|
||||
endif
|
||||
|
||||
|
||||
if confirmed
|
||||
try
|
||||
call currentNode.delete()
|
||||
call NERDTreeRender()
|
||||
|
||||
"if the node is open in a buffer, ask the user if they want to
|
||||
"close that buffer
|
||||
let bufnum = bufnr(currentNode.path.str())
|
||||
if buflisted(bufnum)
|
||||
let prompt = "\nNode deleted.\n\nThe file is open in buffer ". bufnum . (bufwinnr(bufnum) ==# -1 ? " (hidden)" : "") .". Delete this buffer? (yN)"
|
||||
call s:promptToDelBuffer(bufnum, prompt)
|
||||
endif
|
||||
|
||||
redraw
|
||||
catch /^NERDTree/
|
||||
call s:echoWarning("Could not remove node")
|
||||
endtry
|
||||
else
|
||||
call s:echo("delete aborted")
|
||||
endif
|
||||
|
||||
endfunction
|
||||
|
||||
" FUNCTION: NERDTreeCopyNode() {{{1
|
||||
function! NERDTreeCopyNode()
|
||||
let currentNode = g:NERDTreeFileNode.GetSelected()
|
||||
let newNodePath = input("Copy the current node\n" .
|
||||
\ "==========================================================\n" .
|
||||
\ "Enter the new path to copy the node to: \n" .
|
||||
\ "", currentNode.path.str(), "file")
|
||||
|
||||
if newNodePath != ""
|
||||
"strip trailing slash
|
||||
let newNodePath = substitute(newNodePath, '\/$', '', '')
|
||||
|
||||
let confirmed = 1
|
||||
if currentNode.path.copyingWillOverwrite(newNodePath)
|
||||
call s:echo("Warning: copying may overwrite files! Continue? (yN)")
|
||||
let choice = nr2char(getchar())
|
||||
let confirmed = choice ==# 'y'
|
||||
endif
|
||||
|
||||
if confirmed
|
||||
try
|
||||
let newNode = currentNode.copy(newNodePath)
|
||||
if !empty(newNode)
|
||||
call NERDTreeRender()
|
||||
call newNode.putCursorHere(0, 0)
|
||||
endif
|
||||
catch /^NERDTree/
|
||||
call s:echoWarning("Could not copy node")
|
||||
endtry
|
||||
endif
|
||||
else
|
||||
call s:echo("Copy aborted.")
|
||||
endif
|
||||
redraw
|
||||
endfunction
|
||||
|
||||
function! NERDTreeQuickLook()
|
||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
||||
if treenode != {}
|
||||
call system("qlmanage -p 2>/dev/null '" . treenode.path.str() . "'")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! NERDTreeRevealInFinder()
|
||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
||||
if treenode != {}
|
||||
let x = system("open -R '" . treenode.path.str() . "'")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! NERDTreeExecuteFile()
|
||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
||||
if treenode != {}
|
||||
let x = system("open '" . treenode.path.str() . "'")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
4017
.vim/plugin/NERD_tree.vim
Normal file
4017
.vim/plugin/NERD_tree.vim
Normal file
File diff suppressed because it is too large
Load Diff
34
.vim/plugin/sonictemplate.vim
Normal file
34
.vim/plugin/sonictemplate.vim
Normal file
@ -0,0 +1,34 @@
|
||||
"=============================================================================
|
||||
" File: sonictemplate.vim
|
||||
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
|
||||
" Last Change: 08-Nov-2011.
|
||||
" Version: 0.08
|
||||
" WebPage: http://github.com/mattn/sonictemplate-vim
|
||||
" Description: Easy and high speed coding method
|
||||
" Usage:
|
||||
"
|
||||
" :Template {name}
|
||||
" Load template named as {name} in the current buffer.
|
||||
"
|
||||
" Or type <c-y> + t
|
||||
|
||||
if &cp || (exists('g:loaded_sonictemplate_vim') && g:loaded_sonictemplate_vim)
|
||||
finish
|
||||
endif
|
||||
let g:loaded_sonictemplate_vim = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
command! -nargs=1 -complete=customlist,sonictemplate#complete Template call sonictemplate#apply(<f-args>, 'n')
|
||||
|
||||
nnoremap <plug>(sonictemplate) :call sonictemplate#select('n')<cr>
|
||||
inoremap <plug>(sonictemplate) <space><bs><c-o>:call sonictemplate#select('i')<cr>
|
||||
|
||||
nmap <unique> <c-y>t <plug>(sonictemplate)
|
||||
imap <unique> <c-y>t <plug>(sonictemplate)
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim:set et:
|
88
.vim/syntax/nerdtree.vim
Normal file
88
.vim/syntax/nerdtree.vim
Normal file
@ -0,0 +1,88 @@
|
||||
let s:tree_up_dir_line = '.. (up a dir)'
|
||||
"NERDTreeFlags are syntax items that should be invisible, but give clues as to
|
||||
"how things should be highlighted
|
||||
syn match NERDTreeFlag #\~#
|
||||
syn match NERDTreeFlag #\[RO\]#
|
||||
|
||||
"highlighting for the .. (up dir) line at the top of the tree
|
||||
execute "syn match NERDTreeUp #\\V". s:tree_up_dir_line ."#"
|
||||
|
||||
"highlighting for the ~/+ symbols for the directory nodes
|
||||
syn match NERDTreeClosable #\~\<#
|
||||
syn match NERDTreeClosable #\~\.#
|
||||
syn match NERDTreeOpenable #+\<#
|
||||
syn match NERDTreeOpenable #+\.#he=e-1
|
||||
|
||||
"highlighting for the tree structural parts
|
||||
syn match NERDTreePart #|#
|
||||
syn match NERDTreePart #`#
|
||||
syn match NERDTreePartFile #[|`]-#hs=s+1 contains=NERDTreePart
|
||||
|
||||
"quickhelp syntax elements
|
||||
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*:#hs=s+2,he=e-1
|
||||
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*,#hs=s+2,he=e-1
|
||||
syn match NERDTreeHelpTitle #" .*\~#hs=s+2,he=e-1 contains=NERDTreeFlag
|
||||
syn match NERDTreeToggleOn #".*(on)#hs=e-2,he=e-1 contains=NERDTreeHelpKey
|
||||
syn match NERDTreeToggleOff #".*(off)#hs=e-3,he=e-1 contains=NERDTreeHelpKey
|
||||
syn match NERDTreeHelpCommand #" :.\{-}\>#hs=s+3
|
||||
syn match NERDTreeHelp #^".*# contains=NERDTreeHelpKey,NERDTreeHelpTitle,NERDTreeFlag,NERDTreeToggleOff,NERDTreeToggleOn,NERDTreeHelpCommand
|
||||
|
||||
"highlighting for readonly files
|
||||
syn match NERDTreeRO #.*\[RO\]#hs=s+2 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile
|
||||
|
||||
"highlighting for sym links
|
||||
syn match NERDTreeLink #[^-| `].* -> # contains=NERDTreeBookmark,NERDTreeOpenable,NERDTreeClosable,NERDTreeDirSlash
|
||||
|
||||
"highlighing for directory nodes and file nodes
|
||||
syn match NERDTreeDirSlash #/#
|
||||
syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeLink,NERDTreeDirSlash,NERDTreeOpenable,NERDTreeClosable
|
||||
syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark
|
||||
syn match NERDTreeFile #|-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
|
||||
syn match NERDTreeFile #`-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
|
||||
syn match NERDTreeCWD #^[</].*$#
|
||||
|
||||
"highlighting for bookmarks
|
||||
syn match NERDTreeBookmark # {.*}#hs=s+1
|
||||
|
||||
"highlighting for the bookmarks table
|
||||
syn match NERDTreeBookmarksLeader #^>#
|
||||
syn match NERDTreeBookmarksHeader #^>-\+Bookmarks-\+$# contains=NERDTreeBookmarksLeader
|
||||
syn match NERDTreeBookmarkName #^>.\{-} #he=e-1 contains=NERDTreeBookmarksLeader
|
||||
syn match NERDTreeBookmark #^>.*$# contains=NERDTreeBookmarksLeader,NERDTreeBookmarkName,NERDTreeBookmarksHeader
|
||||
|
||||
if exists("g:NERDChristmasTree") && g:NERDChristmasTree
|
||||
hi def link NERDTreePart Special
|
||||
hi def link NERDTreePartFile Type
|
||||
hi def link NERDTreeFile Normal
|
||||
hi def link NERDTreeExecFile Title
|
||||
hi def link NERDTreeDirSlash Identifier
|
||||
hi def link NERDTreeClosable Type
|
||||
else
|
||||
hi def link NERDTreePart Normal
|
||||
hi def link NERDTreePartFile Normal
|
||||
hi def link NERDTreeFile Normal
|
||||
hi def link NERDTreeClosable Title
|
||||
endif
|
||||
|
||||
hi def link NERDTreeBookmarksHeader statement
|
||||
hi def link NERDTreeBookmarksLeader ignore
|
||||
hi def link NERDTreeBookmarkName Identifier
|
||||
hi def link NERDTreeBookmark normal
|
||||
|
||||
hi def link NERDTreeHelp String
|
||||
hi def link NERDTreeHelpKey Identifier
|
||||
hi def link NERDTreeHelpCommand Identifier
|
||||
hi def link NERDTreeHelpTitle Macro
|
||||
hi def link NERDTreeToggleOn Question
|
||||
hi def link NERDTreeToggleOff WarningMsg
|
||||
|
||||
hi def link NERDTreeDir Directory
|
||||
hi def link NERDTreeUp Directory
|
||||
hi def link NERDTreeCWD Statement
|
||||
hi def link NERDTreeLink Macro
|
||||
hi def link NERDTreeOpenable Title
|
||||
hi def link NERDTreeFlag ignore
|
||||
hi def link NERDTreeRO WarningMsg
|
||||
hi def link NERDTreeBookmark Statement
|
||||
|
||||
hi def link NERDTreeCurrentNode Search
|
7
.vim/template/c/base-main.c
Normal file
7
.vim/template/c/base-main.c
Normal file
@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main(int argc, char* argv[]) {
|
||||
{{_cursor_}}
|
||||
return 0;
|
||||
}
|
3
.vim/template/c/snip-comment-block.c
Normal file
3
.vim/template/c/snip-comment-block.c
Normal file
@ -0,0 +1,3 @@
|
||||
/**
|
||||
* {{_cursor_}}
|
||||
*/
|
3
.vim/template/c/snip-for.c
Normal file
3
.vim/template/c/snip-for.c
Normal file
@ -0,0 +1,3 @@
|
||||
for (int n = 0; n < {{_input_:count}}; n++) {
|
||||
{{_cursor_}}
|
||||
}
|
9
.vim/template/cpp/base-main-boost.cpp
Normal file
9
.vim/template/cpp/base-main-boost.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
int
|
||||
main(int argc, char* argv[]) {
|
||||
{{_cursor_}}
|
||||
return 0;
|
||||
}
|
8
.vim/template/cpp/base-main.cpp
Normal file
8
.vim/template/cpp/base-main.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
int
|
||||
main(int argc, char* argv[]) {
|
||||
{{_cursor_}}
|
||||
return 0;
|
||||
}
|
3
.vim/template/cpp/snip-boost-foreach.cpp
Normal file
3
.vim/template/cpp/snip-boost-foreach.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
BOOST_FOREACH(auto x, {{_input_:variable}}) {
|
||||
{{_cursor_}}
|
||||
}
|
3
.vim/template/cpp/snip-comment-block.cpp
Normal file
3
.vim/template/cpp/snip-comment-block.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
/**
|
||||
* {{_cursor_}}
|
||||
*/
|
1
.vim/template/cpp/snip-cout.cpp
Normal file
1
.vim/template/cpp/snip-cout.cpp
Normal file
@ -0,0 +1 @@
|
||||
std::cout << {{_input_:string}} << std::endl;
|
3
.vim/template/cpp/snip-for.cpp
Normal file
3
.vim/template/cpp/snip-for.cpp
Normal file
@ -0,0 +1,3 @@
|
||||
for (int n = 0; n < {{_input_:count}}; n++) {
|
||||
{{_cursor_}}
|
||||
}
|
5
.vim/template/go/base-main.go
Normal file
5
.vim/template/go/base-main.go
Normal file
@ -0,0 +1,5 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
{{_cursor_}}
|
||||
}
|
3
.vim/template/go/base-package.go
Normal file
3
.vim/template/go/base-package.go
Normal file
@ -0,0 +1,3 @@
|
||||
package {{_name_}}
|
||||
|
||||
{{_cursor_}}
|
3
.vim/template/go/snip-goroutine.go
Normal file
3
.vim/template/go/snip-goroutine.go
Normal file
@ -0,0 +1,3 @@
|
||||
go func() {
|
||||
{{_cursor_}}
|
||||
}()
|
5
.vim/template/go/snip-recover.go
Normal file
5
.vim/template/go/snip-recover.go
Normal file
@ -0,0 +1,5 @@
|
||||
defer func() {
|
||||
if recover() != nil {
|
||||
{{_cursor_}}
|
||||
}
|
||||
}()
|
11
.vim/template/html/base-page.html
Normal file
11
.vim/template/html/base-page.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{_cursor_}}</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
11
.vim/template/java/base-class.java
Normal file
11
.vim/template/java/base-class.java
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* {{_name_}}
|
||||
*/
|
||||
public class {{_name_}} {
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public {{_name_}}() {
|
||||
{{_cursor_}}
|
||||
}
|
||||
}
|
8
.vim/template/java/base-main.java
Normal file
8
.vim/template/java/base-main.java
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* {{_name_}}
|
||||
*/
|
||||
public class {{_name_}} {
|
||||
public static void main(String[] args) {
|
||||
{{_cursor_}}
|
||||
}
|
||||
}
|
15
.vim/template/java/snip-getter-setter.java
Normal file
15
.vim/template/java/snip-getter-setter.java
Normal file
@ -0,0 +1,15 @@
|
||||
/**
|
||||
* get {{_input_:name}}
|
||||
* @return {{_input_:name}}
|
||||
*/
|
||||
public {{_input_:type}} get{{_expr_:substitute('{{_input_:name}}', '\w\+', '\u\0', '')}}() {
|
||||
return {{_input_:name}};
|
||||
}
|
||||
|
||||
/**
|
||||
* set {{_input_:name}}
|
||||
* @param {{_input_:name}}
|
||||
*/
|
||||
public void set{{_expr_:substitute('{{_input_:name}}', '\w\+', '\u\0', '')}}({{_input_:type}} {{_input_:name}}) {
|
||||
this.{{_input_:name}} = {{_input_:name}};
|
||||
}
|
7
.vim/template/java/snip-getter.java
Normal file
7
.vim/template/java/snip-getter.java
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* get {{_input_:name}}
|
||||
* @return {{_input_:name}}
|
||||
*/
|
||||
public {{_input_:type}} get{{_expr_:substitute('{{_input_:name}}', '\w\+', '\u\0', '')}}() {
|
||||
return {{_input_:name}};
|
||||
}
|
3
.vim/template/java/snip-main.java
Normal file
3
.vim/template/java/snip-main.java
Normal file
@ -0,0 +1,3 @@
|
||||
public static void main(String[] args) {
|
||||
{{_cursor_}}
|
||||
}
|
6
.vim/template/java/snip-try-catch-finally.java
Normal file
6
.vim/template/java/snip-try-catch-finally.java
Normal file
@ -0,0 +1,6 @@
|
||||
try {
|
||||
{{_cursor_}}
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
}
|
3
.vim/template/javascript/base-anon-call.js
Normal file
3
.vim/template/javascript/base-anon-call.js
Normal file
@ -0,0 +1,3 @@
|
||||
(function() {
|
||||
{{_cursor_}}
|
||||
})();
|
3
.vim/template/javascript/base-jquery-readly.js
Normal file
3
.vim/template/javascript/base-jquery-readly.js
Normal file
@ -0,0 +1,3 @@
|
||||
$(function() {
|
||||
{{_cursor_}}
|
||||
});
|
3
.vim/template/javascript/ship-anon-function.js
Normal file
3
.vim/template/javascript/ship-anon-function.js
Normal file
@ -0,0 +1,3 @@
|
||||
(function() {
|
||||
{{_cursor_}}
|
||||
})
|
3
.vim/template/javascript/snip-jquery-each.js
Normal file
3
.vim/template/javascript/snip-jquery-each.js
Normal file
@ -0,0 +1,3 @@
|
||||
$.each({{_input_:variable}}, function() {
|
||||
{{_cursor_}}
|
||||
});
|
3
.vim/template/javascript/snip-jquery-getjson.js
Normal file
3
.vim/template/javascript/snip-jquery-getjson.js
Normal file
@ -0,0 +1,3 @@
|
||||
$.getJSON("{{_input_:URL}}", function(data) {
|
||||
{{_cursor_}}
|
||||
});
|
5
.vim/template/javascript/snip-jquery-yql.js
Normal file
5
.vim/template/javascript/snip-jquery-yql.js
Normal file
@ -0,0 +1,5 @@
|
||||
$.getJSON("http://query.yahooapis.com/v1/public/yql?callback=?", {
|
||||
q: "{{_cursor_}}",
|
||||
format: "json"
|
||||
}, function (data) {
|
||||
});
|
19
.vim/template/markdown/base-readme.mkd
Normal file
19
.vim/template/markdown/base-readme.mkd
Normal file
@ -0,0 +1,19 @@
|
||||
{{_expr_:expand("%:p:h:t")}}
|
||||
{{_expr_:repeat("=", len(expand("%:p:h:t")))}}
|
||||
|
||||
Usage:
|
||||
------
|
||||
{{_cursor_}}
|
||||
|
||||
Requirements:
|
||||
-------------
|
||||
|
||||
Install:
|
||||
--------
|
||||
|
||||
License:
|
||||
--------
|
||||
|
||||
Author:
|
||||
-------
|
||||
|
9
.vim/template/perl/base-package.pl
Normal file
9
.vim/template/perl/base-package.pl
Normal file
@ -0,0 +1,9 @@
|
||||
package {{_expr_:substitute(substitute(substitute(expand('%'), '.*lib[\\/]', '', 'g'), '[\\/]', '::', 'g'), '\.pm$', '', 'g')}};
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
|
||||
{{_cursor_}}
|
||||
|
||||
1
|
5
.vim/template/perl/base-script.pl
Normal file
5
.vim/template/perl/base-script.pl
Normal file
@ -0,0 +1,5 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
|
||||
{{_cursor_}}
|
6
.vim/template/perl/base-test.pl
Normal file
6
.vim/template/perl/base-test.pl
Normal file
@ -0,0 +1,6 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use utf8;
|
||||
use Test::More;
|
||||
|
||||
{{_cursor_}}
|
2
.vim/template/perl/snip-dbi-connect-mysql.pl
Normal file
2
.vim/template/perl/snip-dbi-connect-mysql.pl
Normal file
@ -0,0 +1,2 @@
|
||||
my $dbh = DBI->connect("dbi:mysql:{{_cursor_}}", "", "");
|
||||
$dbh->disconnect;
|
2
.vim/template/perl/snip-dbi-connect-oracle.pl
Normal file
2
.vim/template/perl/snip-dbi-connect-oracle.pl
Normal file
@ -0,0 +1,2 @@
|
||||
my $dbh = DBI->connect("dbi:Oracle:{{_cursor_}}", "", "");
|
||||
$dbh->disconnect;
|
2
.vim/template/perl/snip-dbi-connect-sqlite.pl
Normal file
2
.vim/template/perl/snip-dbi-connect-sqlite.pl
Normal file
@ -0,0 +1,2 @@
|
||||
my $dbh = DBI->connect("dbi:SQLite:dbname={{_cursor_}}");
|
||||
$dbh->disconnect;
|
5
.vim/template/perl/snip-dbi-prepare.pl
Normal file
5
.vim/template/perl/snip-dbi-prepare.pl
Normal file
@ -0,0 +1,5 @@
|
||||
my $sth = $dbh->prepare("{{_cursor_}}");
|
||||
$sth->execute;
|
||||
while (my @row = $sth->fetchrow_array) {
|
||||
#print join(', ', @row), "\n";
|
||||
}
|
2
.vim/template/perl/snip-file-read.pl
Normal file
2
.vim/template/perl/snip-file-read.pl
Normal file
@ -0,0 +1,2 @@
|
||||
open my $fh, '<', '{{_cursor_}}' or die "failed to open: $!";
|
||||
my $content = do { local $/; <$fh> };
|
5
.vim/template/perl/snip-growl-any.pl
Normal file
5
.vim/template/perl/snip-growl-any.pl
Normal file
@ -0,0 +1,5 @@
|
||||
my $growl = Growl::Any->new(
|
||||
appname => '{{_cursor_}}',
|
||||
events => ['Error']
|
||||
);
|
||||
#$growl->notify('Error', 'Failed to do it!');
|
3
.vim/template/perl/snip-lwp-useragent.pl
Normal file
3
.vim/template/perl/snip-lwp-useragent.pl
Normal file
@ -0,0 +1,3 @@
|
||||
my $ua = LWP::UserAgent->new;
|
||||
$ua->env_proxy;
|
||||
my $res = $ua->get("{{_cursor_}}");
|
7
.vim/template/perl/snip-pit.pl
Normal file
7
.vim/template/perl/snip-pit.pl
Normal file
@ -0,0 +1,7 @@
|
||||
use Config::Pit;
|
||||
|
||||
my $config = pit_get("{{_input_:domain}}", require => {
|
||||
"username" => "username of {{_input_:domain}}",
|
||||
"password" => "password of {{_input_:domain}}",
|
||||
});
|
||||
{{_cursor_}}
|
5
.vim/template/perl/snip-sub.pl
Normal file
5
.vim/template/perl/snip-sub.pl
Normal file
@ -0,0 +1,5 @@
|
||||
sub {{_input_:function name}} {
|
||||
my ($self{{_input_:arguments}}) = @_;
|
||||
{{_cursor_}}
|
||||
}
|
||||
|
10
.vim/template/perl/snip-web-scraper.pl
Normal file
10
.vim/template/perl/snip-web-scraper.pl
Normal file
@ -0,0 +1,10 @@
|
||||
my $scraper = scraper {
|
||||
process '{{_cursor_}}', 'data' => 'TEXT';
|
||||
result 'data';
|
||||
};
|
||||
$scraper->user_agent->env_proxy;
|
||||
|
||||
#use YAML::Syck;
|
||||
#for (@{$scraper->scrape( URI->new('') )}) {
|
||||
# print $_->{data}, "\n";
|
||||
#}
|
8
.vim/template/python/base-main.py
Normal file
8
.vim/template/python/base-main.py
Normal file
@ -0,0 +1,8 @@
|
||||
# vim: fileencoding=utf-8
|
||||
|
||||
def main():
|
||||
{{_cursor_}}
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
7
.vim/template/ruby/snip-pit.rb
Normal file
7
.vim/template/ruby/snip-pit.rb
Normal file
@ -0,0 +1,7 @@
|
||||
require "pit"
|
||||
|
||||
config = Pit.get("{{_input_:domain}}", :require => {
|
||||
"username" => "username of {{_input_:domain}}",
|
||||
"password" => "password of {{_input_:domain}}",
|
||||
})
|
||||
{{_cursor_}}
|
Loading…
Reference in New Issue
Block a user