mirror of
https://github.com/amix/vimrc
synced 2025-07-13 06:35:01 +08:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
154
sources_non_forked/ack.vim/autoload/ack.vim
Normal file
154
sources_non_forked/ack.vim/autoload/ack.vim
Normal file
@ -0,0 +1,154 @@
|
||||
function! ack#Ack(cmd, args)
|
||||
redraw
|
||||
echo "Searching ..."
|
||||
|
||||
" If no pattern is provided, search for the word under the cursor
|
||||
if empty(a:args)
|
||||
let l:grepargs = expand("<cword>")
|
||||
else
|
||||
let l:grepargs = a:args . join(a:000, ' ')
|
||||
end
|
||||
echom l:grepargs
|
||||
let l:ackprg_run = g:ackprg
|
||||
|
||||
" Format, used to manage column jump
|
||||
if a:cmd =~# '-g$'
|
||||
let g:ackformat="%f"
|
||||
let l:ackprg_run = substitute(l:ackprg_run, '-H\|--column', '', 'g')
|
||||
else
|
||||
let g:ackformat="%f:%l:%c:%m,%f:%l:%m"
|
||||
endif
|
||||
|
||||
let grepprg_bak = &grepprg
|
||||
let grepformat_bak = &grepformat
|
||||
let &grepprg=l:ackprg_run
|
||||
let &grepformat=g:ackformat
|
||||
|
||||
try
|
||||
" NOTE: we escape special chars, but not everything using shellescape to
|
||||
" allow for passing arguments etc
|
||||
if g:ack_use_dispatch
|
||||
let &l:errorformat = g:ackformat
|
||||
let &l:makeprg=g:ackprg." " . escape(l:grepargs, '|#%')
|
||||
Make
|
||||
else
|
||||
silent execute a:cmd . " " . escape(l:grepargs, '|#%')
|
||||
endif
|
||||
|
||||
finally
|
||||
let &grepprg=grepprg_bak
|
||||
let &grepformat=grepformat_bak
|
||||
endtry
|
||||
|
||||
if a:cmd =~# '^l'
|
||||
let s:handler = g:ack_lhandler
|
||||
let s:apply_mappings = g:ack_apply_lmappings
|
||||
let s:close_cmd = ':lclose<CR>'
|
||||
else
|
||||
let s:handler = g:ack_qhandler
|
||||
let s:apply_mappings = g:ack_apply_qmappings
|
||||
let s:close_cmd = ':cclose<CR>'
|
||||
endif
|
||||
|
||||
if !g:ack_use_dispatch
|
||||
call ack#show_results()
|
||||
else
|
||||
copen
|
||||
endif
|
||||
call <SID>apply_maps()
|
||||
call <SID>highlight(l:grepargs)
|
||||
|
||||
redraw!
|
||||
endfunction
|
||||
|
||||
function! ack#show_results()
|
||||
execute s:handler
|
||||
endfunction
|
||||
|
||||
function! s:apply_maps()
|
||||
let g:ack_mappings.q = s:close_cmd
|
||||
|
||||
execute "nnoremap <buffer> <silent> ? :call ack#quick_help()<CR>"
|
||||
|
||||
if s:apply_mappings && &ft == "qf"
|
||||
if g:ack_autoclose
|
||||
for key_map in items(g:ack_mappings)
|
||||
execute printf("nnoremap <buffer> <silent> %s %s", get(key_map, 0), get(key_map, 1) . s:close_cmd)
|
||||
endfor
|
||||
execute "nnoremap <buffer> <silent> <CR> <CR>" . s:close_cmd
|
||||
else
|
||||
for key_map in items(g:ack_mappings)
|
||||
execute printf("nnoremap <buffer> <silent> %s %s", get(key_map, 0), get(key_map, 1))
|
||||
endfor
|
||||
endif
|
||||
|
||||
if exists("g:ackpreview") " if auto preview in on, remap j and k keys
|
||||
execute "nnoremap <buffer> <silent> j j<CR><C-W><C-W>"
|
||||
execute "nnoremap <buffer> <silent> k k<CR><C-W><C-W>"
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ack#quick_help()
|
||||
execute "edit " . globpath(&rtp, "doc/ack_quick_help.txt")
|
||||
|
||||
silent normal gg
|
||||
setlocal buftype=nofile
|
||||
setlocal bufhidden=hide
|
||||
setlocal noswapfile
|
||||
setlocal nobuflisted
|
||||
setlocal nomodifiable
|
||||
setlocal filetype=help
|
||||
setlocal nonumber
|
||||
setlocal norelativenumber
|
||||
setlocal nowrap
|
||||
setlocal foldlevel=20
|
||||
setlocal foldmethod=diff
|
||||
nnoremap <buffer> <silent> ? :q!<CR>:call ack#show_results()<CR>
|
||||
endfunction
|
||||
|
||||
function! s:highlight(args)
|
||||
if !g:ackhighlight
|
||||
return
|
||||
endif
|
||||
|
||||
let @/ = matchstr(a:args, "\\v(-)\@<!(\<)\@<=\\w+|['\"]\\zs.{-}\\ze['\"]")
|
||||
call feedkeys(":let &l:hlsearch=1 \| echo \<CR>", "n")
|
||||
endfunction
|
||||
|
||||
function! ack#AckFromSearch(cmd, args)
|
||||
let search = getreg('/')
|
||||
" translate vim regular expression to perl regular expression.
|
||||
let search = substitute(search, '\(\\<\|\\>\)', '\\b', 'g')
|
||||
call ack#Ack(a:cmd, '"' . search . '" ' . a:args)
|
||||
endfunction
|
||||
|
||||
function! s:GetDocLocations()
|
||||
let dp = ''
|
||||
for p in split(&rtp, ',')
|
||||
let p = p . '/doc/'
|
||||
if isdirectory(p)
|
||||
let dp = p . '*.txt ' . dp
|
||||
endif
|
||||
endfor
|
||||
|
||||
return dp
|
||||
endfunction
|
||||
|
||||
function! ack#AckHelp(cmd, args)
|
||||
let args = a:args . ' ' . s:GetDocLocations()
|
||||
call ack#Ack(a:cmd, args)
|
||||
endfunction
|
||||
|
||||
function! ack#AckWindow(cmd, args)
|
||||
let files = tabpagebuflist()
|
||||
" remove duplicated filenames (files appearing in more than one window)
|
||||
let files = filter(copy(sort(files)), 'index(files,v:val,v:key+1)==-1')
|
||||
call map(files, "bufname(v:val)")
|
||||
" remove unnamed buffers as quickfix (empty strings before shellescape)
|
||||
call filter(files, 'v:val != ""')
|
||||
" expand to full path (avoid problems with cd/lcd in au QuickFixCmdPre)
|
||||
let files = map(files, "shellescape(fnamemodify(v:val, ':p'))")
|
||||
let args = a:args . ' ' . join(files)
|
||||
call ack#Ack(a:cmd, args)
|
||||
endfunction
|
14
sources_non_forked/ack.vim/doc/ack_quick_help.txt
Normal file
14
sources_non_forked/ack.vim/doc/ack_quick_help.txt
Normal file
@ -0,0 +1,14 @@
|
||||
==== ack.vim quick help ===============
|
||||
|
||||
*?:* Show this help
|
||||
*t:* Open in a new tab
|
||||
*T:* Open in a new tab silently
|
||||
*o:* Open
|
||||
*O:* Open and close result window
|
||||
*go:* Preview
|
||||
*h:* Horizontal open
|
||||
*H:* Horizontal open silently
|
||||
*v:* Vertical open
|
||||
*gv:* Vertical open silently
|
||||
|
||||
========================================
|
9
sources_non_forked/ack.vim/ftplugin/qf.vim
Normal file
9
sources_non_forked/ack.vim/ftplugin/qf.vim
Normal file
@ -0,0 +1,9 @@
|
||||
if exists("g:ack_autofold_results") && g:ack_autofold_results
|
||||
setlocal foldlevel=0
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=matchstr(getline(v:lnum),'^[^\|]\\+')==#matchstr(getline(v:lnum+1),'^[^\|]\\+')?1:'<1'
|
||||
setlocal foldenable
|
||||
setlocal foldclose=all
|
||||
setlocal foldopen=all
|
||||
nnoremap <buffer> j jzz
|
||||
endif
|
644
sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim
Normal file
644
sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim
Normal file
@ -0,0 +1,644 @@
|
||||
if exists("g:loaded_nerdtree_ui_glue_autoload")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_nerdtree_ui_glue_autoload = 1
|
||||
|
||||
" FUNCTION: nerdtree#ui_glue#createDefaultBindings() {{{1
|
||||
function! nerdtree#ui_glue#createDefaultBindings()
|
||||
let s = '<SNR>' . s:SID() . '_'
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': '<MiddleRelease>', 'scope': "all", 'callback': s."handleMiddleMouse" })
|
||||
call NERDTreeAddKeyMap({ 'key': '<LeftRelease>', 'scope': "all", 'callback': s."handleLeftClick" })
|
||||
call NERDTreeAddKeyMap({ 'key': '<2-LeftMouse>', 'scope': "DirNode", 'callback': s."activateDirNode" })
|
||||
call NERDTreeAddKeyMap({ 'key': '<2-LeftMouse>', 'scope': "FileNode", 'callback': s."activateFileNode" })
|
||||
call NERDTreeAddKeyMap({ 'key': '<2-LeftMouse>', 'scope': "Bookmark", 'callback': s."activateBookmark" })
|
||||
call NERDTreeAddKeyMap({ 'key': '<2-LeftMouse>', 'scope': "all", 'callback': s."activateAll" })
|
||||
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapActivateNode, 'scope': "DirNode", 'callback': s."activateDirNode" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapActivateNode, 'scope': "FileNode", 'callback': s."activateFileNode" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapActivateNode, 'scope': "Bookmark", 'callback': s."activateBookmark" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapActivateNode, 'scope': "all", 'callback': s."activateAll" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenSplit, 'scope': "Node", 'callback': s."openHSplit" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenVSplit, 'scope': "Node", 'callback': s."openVSplit" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenSplit, 'scope': "Bookmark", 'callback': s."openHSplit" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenVSplit, 'scope': "Bookmark", 'callback': s."openVSplit" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreview, 'scope': "Node", 'callback': s."previewNodeCurrent" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreviewVSplit, 'scope': "Node", 'callback': s."previewNodeVSplit" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreviewSplit, 'scope': "Node", 'callback': s."previewNodeHSplit" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreview, 'scope': "Bookmark", 'callback': s."previewNodeCurrent" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreviewVSplit, 'scope': "Bookmark", 'callback': s."previewNodeVSplit" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreviewSplit, 'scope': "Bookmark", 'callback': s."previewNodeHSplit" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenRecursively, 'scope': "DirNode", 'callback': s."openNodeRecursively" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapUpdir, 'scope': "all", 'callback': s."upDirCurrentRootClosed" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapUpdirKeepOpen, 'scope': "all", 'callback': s."upDirCurrentRootOpen" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapChangeRoot, 'scope': "Node", 'callback': s."chRoot" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapChdir, 'scope': "Node", 'callback': s."chCwd" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapQuit, 'scope': "all", 'callback': s."closeTreeWindow" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapCWD, 'scope': "all", 'callback': "nerdtree#ui_glue#chRootCwd" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapRefreshRoot, 'scope': "all", 'callback': s."refreshRoot" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapRefresh, 'scope': "Node", 'callback': s."refreshCurrent" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapHelp, 'scope': "all", 'callback': s."displayHelp" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapToggleZoom, 'scope': "all", 'callback': s."toggleZoom" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapToggleHidden, 'scope': "all", 'callback': s."toggleShowHidden" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapToggleFilters, 'scope': "all", 'callback': s."toggleIgnoreFilter" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapToggleFiles, 'scope': "all", 'callback': s."toggleShowFiles" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapToggleBookmarks, 'scope': "all", 'callback': s."toggleShowBookmarks" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapCloseDir, 'scope': "Node", 'callback': s."closeCurrentDir" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapCloseChildren, 'scope': "DirNode", 'callback': s."closeChildren" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapMenu, 'scope': "Node", 'callback': s."showMenu" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpParent, 'scope': "Node", 'callback': s."jumpToParent" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpFirstChild, 'scope': "Node", 'callback': s."jumpToFirstChild" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpLastChild, 'scope': "Node", 'callback': s."jumpToLastChild" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpRoot, 'scope': "all", 'callback': s."jumpToRoot" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpNextSibling, 'scope': "Node", 'callback': s."jumpToNextSibling" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpPrevSibling, 'scope': "Node", 'callback': s."jumpToPrevSibling" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTab, 'scope': "Node", 'callback': s."openInNewTab" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTabSilent, 'scope': "Node", 'callback': s."openInNewTabSilent" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTab, 'scope': "Bookmark", 'callback': s."openInNewTab" })
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTabSilent, 'scope': "Bookmark", 'callback': s."openInNewTabSilent" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenExpl, 'scope': "DirNode", 'callback': s."openExplorer" })
|
||||
|
||||
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapDeleteBookmark, 'scope': "Bookmark", 'callback': s."deleteBookmark" })
|
||||
endfunction
|
||||
|
||||
|
||||
"SECTION: Interface bindings {{{1
|
||||
"============================================================
|
||||
|
||||
"FUNCTION: s:activateAll() {{{1
|
||||
"handle the user activating the updir line
|
||||
function! s:activateAll()
|
||||
if getline(".") ==# nerdtree#treeUpDirLine()
|
||||
return nerdtree#ui_glue#upDir(0)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:activateDirNode() {{{1
|
||||
"handle the user activating a tree node
|
||||
function! s:activateDirNode(node)
|
||||
call a:node.activate({'reuse': 1})
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:activateFileNode() {{{1
|
||||
"handle the user activating a tree node
|
||||
function! s:activateFileNode(node)
|
||||
call a:node.activate({'reuse': 1, 'where': 'p'})
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:activateBookmark() {{{1
|
||||
"handle the user activating a bookmark
|
||||
function! s:activateBookmark(bm)
|
||||
call a:bm.activate(!a:bm.path.isDirectory ? {'where': 'p'} : {})
|
||||
endfunction
|
||||
|
||||
" FUNCTION: nerdtree#ui_glue#bookmarkNode(name) {{{1
|
||||
" Associate the current node with the given name
|
||||
function! nerdtree#ui_glue#bookmarkNode(...)
|
||||
let currentNode = g:NERDTreeFileNode.GetSelected()
|
||||
if currentNode != {}
|
||||
let name = a:1
|
||||
if empty(name)
|
||||
let name = currentNode.path.getLastPathComponent(0)
|
||||
endif
|
||||
try
|
||||
call currentNode.bookmark(name)
|
||||
call b:NERDTree.render()
|
||||
catch /^NERDTree.IllegalBookmarkNameError/
|
||||
call nerdtree#echo("bookmark names must not contain spaces")
|
||||
endtry
|
||||
else
|
||||
call nerdtree#echo("select a node first")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:chCwd(node) {{{1
|
||||
function! s:chCwd(node)
|
||||
try
|
||||
call a:node.path.changeToDir()
|
||||
catch /^NERDTree.PathChangeError/
|
||||
call nerdtree#echoWarning("could not change cwd")
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:chRoot(node) {{{1
|
||||
" changes the current root to the selected one
|
||||
function! s:chRoot(node)
|
||||
call a:node.makeRoot()
|
||||
call b:NERDTree.render()
|
||||
call b:NERDTreeRoot.putCursorHere(0, 0)
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:nerdtree#ui_glue#chRootCwd() {{{1
|
||||
" changes the current root to CWD
|
||||
function! nerdtree#ui_glue#chRootCwd()
|
||||
try
|
||||
let cwd = g:NERDTreePath.New(getcwd())
|
||||
catch /^NERDTree.InvalidArgumentsError/
|
||||
call nerdtree#echo("current directory does not exist.")
|
||||
return
|
||||
endtry
|
||||
if cwd.str() == g:NERDTreeFileNode.GetRootForTab().path.str()
|
||||
return
|
||||
endif
|
||||
call s:chRoot(g:NERDTreeDirNode.New(cwd))
|
||||
endfunction
|
||||
|
||||
" FUNCTION: nnerdtree#ui_glue#clearBookmarks(bookmarks) {{{1
|
||||
function! nerdtree#ui_glue#clearBookmarks(bookmarks)
|
||||
if a:bookmarks ==# ''
|
||||
let currentNode = g:NERDTreeFileNode.GetSelected()
|
||||
if currentNode != {}
|
||||
call currentNode.clearBookmarks()
|
||||
endif
|
||||
else
|
||||
for name in split(a:bookmarks, ' ')
|
||||
let bookmark = g:NERDTreeBookmark.BookmarkFor(name)
|
||||
call bookmark.delete()
|
||||
endfor
|
||||
endif
|
||||
call b:NERDTree.render()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:closeChildren(node) {{{1
|
||||
" closes all childnodes of the current node
|
||||
function! s:closeChildren(node)
|
||||
call a:node.closeChildren()
|
||||
call b:NERDTree.render()
|
||||
call a:node.putCursorHere(0, 0)
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:closeCurrentDir(node) {{{1
|
||||
" closes the parent dir of the current node
|
||||
function! s:closeCurrentDir(node)
|
||||
let parent = a:node.parent
|
||||
if parent ==# {} || parent.isRoot()
|
||||
call nerdtree#echo("cannot close tree root")
|
||||
else
|
||||
while g:NERDTreeCascadeOpenSingleChildDir && !parent.parent.isRoot()
|
||||
if parent.parent.getVisibleChildCount() == 1
|
||||
call parent.close()
|
||||
let parent = parent.parent
|
||||
else
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
call parent.close()
|
||||
call b:NERDTree.render()
|
||||
call parent.putCursorHere(0, 0)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:closeTreeWindow() {{{1
|
||||
" close the tree window
|
||||
function! s:closeTreeWindow()
|
||||
if b:NERDTreeType ==# "secondary" && b:NERDTreePreviousBuf != -1
|
||||
exec "buffer " . b:NERDTreePreviousBuf
|
||||
else
|
||||
if winnr("$") > 1
|
||||
call nerdtree#closeTree()
|
||||
else
|
||||
call nerdtree#echo("Cannot close last window")
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:deleteBookmark(bm) {{{1
|
||||
" if the cursor is on a bookmark, prompt to delete
|
||||
function! s:deleteBookmark(bm)
|
||||
echo "Are you sure you wish to delete the bookmark:\n\"" . a:bm.name . "\" (yN):"
|
||||
|
||||
if nr2char(getchar()) ==# 'y'
|
||||
try
|
||||
call a:bm.delete()
|
||||
call b:NERDTree.render()
|
||||
redraw
|
||||
catch /^NERDTree/
|
||||
call nerdtree#echoWarning("Could not remove bookmark")
|
||||
endtry
|
||||
else
|
||||
call nerdtree#echo("delete aborted" )
|
||||
endif
|
||||
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:displayHelp() {{{1
|
||||
" toggles the help display
|
||||
function! s:displayHelp()
|
||||
let b:treeShowHelp = b:treeShowHelp ? 0 : 1
|
||||
call b:NERDTree.render()
|
||||
call b:NERDTree.ui.centerView()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:findAndRevealPath() {{{1
|
||||
function! s:findAndRevealPath()
|
||||
try
|
||||
let p = g:NERDTreePath.New(expand("%:p"))
|
||||
catch /^NERDTree.InvalidArgumentsError/
|
||||
call nerdtree#echo("no file for the current buffer")
|
||||
return
|
||||
endtry
|
||||
|
||||
if p.isUnixHiddenPath()
|
||||
let showhidden=g:NERDTreeShowHidden
|
||||
let g:NERDTreeShowHidden = 1
|
||||
endif
|
||||
|
||||
if !g:NERDTree.ExistsForTab()
|
||||
try
|
||||
let cwd = g:NERDTreePath.New(getcwd())
|
||||
catch /^NERDTree.InvalidArgumentsError/
|
||||
call nerdtree#echo("current directory does not exist.")
|
||||
let cwd = p.getParent()
|
||||
endtry
|
||||
|
||||
if p.isUnder(cwd)
|
||||
call g:NERDTreeCreator.CreatePrimary(cwd.str())
|
||||
else
|
||||
call g:NERDTreeCreator.CreatePrimary(p.getParent().str())
|
||||
endif
|
||||
else
|
||||
if !p.isUnder(g:NERDTreeFileNode.GetRootForTab().path)
|
||||
if !nerdtree#isTreeOpen()
|
||||
call g:NERDTreeCreator.TogglePrimary('')
|
||||
else
|
||||
call nerdtree#putCursorInTreeWin()
|
||||
endif
|
||||
let b:NERDTreeShowHidden = g:NERDTreeShowHidden
|
||||
call s:chRoot(g:NERDTreeDirNode.New(p.getParent()))
|
||||
else
|
||||
if !nerdtree#isTreeOpen()
|
||||
call g:NERDTreeCreator.TogglePrimary("")
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
call nerdtree#putCursorInTreeWin()
|
||||
call b:NERDTreeRoot.reveal(p)
|
||||
|
||||
if p.isUnixHiddenFile()
|
||||
let g:NERDTreeShowHidden = showhidden
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:handleLeftClick() {{{1
|
||||
"Checks if the click should open the current node
|
||||
function! s:handleLeftClick()
|
||||
let currentNode = g:NERDTreeFileNode.GetSelected()
|
||||
if currentNode != {}
|
||||
|
||||
"the dir arrows are multibyte chars, and vim's string functions only
|
||||
"deal with single bytes - so split the line up with the hack below and
|
||||
"take the line substring manually
|
||||
let line = split(getline(line(".")), '\zs')
|
||||
let startToCur = ""
|
||||
for i in range(0,len(line)-1)
|
||||
let startToCur .= line[i]
|
||||
endfor
|
||||
|
||||
if currentNode.path.isDirectory
|
||||
if startToCur =~# nerdtree#treeMarkupReg() && startToCur =~# '[+~▾▸] \?$'
|
||||
call currentNode.activate()
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
if (g:NERDTreeMouseMode ==# 2 && currentNode.path.isDirectory) || g:NERDTreeMouseMode ==# 3
|
||||
let char = strpart(startToCur, strlen(startToCur)-1, 1)
|
||||
if char !~# nerdtree#treeMarkupReg()
|
||||
if currentNode.path.isDirectory
|
||||
call currentNode.activate()
|
||||
else
|
||||
call currentNode.activate({'reuse': 1, 'where': 'p'})
|
||||
endif
|
||||
return
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:handleMiddleMouse() {{{1
|
||||
function! s:handleMiddleMouse()
|
||||
let curNode = g:NERDTreeFileNode.GetSelected()
|
||||
if curNode ==# {}
|
||||
call nerdtree#echo("Put the cursor on a node first" )
|
||||
return
|
||||
endif
|
||||
|
||||
if curNode.path.isDirectory
|
||||
call nerdtree#openExplorer(curNode)
|
||||
else
|
||||
call curNode.open({'where': 'h'})
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:jumpToChild(direction) {{{2
|
||||
" Args:
|
||||
" direction: 0 if going to first child, 1 if going to last
|
||||
function! s:jumpToChild(currentNode, direction)
|
||||
if a:currentNode.isRoot()
|
||||
return nerdtree#echo("cannot jump to " . (a:direction ? "last" : "first") . " child")
|
||||
end
|
||||
let dirNode = a:currentNode.parent
|
||||
let childNodes = dirNode.getVisibleChildren()
|
||||
|
||||
let targetNode = childNodes[0]
|
||||
if a:direction
|
||||
let targetNode = childNodes[len(childNodes) - 1]
|
||||
endif
|
||||
|
||||
if targetNode.equals(a:currentNode)
|
||||
let siblingDir = a:currentNode.parent.findOpenDirSiblingWithVisibleChildren(a:direction)
|
||||
if siblingDir != {}
|
||||
let indx = a:direction ? siblingDir.getVisibleChildCount()-1 : 0
|
||||
let targetNode = siblingDir.getChildByIndex(indx, 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
call targetNode.putCursorHere(1, 0)
|
||||
|
||||
call b:NERDTree.ui.centerView()
|
||||
endfunction
|
||||
|
||||
|
||||
" FUNCTION: nerdtree#ui_glue#invokeKeyMap(key) {{{1
|
||||
"this is needed since I cant figure out how to invoke dict functions from a
|
||||
"key map
|
||||
function! nerdtree#ui_glue#invokeKeyMap(key)
|
||||
call g:NERDTreeKeyMap.Invoke(a:key)
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:jumpToFirstChild() {{{1
|
||||
" wrapper for the jump to child method
|
||||
function! s:jumpToFirstChild(node)
|
||||
call s:jumpToChild(a:node, 0)
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:jumpToLastChild() {{{1
|
||||
" wrapper for the jump to child method
|
||||
function! s:jumpToLastChild(node)
|
||||
call s:jumpToChild(a:node, 1)
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:jumpToParent(node) {{{1
|
||||
" moves the cursor to the parent of the current node
|
||||
function! s:jumpToParent(node)
|
||||
if !empty(a:node.parent)
|
||||
call a:node.parent.putCursorHere(1, 0)
|
||||
call b:NERDTree.ui.centerView()
|
||||
else
|
||||
call nerdtree#echo("cannot jump to parent")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:jumpToRoot() {{{1
|
||||
" moves the cursor to the root node
|
||||
function! s:jumpToRoot()
|
||||
call b:NERDTreeRoot.putCursorHere(1, 0)
|
||||
call b:NERDTree.ui.centerView()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:jumpToNextSibling(node) {{{1
|
||||
function! s:jumpToNextSibling(node)
|
||||
call s:jumpToSibling(a:node, 1)
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:jumpToPrevSibling(node) {{{1
|
||||
function! s:jumpToPrevSibling(node)
|
||||
call s:jumpToSibling(a:node, 0)
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:jumpToSibling(currentNode, forward) {{{2
|
||||
" moves the cursor to the sibling of the current node in the given direction
|
||||
"
|
||||
" Args:
|
||||
" forward: 1 if the cursor should move to the next sibling, 0 if it should
|
||||
" move back to the previous sibling
|
||||
function! s:jumpToSibling(currentNode, forward)
|
||||
let sibling = a:currentNode.findSibling(a:forward)
|
||||
|
||||
if !empty(sibling)
|
||||
call sibling.putCursorHere(1, 0)
|
||||
call b:NERDTree.ui.centerView()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: nerdtree#ui_glue#openBookmark(name) {{{1
|
||||
" put the cursor on the given bookmark and, if its a file, open it
|
||||
function! nerdtree#ui_glue#openBookmark(name)
|
||||
try
|
||||
let targetNode = g:NERDTreeBookmark.GetNodeForName(a:name, 0)
|
||||
call targetNode.putCursorHere(0, 1)
|
||||
redraw!
|
||||
catch /^NERDTree.BookmarkedNodeNotFoundError/
|
||||
call nerdtree#echo("note - target node is not cached")
|
||||
let bookmark = g:NERDTreeBookmark.BookmarkFor(a:name)
|
||||
let targetNode = g:NERDTreeFileNode.New(bookmark.path)
|
||||
endtry
|
||||
if targetNode.path.isDirectory
|
||||
call targetNode.openExplorer()
|
||||
else
|
||||
call targetNode.open({'where': 'p'})
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:openHSplit(target) {{{1
|
||||
function! s:openHSplit(target)
|
||||
call a:target.activate({'where': 'h'})
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:openVSplit(target) {{{1
|
||||
function! s:openVSplit(target)
|
||||
call a:target.activate({'where': 'v'})
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:openExplorer(node) {{{1
|
||||
function! s:openExplorer(node)
|
||||
call a:node.openExplorer()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:openInNewTab(target) {{{1
|
||||
function! s:openInNewTab(target)
|
||||
call a:target.activate({'where': 't'})
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:openInNewTabSilent(target) {{{1
|
||||
function! s:openInNewTabSilent(target)
|
||||
call a:target.activate({'where': 't', 'stay': 1})
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:openNodeRecursively(node) {{{1
|
||||
function! s:openNodeRecursively(node)
|
||||
call nerdtree#echo("Recursively opening node. Please wait...")
|
||||
call a:node.openRecursively()
|
||||
call b:NERDTree.render()
|
||||
redraw
|
||||
call nerdtree#echo("Recursively opening node. Please wait... DONE")
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:previewNodeCurrent(node) {{{1
|
||||
function! s:previewNodeCurrent(node)
|
||||
call a:node.open({'stay': 1, 'where': 'p', 'keepopen': 1})
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:previewNodeHSplit(node) {{{1
|
||||
function! s:previewNodeHSplit(node)
|
||||
call a:node.open({'stay': 1, 'where': 'h', 'keepopen': 1})
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:previewNodeVSplit(node) {{{1
|
||||
function! s:previewNodeVSplit(node)
|
||||
call a:node.open({'stay': 1, 'where': 'v', 'keepopen': 1})
|
||||
endfunction
|
||||
|
||||
" FUNCTION: nerdtree#ui_glue#revealBookmark(name) {{{1
|
||||
" put the cursor on the node associate with the given name
|
||||
function! nerdtree#ui_glue#revealBookmark(name)
|
||||
try
|
||||
let targetNode = g:NERDTreeBookmark.GetNodeForName(a:name, 0)
|
||||
call targetNode.putCursorHere(0, 1)
|
||||
catch /^NERDTree.BookmarkNotFoundError/
|
||||
call nerdtree#echo("Bookmark isnt cached under the current root")
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:refreshRoot() {{{1
|
||||
" Reloads the current root. All nodes below this will be lost and the root dir
|
||||
" will be reloaded.
|
||||
function! s:refreshRoot()
|
||||
call nerdtree#echo("Refreshing the root node. This could take a while...")
|
||||
call b:NERDTreeRoot.refresh()
|
||||
call b:NERDTree.render()
|
||||
redraw
|
||||
call nerdtree#echo("Refreshing the root node. This could take a while... DONE")
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:refreshCurrent(node) {{{1
|
||||
" refreshes the root for the current node
|
||||
function! s:refreshCurrent(node)
|
||||
let node = a:node
|
||||
if !node.path.isDirectory
|
||||
let node = node.parent
|
||||
endif
|
||||
|
||||
call nerdtree#echo("Refreshing node. This could take a while...")
|
||||
call node.refresh()
|
||||
call b:NERDTree.render()
|
||||
redraw
|
||||
call nerdtree#echo("Refreshing node. This could take a while... DONE")
|
||||
endfunction
|
||||
|
||||
" FUNCTION: nerdtree#ui_glue#setupCommands() {{{1
|
||||
function! nerdtree#ui_glue#setupCommands()
|
||||
command! -n=? -complete=dir -bar NERDTree :call g:NERDTreeCreator.CreatePrimary('<args>')
|
||||
command! -n=? -complete=dir -bar NERDTreeToggle :call g:NERDTreeCreator.TogglePrimary('<args>')
|
||||
command! -n=0 -bar NERDTreeClose :call nerdtree#closeTreeIfOpen()
|
||||
command! -n=1 -complete=customlist,nerdtree#completeBookmarks -bar NERDTreeFromBookmark call g:NERDTreeCreator.CreatePrimary('<args>')
|
||||
command! -n=0 -bar NERDTreeMirror call g:NERDTreeCreator.CreateMirror()
|
||||
command! -n=0 -bar NERDTreeFind call s:findAndRevealPath()
|
||||
command! -n=0 -bar NERDTreeFocus call NERDTreeFocus()
|
||||
command! -n=0 -bar NERDTreeCWD call NERDTreeCWD()
|
||||
endfunction
|
||||
|
||||
" Function: s:SID() {{{1
|
||||
function s:SID()
|
||||
if !exists("s:sid")
|
||||
let s:sid = matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
|
||||
endif
|
||||
return s:sid
|
||||
endfun
|
||||
|
||||
" FUNCTION: s:showMenu(node) {{{1
|
||||
function! s:showMenu(node)
|
||||
let mc = g:NERDTreeMenuController.New(g:NERDTreeMenuItem.AllEnabled())
|
||||
call mc.showMenu()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:toggleIgnoreFilter() {{{1
|
||||
function! s:toggleIgnoreFilter()
|
||||
call b:NERDTree.ui.toggleIgnoreFilter()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:toggleShowBookmarks() {{{1
|
||||
function! s:toggleShowBookmarks()
|
||||
call b:NERDTree.ui.toggleShowBookmarks()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:toggleShowFiles() {{{1
|
||||
function! s:toggleShowFiles()
|
||||
call b:NERDTree.ui.toggleShowFiles()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:toggleShowHidden() {{{1
|
||||
" toggles the display of hidden files
|
||||
function! s:toggleShowHidden()
|
||||
call b:NERDTree.ui.toggleShowHidden()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:toggleZoom() {{{1
|
||||
function! s:toggleZoom()
|
||||
call b:NERDTree.ui.toggleZoom()
|
||||
endfunction
|
||||
|
||||
"FUNCTION: nerdtree#ui_glue#upDir(keepState) {{{1
|
||||
"moves the tree up a level
|
||||
"
|
||||
"Args:
|
||||
"keepState: 1 if the current root should be left open when the tree is
|
||||
"re-rendered
|
||||
function! nerdtree#ui_glue#upDir(keepState)
|
||||
let cwd = b:NERDTreeRoot.path.str({'format': 'UI'})
|
||||
if cwd ==# "/" || cwd =~# '^[^/]..$'
|
||||
call nerdtree#echo("already at top dir")
|
||||
else
|
||||
if !a:keepState
|
||||
call b:NERDTreeRoot.close()
|
||||
endif
|
||||
|
||||
let oldRoot = b:NERDTreeRoot
|
||||
|
||||
if empty(b:NERDTreeRoot.parent)
|
||||
let path = b:NERDTreeRoot.path.getParent()
|
||||
let newRoot = g:NERDTreeDirNode.New(path)
|
||||
call newRoot.open()
|
||||
call newRoot.transplantChild(b:NERDTreeRoot)
|
||||
let b:NERDTreeRoot = newRoot
|
||||
else
|
||||
let b:NERDTreeRoot = b:NERDTreeRoot.parent
|
||||
endif
|
||||
|
||||
if g:NERDTreeChDirMode ==# 2
|
||||
call b:NERDTreeRoot.path.changeToDir()
|
||||
endif
|
||||
|
||||
call b:NERDTree.render()
|
||||
call oldRoot.putCursorHere(0, 0)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:upDirCurrentRootOpen() {{{1
|
||||
function! s:upDirCurrentRootOpen()
|
||||
call nerdtree#ui_glue#upDir(1)
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:upDirCurrentRootClosed() {{{1
|
||||
function! s:upDirCurrentRootClosed()
|
||||
call nerdtree#ui_glue#upDir(0)
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
13
sources_non_forked/nerdtree/lib/nerdtree/event.vim
Normal file
13
sources_non_forked/nerdtree/lib/nerdtree/event.vim
Normal file
@ -0,0 +1,13 @@
|
||||
"CLASS: Event
|
||||
"============================================================
|
||||
let s:Event = {}
|
||||
let g:NERDTreeEvent = s:Event
|
||||
|
||||
function! s:Event.New(nerdtree, subject, action, params) abort
|
||||
let newObj = copy(self)
|
||||
let newObj.nerdtree = a:nerdtree
|
||||
let newObj.subject = a:subject
|
||||
let newObj.action = a:action
|
||||
let newObj.params = a:params
|
||||
return newObj
|
||||
endfunction
|
56
sources_non_forked/nerdtree/lib/nerdtree/flag_set.vim
Normal file
56
sources_non_forked/nerdtree/lib/nerdtree/flag_set.vim
Normal file
@ -0,0 +1,56 @@
|
||||
"CLASS: FlagSet
|
||||
"============================================================
|
||||
let s:FlagSet = {}
|
||||
let g:NERDTreeFlagSet = s:FlagSet
|
||||
|
||||
"FUNCTION: FlagSet.addFlag(scope, flag) {{{1
|
||||
function! s:FlagSet.addFlag(scope, flag)
|
||||
let flags = self._flagsForScope(a:scope)
|
||||
if index(flags, a:flag) == -1
|
||||
call add(flags, a:flag)
|
||||
end
|
||||
endfunction
|
||||
|
||||
"FUNCTION: FlagSet.clearFlags(scope) {{{1
|
||||
function! s:FlagSet.clearFlags(scope)
|
||||
let self._flags[a:scope] = []
|
||||
endfunction
|
||||
|
||||
"FUNCTION: FlagSet._flagsForScope(scope) {{{1
|
||||
function! s:FlagSet._flagsForScope(scope)
|
||||
if !has_key(self._flags, a:scope)
|
||||
let self._flags[a:scope] = []
|
||||
endif
|
||||
return self._flags[a:scope]
|
||||
endfunction
|
||||
|
||||
"FUNCTION: FlagSet.New() {{{1
|
||||
function! s:FlagSet.New()
|
||||
let newObj = copy(self)
|
||||
let newObj._flags = {}
|
||||
return newObj
|
||||
endfunction
|
||||
|
||||
"FUNCTION: FlagSet.removeFlag(scope, flag) {{{1
|
||||
function! s:FlagSet.removeFlag(scope, flag)
|
||||
let flags = self._flagsForScope(a:scope)
|
||||
|
||||
let i = index(flags, a:flag)
|
||||
if i >= 0
|
||||
call remove(flags, i)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"FUNCTION: FlagSet.renderToString() {{{1
|
||||
function! s:FlagSet.renderToString()
|
||||
let flagstring = ""
|
||||
for i in values(self._flags)
|
||||
let flagstring .= join(i)
|
||||
endfor
|
||||
|
||||
if len(flagstring) == 0
|
||||
return ""
|
||||
endif
|
||||
|
||||
return '[' . flagstring . ']'
|
||||
endfunction
|
39
sources_non_forked/nerdtree/lib/nerdtree/nerdtree.vim
Normal file
39
sources_non_forked/nerdtree/lib/nerdtree/nerdtree.vim
Normal file
@ -0,0 +1,39 @@
|
||||
"CLASS: NERDTree
|
||||
"============================================================
|
||||
let s:NERDTree = {}
|
||||
let g:NERDTree = s:NERDTree
|
||||
|
||||
" Function: s:NERDTree.ExistsForBuffer() {{{1
|
||||
" Returns 1 if a nerd tree root exists in the current buffer
|
||||
function! s:NERDTree.ExistsForBuf()
|
||||
return exists("b:NERDTreeRoot")
|
||||
endfunction
|
||||
|
||||
" Function: s:NERDTree.ExistsForTab() {{{1
|
||||
" Returns 1 if a nerd tree root exists in the current tab
|
||||
function! s:NERDTree.ExistsForTab()
|
||||
return exists("t:NERDTreeBufName")
|
||||
endfunction
|
||||
|
||||
function! s:NERDTree.ForCurrentBuf()
|
||||
if s:NERDTree.ExistsForBuf()
|
||||
return b:NERDTree
|
||||
else
|
||||
return {}
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:NERDTree.New(path)
|
||||
let newObj = copy(self)
|
||||
let newObj.ui = g:NERDTreeUI.New(newObj)
|
||||
let newObj.root = g:NERDTreeDirNode.New(a:path)
|
||||
|
||||
return newObj
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:NERDTree.render() {{{1
|
||||
"A convenience function - since this is called often
|
||||
function! s:NERDTree.render()
|
||||
call self.ui.render()
|
||||
endfunction
|
||||
|
35
sources_non_forked/nerdtree/lib/nerdtree/notifier.vim
Normal file
35
sources_non_forked/nerdtree/lib/nerdtree/notifier.vim
Normal file
@ -0,0 +1,35 @@
|
||||
"CLASS: Notifier
|
||||
"============================================================
|
||||
let s:Notifier = {}
|
||||
|
||||
function! s:Notifier.AddListener(event, funcname)
|
||||
let listeners = s:Notifier.GetListenersForEvent(a:event)
|
||||
if listeners == []
|
||||
let listenersMap = s:Notifier.GetListenersMap()
|
||||
let listenersMap[a:event] = listeners
|
||||
endif
|
||||
call add(listeners, a:funcname)
|
||||
endfunction
|
||||
|
||||
function! s:Notifier.NotifyListeners(event, path, params)
|
||||
let event = g:NERDTreeEvent.New(b:NERDTree, a:path, a:event, a:params)
|
||||
|
||||
for listener in s:Notifier.GetListenersForEvent(a:event)
|
||||
call {listener}(event)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! s:Notifier.GetListenersMap()
|
||||
if !exists("s:refreshListenersMap")
|
||||
let s:refreshListenersMap = {}
|
||||
endif
|
||||
return s:refreshListenersMap
|
||||
endfunction
|
||||
|
||||
function! s:Notifier.GetListenersForEvent(name)
|
||||
let listenersMap = s:Notifier.GetListenersMap()
|
||||
return get(listenersMap, a:name, [])
|
||||
endfunction
|
||||
|
||||
let g:NERDTreePathNotifier = deepcopy(s:Notifier)
|
||||
|
332
sources_non_forked/nerdtree/lib/nerdtree/ui.vim
Normal file
332
sources_non_forked/nerdtree/lib/nerdtree/ui.vim
Normal file
@ -0,0 +1,332 @@
|
||||
"CLASS: UI
|
||||
"============================================================
|
||||
let s:UI = {}
|
||||
let g:NERDTreeUI = s:UI
|
||||
|
||||
|
||||
function! s:UI.lolcats()
|
||||
echomsg "lolcats"
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:UI.centerView() {{{2
|
||||
"centers the nerd tree window around the cursor (provided the nerd tree
|
||||
"options permit)
|
||||
function! s:UI.centerView()
|
||||
if g:NERDTreeAutoCenter
|
||||
let current_line = winline()
|
||||
let lines_to_top = current_line
|
||||
let lines_to_bottom = winheight(nerdtree#getTreeWinNum()) - current_line
|
||||
if lines_to_top < g:NERDTreeAutoCenterThreshold || lines_to_bottom < g:NERDTreeAutoCenterThreshold
|
||||
normal! zz
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:UI.new(nerdtree) {{{1
|
||||
function! s:UI.New(nerdtree)
|
||||
let newObj = copy(self)
|
||||
let newObj.nerdtree = a:nerdtree
|
||||
return newObj
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:UI.getPath(ln) {{{1
|
||||
"Gets the full path to the node that is rendered on the given line number
|
||||
"
|
||||
"Args:
|
||||
"ln: the line number to get the path for
|
||||
"
|
||||
"Return:
|
||||
"A path if a node was selected, {} if nothing is selected.
|
||||
"If the 'up a dir' line was selected then the path to the parent of the
|
||||
"current root is returned
|
||||
function! s:UI.getPath(ln)
|
||||
let line = getline(a:ln)
|
||||
|
||||
let rootLine = self.getRootLineNum()
|
||||
|
||||
"check to see if we have the root node
|
||||
if a:ln == rootLine
|
||||
return b:NERDTreeRoot.path
|
||||
endif
|
||||
|
||||
if !g:NERDTreeDirArrows
|
||||
" in case called from outside the tree
|
||||
if line !~# '^ *[|`▸▾ ]' || line =~# '^$'
|
||||
return {}
|
||||
endif
|
||||
endif
|
||||
|
||||
if line ==# nerdtree#treeUpDirLine()
|
||||
return b:NERDTreeRoot.path.getParent()
|
||||
endif
|
||||
|
||||
let indent = self._indentLevelFor(line)
|
||||
|
||||
"remove the tree parts and the leading space
|
||||
let curFile = nerdtree#stripMarkupFromLine(line, 0)
|
||||
|
||||
let wasdir = 0
|
||||
if curFile =~# '/$'
|
||||
let wasdir = 1
|
||||
let curFile = substitute(curFile, '/\?$', '/', "")
|
||||
endif
|
||||
|
||||
let dir = ""
|
||||
let lnum = a:ln
|
||||
while lnum > 0
|
||||
let lnum = lnum - 1
|
||||
let curLine = getline(lnum)
|
||||
let curLineStripped = nerdtree#stripMarkupFromLine(curLine, 1)
|
||||
|
||||
"have we reached the top of the tree?
|
||||
if lnum == rootLine
|
||||
let dir = b:NERDTreeRoot.path.str({'format': 'UI'}) . dir
|
||||
break
|
||||
endif
|
||||
if curLineStripped =~# '/$'
|
||||
let lpindent = self._indentLevelFor(curLine)
|
||||
if lpindent < indent
|
||||
let indent = indent - 1
|
||||
|
||||
let dir = substitute (curLineStripped,'^\\', "", "") . dir
|
||||
continue
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
let curFile = b:NERDTreeRoot.path.drive . dir . curFile
|
||||
let toReturn = g:NERDTreePath.New(curFile)
|
||||
return toReturn
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:UI.getLineNum(file_node){{{1
|
||||
"returns the line number this node is rendered on, or -1 if it isnt rendered
|
||||
function! s:UI.getLineNum(file_node)
|
||||
"if the node is the root then return the root line no.
|
||||
if a:file_node.isRoot()
|
||||
return b:NERDTree.ui.getRootLineNum()
|
||||
endif
|
||||
|
||||
let totalLines = line("$")
|
||||
|
||||
"the path components we have matched so far
|
||||
let pathcomponents = [substitute(b:NERDTreeRoot.path.str({'format': 'UI'}), '/ *$', '', '')]
|
||||
"the index of the component we are searching for
|
||||
let curPathComponent = 1
|
||||
|
||||
let fullpath = a:file_node.path.str({'format': 'UI'})
|
||||
|
||||
let lnum = b:NERDTree.ui.getRootLineNum()
|
||||
while lnum > 0
|
||||
let lnum = lnum + 1
|
||||
"have we reached the bottom of the tree?
|
||||
if lnum ==# totalLines+1
|
||||
return -1
|
||||
endif
|
||||
|
||||
let curLine = getline(lnum)
|
||||
|
||||
let indent = self._indentLevelFor(curLine)
|
||||
if indent ==# curPathComponent
|
||||
let curLine = nerdtree#stripMarkupFromLine(curLine, 1)
|
||||
|
||||
let curPath = join(pathcomponents, '/') . '/' . curLine
|
||||
if stridx(fullpath, curPath, 0) ==# 0
|
||||
if fullpath ==# curPath || strpart(fullpath, len(curPath)-1,1) ==# '/'
|
||||
let curLine = substitute(curLine, '/ *$', '', '')
|
||||
call add(pathcomponents, curLine)
|
||||
let curPathComponent = curPathComponent + 1
|
||||
|
||||
if fullpath ==# curPath
|
||||
return lnum
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
|
||||
"FUNCTION: s:UI.getRootLineNum(){{{1
|
||||
"gets the line number of the root node
|
||||
function! s:UI.getRootLineNum()
|
||||
let rootLine = 1
|
||||
while getline(rootLine) !~# '^\(/\|<\)'
|
||||
let rootLine = rootLine + 1
|
||||
endwhile
|
||||
return rootLine
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:UI._indentLevelFor(line) {{{2
|
||||
function! s:UI._indentLevelFor(line)
|
||||
let level = match(a:line, '[^ \-+~▸▾`|]') / nerdtree#treeWid()
|
||||
" check if line includes arrows
|
||||
if match(a:line, '[▸▾]') > -1
|
||||
" decrement level as arrow uses 3 ascii chars
|
||||
let level = level - 1
|
||||
endif
|
||||
return level
|
||||
endfunction
|
||||
|
||||
|
||||
"FUNCTION: s:UI.restoreScreenState() {{{2
|
||||
"
|
||||
"Sets the screen state back to what it was when nerdtree#saveScreenState was last
|
||||
"called.
|
||||
"
|
||||
"Assumes the cursor is in the NERDTree window
|
||||
function! s:UI.restoreScreenState()
|
||||
if !has_key(self, '_screenState')
|
||||
return
|
||||
endif
|
||||
exec("silent vertical resize " . self._screenState['oldWindowSize'])
|
||||
|
||||
let old_scrolloff=&scrolloff
|
||||
let &scrolloff=0
|
||||
call cursor(self._screenState['oldTopLine'], 0)
|
||||
normal! zt
|
||||
call setpos(".", self._screenState['oldPos'])
|
||||
let &scrolloff=old_scrolloff
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:UI.saveScreenState() {{{2
|
||||
"Saves the current cursor position in the current buffer and the window
|
||||
"scroll position
|
||||
function! s:UI.saveScreenState()
|
||||
let win = winnr()
|
||||
try
|
||||
call nerdtree#putCursorInTreeWin()
|
||||
let self._screenState = {}
|
||||
let self._screenState['oldPos'] = getpos(".")
|
||||
let self._screenState['oldTopLine'] = line("w0")
|
||||
let self._screenState['oldWindowSize']= winwidth("")
|
||||
call nerdtree#exec(win . "wincmd w")
|
||||
catch /^NERDTree.InvalidOperationError/
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:UI.render() {{{2
|
||||
function! s:UI.render()
|
||||
setlocal modifiable
|
||||
|
||||
"remember the top line of the buffer and the current line so we can
|
||||
"restore the view exactly how it was
|
||||
let curLine = line(".")
|
||||
let curCol = col(".")
|
||||
let topLine = line("w0")
|
||||
|
||||
"delete all lines in the buffer (being careful not to clobber a register)
|
||||
silent 1,$delete _
|
||||
|
||||
call nerdtree#dumpHelp()
|
||||
|
||||
"delete the blank line before the help and add one after it
|
||||
if g:NERDTreeMinimalUI == 0
|
||||
call setline(line(".")+1, "")
|
||||
call cursor(line(".")+1, col("."))
|
||||
endif
|
||||
|
||||
if b:NERDTreeShowBookmarks
|
||||
call nerdtree#renderBookmarks()
|
||||
endif
|
||||
|
||||
"add the 'up a dir' line
|
||||
if !g:NERDTreeMinimalUI
|
||||
call setline(line(".")+1, nerdtree#treeUpDirLine())
|
||||
call cursor(line(".")+1, col("."))
|
||||
endif
|
||||
|
||||
"draw the header line
|
||||
let header = b:NERDTreeRoot.path.str({'format': 'UI', 'truncateTo': winwidth(0)})
|
||||
call setline(line(".")+1, header)
|
||||
call cursor(line(".")+1, col("."))
|
||||
|
||||
"draw the tree
|
||||
let old_o = @o
|
||||
let @o = b:NERDTreeRoot.renderToString()
|
||||
silent put o
|
||||
let @o = old_o
|
||||
|
||||
"delete the blank line at the top of the buffer
|
||||
silent 1,1delete _
|
||||
|
||||
"restore the view
|
||||
let old_scrolloff=&scrolloff
|
||||
let &scrolloff=0
|
||||
call cursor(topLine, 1)
|
||||
normal! zt
|
||||
call cursor(curLine, curCol)
|
||||
let &scrolloff = old_scrolloff
|
||||
|
||||
setlocal nomodifiable
|
||||
endfunction
|
||||
|
||||
|
||||
"FUNCTION: UI.renderViewSavingPosition {{{1
|
||||
"Renders the tree and ensures the cursor stays on the current node or the
|
||||
"current nodes parent if it is no longer available upon re-rendering
|
||||
function! s:UI.renderViewSavingPosition()
|
||||
let currentNode = g:NERDTreeFileNode.GetSelected()
|
||||
|
||||
"go up the tree till we find a node that will be visible or till we run
|
||||
"out of nodes
|
||||
while currentNode != {} && !currentNode.isVisible() && !currentNode.isRoot()
|
||||
let currentNode = currentNode.parent
|
||||
endwhile
|
||||
|
||||
call b:NERDTree.render()
|
||||
|
||||
if currentNode != {}
|
||||
call currentNode.putCursorHere(0, 0)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:UI.toggleIgnoreFilter() {{{1
|
||||
" toggles the use of the NERDTreeIgnore option
|
||||
function! s:UI.toggleIgnoreFilter()
|
||||
let b:NERDTreeIgnoreEnabled = !b:NERDTreeIgnoreEnabled
|
||||
call b:NERDTree.ui.renderViewSavingPosition()
|
||||
call b:NERDTree.ui.centerView()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:UI.toggleShowBookmarks() {{{1
|
||||
" toggles the display of bookmarks
|
||||
function! s:UI.toggleShowBookmarks()
|
||||
let b:NERDTreeShowBookmarks = !b:NERDTreeShowBookmarks
|
||||
if b:NERDTreeShowBookmarks
|
||||
call b:NERDTree.render()
|
||||
call nerdtree#putCursorOnBookmarkTable()
|
||||
else
|
||||
call b:NERDTree.ui.renderViewSavingPosition()
|
||||
endif
|
||||
call b:NERDTree.ui.centerView()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:UI.toggleShowFiles() {{{1
|
||||
" toggles the display of hidden files
|
||||
function! s:UI.toggleShowFiles()
|
||||
let b:NERDTreeShowFiles = !b:NERDTreeShowFiles
|
||||
call b:NERDTree.ui.renderViewSavingPosition()
|
||||
call b:NERDTree.ui.centerView()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:UI.toggleShowHidden() {{{1
|
||||
" toggles the display of hidden files
|
||||
function! s:UI.toggleShowHidden()
|
||||
let b:NERDTreeShowHidden = !b:NERDTreeShowHidden
|
||||
call b:NERDTree.ui.renderViewSavingPosition()
|
||||
call self.centerView()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:UI.toggleZoom() {{{1
|
||||
" zoom (maximize/minimize) the NERDTree window
|
||||
function! s:UI.toggleZoom()
|
||||
if exists("b:NERDTreeZoomed") && b:NERDTreeZoomed
|
||||
let size = exists("b:NERDTreeOldWindowSize") ? b:NERDTreeOldWindowSize : g:NERDTreeWinSize
|
||||
exec "silent vertical resize ". size
|
||||
let b:NERDTreeZoomed = 0
|
||||
else
|
||||
exec "vertical resize"
|
||||
let b:NERDTreeZoomed = 1
|
||||
endif
|
||||
endfunction
|
@ -0,0 +1,26 @@
|
||||
"============================================================================
|
||||
"File: avrgcc.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Karel <karelishere at gmail dot com>
|
||||
"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_syntastic_arduino_avrgcc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_arduino_avrgcc_checker = 1
|
||||
|
||||
runtime! syntax_checkers/c/*.vim
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'arduino',
|
||||
\ 'name': 'avrgcc',
|
||||
\ 'exec': 'avr-gcc',
|
||||
\ 'redirect': 'c/avrgcc'})
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
45
sources_non_forked/syntastic/syntax_checkers/bro/bro.vim
Normal file
45
sources_non_forked/syntastic/syntax_checkers/bro/bro.vim
Normal file
@ -0,0 +1,45 @@
|
||||
"============================================================================
|
||||
"File: bro.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Justin Azoff <justin.azoff@gmail.com>
|
||||
"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_syntastic_bro_bro_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_bro_bro_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_bro_bro_IsAvailable() dict
|
||||
return system(self.getExecEscaped() . ' --help') =~# '--parse-only'
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_bro_bro_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'args_before': '--parse-only' })
|
||||
|
||||
"example: error in ./foo.bro, line 3: unknown identifier banana, at or "near "banana"
|
||||
let errorformat =
|
||||
\ '%trror in %f\, line %l: %m,' .
|
||||
\ '%tarning in %f\, line %l: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'bro',
|
||||
\ 'name': 'bro'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -0,0 +1,65 @@
|
||||
"============================================================================
|
||||
"File: clang_check.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Benjamin Bannier <bbannier at gmail dot com>
|
||||
"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_syntastic_c_clang_check_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_clang_check_checker = 1
|
||||
|
||||
if !exists('g:syntastic_clang_check_config_file')
|
||||
let g:syntastic_clang_check_config_file = '.syntastic_clang_check_config'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_clang_check_IsAvailable() dict
|
||||
return executable(self.getExec())
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_c_clang_check_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'post_args':
|
||||
\ '-- ' .
|
||||
\ syntastic#c#ReadConfig(g:syntastic_clang_check_config_file) . ' ' .
|
||||
\ '-fshow-column ' .
|
||||
\ '-fshow-source-location ' .
|
||||
\ '-fno-caret-diagnostics ' .
|
||||
\ '-fno-color-diagnostics ' .
|
||||
\ '-fdiagnostics-format=clang' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: fatal error: %m,' .
|
||||
\ '%E%f:%l:%c: error: %m,' .
|
||||
\ '%W%f:%l:%c: warning: %m,' .
|
||||
\ '%-G%\m%\%%(LLVM ERROR:%\|No compilation database found%\)%\@!%.%#,' .
|
||||
\ '%E%m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr('')},
|
||||
\ 'returns': [0, 1] })
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'clang_check',
|
||||
\ 'exec': 'clang-check'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -0,0 +1,65 @@
|
||||
"============================================================================
|
||||
"File: clang_tidy.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Benjamin Bannier <bbannier at gmail dot com>
|
||||
"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_syntastic_c_clang_tidy_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_clang_tidy_checker = 1
|
||||
|
||||
if !exists('g:syntastic_clang_tidy_config_file')
|
||||
let g:syntastic_clang_tidy_config_file = '.syntastic_clang_tidy_config'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_clang_tidy_IsAvailable() dict
|
||||
return executable(self.getExec())
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_c_clang_tidy_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'post_args':
|
||||
\ '-- ' .
|
||||
\ syntastic#c#ReadConfig(g:syntastic_clang_tidy_config_file) . ' ' .
|
||||
\ '-fshow-column ' .
|
||||
\ '-fshow-source-location ' .
|
||||
\ '-fno-caret-diagnostics ' .
|
||||
\ '-fno-color-diagnostics ' .
|
||||
\ '-fdiagnostics-format=clang' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: fatal error: %m,' .
|
||||
\ '%E%f:%l:%c: error: %m,' .
|
||||
\ '%W%f:%l:%c: warning: %m,' .
|
||||
\ '%-G%\m%\%%(LLVM ERROR:%\|No compilation database found%\)%\@!%.%#,' .
|
||||
\ '%E%m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr('')},
|
||||
\ 'returns': [0, 1] })
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'clang_tidy',
|
||||
\ 'exec': 'clang-tidy'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
65
sources_non_forked/syntastic/syntax_checkers/c/pc_lint.vim
Normal file
65
sources_non_forked/syntastic/syntax_checkers/c/pc_lint.vim
Normal file
@ -0,0 +1,65 @@
|
||||
"============================================================================
|
||||
"File: pc_lint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Steve Bragg <steve at empresseffects dot com>
|
||||
"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_syntastic_c_pc_lint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_pc_lint_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:syntastic_pc_lint_config_file')
|
||||
let g:syntastic_pc_lint_config_file = 'options.lnt'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_pc_lint_GetLocList() dict
|
||||
let config = findfile(g:syntastic_pc_lint_config_file, '.;')
|
||||
|
||||
" -hFs1 - show filename, add space after messages, try to make message 1 line
|
||||
" -width(0,0) - make sure there are no line breaks
|
||||
" -t - set tab size
|
||||
" -v - turn off verbosity
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': (filereadable(config) ? syntastic#util#shescape(fnamemodify(config, ':p')) : ''),
|
||||
\ 'args_after': ['-hFs1', '-width(0,0)', '-t' . &tabstop, '-format=%f:%l:%C:%t:%n:%m'] })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%v:Error:%n:%m,' .
|
||||
\ '%W%f:%l:%v:Warning:%n:%m,' .
|
||||
\ '%I%f:%l:%v:Info:%n:%m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['cygwinRemoveCR'] })
|
||||
|
||||
for e in loclist
|
||||
if e['type'] ==? 'I'
|
||||
let e['type'] = 'W'
|
||||
let e['subtype'] = 'Style'
|
||||
endif
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'pc_lint',
|
||||
\ 'exec': 'lint-nt'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
55
sources_non_forked/syntastic/syntax_checkers/cabal/cabal.vim
Normal file
55
sources_non_forked/syntastic/syntax_checkers/cabal/cabal.vim
Normal file
@ -0,0 +1,55 @@
|
||||
"============================================================================
|
||||
"File: cabal.vim
|
||||
"Description: Haskell package description (.cabal file) linting and syntax
|
||||
" validation via 'cabal check'
|
||||
"Maintainer: Ian D. Bollinger <ian.bollinger@gmail.com>
|
||||
"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_syntastic_cabal_cabal_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cabal_cabal_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_cabal_cabal_GetHighlightRegex(item)
|
||||
let field = matchstr(a:item['text'], "\\vParse of field '\\zs[^']+")
|
||||
if field != ''
|
||||
return '\v\c^\s*' . field . '\s*:\s*\zs.*$'
|
||||
endif
|
||||
let field = matchstr(a:item['text'], "\\v(^|\\s)'\\zs[^']+\\ze'")
|
||||
if field != ''
|
||||
return '\V\c\<' . escape(field, '\') . '\>'
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cabal_cabal_GetLocList() dict
|
||||
let makeprg = self.getExecEscaped() . ' check'
|
||||
|
||||
let errorformat =
|
||||
\ '%Ecabal: %f:%l: %m,' .
|
||||
\ '%W* %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': expand('%:p:h'),
|
||||
\ 'preprocess': 'cabal',
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cabal',
|
||||
\ 'name': 'cabal'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -0,0 +1,25 @@
|
||||
"============================================================================
|
||||
"File: clang_check.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Benjamin Bannier <bbannier at gmail dot com>
|
||||
"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_syntastic_cpp_clang_check_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_clang_check_checker = 1
|
||||
|
||||
runtime! syntax_checkers/c/*.vim
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'clang_check',
|
||||
\ 'exec': 'clang-check',
|
||||
\ 'redirect': 'c/clang_check'})
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -0,0 +1,25 @@
|
||||
"============================================================================
|
||||
"File: clang_tidy.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Benjamin Bannier <bbannier at gmail dot com>
|
||||
"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_syntastic_cpp_clang_tidy_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_clang_tidy_checker = 1
|
||||
|
||||
runtime! syntax_checkers/c/*.vim
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'clang_tidy',
|
||||
\ 'exec': 'clang-tidy',
|
||||
\ 'redirect': 'c/clang_tidy'})
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
26
sources_non_forked/syntastic/syntax_checkers/cpp/pc_lint.vim
Normal file
26
sources_non_forked/syntastic/syntax_checkers/cpp/pc_lint.vim
Normal file
@ -0,0 +1,26 @@
|
||||
"============================================================================
|
||||
"File: pc_lint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Steve Bragg <steve at empresseffects dot com>
|
||||
"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_syntastic_cpp_pc_lint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_pc_lint_checker = 1
|
||||
|
||||
runtime! syntax_checkers/c/*.vim
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'pc_lint',
|
||||
\ 'exec': 'lint-nt',
|
||||
\ 'redirect': 'c/pc_lint'})
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
26
sources_non_forked/syntastic/syntax_checkers/css/recess.vim
Normal file
26
sources_non_forked/syntastic/syntax_checkers/css/recess.vim
Normal file
@ -0,0 +1,26 @@
|
||||
"============================================================================
|
||||
"File: recess.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim using `recess`
|
||||
" (http://twitter.github.io/recess/).
|
||||
"Maintainer: Tim Carry <tim at pixelastic dot com>
|
||||
"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_syntastic_css_recess_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_css_recess_checker = 1
|
||||
|
||||
runtime! syntax_checkers/less/*.vim
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'css',
|
||||
\ 'name': 'recess',
|
||||
\ 'redirect': 'less/recess'})
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -0,0 +1,43 @@
|
||||
"============================================================================
|
||||
"File: scan.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"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_syntastic_haskell_scan_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_haskell_scan_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_haskell_scan_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({})
|
||||
|
||||
let errorformat = '%f:%l:%v: %m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style' })
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'haskell',
|
||||
\ 'name': 'scan'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
44
sources_non_forked/syntastic/syntax_checkers/less/recess.vim
Normal file
44
sources_non_forked/syntastic/syntax_checkers/less/recess.vim
Normal file
@ -0,0 +1,44 @@
|
||||
"============================================================================
|
||||
"File: recess.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim using `recess`
|
||||
" (http://twitter.github.io/recess/).
|
||||
"Maintainer: Tim Carry <tim at pixelastic dot com>
|
||||
"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_syntastic_less_recess_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_less_recess_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_less_recess_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'post_args_after': '--format=compact --stripColors' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%m in %f,' .
|
||||
\ '%Z %#%l.%.%#,' .
|
||||
\ '%f:%l:%m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'less',
|
||||
\ 'name': 'recess'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
91
sources_non_forked/syntastic/syntax_checkers/php/phplint.vim
Normal file
91
sources_non_forked/syntastic/syntax_checkers/php/phplint.vim
Normal file
@ -0,0 +1,91 @@
|
||||
"============================================================================
|
||||
"File: phplint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"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_syntastic_php_phplint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_php_phplint_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_php_phplint_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
|
||||
if term != ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\m\(class\|function\|method\) \zs\S\+\ze was declared as')
|
||||
if term != ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\maccess forbidden to \(private\|protected\) \(class\|constant\|method\|variable\|\(private\|protected\) property\) \zs\S\+\ze')
|
||||
if term != ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\musing deprecated \(class\|constant\|method\|property\|variable\) \zs\S\+\ze')
|
||||
if term != ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
|
||||
if term != ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
|
||||
if term != ''
|
||||
return '\V' . escape(term, '\')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\munresolved function \zs\S\+\ze')
|
||||
return term != '' ? '\V' . escape(term, '\') : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_phplint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_after':
|
||||
\ '--print-file-name ' .
|
||||
\ '--print-line-numbers ' .
|
||||
\ '--print-column-number ' .
|
||||
\ '--print-errors ' .
|
||||
\ '--print-warnings ' .
|
||||
\ '--no-print-notices ' .
|
||||
\ '--no-print-context ' .
|
||||
\ '--no-print-source ' .
|
||||
\ '--tab-size ' . &tabstop })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%v: %tRROR: %m,' .
|
||||
\ '%W%f:%l:%v: %tarning: %m,' .
|
||||
\ '%+C%\t%.%#,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['compressWhitespace'],
|
||||
\ 'subtype': 'Style',
|
||||
\ 'returns': [0, 1] })
|
||||
|
||||
for e in loclist
|
||||
let e['text'] = substitute(e['text'], '\m \(Hint\|Examples\):.*', '', '')
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'php',
|
||||
\ 'name': 'phplint',
|
||||
\ 'exec': 'phpl' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
81
sources_non_forked/syntastic/syntax_checkers/r/lint.vim
Normal file
81
sources_non_forked/syntastic/syntax_checkers/r/lint.vim
Normal file
@ -0,0 +1,81 @@
|
||||
"============================================================================
|
||||
"File: lint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"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_syntastic_r_lint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_r_lint_checker = 1
|
||||
|
||||
if !exists('g:syntastic_r_lint_styles')
|
||||
let g:syntastic_r_lint_styles = 'lint.style'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_r_lint_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\m`\zs[^`]\+\ze`')
|
||||
if term == ''
|
||||
let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'")
|
||||
endif
|
||||
return term != '' ? '\V' . escape(term, '\') : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_r_lint_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
call system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(lint)'))
|
||||
return v:shell_error == 0
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_r_lint_GetLocList() dict
|
||||
let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : ''
|
||||
let setwd = 'setwd("' . escape(getcwd(), '"\') . '"); '
|
||||
let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
|
||||
\ ' -e ' . syntastic#util#shescape(setwd . 'library(lint); ' .
|
||||
\ 'try(lint(commandArgs(TRUE), ' . g:syntastic_r_lint_styles . '))') .
|
||||
\ ' --args ' . syntastic#util#shexpand('%')
|
||||
|
||||
let errorformat =
|
||||
\ '%t:%f:%l:%v: %m,' .
|
||||
\ '%t:%f:%l: %m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'preprocess': 'rparse',
|
||||
\ 'returns': [0] })
|
||||
|
||||
for e in loclist
|
||||
if e['type'] == 'F'
|
||||
" parse error
|
||||
let e['type'] = 'E'
|
||||
call remove(e, 'subtype')
|
||||
endif
|
||||
endfor
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'r',
|
||||
\ 'name': 'lint',
|
||||
\ 'exec': 'R' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
78
sources_non_forked/syntastic/syntax_checkers/r/svtools.vim
Normal file
78
sources_non_forked/syntastic/syntax_checkers/r/svtools.vim
Normal file
@ -0,0 +1,78 @@
|
||||
"============================================================================
|
||||
"File: svtools.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" Security:
|
||||
"
|
||||
" This checker runs the code in your file. This is probably fine if you
|
||||
" wrote the file yourself, but it can be a problem if you're trying to
|
||||
" check third party files. If you are 100% willing to let Vim run the
|
||||
" code in your file, set g:syntastic_enable_r_svtools_checker to 1 in
|
||||
" your vimrc to enable this checker:
|
||||
"
|
||||
" let g:syntastic_enable_r_svtools_checker = 1
|
||||
|
||||
if exists("g:loaded_syntastic_r_svtools_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_r_svtools_checker = 1
|
||||
|
||||
if !exists('g:syntastic_r_svtools_styles')
|
||||
let g:syntastic_r_svtools_styles = 'lint.style'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_r_svtools_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'")
|
||||
return term != '' ? '\V' . escape(term, '\') : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_r_svtools_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
call system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(svTools)'))
|
||||
return v:shell_error == 0
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_r_svtools_GetLocList() dict
|
||||
if !exists('g:syntastic_enable_r_svtools_checker') || !g:syntastic_enable_r_svtools_checker
|
||||
call syntastic#log#error('checker r/svtools: checks disabled for security reasons; set g:syntastic_enable_r_svtools_checker to 1 to override')
|
||||
return []
|
||||
endif
|
||||
|
||||
let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : ''
|
||||
let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
|
||||
\ ' -e ' . syntastic#util#shescape(setwd . 'library(svTools); ' .
|
||||
\ 'try(lint(commandArgs(TRUE), filename = commandArgs(TRUE), type = "flat", sep = ":"))') .
|
||||
\ ' --args ' . syntastic#util#shexpand('%')
|
||||
|
||||
let errorformat =
|
||||
\ '%trror:%f:%\s%#%l:%\s%#%v:%m,' .
|
||||
\ '%tarning:%f:%\s%#%l:%\s%#%v:%m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'r',
|
||||
\ 'name': 'svtools',
|
||||
\ 'exec': 'R' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
38
sources_non_forked/syntastic/syntax_checkers/sass/sassc.vim
Normal file
38
sources_non_forked/syntastic/syntax_checkers/sass/sassc.vim
Normal file
@ -0,0 +1,38 @@
|
||||
"============================================================================
|
||||
"File: sassc.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"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_syntastic_sass_sassc_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_sass_sassc_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_sass_sassc_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({ 'fname_after': syntastic#util#DevNull() })
|
||||
|
||||
let errorformat = '%f:%l: %trror: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'sass',
|
||||
\ 'name': 'sassc'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -0,0 +1,71 @@
|
||||
"============================================================================
|
||||
"File: scalastyle.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"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_syntastic_scala_scalastyle_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_scala_scalastyle_checker = 1
|
||||
|
||||
if !exists('g:syntastic_scala_scalastyle_jar')
|
||||
let g:syntastic_scala_scalastyle_jar = 'scalastyle-batch_2.10.jar'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_scala_scalastyle_config_file')
|
||||
let g:syntastic_scala_scalastyle_config_file = 'scalastyle_config.xml'
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_scala_scalastyle_IsAvailable() dict
|
||||
return
|
||||
\ executable(self.getExec()) &&
|
||||
\ filereadable(expand(g:syntastic_scala_scalastyle_jar)) &&
|
||||
\ filereadable(expand(g:syntastic_scala_scalastyle_config_file))
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_scala_scalastyle_GetLocList() dict
|
||||
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'exe_after': ['-jar', expand(g:syntastic_scala_scalastyle_jar)],
|
||||
\ 'args_before': ['-q', 'true', '-c', expand(g:syntastic_scala_scalastyle_config_file)] })
|
||||
|
||||
let errorformat =
|
||||
\ '%trror file=%f message=%m line=%l column=%c,' .
|
||||
\ '%trror file=%f message=%m line=%l,' .
|
||||
\ '%tarning file=%f message=%m line=%l column=%c,' .
|
||||
\ '%tarning file=%f message=%m line=%l'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'returns': [0, 1] })
|
||||
|
||||
for e in loclist
|
||||
if has_key(e, 'col')
|
||||
let e['col'] += 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'scala',
|
||||
\ 'name': 'scalastyle',
|
||||
\ 'exec': 'java'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
25
sources_non_forked/syntastic/syntax_checkers/scss/sassc.vim
Normal file
25
sources_non_forked/syntastic/syntax_checkers/scss/sassc.vim
Normal file
@ -0,0 +1,25 @@
|
||||
"============================================================================
|
||||
"File: sassc.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"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_syntastic_scss_sassc_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_scss_sassc_checker = 1
|
||||
|
||||
runtime! syntax_checkers/sass/*.vim
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'scss',
|
||||
\ 'name': 'sassc',
|
||||
\ 'redirect': 'sass/sassc'})
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -0,0 +1,43 @@
|
||||
"============================================================================
|
||||
"File: rpmlint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"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_syntastic_spec_rpmlint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_spec_rpmlint_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_spec_rpmlint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({})
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l: E: %m,' .
|
||||
\ '%E%f: E: %m,' .
|
||||
\ '%W%f:%l: W: %m,' .
|
||||
\ '%W%f: W: %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'spec',
|
||||
\ 'name': 'rpmlint'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -0,0 +1,46 @@
|
||||
"============================================================================
|
||||
"File: typescript/tslint.vim
|
||||
"Description: TypeScript linter
|
||||
"Maintainer: Seon-Wook Park <seon.wook@swook.net>
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_typescript_tslint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_typescript_tslint_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_typescript_tslint_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], "\\m\\s'\\zs.\\{-}\\ze'\\s")
|
||||
return term != '' ? '\V' . escape(term, '\') : ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_typescript_tslint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_after': '--format verbose',
|
||||
\ 'fname_before': '-f' })
|
||||
|
||||
" (comment-format) ts/app.ts[12, 36]: comment must start with lowercase letter
|
||||
let errorformat = '%f[%l\, %c]: %m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'preprocess': 'tslint',
|
||||
\ 'returns': [0, 2] })
|
||||
|
||||
call self.setWantSort(1)
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'typescript',
|
||||
\ 'name': 'tslint'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
42
sources_non_forked/syntastic/syntax_checkers/xml/plutil.vim
Normal file
42
sources_non_forked/syntastic/syntax_checkers/xml/plutil.vim
Normal file
@ -0,0 +1,42 @@
|
||||
"============================================================================
|
||||
"File: plutil.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"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_syntastic_xml_plutil_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_xml_plutil_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_xml_plutil_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_before': '-lint -s',
|
||||
\ 'fname_before': '--' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f: %m at line %l'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0, 1] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'xml',
|
||||
\ 'name': 'plutil'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
127
sources_non_forked/tlib/autoload/tlib/sys.vim
Normal file
127
sources_non_forked/tlib/autoload/tlib/sys.vim
Normal file
@ -0,0 +1,127 @@
|
||||
" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
|
||||
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
|
||||
" @Last Change: 2014-06-30.
|
||||
" @Revision: 25
|
||||
|
||||
|
||||
if !exists('g:tlib#sys#windows')
|
||||
let g:tlib#sys#windows = &shell !~ 'sh' && (has('win16') || has('win32') || has('win64')) "{{{2
|
||||
endif
|
||||
|
||||
|
||||
if !exists('g:tlib#sys#null')
|
||||
let g:tlib#sys#null = g:tlib#sys#windows ? 'NUL' : (filereadable('/dev/null') ? '/dev/null' : '') "{{{2
|
||||
endif
|
||||
|
||||
|
||||
let s:executables = {}
|
||||
|
||||
function! tlib#sys#IsExecutable(cmd, ...) "{{{3
|
||||
" TLogVAR a:cmd
|
||||
" echom "DBG has_key(s:executables, a:cmd)" has_key(s:executables, a:cmd)
|
||||
if !has_key(s:executables, a:cmd)
|
||||
let executable = executable(a:cmd)
|
||||
" TLogVAR 1, executable
|
||||
let ignore_cyg = a:0 >= 1 ? a:1 : !g:tlib#sys#windows
|
||||
if !executable && !ignore_cyg
|
||||
let executable = tlib#sys#IsCygwinBin(a:cmd)
|
||||
" TLogVAR 2, executable
|
||||
endif
|
||||
let s:executables[a:cmd] = executable
|
||||
endif
|
||||
" echom "DBG s:executables[a:cmd]" s:executables[a:cmd]
|
||||
return s:executables[a:cmd]
|
||||
endf
|
||||
|
||||
|
||||
if !exists('g:tlib#sys#check_cygpath')
|
||||
" If true, check whether we have to convert a path via cyppath --
|
||||
" see |tlib#sys#MaybeUseCygpath|
|
||||
let g:tlib#sys#check_cygpath = g:tlib#sys#windows && tlib#sys#IsExecutable('cygpath') "{{{2
|
||||
endif
|
||||
|
||||
|
||||
if !exists('g:tlib#sys#cygwin_path_rx')
|
||||
" If a full windows filename (with slashes instead of backslashes)
|
||||
" matches this |regexp|, it is assumed to be a cygwin executable.
|
||||
let g:tlib#sys#cygwin_path_rx = '/cygwin/' "{{{2
|
||||
endif
|
||||
|
||||
|
||||
if !exists('g:tlib#sys#cygwin_expr')
|
||||
" For cygwin binaries, convert command calls using this vim
|
||||
" expression.
|
||||
let g:tlib#sys#cygwin_expr = '"bash -c ''". escape(%s, "''\\") ."''"' "{{{2
|
||||
endif
|
||||
|
||||
|
||||
let s:cygwin = {}
|
||||
|
||||
function! tlib#sys#IsCygwinBin(cmd) "{{{3
|
||||
" TLogVAR a:cmd
|
||||
if !g:tlib#sys#windows
|
||||
return 0
|
||||
elseif has_key(s:cygwin, a:cmd)
|
||||
let rv = s:cygwin[a:cmd]
|
||||
else
|
||||
if !tlib#sys#IsExecutable('cygpath', 1) || !tlib#sys#IsExecutable('which', 1)
|
||||
let rv = 0
|
||||
else
|
||||
let which = substitute(system('which '. shellescape(a:cmd)), '\n$', '', '')
|
||||
" echom "DBG which:" which
|
||||
if which =~ '^/'
|
||||
let filename = system('cygpath -ma '. shellescape(which))
|
||||
" echom "DBG filename:" filename
|
||||
let rv = filename =~ g:tlib#sys#cygwin_path_rx
|
||||
else
|
||||
let rv = 0
|
||||
endif
|
||||
endif
|
||||
let s:cygwin[a:cmd] = rv
|
||||
endif
|
||||
" TLogVAR rv
|
||||
return rv
|
||||
endf
|
||||
|
||||
|
||||
function! tlib#sys#GetCmd(cmd) "{{{3
|
||||
if !empty(g:tlib#sys#cygwin_expr) && tlib#sys#IsCygwinBin(matchstr(a:cmd, '^\S\+'))
|
||||
let cmd = eval(printf(g:tlib#sys#cygwin_expr, string(a:cmd)))
|
||||
" TLogVAR cmd
|
||||
return cmd
|
||||
else
|
||||
return a:cmd
|
||||
endif
|
||||
endf
|
||||
|
||||
|
||||
" If cmd seems to be a cygwin executable, use cygpath to convert
|
||||
" filenames. This assumes that cygwin's which command returns full
|
||||
" filenames for non-cygwin executables.
|
||||
function! tlib#sys#MaybeUseCygpath(cmd) "{{{3
|
||||
" echom "DBG" a:cmd
|
||||
if g:tlib#sys#check_cygpath && tlib#sys#IsCygwinBin(a:cmd)
|
||||
return 'cygpath -u "%s"'
|
||||
endif
|
||||
return ''
|
||||
endf
|
||||
|
||||
|
||||
function! tlib#sys#ConvertPath(converter, filename) "{{{3
|
||||
return tlib#string#Chomp(system(printf(a:converter, shellescape(a:filename))))
|
||||
endf
|
||||
|
||||
|
||||
let s:native_filenames = {}
|
||||
|
||||
function! tlib#sys#FileArgs(cmd, files) "{{{3
|
||||
let cygpath = tlib#sys#MaybeUseCygpath(a:cmd)
|
||||
" TLogVAR cygpath
|
||||
if empty(cygpath)
|
||||
return a:files
|
||||
else
|
||||
let files = map(copy(a:files), 'has_key(s:native_filenames, v:val) ? s:native_filenames[v:val] : tlib#sys#CygPath(v:val)')
|
||||
return files
|
||||
endif
|
||||
endf
|
||||
|
@ -0,0 +1,14 @@
|
||||
" MIT License. Copyright (c) 2014 Mathias Andersson.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
if !exists('*CapsLockStatusline')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#capslock#status()
|
||||
return CapsLockStatusline() == '[caps]' ? 'CAPS' : ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#capslock#init(ext)
|
||||
call airline#parts#define_function('capslock', 'airline#extensions#capslock#status')
|
||||
endfunction
|
||||
|
@ -0,0 +1,54 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'loaded_nrrw_rgn', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#nrrwrgn#apply(...)
|
||||
if exists(":WidenRegion") == 2
|
||||
let spc = g:airline_symbols.space
|
||||
if !exists("*nrrwrgn#NrrwRgnStatus()") || empty(nrrwrgn#NrrwRgnStatus())
|
||||
call a:1.add_section('airline_a', printf('%s[Narrowed%s#%d]', spc, spc, b:nrrw_instn))
|
||||
let bufname=(get(b:, 'orig_buf', 0) ? bufname(b:orig_buf) : substitute(bufname('%'), '^Nrrwrgn_\zs.*\ze_\d\+$', submatch(0), ''))
|
||||
call a:1.add_section('airline_c', spc.bufname.spc)
|
||||
call a:1.split()
|
||||
else
|
||||
let dict=nrrwrgn#NrrwRgnStatus()
|
||||
let vmode = { 'v': 'Char ', 'V': 'Line ', '': 'Block '}
|
||||
let mode = dict.visual ? vmode[dict.visual] : vmode['V']
|
||||
let winwidth = winwidth(0)
|
||||
if winwidth < 80
|
||||
let mode = mode[0]
|
||||
endif
|
||||
let title = (winwidth < 80 ? "Nrrw" : "Narrowed ")
|
||||
let multi = (winwidth < 80 ? 'M' : 'Multi')
|
||||
call a:1.add_section('airline_a', printf('[%s%s%s#%d]%s', (dict.multi ? multi : ""),
|
||||
\ title, mode, b:nrrw_instn, spc))
|
||||
let name = dict.fullname
|
||||
if name !=# '[No Name]'
|
||||
if winwidth > 100
|
||||
" need some space
|
||||
let name = fnamemodify(dict.fullname, ':~')
|
||||
if strlen(name) > 8
|
||||
" shorten name
|
||||
let name = substitute(name, '\(.\)[^/\\]*\([/\\]\)', '\1\2', 'g')
|
||||
endif
|
||||
else
|
||||
let name = fnamemodify(dict.fullname, ':t')
|
||||
endif
|
||||
endif
|
||||
let range=(dict.multi ? '' : printf("[%d-%d]", dict.start[1], dict.end[1]))
|
||||
call a:1.add_section('airline_c', printf("%s %s %s", name, range, dict.enabled ? "\u2713" : '!'))
|
||||
call a:1.split()
|
||||
call a:1.add_section('airline_x', get(g:, 'airline_section_x').spc)
|
||||
call a:1.add_section('airline_y', spc.get(g:, 'airline_section_y').spc)
|
||||
call a:1.add_section('airline_z', spc.get(g:, 'airline_section_z'))
|
||||
endif
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#nrrwrgn#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#nrrwrgn#apply')
|
||||
endfunction
|
@ -0,0 +1,23 @@
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists('g:loaded_windowswap')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
if !exists('g:airline#extensions#windowswap#indicator_text')
|
||||
let g:airline#extensions#windowswap#indicator_text = 'WS'
|
||||
endif
|
||||
|
||||
function! airline#extensions#windowswap#init(ext)
|
||||
call airline#parts#define_function('windowswap', 'airline#extensions#windowswap#get_status')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#windowswap#get_status()
|
||||
if WindowSwap#HasMarkedWindow() && WindowSwap#GetMarkedWindowNum() == winnr()
|
||||
return g:airline#extensions#windowswap#indicator_text.s:spc
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
8
sources_non_forked/vim-golang/README.md
Normal file
8
sources_non_forked/vim-golang/README.md
Normal file
@ -0,0 +1,8 @@
|
||||
## Vim plugins have moved
|
||||
|
||||
The vim plugins have been removed from the Go repository along with all other
|
||||
editor plugins. Please visit [The Go Wiki][1] for a current list of plugins. I
|
||||
have personally moved over to the [vim-go][2] suite of plugins.
|
||||
|
||||
[1]: https://code.google.com/p/go-wiki/wiki/IDEsAndTextEditorPlugins
|
||||
[2]: https://github.com/fatih/vim-go
|
22
sources_non_forked/vim-less/after/syntax/html.vim
Normal file
22
sources_non_forked/vim-less/after/syntax/html.vim
Normal file
@ -0,0 +1,22 @@
|
||||
if !exists("g:less_html_style_tags")
|
||||
let g:less_html_style_tags = 1
|
||||
endif
|
||||
|
||||
if !g:less_html_style_tags
|
||||
finish
|
||||
endif
|
||||
|
||||
" Unset (but preserve) so that less will run.
|
||||
let s:pre_less_cur_syn = b:current_syntax
|
||||
unlet b:current_syntax
|
||||
|
||||
" Inspired by code from github.com/kchmck/vim-coffee-script
|
||||
" and the html syntax file included with vim 7.4.
|
||||
|
||||
syn include @htmlLess syntax/less.vim
|
||||
|
||||
" We have to explicitly add to htmlHead (containedin) as that region specifies 'contains'.
|
||||
syn region lessStyle start=+<style [^>]*type *=[^>]*text/less[^>]*>+ keepend end=+</style>+ contains=@htmlLess,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc containedin=htmlHead
|
||||
|
||||
" Reset since 'less' isn't really the current_syntax.
|
||||
let b:current_syntax = s:pre_less_cur_syn
|
17
sources_non_forked/vim-markdown/README.markdown
Normal file
17
sources_non_forked/vim-markdown/README.markdown
Normal file
@ -0,0 +1,17 @@
|
||||
# Vim Markdown runtime files
|
||||
|
||||
This is the development version of Vim's included syntax highlighting and
|
||||
filetype plugins for Markdown. Generally you don't need to install these if
|
||||
you are running a recent version of Vim.
|
||||
|
||||
One difference between this repository and the upstream files in Vim is that
|
||||
the former forces `*.md` as Markdown, while the latter detects it as Modula-2,
|
||||
with an exception for `README.md`. If you'd like to force Markdown without
|
||||
installing from this repository, add the following to your vimrc:
|
||||
|
||||
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
|
||||
|
||||
## License
|
||||
|
||||
Copyright © Tim Pope. Distributed under the same terms as Vim itself.
|
||||
See `:help license`.
|
3
sources_non_forked/vim-markdown/indent/markdown.vim
Normal file
3
sources_non_forked/vim-markdown/indent/markdown.vim
Normal file
@ -0,0 +1,3 @@
|
||||
set noexpandtab
|
||||
set tabstop=2
|
||||
set shiftwidth=2
|
1
sources_non_forked/vim-snippets/.gitignore
vendored
Normal file
1
sources_non_forked/vim-snippets/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.pyc
|
324
sources_non_forked/vim-snippets/UltiSnips/ada.snippets
Normal file
324
sources_non_forked/vim-snippets/UltiSnips/ada.snippets
Normal file
@ -0,0 +1,324 @@
|
||||
priority -50
|
||||
|
||||
global !p
|
||||
|
||||
def ada_case(word):
|
||||
out = word[0].upper()
|
||||
for i in range(1, len(word)):
|
||||
if word[i - 1] == '_':
|
||||
out = out + word[i].upper()
|
||||
else:
|
||||
out = out + word[i]
|
||||
return out
|
||||
|
||||
def get_year():
|
||||
import time
|
||||
return time.strftime("%Y")
|
||||
|
||||
endglobal
|
||||
|
||||
snippet wi "with"
|
||||
with $1;$0
|
||||
endsnippet
|
||||
|
||||
snippet pac "package"
|
||||
package ${1:`!p snip.rv = ada_case(snip.basename)`} is
|
||||
$0
|
||||
end $1;
|
||||
endsnippet
|
||||
|
||||
snippet pacb "package body"
|
||||
package body ${1:`!p snip.rv = ada_case(snip.basename)`} is
|
||||
$0
|
||||
end $1;
|
||||
endsnippet
|
||||
|
||||
snippet ent "entry ... when"
|
||||
entry $1($2) when $3 is
|
||||
begin
|
||||
$0
|
||||
end $1;
|
||||
endsnippet
|
||||
|
||||
snippet task "task"
|
||||
task $1 is
|
||||
entry $0
|
||||
end $1;
|
||||
endsnippet
|
||||
|
||||
snippet taskb "task body"
|
||||
task body $1 is
|
||||
$2
|
||||
begin
|
||||
$0
|
||||
end $1;
|
||||
endsnippet
|
||||
|
||||
snippet acc "accept"
|
||||
accept $1($2) do
|
||||
$0
|
||||
end $1;
|
||||
endsnippet
|
||||
|
||||
snippet prot "protected type"
|
||||
protected type $1($2) is
|
||||
$0
|
||||
end $1;
|
||||
endsnippet
|
||||
|
||||
snippet prob "protected body"
|
||||
protected body $1 is
|
||||
$2
|
||||
begin
|
||||
$0
|
||||
end $1;
|
||||
endsnippet
|
||||
|
||||
snippet gen "generic type"
|
||||
generic
|
||||
type $1 is $2;$0
|
||||
endsnippet
|
||||
|
||||
snippet ty "type"
|
||||
type $1 is $2;$0
|
||||
endsnippet
|
||||
|
||||
snippet tyd "type with default value"
|
||||
type $1 is $2
|
||||
with Default_Value => $3;$0
|
||||
endsnippet
|
||||
|
||||
snippet subty "subtype"
|
||||
subtype $1 is $2;$0
|
||||
endsnippet
|
||||
|
||||
snippet dec "declare block"
|
||||
declare
|
||||
$1
|
||||
begin
|
||||
$0
|
||||
end;
|
||||
endsnippet
|
||||
|
||||
snippet decn "declare named block"
|
||||
$1:
|
||||
declare
|
||||
$2
|
||||
begin
|
||||
$0
|
||||
end $1;
|
||||
endsnippet
|
||||
|
||||
snippet ifex "if expression"
|
||||
if $1 then $2 else $0
|
||||
endsnippet
|
||||
|
||||
snippet casex "case expression"
|
||||
case $1 is
|
||||
when $2 => $3,$0
|
||||
endsnippet
|
||||
|
||||
snippet fora "for all"
|
||||
for all $1 ${2:in} $3 => $0
|
||||
endsnippet
|
||||
|
||||
snippet fors "for some"
|
||||
for some $1 ${2:in} $3 => $0
|
||||
endsnippet
|
||||
|
||||
snippet if "if"
|
||||
if $1 then
|
||||
$0
|
||||
end if;
|
||||
endsnippet
|
||||
|
||||
snippet ife "if ... else"
|
||||
if $1 then
|
||||
$2
|
||||
else
|
||||
$0
|
||||
end if;
|
||||
endsnippet
|
||||
|
||||
snippet el "else"
|
||||
else
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet eif "elsif"
|
||||
elsif $1 then
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet wh "while"
|
||||
while $1 loop
|
||||
$0
|
||||
end loop;
|
||||
endsnippet
|
||||
|
||||
snippet nwh "named while"
|
||||
$1:
|
||||
while $2 loop
|
||||
$0
|
||||
end loop $1;
|
||||
endsnippet
|
||||
|
||||
snippet for "for"
|
||||
for ${1:I} in $2 loop
|
||||
$0
|
||||
end loop;
|
||||
endsnippet
|
||||
|
||||
snippet fore "for each"
|
||||
for $1 of $2 loop
|
||||
$0
|
||||
end loop;
|
||||
endsnippet
|
||||
|
||||
snippet nfor "named for"
|
||||
$1:
|
||||
for ${2:I} in $3 loop
|
||||
$0
|
||||
end loop $1;
|
||||
endsnippet
|
||||
|
||||
snippet nfore "named for each"
|
||||
$1:
|
||||
for $2 of $3 loop
|
||||
$0
|
||||
end loop $1;
|
||||
endsnippet
|
||||
|
||||
snippet proc "procedure"
|
||||
procedure $1($2) is
|
||||
$3
|
||||
begin
|
||||
$0
|
||||
end $1;
|
||||
endsnippet
|
||||
|
||||
snippet procd "procedure declaration"
|
||||
procedure $1;$0
|
||||
endsnippet
|
||||
|
||||
snippet fun "function"
|
||||
function $1($2) return $3 is
|
||||
$4
|
||||
begin
|
||||
$0
|
||||
end $1;
|
||||
endsnippet
|
||||
|
||||
snippet fune "expression function"
|
||||
function $1 return $2 is
|
||||
($3);$0
|
||||
endsnippet
|
||||
|
||||
snippet fund "function declaration"
|
||||
function $1 return $2;$0
|
||||
endsnippet
|
||||
|
||||
snippet ret "extended return"
|
||||
return $1 do
|
||||
$0
|
||||
end return;
|
||||
endsnippet
|
||||
|
||||
snippet rec "record"
|
||||
record
|
||||
$0
|
||||
end record;
|
||||
endsnippet
|
||||
|
||||
snippet case "case"
|
||||
case $1 is
|
||||
when $2 => $3;$0
|
||||
end case;
|
||||
endsnippet
|
||||
|
||||
snippet whe "when"
|
||||
when $1 => $2;$0
|
||||
endsnippet
|
||||
|
||||
snippet wheo "when others"
|
||||
when others => $1;$0
|
||||
endsnippet
|
||||
|
||||
snippet lo "loop"
|
||||
loop
|
||||
$0
|
||||
end loop;
|
||||
endsnippet
|
||||
|
||||
snippet nlo "named loop"
|
||||
$1:
|
||||
loop
|
||||
$0
|
||||
end loop $1;
|
||||
endsnippet
|
||||
|
||||
snippet ex "exit when"
|
||||
exit when $1;$0
|
||||
endsnippet
|
||||
|
||||
snippet put "Ada.Text_IO.Put"
|
||||
Ada.Text_IO.Put($1);$0
|
||||
endsnippet
|
||||
|
||||
snippet putl "Ada.Text_IO.Put_Line"
|
||||
Ada.Text_IO.Put_Line($1);$0
|
||||
endsnippet
|
||||
|
||||
snippet get "Ada.Text_IO.Get"
|
||||
Ada.Text_IO.Get($1);$0
|
||||
endsnippet
|
||||
|
||||
snippet getl "Ada.Text_IO.Get_Line"
|
||||
Ada.Text_IO.Get_Line($1);$0
|
||||
endsnippet
|
||||
|
||||
snippet newline "Ada.Text_IO.New_Line"
|
||||
Ada.Text_IO.New_Line(${1:1});$0
|
||||
endsnippet
|
||||
|
||||
snippet gpl "GPL license header"
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU ${1}General Public License as published by
|
||||
-- the Free Software Foundation; either version ${2:3} of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU $1General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU $1General Public License
|
||||
-- along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- Copyright (C) ${3:Author}, ${4:`!p snip.rv = get_year()`}
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet gplf "GPL file license header"
|
||||
-- This file is part of ${1:Program-Name}.
|
||||
--
|
||||
-- $1 is free software: you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU ${2}General Public License as published by
|
||||
-- the Free Software Foundation, either version ${3:3} of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- $1 is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU $2General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU $2General Public License
|
||||
-- along with $1. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- Copyright (C) ${4:Author}, ${5:`!p snip.rv = get_year()`}
|
||||
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
@ -0,0 +1,25 @@
|
||||
priority -50
|
||||
|
||||
snippet iti "it (js, inject)" b
|
||||
it('${1:description}', inject(function($2) {
|
||||
$0
|
||||
}));
|
||||
endsnippet
|
||||
|
||||
snippet befi "before each (js, inject)" b
|
||||
beforeEach(inject(function($1) {
|
||||
$0
|
||||
}));
|
||||
endsnippet
|
||||
|
||||
snippet aconf "angular config" i
|
||||
config(function($1) {
|
||||
$0
|
||||
});
|
||||
endsnippet
|
||||
|
||||
snippet acont "angular controller" i
|
||||
controller('${1:name}', function($2) {
|
||||
$0
|
||||
});
|
||||
endsnippet
|
34
sources_non_forked/vim-snippets/UltiSnips/julia.snippets
Normal file
34
sources_non_forked/vim-snippets/UltiSnips/julia.snippets
Normal file
@ -0,0 +1,34 @@
|
||||
# Documentation
|
||||
snippet docf "function documentation" b
|
||||
#' @description
|
||||
#'
|
||||
#' ${1:function description}
|
||||
#'
|
||||
#' ${2:@param ${3:name}::${4:Type} ${5:Description}}
|
||||
#'
|
||||
#' ${6:@returns ${7:name}::${8:Type} ${9:Description}}
|
||||
#'
|
||||
#' @examples
|
||||
#'
|
||||
#' ${10: function call examples}
|
||||
endsnippet
|
||||
|
||||
snippet doct "type definition" b
|
||||
#' @description
|
||||
#'
|
||||
#' ${1:type description}
|
||||
#'
|
||||
#' ${2:@field ${3:name}::${4:Type} ${5:Description}}
|
||||
#'
|
||||
#' @examples
|
||||
#'
|
||||
#' ${10: constructor examples}
|
||||
endsnippet
|
||||
|
||||
snippet par "function parameter documentation" b
|
||||
#' @param ${1:name}::${2:Type} ${0:Description}
|
||||
endsnippet
|
||||
|
||||
snippet fld "type field documentation" b
|
||||
#' @field ${1:name}::${2:Type} ${0:Description}
|
||||
endsnippet
|
12
sources_non_forked/vim-snippets/UltiSnips/pandoc.snippets
Normal file
12
sources_non_forked/vim-snippets/UltiSnips/pandoc.snippets
Normal file
@ -0,0 +1,12 @@
|
||||
extends markdown
|
||||
|
||||
# overwrite if necessary
|
||||
priority -49
|
||||
|
||||
snippet title "Title Header" b
|
||||
% ${1:`!v Filename('', 'title')`}
|
||||
% ${2:`!v g:snips_author`}
|
||||
% ${3:`!v strftime("%d %B %Y")`}
|
||||
|
||||
$0
|
||||
endsnippet
|
52
sources_non_forked/vim-snippets/UltiSnips/proto.snippets
Normal file
52
sources_non_forked/vim-snippets/UltiSnips/proto.snippets
Normal file
@ -0,0 +1,52 @@
|
||||
priority -50
|
||||
|
||||
global !p
|
||||
from vimsnippets import complete
|
||||
|
||||
FIELD_TYPES = [
|
||||
'double',
|
||||
'float',
|
||||
'int32',
|
||||
'int64',
|
||||
'uint32',
|
||||
'uint64',
|
||||
'sint32',
|
||||
'sint64',
|
||||
'fixed32',
|
||||
'fixed64',
|
||||
'sfixed32',
|
||||
'sfixed64',
|
||||
'bool',
|
||||
'string',
|
||||
'bytes']
|
||||
endglobal
|
||||
|
||||
snippet mess "Proto message" b
|
||||
// ${2:TODO(`whoami`): Describe this message.}
|
||||
message ${1:Name} {
|
||||
$0
|
||||
|
||||
// Next available id: 1
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet reqf "Required field" b
|
||||
// ${4:TODO(`whoami`): Describe this field.}
|
||||
optional ${1}`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1}; // Required
|
||||
endsnippet
|
||||
|
||||
snippet optf "Optional field" b
|
||||
// ${4:TODO(`whoami`): Describe this field.}
|
||||
optional ${1}`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1};
|
||||
endsnippet
|
||||
|
||||
snippet repf "Repeated field" b
|
||||
// ${4:TODO(`whoami`): Describe this field.}
|
||||
repeated ${1}`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1};
|
||||
endsnippet
|
||||
|
||||
snippet enum "Enumeration" b
|
||||
// ${2:TODO(`whoami`): Describe this enum.}
|
||||
enum ${1:Name} {
|
||||
}
|
||||
endsnippet
|
177
sources_non_forked/vim-snippets/UltiSnips/r.snippets
Normal file
177
sources_non_forked/vim-snippets/UltiSnips/r.snippets
Normal file
@ -0,0 +1,177 @@
|
||||
priority -50
|
||||
|
||||
global !p
|
||||
import os
|
||||
from vimsnippets import complete
|
||||
|
||||
FIELD_TYPES = [
|
||||
'character',
|
||||
'data.frame',
|
||||
'integer',
|
||||
'list',
|
||||
'logical',
|
||||
'matrix',
|
||||
'numeric',
|
||||
'vector']
|
||||
endglobal
|
||||
|
||||
snippet #! "Hashbang for Rscript (#!)" b
|
||||
#!/usr/bin/env Rscript
|
||||
endsnippet
|
||||
|
||||
snippet setwd "Set workingdir" b
|
||||
setwd("${1:`!p snip.rv = os.getcwd()`}")
|
||||
endsnippet
|
||||
|
||||
snippet as "Apply type on variable" w
|
||||
as.$1`!p snip.rv = complete(t[1], FIELD_TYPES)`(${2}${VISUAL})
|
||||
endsnippet
|
||||
|
||||
snippet is "Test type on variable" w
|
||||
is.$1`!p snip.rv = complete(t[1], FIELD_TYPES)`(${2}${VISUAL})
|
||||
endsnippet
|
||||
|
||||
snippet dl "Download and install a package" b
|
||||
download.file("${1:${VISUAL:url to package}}", destfile = "${2:${1/.*\/(\S*)$/(?1:$1)/ga}}")
|
||||
install.packages("$2", type = "source", repos = NULL)
|
||||
library("${3:${2/^(\w+)_.*$/(?1:$1)/ga}}")
|
||||
endsnippet
|
||||
|
||||
snippet lib "Import a library"
|
||||
library(${0:package})
|
||||
endsnippet
|
||||
|
||||
snippet req "Require a file"
|
||||
require(${0:package})
|
||||
endsnippet
|
||||
|
||||
snippet source "Source a file"
|
||||
source('${0:file}')
|
||||
endsnippet
|
||||
|
||||
snippet if "If statement"
|
||||
if (${1}) {
|
||||
${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet eif "Else-If statement"
|
||||
else if (${1}) {
|
||||
${0}
|
||||
}
|
||||
|
||||
snippet el "Else statement"
|
||||
else {
|
||||
${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ife "if .. else"
|
||||
if (${1}) {
|
||||
${2}
|
||||
} else {
|
||||
${3}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet wh "while loop"
|
||||
while(${1}) {
|
||||
${2}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet for "for loop"
|
||||
for (${1:item} in ${2:list}) {
|
||||
${3}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet fun "Function definition"
|
||||
${1:name} <- function (${2}) {
|
||||
${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ret "Return call"
|
||||
return(${0})
|
||||
endsnippet
|
||||
|
||||
snippet df "Data frame"
|
||||
${1:name}[${2:rows}, ${0:cols}]
|
||||
endsnippet
|
||||
|
||||
snippet c "c function"
|
||||
c(${0:items})
|
||||
endsnippet
|
||||
|
||||
snippet li "list function"
|
||||
list(${0:items})
|
||||
endsnippet
|
||||
|
||||
snippet mat "matrix function"
|
||||
matrix(${1:data}, nrow = ${2:rows}, ncol = ${0:cols})
|
||||
endsnippet
|
||||
|
||||
snippet apply "apply function"
|
||||
apply(${1:array}, ${2:margin}, ${0:function})
|
||||
endsnippet
|
||||
|
||||
snippet lapply "lapply function"
|
||||
lapply(${1:list}, ${0:function})
|
||||
endsnippet
|
||||
|
||||
snippet sapply "sapply function"
|
||||
sapply(${1:list}, ${0:function})
|
||||
endsnippet
|
||||
|
||||
snippet vapply "vapply function"
|
||||
vapply(${1:list}, ${2:function}, ${0:type})
|
||||
endsnippet
|
||||
|
||||
snippet mapply "mapply function"
|
||||
mapply(${1:function}, ${0:...})
|
||||
endsnippet
|
||||
|
||||
snippet tapply "tapply function"
|
||||
tapply(${1:vector}, ${2:index}, ${0:function})
|
||||
endsnippet
|
||||
|
||||
snippet rapply "rapply function"
|
||||
rapply(${1:list}, ${0:function})
|
||||
endsnippet
|
||||
|
||||
snippet pl "Plot function"
|
||||
plot(${1:x}, ${0:y})
|
||||
endsnippet
|
||||
|
||||
snippet ggp "ggplot2 plot"
|
||||
ggplot(${1:data}, aes(${0:aesthetics}))
|
||||
endsnippet
|
||||
|
||||
snippet fis "Fisher test"
|
||||
fisher.test(${1:x}, ${0:y})
|
||||
endsnippet
|
||||
|
||||
snippet chi "Chi Squared test"
|
||||
chisq.test(${1:x}, ${0:y})
|
||||
endsnippet
|
||||
|
||||
snippet tt "t-test"
|
||||
t.test(${1:x}, ${0:y})
|
||||
endsnippet
|
||||
|
||||
snippet wil "Wilcox test"
|
||||
wilcox.test(${1:x}, ${0:y})
|
||||
endsnippet
|
||||
|
||||
snippet cor "Correlation test"
|
||||
cor.test(${1:x}, ${0:y})
|
||||
endsnippet
|
||||
|
||||
snippet fte "FTE test"
|
||||
var.test(${1:x}, ${0:y})
|
||||
endsnippet
|
||||
|
||||
snippet kvt "KV test"
|
||||
kv.test(${1:x}, ${0:y})
|
||||
endsnippet
|
@ -0,0 +1,3 @@
|
||||
priority -50
|
||||
|
||||
extends tex, r
|
252
sources_non_forked/vim-snippets/UltiSnips/rust.snippets
Normal file
252
sources_non_forked/vim-snippets/UltiSnips/rust.snippets
Normal file
@ -0,0 +1,252 @@
|
||||
#######################################################################
|
||||
# Rust Snippets #
|
||||
#######################################################################
|
||||
|
||||
priority -50
|
||||
|
||||
snippet fn "A function, optionally with arguments and return type." b
|
||||
fn ${1:function_name}(${2})${3/..*/ -> /}${3} {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet test "Test function" b
|
||||
#[test]
|
||||
fn ${1:test_function_name}() {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet bench "Bench function" b
|
||||
#[bench]
|
||||
fn ${1:bench_function_name}(b: &mut test::Bencher) {
|
||||
b.iter(|| {
|
||||
${VISUAL}${0}
|
||||
})
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet new "A new function" b
|
||||
pub fn new(${2}) -> ${1:Name} {
|
||||
${VISUAL}${0}return $1 { ${3} };
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet main "The main function" b
|
||||
pub fn main() {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet let "A let statement" b
|
||||
let ${1:name}${3} = ${VISUAL}${2};
|
||||
endsnippet
|
||||
|
||||
snippet lmut "let mut = .." b
|
||||
let mut ${1:name}${3} = ${VISUAL}${2};
|
||||
endsnippet
|
||||
|
||||
snippet pri "print!(..)" b
|
||||
print!("${1}"${2/..*/, /}${2});
|
||||
endsnippet
|
||||
|
||||
snippet pln "println!(..)" b
|
||||
println!("${1}"${2/..*/, /}${2});
|
||||
endsnippet
|
||||
|
||||
snippet fmt "format!(..)"
|
||||
format!("${1}"${2/..*/, /}${2});
|
||||
endsnippet
|
||||
|
||||
snippet macro "macro_rules!" b
|
||||
macro_rules! ${1:name} (
|
||||
(${2:matcher}) => (
|
||||
${3}
|
||||
)
|
||||
)
|
||||
endsnippet
|
||||
|
||||
snippet ec "extern crate ..." b
|
||||
extern crate ${1:sync};
|
||||
endsnippet
|
||||
|
||||
snippet ecl "...extern crate log;" b
|
||||
#![feature(phase)]
|
||||
#[phase(plugin, link)] extern crate log;
|
||||
endsnippet
|
||||
|
||||
snippet mod "A module" b
|
||||
mod ${1:`!p snip.rv = snip.basename.lower() or "name"`} {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet crate "Create header information" b
|
||||
// Crate name
|
||||
#![crate_name = "${1:crate_name}"]
|
||||
|
||||
// Additional metadata attributes
|
||||
#![desc = "${2:Descrption.}"]
|
||||
#![license = "${3:BSD}"]
|
||||
#![comment = "${4:Comment.}"]
|
||||
|
||||
// Specify the output type
|
||||
#![crate_type = "${5:lib}"]
|
||||
endsnippet
|
||||
|
||||
snippet allow "#[allow(..)]" b
|
||||
#[allow(${1:unused_variable})]
|
||||
endsnippet
|
||||
|
||||
snippet feat "#![feature(..)]" b
|
||||
#![feature(${1:macro_rules})]
|
||||
endsnippet
|
||||
|
||||
snippet der "#[deriving(..)]" b
|
||||
#[deriving(${1:Show})]
|
||||
endsnippet
|
||||
|
||||
snippet attr "#[..]" b
|
||||
#[${1:inline}]
|
||||
endsnippet
|
||||
|
||||
snippet opt "Option<..>"
|
||||
Option<${1:int}>
|
||||
endsnippet
|
||||
|
||||
snippet res "Result<.., ..>"
|
||||
Result<${1:int}, ${2:()}>
|
||||
endsnippet
|
||||
|
||||
snippet if "if .. (if)" b
|
||||
if ${1} {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet el "else .. (el)"
|
||||
else {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet eli "else if .. (eli)"
|
||||
else if ${1} {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ife "if .. else (ife)"
|
||||
if ${1} {
|
||||
${2}
|
||||
} else {
|
||||
${3}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet mat "match"
|
||||
match ${1} {
|
||||
${2} => ${3},
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet loop "loop {}" b
|
||||
loop {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet while "while .. {}" b
|
||||
while ${1} {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet for "for .. in .." b
|
||||
for ${1:i} in ${2:range(0u, 10)} {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet spawn "spawn(proc() { .. });" b
|
||||
spawn(proc() {
|
||||
${VISUAL}${0}
|
||||
});
|
||||
endsnippet
|
||||
|
||||
snippet chan "A channel" b
|
||||
let (${1:tx}, ${2:rx}): (Sender<${3:int}>, Receiver<${4:int}>) = channel();
|
||||
endsnippet
|
||||
|
||||
snippet duplex "Duplex stream" b
|
||||
let (${1:from_child}, ${2:to_child}) = sync::duplex();
|
||||
endsnippet
|
||||
|
||||
snippet todo "A Todo comment"
|
||||
// [TODO]: ${1:Description} - `!v strftime("%Y-%m-%d %I:%M%P")`
|
||||
endsnippet
|
||||
|
||||
snippet fixme "FIXME comment"
|
||||
// FIXME: ${1}
|
||||
endsnippet
|
||||
|
||||
snippet st "Struct" b
|
||||
struct ${1:`!p snip.rv = snip.basename.title() or "Name"`} {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet stn "Struct with new constructor." b
|
||||
pub struct ${1:`!p snip.rv = snip.basename.title() or "Name"`} {
|
||||
${3}
|
||||
}
|
||||
|
||||
impl $1 {
|
||||
pub fn new(${2}) -> $1 {
|
||||
${4}return $1 {
|
||||
${5}
|
||||
};
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet enum "An enum" b
|
||||
enum ${1:Name} {
|
||||
${VISUAL}${0},
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet type "A type" b
|
||||
type ${1:NewName} = ${VISUAL}${0};
|
||||
endsnippet
|
||||
|
||||
snippet imp "An impl" b
|
||||
impl ${1:Name} {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet drop "Drop implementation" b
|
||||
impl Drop for ${1:Name} {
|
||||
fn drop(&mut self) {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet trait "Trait definition" b
|
||||
trait ${1:Name} {
|
||||
${VISUAL}${0}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet ss "A static string."
|
||||
static ${1}: &'static str = "${VISUAL}${0}";
|
||||
endsnippet
|
||||
|
||||
snippet stat "A static variable."
|
||||
static ${1}: ${2:uint} = ${VISUAL}${0};
|
||||
endsnippet
|
||||
|
||||
# vim:ft=snippets:
|
63
sources_non_forked/vim-snippets/UltiSnips/soy.snippets
Normal file
63
sources_non_forked/vim-snippets/UltiSnips/soy.snippets
Normal file
@ -0,0 +1,63 @@
|
||||
priority -50
|
||||
|
||||
extends html
|
||||
|
||||
snippet ns "Namespace" b
|
||||
{namespace ${1:name}}
|
||||
endsnippet
|
||||
|
||||
snippet tmpl "Template" b
|
||||
/**
|
||||
* ${2:TODO(`whoami`): Describe this template.}
|
||||
*/
|
||||
{template .${1:name}}
|
||||
$0
|
||||
{/template}
|
||||
endsnippet
|
||||
|
||||
snippet msg "Message" b
|
||||
{msg desc="${1:description}"}
|
||||
$0
|
||||
{/msg}
|
||||
endsnippet
|
||||
|
||||
snippet let "let command" b
|
||||
{let $${1:identifier}: ${2:expression} /}
|
||||
endsnippet
|
||||
|
||||
snippet if "if .. (if)" b
|
||||
{if ${1:expression}}
|
||||
$0
|
||||
{/if}
|
||||
endsnippet
|
||||
|
||||
snippet ife "if .. else (ife)" b
|
||||
{if ${1:expression}}
|
||||
$2
|
||||
{else}
|
||||
$0
|
||||
{/if}
|
||||
endsnippet
|
||||
|
||||
snippet eli "else if .. (eli)" b
|
||||
{elif ${1:expression}}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet fore "foreach command" b
|
||||
{foreach $${1:var} in ${2:ref}}
|
||||
$0
|
||||
{/foreach}
|
||||
endsnippet
|
||||
|
||||
snippet for "for command" b
|
||||
{for $${1:var} in range(${2:rangeexpr})}
|
||||
$0
|
||||
{/for}
|
||||
endsnippet
|
||||
|
||||
snippet call "template call" b
|
||||
{call ${1:tmpl}}
|
||||
$0
|
||||
{/call}
|
||||
endsnippet
|
37
sources_non_forked/vim-snippets/plugin/vimsnippets.vim
Normal file
37
sources_non_forked/vim-snippets/plugin/vimsnippets.vim
Normal file
@ -0,0 +1,37 @@
|
||||
if exists("b:done_vimsnippets")
|
||||
finish
|
||||
endif
|
||||
let b:done_vimsnippets = 1
|
||||
|
||||
" Expanding the path is not needed on Vim 7.4
|
||||
if &cp || version >= 704
|
||||
finish
|
||||
endif
|
||||
|
||||
" Add pythonx to the python search path if needed (i.e. <= Vim 7.3).
|
||||
if !has("python") && !has("python3")
|
||||
finish
|
||||
end
|
||||
|
||||
" This will fail if UltiSnips is not installed.
|
||||
try
|
||||
call UltiSnips#bootstrap#Bootstrap()
|
||||
catch /E117/
|
||||
finish
|
||||
endtry
|
||||
|
||||
|
||||
" This should have been set by UltiSnips, otherwise something is wrong.
|
||||
if !exists("g:_uspy")
|
||||
finish
|
||||
end
|
||||
|
||||
|
||||
" Expand our path
|
||||
let s:SourcedFile=expand("<sfile>")
|
||||
exec g:_uspy "import vim, os, sys"
|
||||
exec g:_uspy "sourced_file = vim.eval('s:SourcedFile')"
|
||||
exec g:_uspy "while not os.path.exists(os.path.join(sourced_file, 'pythonx')):
|
||||
\ sourced_file = os.path.dirname(sourced_file)"
|
||||
exec g:_uspy "module_path = os.path.join(sourced_file, 'pythonx')"
|
||||
exec g:_uspy "sys.path.append(module_path)"
|
20
sources_non_forked/vim-snippets/pythonx/vimsnippets.py
Normal file
20
sources_non_forked/vim-snippets/pythonx/vimsnippets.py
Normal file
@ -0,0 +1,20 @@
|
||||
"""Helper methods used in UltiSnips snippets."""
|
||||
|
||||
def complete(tab, opts):
|
||||
"""
|
||||
get options that start with tab
|
||||
|
||||
:param tab: query string
|
||||
:param opts: list that needs to be completed
|
||||
|
||||
:return: a string that start with tab
|
||||
"""
|
||||
msg = "({0})"
|
||||
if tab:
|
||||
opts = [m[len(tab):] for m in opts if m.startswith(tab)]
|
||||
if len(opts) == 1:
|
||||
return opts[0]
|
||||
|
||||
if not len(opts):
|
||||
msg = "{0}"
|
||||
return msg.format("|".join(opts))
|
255
sources_non_forked/vim-snippets/snippets/ada.snippets
Normal file
255
sources_non_forked/vim-snippets/snippets/ada.snippets
Normal file
@ -0,0 +1,255 @@
|
||||
snippet wi with
|
||||
with ${1};${0}
|
||||
|
||||
snippet pac package
|
||||
package ${1} is
|
||||
${0}
|
||||
end $1;
|
||||
|
||||
snippet pacb package body
|
||||
package body ${1} is
|
||||
${0}
|
||||
end $1;
|
||||
|
||||
snippet ent entry ... when
|
||||
entry ${1}(${2}) when ${3} is
|
||||
begin
|
||||
${0}
|
||||
end $1;
|
||||
|
||||
snippet task task
|
||||
task ${1} is
|
||||
entry ${0}
|
||||
end $1;
|
||||
|
||||
snippet taskb task body
|
||||
task body ${1} is
|
||||
${2}
|
||||
begin
|
||||
${0}
|
||||
end $1;
|
||||
|
||||
snippet acc accept
|
||||
accept ${1}(${2}) do
|
||||
${0}
|
||||
end $1;
|
||||
|
||||
snippet prot protected type
|
||||
protected type ${1}(${2}) is
|
||||
${0}
|
||||
end $1;
|
||||
|
||||
snippet prob protected body
|
||||
protected body ${1} is
|
||||
${2}
|
||||
begin
|
||||
${0}
|
||||
end $1;
|
||||
|
||||
snippet gen generic type
|
||||
generic
|
||||
type ${1} is ${2};${0}
|
||||
|
||||
snippet ty type
|
||||
type ${1} is ${2};${0}
|
||||
|
||||
snippet tyd type with default value
|
||||
type ${1} is ${2}
|
||||
with Default_Value => ${3};${0}
|
||||
|
||||
snippet subty subtype
|
||||
subtype ${1} is ${2};${0}
|
||||
|
||||
snippet dec declare block
|
||||
declare
|
||||
${1}
|
||||
begin
|
||||
${0}
|
||||
end;
|
||||
|
||||
snippet decn declare named block
|
||||
${1}:
|
||||
declare
|
||||
${2}
|
||||
begin
|
||||
${0}
|
||||
end $1;
|
||||
|
||||
snippet ifex if expression
|
||||
if ${1} then ${2} else ${0}
|
||||
|
||||
snippet casex case expression
|
||||
case ${1} is
|
||||
when ${2} => ${3},${0}
|
||||
|
||||
snippet fora for all
|
||||
for all ${1} ${2:in} ${3} => ${0}
|
||||
|
||||
snippet fors for some
|
||||
for some ${1} ${2:in} ${3} => ${0}
|
||||
|
||||
snippet if if
|
||||
if ${1} then
|
||||
${0}
|
||||
end if;
|
||||
|
||||
snippet ife if ... else
|
||||
if ${1} then
|
||||
${2}
|
||||
else
|
||||
${0}
|
||||
end if;
|
||||
|
||||
snippet el else
|
||||
else
|
||||
${0}
|
||||
|
||||
snippet eif elsif
|
||||
elsif ${1} then
|
||||
${0}
|
||||
|
||||
snippet wh while
|
||||
while ${1} loop
|
||||
${0}
|
||||
end loop;
|
||||
|
||||
snippet nwh named while
|
||||
${1}:
|
||||
while ${2} loop
|
||||
${0}
|
||||
end loop $1;
|
||||
|
||||
snippet for for
|
||||
for ${1:I} in ${2} loop
|
||||
${0}
|
||||
end loop;
|
||||
|
||||
snippet fore for each
|
||||
for ${1} of ${2} loop
|
||||
${0}
|
||||
end loop;
|
||||
|
||||
snippet nfor named for
|
||||
${1}:
|
||||
for ${2:I} in ${3} loop
|
||||
${0}
|
||||
end loop $1;
|
||||
|
||||
snippet nfore named for each
|
||||
${1}:
|
||||
for ${2} of ${3} loop
|
||||
${0}
|
||||
end loop $1;
|
||||
|
||||
snippet proc procedure
|
||||
procedure ${1}(${2}) is
|
||||
${3}
|
||||
begin
|
||||
${0}
|
||||
end $1;
|
||||
|
||||
snippet procd procedure declaration
|
||||
procedure ${1};${0}
|
||||
|
||||
snippet fun function
|
||||
function ${1}(${2}) return ${3} is
|
||||
${4}
|
||||
begin
|
||||
${0}
|
||||
end $1;
|
||||
|
||||
snippet fune expression function
|
||||
function ${1} return ${2} is
|
||||
(${3});${0}
|
||||
|
||||
snippet fund function declaration
|
||||
function ${1} return ${2};${0}
|
||||
|
||||
snippet ret extended return
|
||||
return ${1} do
|
||||
${0}
|
||||
end return;
|
||||
|
||||
snippet rec record
|
||||
record
|
||||
${0}
|
||||
end record;
|
||||
|
||||
snippet case case
|
||||
case ${1} is
|
||||
when ${2} => ${3};${0}
|
||||
end case;
|
||||
|
||||
snippet whe when
|
||||
when ${1} => ${2};${0}
|
||||
|
||||
snippet wheo when others
|
||||
when others => ${1};${0}
|
||||
|
||||
snippet lo loop
|
||||
loop
|
||||
${0}
|
||||
end loop;
|
||||
|
||||
snippet nlo named loop
|
||||
${1}:
|
||||
loop
|
||||
${0}
|
||||
end loop $1;
|
||||
|
||||
snippet ex exit when
|
||||
exit when ${1};${0}
|
||||
|
||||
snippet put Ada.Text_IO.Put
|
||||
Ada.Text_IO.Put(${1});${0}
|
||||
|
||||
snippet putl Ada.Text_IO.Put_Line
|
||||
Ada.Text_IO.Put_Line(${1});${0}
|
||||
|
||||
snippet get Ada.Text_IO.Get
|
||||
Ada.Text_IO.Get(${1});${0}
|
||||
|
||||
snippet getl Ada.Text_IO.Get_Line
|
||||
Ada.Text_IO.Get_Line(${1});${0}
|
||||
|
||||
snippet newline Ada.Text_IO.New_Line
|
||||
Ada.Text_IO.New_Line(${1:1});${0}
|
||||
|
||||
snippet gpl GPL license header
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU ${1}General Public License as published by
|
||||
-- the Free Software Foundation; either version ${2:3} of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU $1General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU $1General Public License
|
||||
-- along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- Copyright (C) ${3:Author}, ${4:`strftime("%Y")`}
|
||||
|
||||
${0}
|
||||
|
||||
snippet gplf GPL file license header
|
||||
-- This file is part of ${1:Program-Name}.
|
||||
--
|
||||
-- $1 is free software: you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU ${2}General Public License as published by
|
||||
-- the Free Software Foundation, either version ${3:3} of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- $1 is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU $2General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU $2General Public License
|
||||
-- along with $1. If not, see <http://www.gnu.org/licenses/>.
|
||||
--
|
||||
-- Copyright (C) ${4:Author}, ${5:`strftime("%Y")`}
|
||||
|
||||
${0}
|
||||
|
@ -0,0 +1,11 @@
|
||||
snippet def
|
||||
define ["${1:#dependencies1}"], (${2:#dependencies2}) ->
|
||||
${0:TARGET}
|
||||
|
||||
snippet defn
|
||||
define "${1:#name}", ["${2:#dependencies1}"], (${3:#dependencies2}) ->
|
||||
${0:TARGET}
|
||||
|
||||
snippet reqjs
|
||||
require ["${1:#dependencies1}"], (${2:#dependencies2}) ->
|
||||
${0:TARGET}
|
338
sources_non_forked/vim-snippets/snippets/d.snippets
Normal file
338
sources_non_forked/vim-snippets/snippets/d.snippets
Normal file
@ -0,0 +1,338 @@
|
||||
### Import
|
||||
snippet imp
|
||||
import
|
||||
snippet pimp
|
||||
public import
|
||||
### My favorite modules
|
||||
snippet io
|
||||
std.stdio
|
||||
snippet traits
|
||||
std.traits
|
||||
snippet conv
|
||||
std.conv
|
||||
snippet arr
|
||||
std.array
|
||||
snippet algo
|
||||
std.algorithm
|
||||
snippet theusual
|
||||
import std.stdio, std.string, std.array;
|
||||
import std.traits, std.conv, std.algorithm;
|
||||
import std.math, std.regex;
|
||||
### Control Structures
|
||||
snippet for
|
||||
for(int ${1:i} = 0; $1 < ${2:count}; $1++) {
|
||||
${0}
|
||||
}
|
||||
snippet fe
|
||||
foreach(${1:elem}; ${2:range}) {
|
||||
${0}
|
||||
}
|
||||
snippet fei
|
||||
foreach(${1:i}, ${2:elem}; ${3:range}) {
|
||||
${0}
|
||||
}
|
||||
snippet fer
|
||||
foreach_reverse(${1:elem}; ${2:range}) {
|
||||
${0}
|
||||
}
|
||||
snippet feri
|
||||
foreach_reverse(${1:i}, ${2:elem}; ${3:range}) {
|
||||
${0}
|
||||
}
|
||||
snippet sce
|
||||
scope(exit) ${1:f.close();}
|
||||
snippet scs
|
||||
scope(success) ${1}
|
||||
snippet scf
|
||||
scope(failure) ${1}
|
||||
snippet el
|
||||
else {
|
||||
${1}
|
||||
}
|
||||
snippet eif
|
||||
else if(${1}) {
|
||||
${0}
|
||||
}
|
||||
snippet if
|
||||
if(${1}) {
|
||||
${0}
|
||||
}
|
||||
snippet ife
|
||||
if(${1}) {
|
||||
${2}
|
||||
} else {
|
||||
${3}
|
||||
}
|
||||
snippet ifee
|
||||
if(${1}) {
|
||||
${2}
|
||||
} else if(${3}) {
|
||||
${4}
|
||||
} else {
|
||||
${5}
|
||||
}
|
||||
snippet sw
|
||||
switch(${1}) {
|
||||
${0}
|
||||
}
|
||||
snippet cs
|
||||
case ${1:0}:
|
||||
${2}
|
||||
break;
|
||||
snippet def
|
||||
default:
|
||||
${0}
|
||||
snippet fsw
|
||||
final switch(${1}) {
|
||||
${0}
|
||||
}
|
||||
snippet try
|
||||
try {
|
||||
${1}
|
||||
} catch(${2:Exception} ${3:e}) {
|
||||
${4}
|
||||
}
|
||||
snippet tcf
|
||||
try {
|
||||
${0}
|
||||
} catch(${1:Exception} ${2:e}) {
|
||||
${3}
|
||||
} finally {
|
||||
${4}
|
||||
}
|
||||
snippet wh
|
||||
while(${1:cond}) {
|
||||
${0}
|
||||
}
|
||||
snippet dowh
|
||||
do {
|
||||
${1}
|
||||
} while(${2});
|
||||
snippet sif
|
||||
static if(${1:cond}) {
|
||||
${2}
|
||||
}
|
||||
snippet sife
|
||||
static if(${1}) {
|
||||
${2}
|
||||
} else {
|
||||
${3}
|
||||
}
|
||||
snippet sifee
|
||||
static if(${1}) {
|
||||
${2}
|
||||
} else static if(${3}) {
|
||||
${4}
|
||||
} else {
|
||||
${5}
|
||||
}
|
||||
snippet seif
|
||||
else static if(${1}) {
|
||||
${2}
|
||||
}
|
||||
snippet ?
|
||||
(${1: a > b}) ? ${2:a} : ${3:b};
|
||||
snippet with
|
||||
with(${1:exp}) {
|
||||
${2}
|
||||
} ${0}
|
||||
### Functions
|
||||
snippet fun
|
||||
${1:auto} ${2:func}(${3:params}) {
|
||||
${0}
|
||||
}
|
||||
snippet contr
|
||||
in {
|
||||
${1}
|
||||
} out {
|
||||
${2}
|
||||
} body {
|
||||
${0}
|
||||
}
|
||||
snippet l
|
||||
(${1:x}) => ${2:x}${0:;}
|
||||
snippet funl
|
||||
function (${1:int x}) => ${2}${3:;}
|
||||
snippet del
|
||||
delegate (${1:int x}) => ${2}${3:;}
|
||||
### Templates
|
||||
snippet temp
|
||||
template ${1:`vim_snippets#Filename("$2", "untitled")`}(${2:T}) {
|
||||
${0}
|
||||
}
|
||||
snippet tempif
|
||||
template ${1:`vim_snippets#Filename("$2", "untitled")`}(${2:T}) if(${3:isSomeString!}$2) {
|
||||
${0}
|
||||
}
|
||||
snippet opApply
|
||||
int opApply(Dg)(Dg dg) if(ParameterTypeTuble!Dg.length == 2) {
|
||||
${0}
|
||||
}
|
||||
snippet psn
|
||||
pure @safe nothrow
|
||||
snippet safe
|
||||
@safe
|
||||
snippet trusted
|
||||
@trusted
|
||||
snippet system
|
||||
@system
|
||||
### OOPs
|
||||
snippet cl
|
||||
class${1:(T)} ${2:`vim_snippets#Filename("$3", "untitled")`} {
|
||||
${0}
|
||||
}
|
||||
snippet str
|
||||
struct${1:(T)} ${2:`vim_snippets#Filename("$3", "untitled")`} {
|
||||
${0}
|
||||
}
|
||||
snippet uni
|
||||
union${1:(T)} ${2:`vim_snippets#Filename("$3", "untitled")`} {
|
||||
${0}
|
||||
}
|
||||
snippet inter
|
||||
interface I${1:`vim_snippets#Filename("$2", "untitled")`} {
|
||||
${0}
|
||||
}
|
||||
snippet enum
|
||||
enum ${1} {
|
||||
${0}
|
||||
}
|
||||
snippet pu
|
||||
public
|
||||
snippet pr
|
||||
private
|
||||
snippet po
|
||||
protected
|
||||
snippet ctor
|
||||
this(${1}) {
|
||||
${0}
|
||||
}
|
||||
snippet dtor
|
||||
~this(${1}) {
|
||||
${0}
|
||||
}
|
||||
### Type Witchery
|
||||
snippet al
|
||||
alias ${1:b} = ${2:a};
|
||||
${0}
|
||||
snippet alth
|
||||
alias ${1:value} this;
|
||||
${0}
|
||||
### The Commonplace
|
||||
snippet main
|
||||
void main() {
|
||||
${0}
|
||||
}
|
||||
snippet maina
|
||||
void main(string[] args) {
|
||||
${0}
|
||||
}
|
||||
snippet mod
|
||||
module ${1:main};${0}
|
||||
snippet var
|
||||
${1:auto} ${2:var} = ${0:1};
|
||||
snippet new
|
||||
${1:auto} ${2:var} = new ${3:Object}(${4});
|
||||
${0}
|
||||
snippet file
|
||||
auto ${1:f} = File(${2:"useful_info.xml"}, ${3:"rw"});
|
||||
${0}
|
||||
snippet map
|
||||
map!(${1:f})(${2:xs});
|
||||
${0}
|
||||
snippet filter
|
||||
filter!(${1:p})(${2:xs});
|
||||
${0}
|
||||
snippet reduce
|
||||
reduce!(${1:f})(${2:xs});
|
||||
${0}
|
||||
snippet find
|
||||
find!(${1:p})($2:xs);
|
||||
${0}
|
||||
snippet aa
|
||||
${1:int}[${2:string}] ${3:dict} = ${0};
|
||||
### Misc
|
||||
snippet #!
|
||||
#!/usr/bin/env rdmd
|
||||
snippet bang
|
||||
#!/usr/bin/env rdmd
|
||||
snippet rdmd
|
||||
#!/usr/bin/env rdmd
|
||||
snippet isstr
|
||||
isSomeString!${1:S}
|
||||
snippet isnum
|
||||
isNumeric!${1:N}
|
||||
snippet tos
|
||||
to!string(${1:x});
|
||||
${0}
|
||||
snippet toi
|
||||
to!int(${1:str});
|
||||
${0}
|
||||
snippet tod
|
||||
to!double(${1:str});
|
||||
${0}
|
||||
snippet un
|
||||
unittest {
|
||||
${0}
|
||||
}
|
||||
snippet ver
|
||||
version(${1:Posix}) {
|
||||
${0}
|
||||
}
|
||||
snippet de
|
||||
debug {
|
||||
${0}
|
||||
}
|
||||
snippet sst
|
||||
shared static this(${1}) {
|
||||
${0}
|
||||
}
|
||||
snippet td
|
||||
// Typedef is deprecated. Use alias instead.
|
||||
typedef
|
||||
snippet ino
|
||||
inout
|
||||
snippet imm
|
||||
immutable
|
||||
snippet fin
|
||||
final
|
||||
snippet con
|
||||
const
|
||||
snippet psi
|
||||
private static immutable ${1:int} ${2:Constant} = ${3:1};
|
||||
${0}
|
||||
snippet prag
|
||||
pragma(${1})
|
||||
snippet pms
|
||||
pragma(msg, ${1:Warning});
|
||||
snippet asm
|
||||
asm {
|
||||
${1}
|
||||
}
|
||||
snippet mixin
|
||||
mixin(${1:`writeln("Hello, World!");`});
|
||||
snippet over
|
||||
override
|
||||
snippet ret
|
||||
return ${1};
|
||||
snippet FILE
|
||||
__FILE__
|
||||
snippet MOD
|
||||
__MODULE__
|
||||
snippet LINE
|
||||
__LINE__
|
||||
snippet FUN
|
||||
__FUNCTION__
|
||||
snippet PF
|
||||
__PRETTY_FUNCTION__
|
||||
snippet cast
|
||||
cast(${1:T})(${2:val});
|
||||
snippet /*
|
||||
/*
|
||||
* ${1}
|
||||
*/
|
||||
### Fun stuff
|
||||
snippet idk
|
||||
// I don't know how this works. Don't touch it.
|
||||
snippet idfk
|
||||
// Don't FUCKING touch this.
|
18
sources_non_forked/vim-snippets/snippets/jade.snippets
Normal file
18
sources_non_forked/vim-snippets/snippets/jade.snippets
Normal file
@ -0,0 +1,18 @@
|
||||
# Angular HTML
|
||||
snippet rep
|
||||
div(ng-repeat='${1} in ${2}')
|
||||
|
||||
snippet repf
|
||||
div(ng-repeat='${1} in ${2}' | ${3})
|
||||
|
||||
snippet repi
|
||||
div(ng-repeat='${1} in ${2}' track by $index)
|
||||
|
||||
snippet hide
|
||||
div(ng-hide='${1}')
|
||||
|
||||
snippet show
|
||||
div(ng-show='${1}')
|
||||
|
||||
snippet if
|
||||
div(ng-if='${1}')
|
@ -0,0 +1,14 @@
|
||||
snippet def
|
||||
define(["${1:#dependencies1}"], function (${2:#dependencies2}) {
|
||||
return ${0:TARGET};
|
||||
});
|
||||
|
||||
snippet defn
|
||||
define("${1:#name}", ["${2:#dependencies1}"], function (${3:#dependencies2}) {
|
||||
return ${0:TARGET};
|
||||
});
|
||||
|
||||
snippet reqjs
|
||||
require(["${1:#dependencies1}"], function (${2:#dependencies2}) {
|
||||
return ${0:TARGET};
|
||||
});
|
@ -0,0 +1,50 @@
|
||||
# module exports
|
||||
snippet ex
|
||||
module.exports = ${1};
|
||||
# require
|
||||
snippet re
|
||||
var ${1} = require("${2:module_name}");
|
||||
# EventEmitter
|
||||
snippet on
|
||||
on('${1:event_name}', function(${2:stream}) {
|
||||
${3}
|
||||
});
|
||||
snippet emit
|
||||
emit('${1:event_name}', ${2:args});
|
||||
snippet once
|
||||
once('${1:event_name}', function(${2:stream}) {
|
||||
${3}
|
||||
});
|
||||
# http. User js function snippet as handler
|
||||
snippet http
|
||||
http.createServer(${1:handler}).listen(${2:port_number});
|
||||
# net
|
||||
snippet net
|
||||
net.createServer(function(${1:socket}){
|
||||
${1}.on('data', function('data'){
|
||||
${2}
|
||||
]});
|
||||
${1}.on('end', function(){
|
||||
${3}
|
||||
});
|
||||
}).listen(${4:8124});
|
||||
# Stream snippets
|
||||
snippet pipe
|
||||
pipe(${1:stream})${2}
|
||||
# Express snippets
|
||||
snippet eget
|
||||
${1:app}.get('${2:route}', ${3:handler});
|
||||
snippet epost
|
||||
${1:app}.post('${2:route}', ${3:handler});
|
||||
snippet eput
|
||||
${1:app}.put('${2:route}', ${3:handler});
|
||||
snippet edel
|
||||
${1:app}.delete('${2:route}', ${3:handler});
|
||||
# process snippets
|
||||
snippet stdin
|
||||
process.stdin
|
||||
snippet stdout
|
||||
process.stdout
|
||||
snippet stderr
|
||||
process.stderr
|
||||
|
102
sources_non_forked/vim-snippets/snippets/julia.snippets
Normal file
102
sources_non_forked/vim-snippets/snippets/julia.snippets
Normal file
@ -0,0 +1,102 @@
|
||||
snippet #!
|
||||
#!/usr/bin/env julia
|
||||
|
||||
# Functions
|
||||
snippet fun function definition
|
||||
function ${1}(${2})
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet ret return
|
||||
return(${0})
|
||||
|
||||
# Printing to console
|
||||
snippet pr print
|
||||
print("${1}")
|
||||
${0}
|
||||
|
||||
snippet prl print line
|
||||
println("${1}")
|
||||
${0}
|
||||
|
||||
# Includes
|
||||
snippet use load a package
|
||||
using ${0}
|
||||
|
||||
snippet incl include source code
|
||||
include("${1}")
|
||||
${0}
|
||||
|
||||
# Loops
|
||||
snippet forc for loop iterating over iterable container
|
||||
for ${1} in ${2}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet for standard for loop
|
||||
for ${1} = ${2}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet fornest nested for loop
|
||||
for ${1} = ${2}, ${3} = ${4}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet wh while loop
|
||||
while ${1} ${2:<=} ${3}
|
||||
${0}
|
||||
end
|
||||
|
||||
# Conditionals
|
||||
snippet if if statement
|
||||
if ${1}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet el else part of statement
|
||||
else
|
||||
${0}
|
||||
|
||||
snippet eif else if part of if statement
|
||||
else if ${1}
|
||||
${0}
|
||||
|
||||
snippet ife full if-else statement
|
||||
if ${1}
|
||||
${2}
|
||||
else
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet tern ternary operator
|
||||
${1} ? ${2} : ${3:nothing}
|
||||
|
||||
# Exceptions
|
||||
snippet try try catch
|
||||
try
|
||||
${1}
|
||||
catch ${2}
|
||||
${0}
|
||||
end
|
||||
|
||||
snippet fin finally statement
|
||||
finally
|
||||
${0}
|
||||
|
||||
snippet thr throw
|
||||
throw(${1})
|
||||
${0}
|
||||
|
||||
# Messages
|
||||
snippet in
|
||||
info("${1}")
|
||||
${0}
|
||||
|
||||
snippet wa
|
||||
warn("${1}")
|
||||
${0}
|
||||
|
||||
snippet err
|
||||
error("${1}")
|
||||
${0}
|
486
sources_non_forked/vim-snippets/snippets/rails.snippets
Normal file
486
sources_non_forked/vim-snippets/snippets/rails.snippets
Normal file
@ -0,0 +1,486 @@
|
||||
snippet art
|
||||
assert_redirected_to ${1:action}: '${2:index}'
|
||||
snippet artnp
|
||||
assert_redirected_to ${1:parent}_${2:child}_path(${3:@$1}, ${0:@$2})
|
||||
snippet artnpp
|
||||
assert_redirected_to ${1:parent}_${2:child}_path(${0:@$1})
|
||||
snippet artp
|
||||
assert_redirected_to ${1:model}_path(${0:@$1})
|
||||
snippet artpp
|
||||
assert_redirected_to ${0:model}s_path
|
||||
snippet asd
|
||||
assert_difference '${1:Model}.${2:count}', ${3:1} do
|
||||
${0}
|
||||
end
|
||||
snippet asnd
|
||||
assert_no_difference '${1:Model}.${2:count}' do
|
||||
${0}
|
||||
end
|
||||
snippet asre
|
||||
assert_response :${1:success}, @response.body
|
||||
snippet asrj
|
||||
assert_rjs :${1:replace}, '${0:dom id}'
|
||||
snippet ass assert_select(..)
|
||||
assert_select '${1:path}', ${2:text}: '${3:inner_html}' ${4:do}
|
||||
${0}
|
||||
end
|
||||
snippet ba
|
||||
before_action :${0:method}
|
||||
snippet bf
|
||||
before_filter :${0:method}
|
||||
snippet bt
|
||||
belongs_to :${0:association}
|
||||
snippet btp
|
||||
belongs_to :${1:association}, polymorphic: true
|
||||
snippet crw
|
||||
cattr_accessor :${0:attr_names}
|
||||
snippet defcreate
|
||||
def create
|
||||
@${1:model_class_name} = ${2:ModelClassName}.new(params[:$1])
|
||||
|
||||
respond_to do |format|
|
||||
if @$1.save
|
||||
flash[:notice] = '$2 was successfully created.'
|
||||
format.html { redirect_to(@$1) }
|
||||
format.xml { render xml: @$1, status: :created, location: @$1 }
|
||||
else
|
||||
format.html { render action: 'new' }
|
||||
format.xml { render xml: @$1.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
snippet defdestroy
|
||||
def destroy
|
||||
@${1:model_class_name} = ${2:ModelClassName}.find(params[:id])
|
||||
@$1.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to($1s_url) }
|
||||
format.xml { head :ok }
|
||||
end
|
||||
end
|
||||
snippet defedit
|
||||
def edit
|
||||
@${1:model_class_name} = ${0:ModelClassName}.find(params[:id])
|
||||
end
|
||||
snippet defindex
|
||||
def index
|
||||
@${1:model_class_name} = ${2:ModelClassName}.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.xml { render xml: @$1s }
|
||||
end
|
||||
end
|
||||
snippet defnew
|
||||
def new
|
||||
@${1:model_class_name} = ${2:ModelClassName}.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.xml { render xml: @$1 }
|
||||
end
|
||||
end
|
||||
snippet defshow
|
||||
def show
|
||||
@${1:model_class_name} = ${2:ModelClassName}.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.xml { render xml: @$1 }
|
||||
end
|
||||
end
|
||||
snippet defupdate
|
||||
def update
|
||||
@${1:model_class_name} = ${2:ModelClassName}.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @$1.update_attributes(params[:$1])
|
||||
flash[:notice] = '$2 was successfully updated.'
|
||||
format.html { redirect_to(@$1) }
|
||||
format.xml { head :ok }
|
||||
else
|
||||
format.html { render action: 'edit' }
|
||||
format.xml { render xml: @$1.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
snippet dele delegate .. to
|
||||
delegate :${1:methods}, to: :${0:object}
|
||||
snippet dele delegate .. to .. prefix .. allow_nil
|
||||
delegate :${1:methods}, to: :${2:object}, prefix: :${3:prefix}, allow_nil: ${0:allow_nil}
|
||||
snippet amc
|
||||
alias_method_chain :${1:method_name}, :${0:feature}
|
||||
snippet flash
|
||||
flash[:${1:notice}] = '${0}'
|
||||
snippet habtm
|
||||
has_and_belongs_to_many :${1:object}, join_table: '${2:table_name}', foreign_key: '${3}_id'
|
||||
snippet hm
|
||||
has_many :${0:object}
|
||||
snippet hmd
|
||||
has_many :${1:other}s, class_name: '${2:$1}', foreign_key: '${3:$1}_id', dependent: :destroy
|
||||
snippet hmt
|
||||
has_many :${1:object}, through: :${0:object}
|
||||
snippet ho
|
||||
has_one :${0:object}
|
||||
snippet hod
|
||||
has_one :${1:object}, dependent: :${0:destroy}
|
||||
snippet i18
|
||||
I18n.t('${1:type.key}')
|
||||
snippet ist
|
||||
<%= image_submit_tag('${1:agree.png}', id: '${2:id}'${0}) %>
|
||||
snippet log
|
||||
Rails.logger.${1:debug} ${0}
|
||||
snippet log2
|
||||
RAILS_DEFAULT_LOGGER.${1:debug} ${0}
|
||||
snippet logd
|
||||
logger.debug { '${1:message}' }
|
||||
snippet loge
|
||||
logger.error { '${1:message}' }
|
||||
snippet logf
|
||||
logger.fatal { '${1:message}' }
|
||||
snippet logi
|
||||
logger.info { '${1:message}' }
|
||||
snippet logw
|
||||
logger.warn { '${1:message}' }
|
||||
snippet mapc
|
||||
${1:map}.${2:connect} '${0:controller/:action/:id}'
|
||||
snippet mapca
|
||||
${1:map}.catch_all '*${2:anything}', controller: '${3:default}', action: '${4:error}'
|
||||
snippet mapr
|
||||
${1:map}.resource :${0:resource}
|
||||
snippet maprs
|
||||
${1:map}.resources :${0:resource}
|
||||
snippet mapwo
|
||||
${1:map}.with_options ${2:controller}: '${3:thing}' do |$3|
|
||||
${0}
|
||||
end
|
||||
|
||||
###############################
|
||||
# model callback snippets #
|
||||
###############################
|
||||
|
||||
# before callback
|
||||
snippet mbv
|
||||
before_validation :${0:method}
|
||||
snippet mbc
|
||||
before_create :${0:method}
|
||||
snippet mbu
|
||||
before_update :${0:method}
|
||||
snippet mbs
|
||||
before_save :${0:method}
|
||||
snippet mbd
|
||||
before_destroy :${0:method}
|
||||
|
||||
# after callback
|
||||
snippet mav
|
||||
after_validation :${0:method}
|
||||
snippet maf
|
||||
after_find :${0:method}
|
||||
snippet mat
|
||||
after_touch :${0:method}
|
||||
snippet macr
|
||||
after_create :${0:method}
|
||||
snippet mau
|
||||
after_update :${0:method}
|
||||
snippet mas
|
||||
after_save :${0:method}
|
||||
snippet mad
|
||||
after_destroy :${0:method}
|
||||
|
||||
# around callback
|
||||
snippet marc
|
||||
around_create :${0:method}
|
||||
snippet maru
|
||||
around_update :${0:method}
|
||||
snippet mars
|
||||
around_save :${0:method}
|
||||
snippet mard
|
||||
around_destroy :${0:method}
|
||||
|
||||
snippet mcht
|
||||
change_table :${1:table_name} do |t|
|
||||
${0}
|
||||
end
|
||||
snippet mp
|
||||
map(&:${0:id})
|
||||
snippet mrw
|
||||
mattr_accessor :${0:attr_names}
|
||||
snippet oa
|
||||
order('${0:field}')
|
||||
snippet od
|
||||
order('${0:field} DESC')
|
||||
snippet pa
|
||||
params[:${1:id}]
|
||||
snippet ra
|
||||
render action: '${0:action}'
|
||||
snippet ral
|
||||
render action: '${1:action}', layout: '${0:layoutname}'
|
||||
snippet rest
|
||||
respond_to do |format|
|
||||
format.${1:html} { ${0} }
|
||||
end
|
||||
snippet rf
|
||||
render file: '${0:filepath}'
|
||||
snippet rfu
|
||||
render file: '${1:filepath}', use_full_path: ${0:false}
|
||||
snippet ri
|
||||
render inline: "${0:<%= 'hello' %>}"
|
||||
snippet ril
|
||||
render inline: "${1:<%= 'hello' %>}", locals: { ${2:name}: '${3:value}'${0} }
|
||||
snippet rit
|
||||
render inline: "${1:<%= 'hello' %>}", type: ${0::rxml}
|
||||
snippet rjson
|
||||
render json: '${0:text to render}'
|
||||
snippet rl
|
||||
render layout: '${0:layoutname}'
|
||||
snippet rn
|
||||
render nothing: ${0:true}
|
||||
snippet rns
|
||||
render nothing: ${1:true}, status: ${0:401}
|
||||
snippet rp
|
||||
render partial: '${0:item}'
|
||||
snippet rpc
|
||||
render partial: '${1:item}', collection: ${0:@$1s}
|
||||
snippet rpl
|
||||
render partial: '${1:item}', locals: { ${2:$1}: ${0:@$1} }
|
||||
snippet rpo
|
||||
render partial: '${1:item}', object: ${0:@$1}
|
||||
snippet rps
|
||||
render partial: '${1:item}', status: ${0:500}
|
||||
snippet rt
|
||||
render text: '${0:text to render}'
|
||||
snippet rtl
|
||||
render text: '${1:text to render}', layout: '${0:layoutname}'
|
||||
snippet rtlt
|
||||
render text: '${1:text to render}', layout: ${0:true}
|
||||
snippet rts
|
||||
render text: '${1:text to render}', status: ${0:401}
|
||||
snippet ru
|
||||
render :update do |${1:page}|
|
||||
$1.${0}
|
||||
end
|
||||
snippet rxml
|
||||
render xml: '${0:text to render}'
|
||||
snippet sc
|
||||
scope :${1:name}, -> { where(${2:field}: ${0:value}) }
|
||||
snippet sl
|
||||
scope :${1:name}, lambda do |${2:value}|
|
||||
where('${3:field = ?}', ${0:value})
|
||||
end
|
||||
snippet sha1
|
||||
Digest::SHA1.hexdigest(${0:string})
|
||||
snippet sweeper
|
||||
class ${1:ModelClassName}Sweeper < ActionController::Caching::Sweeper
|
||||
observe $1
|
||||
|
||||
def after_save(${0:model_class_name})
|
||||
expire_cache($2)
|
||||
end
|
||||
|
||||
def after_destroy($2)
|
||||
expire_cache($2)
|
||||
end
|
||||
|
||||
def expire_cache($2)
|
||||
expire_page
|
||||
end
|
||||
end
|
||||
snippet va validates_associated
|
||||
validates_associated :${0:attribute}
|
||||
snippet va validates .., acceptance: true
|
||||
validates :${0:terms}, acceptance: true
|
||||
snippet vc
|
||||
validates :${0:attribute}, confirmation: true
|
||||
snippet ve
|
||||
validates :${1:attribute}, exclusion: { in: ${0:%w( mov avi )} }
|
||||
snippet vf
|
||||
validates :${1:attribute}, format: { with: /${0:regex}/ }
|
||||
snippet vi
|
||||
validates :${1:attribute}, inclusion: { in: %w(${0: mov avi }) }
|
||||
snippet vl
|
||||
validates :${1:attribute}, length: { in: ${2:3}..${0:20} }
|
||||
snippet vn
|
||||
validates :${0:attribute}, numericality: true
|
||||
snippet vp
|
||||
validates :${0:attribute}, presence: true
|
||||
snippet vu
|
||||
validates :${0:attribute}, uniqueness: true
|
||||
snippet format
|
||||
format.${1:js|xml|html} { ${0} }
|
||||
snippet wc
|
||||
where(${1:'conditions'}${0:, bind_var})
|
||||
snippet wf
|
||||
where(${1:field}: ${0:value})
|
||||
snippet xdelete
|
||||
xhr :delete, :${1:destroy}, id: ${2:1}
|
||||
snippet xget
|
||||
xhr :get, :${1:show}, id: ${2:1}
|
||||
snippet xpost
|
||||
xhr :post, :${1:create}, ${2:object}: ${3:object}
|
||||
snippet xput
|
||||
xhr :put, :${1:update}, id: ${2:1}, ${3:object}: ${4:object}
|
||||
snippet test
|
||||
test 'should ${1:do something}' do
|
||||
${0}
|
||||
end
|
||||
###########################
|
||||
# migrations snippets #
|
||||
###########################
|
||||
snippet mac
|
||||
add_column :${1:table_name}, :${2:column_name}, :${0:data_type}
|
||||
snippet mai
|
||||
add_index :${1:table_name}, :${0:column_name}
|
||||
snippet mrc
|
||||
remove_column :${1:table_name}, :${0:column_name}
|
||||
snippet mrnc
|
||||
rename_column :${1:table_name}, :${2:old_column_name}, :${0:new_column_name}
|
||||
snippet mcc
|
||||
change_column :${1:table}, :${2:column}, :${0:type}
|
||||
snippet mnc
|
||||
t.${1:string} :${2:title}${3:, null: false}
|
||||
snippet mct
|
||||
create_table :${1:table_name} do |t|
|
||||
${0}
|
||||
end
|
||||
snippet migration class .. < ActiveRecord::Migration .. def up .. def down .. end
|
||||
class ${1:class_name} < ActiveRecord::Migration
|
||||
def up
|
||||
${0}
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
||||
snippet migration class .. < ActiveRecord::Migration .. def change .. end
|
||||
class ${1:class_name} < ActiveRecord::Migration
|
||||
def change
|
||||
${0}
|
||||
end
|
||||
end
|
||||
snippet trc
|
||||
t.remove :${0:column}
|
||||
snippet tre
|
||||
t.rename :${1:old_column_name}, :${2:new_column_name}
|
||||
${0}
|
||||
snippet tref
|
||||
t.references :${0:model}
|
||||
snippet tcb
|
||||
t.boolean :${1:title}
|
||||
${0}
|
||||
snippet tcbi
|
||||
t.binary :${1:title}, limit: ${2:2}.megabytes
|
||||
${0}
|
||||
snippet tcd
|
||||
t.decimal :${1:title}, precision: ${2:10}, scale: ${3:2}
|
||||
${0}
|
||||
snippet tcda
|
||||
t.date :${1:title}
|
||||
${0}
|
||||
snippet tcdt
|
||||
t.datetime :${1:title}
|
||||
${0}
|
||||
snippet tcf
|
||||
t.float :${1:title}
|
||||
${0}
|
||||
snippet tch
|
||||
t.change :${1:name}, :${2:string}, ${3:limit}: ${4:80}
|
||||
${0}
|
||||
snippet tci
|
||||
t.integer :${1:title}
|
||||
${0}
|
||||
snippet tcl
|
||||
t.integer :lock_version, null: false, default: 0
|
||||
${0}
|
||||
snippet tcr
|
||||
t.references :${1:taggable}, polymorphic: { default: '${2:Photo}' }
|
||||
${0}
|
||||
snippet tcs
|
||||
t.string :${1:title}
|
||||
${0}
|
||||
snippet tct
|
||||
t.text :${1:title}
|
||||
${0}
|
||||
snippet tcti
|
||||
t.time :${1:title}
|
||||
${0}
|
||||
snippet tcts
|
||||
t.timestamp :${1:title}
|
||||
${0}
|
||||
snippet tctss
|
||||
t.timestamps
|
||||
${0}
|
||||
##########################
|
||||
# Rspec snippets #
|
||||
##########################
|
||||
#ShouldaMatchers#ActionController
|
||||
snippet isfp
|
||||
it { should filter_param :${0:key} }
|
||||
snippet isrt
|
||||
it { should redirect_to ${0:url} }
|
||||
snippet isrtp
|
||||
it { should render_template ${0} }
|
||||
snippet isrwl
|
||||
it { should render_with_layout ${0} }
|
||||
snippet isrf
|
||||
it { should rescue_from ${0:exception} }
|
||||
snippet isrw
|
||||
it { should respond_with ${0:status} }
|
||||
snippet isr
|
||||
it { should route(:${1:method}, '${0:path}') }
|
||||
snippet isss
|
||||
it { should set_session :${0:key} }
|
||||
snippet issf
|
||||
it { should set_the_flash('${0}') }
|
||||
#ShouldaMatchers#ActiveModel
|
||||
snippet isama
|
||||
it { should allow_mass_assignment_of :${0} }
|
||||
snippet isav
|
||||
it { should allow_value(${1}).for :${0} }
|
||||
snippet isee
|
||||
it { should ensure_exclusion_of :${0} }
|
||||
snippet isei
|
||||
it { should ensure_inclusion_of :${0} }
|
||||
snippet isel
|
||||
it { should ensure_length_of :${0} }
|
||||
snippet isva
|
||||
it { should validate_acceptance_of :${0} }
|
||||
snippet isvc
|
||||
it { should validate_confirmation_of :${0} }
|
||||
snippet isvn
|
||||
it { should validate_numericality_of :${0} }
|
||||
snippet isvp
|
||||
it { should validate_presence_of :${0} }
|
||||
snippet isvu
|
||||
it { should validate_uniqueness_of :${0} }
|
||||
#ShouldaMatchers#ActiveRecord
|
||||
snippet isana
|
||||
it { should accept_nested_attributes_for :${0} }
|
||||
snippet isbt
|
||||
it { should belong_to :${0} }
|
||||
snippet isbtcc
|
||||
it { should belong_to(:${1}).counter_cache ${0:true} }
|
||||
snippet ishbtm
|
||||
it { should have_and_belong_to_many :${0} }
|
||||
snippet isbv
|
||||
it { should be_valid }
|
||||
snippet ishc
|
||||
it { should have_db_column :${0} }
|
||||
snippet ishi
|
||||
it { should have_db_index :${0} }
|
||||
snippet ishm
|
||||
it { should have_many :${0} }
|
||||
snippet ishmt
|
||||
it { should have_many(:${1}).through :${0} }
|
||||
snippet isho
|
||||
it { should have_one :${0} }
|
||||
snippet ishro
|
||||
it { should have_readonly_attribute :${0} }
|
||||
snippet iss
|
||||
it { should serialize :${0} }
|
||||
snippet isres
|
||||
it { should respond_to :${0} }
|
||||
snippet isresw
|
||||
it { should respond_to(:${1}).with(${0}).arguments }
|
||||
snippet super_call
|
||||
${1:super_class}.instance_method(:${0:method}).bind(self).call
|
125
sources_non_forked/vim-snippets/snippets/rust.snippets
Normal file
125
sources_non_forked/vim-snippets/snippets/rust.snippets
Normal file
@ -0,0 +1,125 @@
|
||||
#################
|
||||
# Rust Snippets #
|
||||
#################
|
||||
|
||||
# Functions
|
||||
snippet fn
|
||||
fn ${1:function_name}(${2}) {
|
||||
${0}
|
||||
}
|
||||
snippet fn-
|
||||
fn ${1:function_name}(${2}) -> ${3} {
|
||||
${0}
|
||||
}
|
||||
snippet test
|
||||
#[test]
|
||||
fn ${1:test_function_name}() {
|
||||
${0}
|
||||
}
|
||||
snippet new
|
||||
pub fn new(${2}) -> ${1:Name} {
|
||||
${0}return $1 { ${3} };
|
||||
}
|
||||
snippet main
|
||||
pub fn main() {
|
||||
${0}
|
||||
}
|
||||
snippet let
|
||||
let ${1:name}${3} = ${2};
|
||||
snippet pln
|
||||
println!("${1}");
|
||||
snippet pln,
|
||||
println!("${1}", ${2});
|
||||
snippet ec
|
||||
extern crate ${1:sync};
|
||||
snippet ecl
|
||||
#![feature(phase)]
|
||||
#[phase(plugin, link)] extern crate log;
|
||||
snippet mod
|
||||
mod ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
|
||||
${0}
|
||||
} /* $1 */
|
||||
snippet crate
|
||||
// Crate name
|
||||
#![crate_name = "${1:crate_name}"]
|
||||
// Additional metadata attributes
|
||||
#![desc = "${2:Descrption.}"]
|
||||
#![license = "${3:BSD}"]
|
||||
#![comment = "${4:Comment.}"]
|
||||
// Specify the output type
|
||||
#![crate_type = "${5:lib}"]
|
||||
snippet allow
|
||||
#[allow(${1:unused_variable})]
|
||||
snippet feat
|
||||
#![feature(${1:macro_rules})]
|
||||
# Common types
|
||||
snippet opt
|
||||
Option<${1:int}>
|
||||
snippet res
|
||||
Result<${1:~str}, ${2:()}>
|
||||
snippet if
|
||||
if ${1:/* condition */} {
|
||||
${0}
|
||||
}
|
||||
snippet mat
|
||||
match ${1} {
|
||||
${2} => ${3},
|
||||
}
|
||||
snippet while
|
||||
while ${1:condition} {
|
||||
${0}
|
||||
}
|
||||
snippet for
|
||||
for ${1:i} in ${2:range(0u, 10)} {
|
||||
${0}
|
||||
}
|
||||
snippet spawn
|
||||
spawn(proc() {
|
||||
${0}
|
||||
});
|
||||
snippet chan
|
||||
let (${1:tx}, ${2:rx}): (Sender<${3:int}>, Receiver<${4:int}>) = channel();
|
||||
snippet duplex
|
||||
let (${1:from_child}, ${2:to_child}) = sync::duplex();
|
||||
# TODO commenting
|
||||
snippet todo
|
||||
// [TODO]: ${1:Description}
|
||||
# Struct
|
||||
snippet st
|
||||
struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
|
||||
${0}
|
||||
}
|
||||
|
||||
impl $1 {
|
||||
pub fn new(${2}) -> $1 {
|
||||
${4}return $1 {
|
||||
${5}
|
||||
};
|
||||
}
|
||||
}
|
||||
# Enum
|
||||
snippet enum
|
||||
enum ${1:enum_name} {
|
||||
${0},
|
||||
}
|
||||
# Impl
|
||||
snippet imp
|
||||
impl ${1:Name} {
|
||||
${0}
|
||||
}
|
||||
snippet drop
|
||||
impl Drop for ${1:Name} {
|
||||
fn drop(&mut self) {
|
||||
${0}
|
||||
}
|
||||
}
|
||||
# Traits
|
||||
snippet trait
|
||||
trait ${1:Name} {
|
||||
${0}
|
||||
}
|
||||
# Statics
|
||||
snippet ss
|
||||
static ${1}: &'static str = "${0}";
|
||||
snippet stat
|
||||
static ${1}: ${2:uint} = ${0};
|
36
sources_non_forked/vim-snippets/snippets/scheme.snippets
Normal file
36
sources_non_forked/vim-snippets/snippets/scheme.snippets
Normal file
@ -0,0 +1,36 @@
|
||||
snippet +
|
||||
(+ ${1}
|
||||
${0})
|
||||
|
||||
snippet -
|
||||
(- ${1}
|
||||
${0})
|
||||
|
||||
snippet /
|
||||
(/ ${1}
|
||||
${0})
|
||||
|
||||
snippet *
|
||||
(* ${1}
|
||||
${0})
|
||||
|
||||
# Definition
|
||||
snippet def
|
||||
(define (${1:name})
|
||||
(${0:definition}))
|
||||
|
||||
# Definition with lambda
|
||||
snippet defl
|
||||
(define ${1:name}
|
||||
(lambda (x)(${0:definition})))
|
||||
|
||||
# Condition
|
||||
snippet cond
|
||||
(cond ((${1:predicate}) (${2:action}))
|
||||
((${3:predicate}) (${0:action})))
|
||||
|
||||
# If statement
|
||||
snippet if
|
||||
(if (${1:predicate})
|
||||
(${2:true-action})
|
||||
(${0:false-action}))
|
993
sources_non_forked/vim-snippets/snippets/stylus.snippets
Normal file
993
sources_non_forked/vim-snippets/snippets/stylus.snippets
Normal file
@ -0,0 +1,993 @@
|
||||
snippet !
|
||||
!important
|
||||
snippet bdi:m+
|
||||
-moz-border-image url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch}
|
||||
snippet bdi:m
|
||||
-moz-border-image ${0}
|
||||
snippet bdrz:m
|
||||
-moz-border-radius ${0}
|
||||
snippet bxsh:m+
|
||||
-moz-box-shadow ${1:0} ${2:0} ${3:0} ${0}
|
||||
snippet bxsh:m
|
||||
-moz-box-shadow ${0}
|
||||
snippet bdi:w+
|
||||
-webkit-border-image url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch}
|
||||
snippet bdi:w
|
||||
-webkit-border-image ${0}
|
||||
snippet bdrz:w
|
||||
-webkit-border-radius ${0}
|
||||
snippet bxsh:w+
|
||||
-webkit-box-shadow ${1:0} ${2:0} ${3:0} ${0}
|
||||
snippet bxsh:w
|
||||
-webkit-box-shadow ${0}
|
||||
snippet @f
|
||||
@font-face ${0}
|
||||
snippet @i
|
||||
@import '${0}'
|
||||
snippet @r
|
||||
@require '${0}'
|
||||
snippet @m
|
||||
@media ${1:screen}
|
||||
snippet @msmw
|
||||
@media screen and (min-width: ${0}px)
|
||||
snippet @ext
|
||||
@extend .${1}
|
||||
${0}
|
||||
snippet bg+
|
||||
background ${1} url(${2}) ${3:0} ${4:0} ${0:no-repeat}
|
||||
snippet bga
|
||||
background-attachment ${0}
|
||||
snippet bga:f
|
||||
background-attachment fixed
|
||||
snippet bga:s
|
||||
background-attachment scroll
|
||||
snippet bgbk
|
||||
background-break ${0}
|
||||
snippet bgbk:bb
|
||||
background-break bounding-box
|
||||
snippet bgbk:c
|
||||
background-break continuous
|
||||
snippet bgbk:eb
|
||||
background-break each-box
|
||||
snippet bgcp
|
||||
background-clip ${0}
|
||||
snippet bgcp:bb
|
||||
background-clip border-box
|
||||
snippet bgcp:cb
|
||||
background-clip content-box
|
||||
snippet bgcp:nc
|
||||
background-clip no-clip
|
||||
snippet bgcp:pb
|
||||
background-clip padding-box
|
||||
snippet bgc
|
||||
background-color ${0}
|
||||
snippet bgc:t
|
||||
background-color transparent
|
||||
snippet bgi
|
||||
background-image url(${0})
|
||||
snippet bgi:n
|
||||
background-image none
|
||||
snippet bgo
|
||||
background-origin ${0}
|
||||
snippet bgo:bb
|
||||
background-origin border-box
|
||||
snippet bgo:cb
|
||||
background-origin content-box
|
||||
snippet bgo:pb
|
||||
background-origin padding-box
|
||||
snippet bgpx
|
||||
background-position-x ${0}
|
||||
snippet bgpy
|
||||
background-position-y ${0}
|
||||
snippet bgp
|
||||
background-position ${1:0} ${0:0}
|
||||
snippet bgr
|
||||
background-repeat ${0}
|
||||
snippet bgr:n
|
||||
background-repeat no-repeat
|
||||
snippet bgr:x
|
||||
background-repeat repeat-x
|
||||
snippet bgr:y
|
||||
background-repeat repeat-y
|
||||
snippet bgr:r
|
||||
background-repeat repeat
|
||||
snippet bgz
|
||||
background-size ${0}
|
||||
snippet bgz:a
|
||||
background-size auto
|
||||
snippet bgz:ct
|
||||
background-size contain
|
||||
snippet bgz:cv
|
||||
background-size cover
|
||||
snippet bg
|
||||
background ${0}
|
||||
snippet bg:ie
|
||||
filter progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1}',sizingMethod='${0:crop}')
|
||||
snippet bg:n
|
||||
background none
|
||||
snippet bd+
|
||||
border ${1:1px} ${2:solid} ${0}
|
||||
snippet bdb+
|
||||
border-bottom ${1:1px} ${2:solid} ${0}
|
||||
snippet bdbc
|
||||
border-bottom-color ${0}
|
||||
snippet bdbi
|
||||
border-bottom-image url(${0})
|
||||
snippet bdbi:n
|
||||
border-bottom-image none
|
||||
snippet bdbli
|
||||
border-bottom-left-image url(${0})
|
||||
snippet bdbli:c
|
||||
border-bottom-left-image continue
|
||||
snippet bdbli:n
|
||||
border-bottom-left-image none
|
||||
snippet bdblrz
|
||||
border-bottom-left-radius ${0}
|
||||
snippet bdbri
|
||||
border-bottom-right-image url(${0})
|
||||
snippet bdbri:c
|
||||
border-bottom-right-image continue
|
||||
snippet bdbri:n
|
||||
border-bottom-right-image none
|
||||
snippet bdbrrz
|
||||
border-bottom-right-radius ${0}
|
||||
snippet bdbs
|
||||
border-bottom-style ${0}
|
||||
snippet bdbs:n
|
||||
border-bottom-style none
|
||||
snippet bdbw
|
||||
border-bottom-width ${0}
|
||||
snippet bdb
|
||||
border-bottom ${0}
|
||||
snippet bdb:n
|
||||
border-bottom none
|
||||
snippet bdbk
|
||||
border-break ${0}
|
||||
snippet bdbk:c
|
||||
border-break close
|
||||
snippet bdcl
|
||||
border-collapse ${0}
|
||||
snippet bdcl:c
|
||||
border-collapse collapse
|
||||
snippet bdcl:s
|
||||
border-collapse separate
|
||||
snippet bdc
|
||||
border-color ${0}
|
||||
snippet bdci
|
||||
border-corner-image url(${0})
|
||||
snippet bdci:c
|
||||
border-corner-image continue
|
||||
snippet bdci:n
|
||||
border-corner-image none
|
||||
snippet bdf
|
||||
border-fit ${0}
|
||||
snippet bdf:c
|
||||
border-fit clip
|
||||
snippet bdf:of
|
||||
border-fit overwrite
|
||||
snippet bdf:ow
|
||||
border-fit overwrite
|
||||
snippet bdf:r
|
||||
border-fit repeat
|
||||
snippet bdf:sc
|
||||
border-fit scale
|
||||
snippet bdf:sp
|
||||
border-fit space
|
||||
snippet bdf:st
|
||||
border-fit stretch
|
||||
snippet bdi
|
||||
border-image url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch}
|
||||
snippet bdi:n
|
||||
border-image none
|
||||
snippet bdl+
|
||||
border-left ${1:1px} ${2:solid} ${0}
|
||||
snippet bdlc
|
||||
border-left-color ${0}
|
||||
snippet bdli
|
||||
border-left-image url(${0})
|
||||
snippet bdli:n
|
||||
border-left-image none
|
||||
snippet bdls
|
||||
border-left-style ${0}
|
||||
snippet bdls:n
|
||||
border-left-style none
|
||||
snippet bdlw
|
||||
border-left-width ${0}
|
||||
snippet bdl
|
||||
border-left ${0}
|
||||
snippet bdl:n
|
||||
border-left none
|
||||
snippet bdlt
|
||||
border-length ${0}
|
||||
snippet bdlt:a
|
||||
border-length auto
|
||||
snippet bdrz
|
||||
border-radius ${0}
|
||||
snippet bdr+
|
||||
border-right ${1:1px} ${2:solid} ${0}
|
||||
snippet bdrc
|
||||
border-right-color ${0}
|
||||
snippet bdri
|
||||
border-right-image url(${0})
|
||||
snippet bdri:n
|
||||
border-right-image none
|
||||
snippet bdrs
|
||||
border-right-style ${0}
|
||||
snippet bdrs:n
|
||||
border-right-style none
|
||||
snippet bdrw
|
||||
border-right-width ${0}
|
||||
snippet bdr
|
||||
border-right ${0}
|
||||
snippet bdr:n
|
||||
border-right none
|
||||
snippet bdsp
|
||||
border-spacing ${0}
|
||||
snippet bds
|
||||
border-style ${0}
|
||||
snippet bds:ds
|
||||
border-style dashed
|
||||
snippet bds:dtds
|
||||
border-style dot-dash
|
||||
snippet bds:dtdtds
|
||||
border-style dot-dot-dash
|
||||
snippet bds:dt
|
||||
border-style dotted
|
||||
snippet bds:db
|
||||
border-style double
|
||||
snippet bds:g
|
||||
border-style groove
|
||||
snippet bds:h
|
||||
border-style hidden
|
||||
snippet bds:i
|
||||
border-style inset
|
||||
snippet bds:n
|
||||
border-style none
|
||||
snippet bds:o
|
||||
border-style outset
|
||||
snippet bds:r
|
||||
border-style ridge
|
||||
snippet bds:s
|
||||
border-style solid
|
||||
snippet bds:w
|
||||
border-style wave
|
||||
snippet bdt+
|
||||
border-top ${1:1px} ${2:solid} ${0}
|
||||
snippet bdtc
|
||||
border-top-color ${0}
|
||||
snippet bdti
|
||||
border-top-image url(${0})
|
||||
snippet bdti:n
|
||||
border-top-image none
|
||||
snippet bdtli
|
||||
border-top-left-image url(${0})
|
||||
snippet bdtli:c
|
||||
border-corner-image continue
|
||||
snippet bdtli:n
|
||||
border-corner-image none
|
||||
snippet bdtlrz
|
||||
border-top-left-radius ${0}
|
||||
snippet bdtri
|
||||
border-top-right-image url(${0})
|
||||
snippet bdtri:c
|
||||
border-top-right-image continue
|
||||
snippet bdtri:n
|
||||
border-top-right-image none
|
||||
snippet bdtrrz
|
||||
border-top-right-radius ${0}
|
||||
snippet bdts
|
||||
border-top-style ${0}
|
||||
snippet bdts:n
|
||||
border-top-style none
|
||||
snippet bdtw
|
||||
border-top-width ${0}
|
||||
snippet bdt
|
||||
border-top ${0}
|
||||
snippet bdt:n
|
||||
border-top none
|
||||
snippet bdw
|
||||
border-width ${0}
|
||||
snippet bd
|
||||
border ${0}
|
||||
snippet bd:n
|
||||
border none
|
||||
snippet b
|
||||
bottom ${0}
|
||||
snippet b:a
|
||||
bottom auto
|
||||
snippet bxsh+
|
||||
box-shadow ${1:0} ${2:0} ${3:0} ${0}
|
||||
snippet bxsh
|
||||
box-shadow ${0}
|
||||
snippet bxsh:n
|
||||
box-shadow none
|
||||
snippet bxz
|
||||
box-sizing ${0}
|
||||
snippet bxz:bb
|
||||
box-sizing border-box
|
||||
snippet bxz:cb
|
||||
box-sizing content-box
|
||||
snippet cps
|
||||
caption-side ${0}
|
||||
snippet cps:b
|
||||
caption-side bottom
|
||||
snippet cps:t
|
||||
caption-side top
|
||||
snippet cl
|
||||
clear ${0}
|
||||
snippet cl:b
|
||||
clear both
|
||||
snippet cl:l
|
||||
clear left
|
||||
snippet cl:n
|
||||
clear none
|
||||
snippet cl:r
|
||||
clear right
|
||||
snippet cp
|
||||
clip ${0}
|
||||
snippet cp:a
|
||||
clip auto
|
||||
snippet cp:r
|
||||
clip rect(${1:0} ${2:0} ${3:0} ${0:0})
|
||||
snippet c
|
||||
color ${0}
|
||||
snippet ct
|
||||
content ${0}
|
||||
snippet ct:a
|
||||
content attr(${0})
|
||||
snippet ct:cq
|
||||
content close-quote
|
||||
snippet ct:c
|
||||
content counter(${0})
|
||||
snippet ct:cs
|
||||
content counters(${0})
|
||||
snippet ct:ncq
|
||||
content no-close-quote
|
||||
snippet ct:noq
|
||||
content no-open-quote
|
||||
snippet ct:n
|
||||
content normal
|
||||
snippet ct:oq
|
||||
content open-quote
|
||||
snippet coi
|
||||
counter-increment ${0}
|
||||
snippet cor
|
||||
counter-reset ${0}
|
||||
snippet cur
|
||||
cursor ${0}
|
||||
snippet cur:a
|
||||
cursor auto
|
||||
snippet cur:c
|
||||
cursor crosshair
|
||||
snippet cur:d
|
||||
cursor default
|
||||
snippet cur:ha
|
||||
cursor hand
|
||||
snippet cur:he
|
||||
cursor help
|
||||
snippet cur:m
|
||||
cursor move
|
||||
snippet cur:p
|
||||
cursor pointer
|
||||
snippet cur:t
|
||||
cursor text
|
||||
snippet d
|
||||
display ${0}
|
||||
snippet d:mib
|
||||
display -moz-inline-box
|
||||
snippet d:mis
|
||||
display -moz-inline-stack
|
||||
snippet d:b
|
||||
display block
|
||||
snippet d:cp
|
||||
display compact
|
||||
snippet d:ib
|
||||
display inline-block
|
||||
snippet d:itb
|
||||
display inline-table
|
||||
snippet d:i
|
||||
display inline
|
||||
snippet d:li
|
||||
display list-item
|
||||
snippet d:n
|
||||
display none
|
||||
snippet d:ri
|
||||
display run-in
|
||||
snippet d:tbcp
|
||||
display table-caption
|
||||
snippet d:tbc
|
||||
display table-cell
|
||||
snippet d:tbclg
|
||||
display table-column-group
|
||||
snippet d:tbcl
|
||||
display table-column
|
||||
snippet d:tbfg
|
||||
display table-footer-group
|
||||
snippet d:tbhg
|
||||
display table-header-group
|
||||
snippet d:tbrg
|
||||
display table-row-group
|
||||
snippet d:tbr
|
||||
display table-row
|
||||
snippet d:tb
|
||||
display table
|
||||
snippet ec
|
||||
empty-cells ${0}
|
||||
snippet ec:h
|
||||
empty-cells hide
|
||||
snippet ec:s
|
||||
empty-cells show
|
||||
snippet exp
|
||||
expression()
|
||||
snippet fl
|
||||
float ${0}
|
||||
snippet fl:l
|
||||
float left
|
||||
snippet fl:n
|
||||
float none
|
||||
snippet fl:r
|
||||
float right
|
||||
snippet f+
|
||||
font ${1:1em} ${2:Arial},${0:sans-serif}
|
||||
snippet fef
|
||||
font-effect ${0}
|
||||
snippet fef:eb
|
||||
font-effect emboss
|
||||
snippet fef:eg
|
||||
font-effect engrave
|
||||
snippet fef:n
|
||||
font-effect none
|
||||
snippet fef:o
|
||||
font-effect outline
|
||||
snippet femp
|
||||
font-emphasize-position ${0}
|
||||
snippet femp:a
|
||||
font-emphasize-position after
|
||||
snippet femp:b
|
||||
font-emphasize-position before
|
||||
snippet fems
|
||||
font-emphasize-style ${0}
|
||||
snippet fems:ac
|
||||
font-emphasize-style accent
|
||||
snippet fems:c
|
||||
font-emphasize-style circle
|
||||
snippet fems:ds
|
||||
font-emphasize-style disc
|
||||
snippet fems:dt
|
||||
font-emphasize-style dot
|
||||
snippet fems:n
|
||||
font-emphasize-style none
|
||||
snippet fem
|
||||
font-emphasize ${0}
|
||||
snippet ff
|
||||
font-family ${0}
|
||||
snippet ff:c
|
||||
font-family ${0:'Monotype Corsiva','Comic Sans MS'},cursive
|
||||
snippet ff:f
|
||||
font-family ${0:Capitals,Impact},fantasy
|
||||
snippet ff:m
|
||||
font-family ${0:Monaco,'Courier New'},monospace
|
||||
snippet ff:ss
|
||||
font-family ${0:Helvetica,Arial},sans-serif
|
||||
snippet ff:s
|
||||
font-family ${0:Georgia,'Times New Roman'},serif
|
||||
snippet fza
|
||||
font-size-adjust ${0}
|
||||
snippet fza:n
|
||||
font-size-adjust none
|
||||
snippet fz
|
||||
font-size ${0}
|
||||
snippet fsm
|
||||
font-smooth ${0}
|
||||
snippet fsm:aw
|
||||
font-smooth always
|
||||
snippet fsm:a
|
||||
font-smooth auto
|
||||
snippet fsm:n
|
||||
font-smooth never
|
||||
snippet fst
|
||||
font-stretch ${0}
|
||||
snippet fst:c
|
||||
font-stretch condensed
|
||||
snippet fst:e
|
||||
font-stretch expanded
|
||||
snippet fst:ec
|
||||
font-stretch extra-condensed
|
||||
snippet fst:ee
|
||||
font-stretch extra-expanded
|
||||
snippet fst:n
|
||||
font-stretch normal
|
||||
snippet fst:sc
|
||||
font-stretch semi-condensed
|
||||
snippet fst:se
|
||||
font-stretch semi-expanded
|
||||
snippet fst:uc
|
||||
font-stretch ultra-condensed
|
||||
snippet fst:ue
|
||||
font-stretch ultra-expanded
|
||||
snippet fs
|
||||
font-style ${0}
|
||||
snippet fs:i
|
||||
font-style italic
|
||||
snippet fs:n
|
||||
font-style normal
|
||||
snippet fs:o
|
||||
font-style oblique
|
||||
snippet fv
|
||||
font-variant ${0}
|
||||
snippet fv:n
|
||||
font-variant normal
|
||||
snippet fv:sc
|
||||
font-variant small-caps
|
||||
snippet fw
|
||||
font-weight ${0}
|
||||
snippet fw:b
|
||||
font-weight bold
|
||||
snippet fw:br
|
||||
font-weight bolder
|
||||
snippet fw:lr
|
||||
font-weight lighter
|
||||
snippet fw:n
|
||||
font-weight normal
|
||||
snippet f
|
||||
font ${0}
|
||||
snippet h
|
||||
height ${0}
|
||||
snippet h:a
|
||||
height auto
|
||||
snippet l
|
||||
left ${0}
|
||||
snippet l:a
|
||||
left auto
|
||||
snippet lts
|
||||
letter-spacing ${0}
|
||||
snippet lh
|
||||
line-height ${0}
|
||||
snippet lisi
|
||||
list-style-image url(${0})
|
||||
snippet lisi:n
|
||||
list-style-image none
|
||||
snippet lisp
|
||||
list-style-position ${0}
|
||||
snippet lisp:i
|
||||
list-style-position inside
|
||||
snippet lisp:o
|
||||
list-style-position outside
|
||||
snippet list
|
||||
list-style-type ${0}
|
||||
snippet list:c
|
||||
list-style-type circle
|
||||
snippet list:dclz
|
||||
list-style-type decimal-leading-zero
|
||||
snippet list:dc
|
||||
list-style-type decimal
|
||||
snippet list:d
|
||||
list-style-type disc
|
||||
snippet list:lr
|
||||
list-style-type lower-roman
|
||||
snippet list:n
|
||||
list-style-type none
|
||||
snippet list:s
|
||||
list-style-type square
|
||||
snippet list:ur
|
||||
list-style-type upper-roman
|
||||
snippet lis
|
||||
list-style ${0}
|
||||
snippet lis:n
|
||||
list-style none
|
||||
snippet mb
|
||||
margin-bottom ${0}
|
||||
snippet mb:a
|
||||
margin-bottom auto
|
||||
snippet ml
|
||||
margin-left ${0}
|
||||
snippet ml:a
|
||||
margin-left auto
|
||||
snippet mr
|
||||
margin-right ${0}
|
||||
snippet mr:a
|
||||
margin-right auto
|
||||
snippet mt
|
||||
margin-top ${0}
|
||||
snippet mt:a
|
||||
margin-top auto
|
||||
snippet m
|
||||
margin ${0}
|
||||
snippet m:4
|
||||
margin ${1:0} ${2:0} ${3:0} ${0:0}
|
||||
snippet m:3
|
||||
margin ${1:0} ${2:0} ${0:0}
|
||||
snippet m:2
|
||||
margin ${1:0} ${0:0}
|
||||
snippet m:0
|
||||
margin 0
|
||||
snippet m:a
|
||||
margin auto
|
||||
snippet mah
|
||||
max-height ${0}
|
||||
snippet mah:n
|
||||
max-height none
|
||||
snippet maw
|
||||
max-width ${0}
|
||||
snippet maw:n
|
||||
max-width none
|
||||
snippet mih
|
||||
min-height ${0}
|
||||
snippet miw
|
||||
min-width ${0}
|
||||
snippet op
|
||||
opacity ${0}
|
||||
snippet op:ie
|
||||
filter progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100})
|
||||
snippet op:ms
|
||||
-ms-filter 'progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100})'
|
||||
snippet orp
|
||||
orphans ${0}
|
||||
snippet o+
|
||||
outline ${1:1px} ${2:solid} ${0}
|
||||
snippet oc
|
||||
outline-color ${0}
|
||||
snippet oc:i
|
||||
outline-color invert
|
||||
snippet oo
|
||||
outline-offset ${0}
|
||||
snippet os
|
||||
outline-style ${0}
|
||||
snippet ow
|
||||
outline-width ${0}
|
||||
snippet o
|
||||
outline ${0}
|
||||
snippet o:n
|
||||
outline none
|
||||
snippet ovs
|
||||
overflow-style ${0}
|
||||
snippet ovs:a
|
||||
overflow-style auto
|
||||
snippet ovs:mq
|
||||
overflow-style marquee
|
||||
snippet ovs:mv
|
||||
overflow-style move
|
||||
snippet ovs:p
|
||||
overflow-style panner
|
||||
snippet ovs:s
|
||||
overflow-style scrollbar
|
||||
snippet ovx
|
||||
overflow-x ${0}
|
||||
snippet ovx:a
|
||||
overflow-x auto
|
||||
snippet ovx:h
|
||||
overflow-x hidden
|
||||
snippet ovx:s
|
||||
overflow-x scroll
|
||||
snippet ovx:v
|
||||
overflow-x visible
|
||||
snippet ovy
|
||||
overflow-y ${0}
|
||||
snippet ovy:a
|
||||
overflow-y auto
|
||||
snippet ovy:h
|
||||
overflow-y hidden
|
||||
snippet ovy:s
|
||||
overflow-y scroll
|
||||
snippet ovy:v
|
||||
overflow-y visible
|
||||
snippet ov
|
||||
overflow ${0}
|
||||
snippet ov:a
|
||||
overflow auto
|
||||
snippet ov:h
|
||||
overflow hidden
|
||||
snippet ov:s
|
||||
overflow scroll
|
||||
snippet ov:v
|
||||
overflow visible
|
||||
snippet pb
|
||||
padding-bottom ${0}
|
||||
snippet pl
|
||||
padding-left ${0}
|
||||
snippet pr
|
||||
padding-right ${0}
|
||||
snippet pt
|
||||
padding-top ${0}
|
||||
snippet p
|
||||
padding ${0}
|
||||
snippet p:4
|
||||
padding ${1:0} ${2:0} ${3:0} ${0:0}
|
||||
snippet p:3
|
||||
padding ${1:0} ${2:0} ${0:0}
|
||||
snippet p:2
|
||||
padding ${1:0} ${0:0}
|
||||
snippet p:0
|
||||
padding 0
|
||||
snippet pgba
|
||||
page-break-after ${0}
|
||||
snippet pgba:aw
|
||||
page-break-after always
|
||||
snippet pgba:a
|
||||
page-break-after auto
|
||||
snippet pgba:l
|
||||
page-break-after left
|
||||
snippet pgba:r
|
||||
page-break-after right
|
||||
snippet pgbb
|
||||
page-break-before ${0}
|
||||
snippet pgbb:aw
|
||||
page-break-before always
|
||||
snippet pgbb:a
|
||||
page-break-before auto
|
||||
snippet pgbb:l
|
||||
page-break-before left
|
||||
snippet pgbb:r
|
||||
page-break-before right
|
||||
snippet pgbi
|
||||
page-break-inside ${0}
|
||||
snippet pgbi:a
|
||||
page-break-inside auto
|
||||
snippet pgbi:av
|
||||
page-break-inside avoid
|
||||
snippet pos
|
||||
position ${0}
|
||||
snippet pos:a
|
||||
position absolute
|
||||
snippet pos:f
|
||||
position fixed
|
||||
snippet pos:r
|
||||
position relative
|
||||
snippet pos:s
|
||||
position static
|
||||
snippet q
|
||||
quotes ${0}
|
||||
snippet q:en
|
||||
quotes '\201C' '\201D' '\2018' '\2019'
|
||||
snippet q:n
|
||||
quotes none
|
||||
snippet q:ru
|
||||
quotes '\00AB' '\00BB' '\201E' '\201C'
|
||||
snippet rz
|
||||
resize ${0}
|
||||
snippet rz:b
|
||||
resize both
|
||||
snippet rz:h
|
||||
resize horizontal
|
||||
snippet rz:n
|
||||
resize none
|
||||
snippet rz:v
|
||||
resize vertical
|
||||
snippet r
|
||||
right ${0}
|
||||
snippet r:a
|
||||
right auto
|
||||
snippet tbl
|
||||
table-layout ${0}
|
||||
snippet tbl:a
|
||||
table-layout auto
|
||||
snippet tbl:f
|
||||
table-layout fixed
|
||||
snippet tal
|
||||
text-align-last ${0}
|
||||
snippet tal:a
|
||||
text-align-last auto
|
||||
snippet tal:c
|
||||
text-align-last center
|
||||
snippet tal:l
|
||||
text-align-last left
|
||||
snippet tal:r
|
||||
text-align-last right
|
||||
snippet ta
|
||||
text-align ${0}
|
||||
snippet ta:c
|
||||
text-align center
|
||||
snippet ta:l
|
||||
text-align left
|
||||
snippet ta:r
|
||||
text-align right
|
||||
snippet td
|
||||
text-decoration ${0}
|
||||
snippet td:l
|
||||
text-decoration line-through
|
||||
snippet td:n
|
||||
text-decoration none
|
||||
snippet td:o
|
||||
text-decoration overline
|
||||
snippet td:u
|
||||
text-decoration underline
|
||||
snippet te
|
||||
text-emphasis ${0}
|
||||
snippet te:ac
|
||||
text-emphasis accent
|
||||
snippet te:a
|
||||
text-emphasis after
|
||||
snippet te:b
|
||||
text-emphasis before
|
||||
snippet te:c
|
||||
text-emphasis circle
|
||||
snippet te:ds
|
||||
text-emphasis disc
|
||||
snippet te:dt
|
||||
text-emphasis dot
|
||||
snippet te:n
|
||||
text-emphasis none
|
||||
snippet th
|
||||
text-height ${0}
|
||||
snippet th:a
|
||||
text-height auto
|
||||
snippet th:f
|
||||
text-height font-size
|
||||
snippet th:m
|
||||
text-height max-size
|
||||
snippet th:t
|
||||
text-height text-size
|
||||
snippet ti
|
||||
text-indent ${0}
|
||||
snippet ti:-
|
||||
text-indent -9999px
|
||||
snippet tj
|
||||
text-justify ${0}
|
||||
snippet tj:a
|
||||
text-justify auto
|
||||
snippet tj:d
|
||||
text-justify distribute
|
||||
snippet tj:ic
|
||||
text-justify inter-cluster
|
||||
snippet tj:ii
|
||||
text-justify inter-ideograph
|
||||
snippet tj:iw
|
||||
text-justify inter-word
|
||||
snippet tj:k
|
||||
text-justify kashida
|
||||
snippet tj:t
|
||||
text-justify tibetan
|
||||
snippet to+
|
||||
text-outline ${1:0} ${2:0} ${0}
|
||||
snippet to
|
||||
text-outline ${0}
|
||||
snippet to:n
|
||||
text-outline none
|
||||
snippet tr
|
||||
text-replace ${0}
|
||||
snippet tr:n
|
||||
text-replace none
|
||||
snippet tsh+
|
||||
text-shadow ${1:0} ${2:0} ${3:0} ${0}
|
||||
snippet tsh
|
||||
text-shadow ${0}
|
||||
snippet tsh:n
|
||||
text-shadow none
|
||||
snippet tt
|
||||
text-transform ${0}
|
||||
snippet tt:c
|
||||
text-transform capitalize
|
||||
snippet tt:l
|
||||
text-transform lowercase
|
||||
snippet tt:n
|
||||
text-transform none
|
||||
snippet tt:u
|
||||
text-transform uppercase
|
||||
snippet tw
|
||||
text-wrap ${0}
|
||||
snippet tw:no
|
||||
text-wrap none
|
||||
snippet tw:n
|
||||
text-wrap normal
|
||||
snippet tw:s
|
||||
text-wrap suppress
|
||||
snippet tw:u
|
||||
text-wrap unrestricted
|
||||
snippet t
|
||||
top ${0}
|
||||
snippet t:a
|
||||
top auto
|
||||
snippet va
|
||||
vertical-align ${0}
|
||||
snippet va:bl
|
||||
vertical-align baseline
|
||||
snippet va:b
|
||||
vertical-align bottom
|
||||
snippet va:m
|
||||
vertical-align middle
|
||||
snippet va:sub
|
||||
vertical-align sub
|
||||
snippet va:sup
|
||||
vertical-align super
|
||||
snippet va:tb
|
||||
vertical-align text-bottom
|
||||
snippet va:tt
|
||||
vertical-align text-top
|
||||
snippet va:t
|
||||
vertical-align top
|
||||
snippet v
|
||||
visibility ${0}
|
||||
snippet v:c
|
||||
visibility collapse
|
||||
snippet v:h
|
||||
visibility hidden
|
||||
snippet v:v
|
||||
visibility visible
|
||||
snippet whsc
|
||||
white-space-collapse ${0}
|
||||
snippet whsc:ba
|
||||
white-space-collapse break-all
|
||||
snippet whsc:bs
|
||||
white-space-collapse break-strict
|
||||
snippet whsc:k
|
||||
white-space-collapse keep-all
|
||||
snippet whsc:l
|
||||
white-space-collapse loose
|
||||
snippet whsc:n
|
||||
white-space-collapse normal
|
||||
snippet whs
|
||||
white-space ${0}
|
||||
snippet whs:n
|
||||
white-space normal
|
||||
snippet whs:nw
|
||||
white-space nowrap
|
||||
snippet whs:pl
|
||||
white-space pre-line
|
||||
snippet whs:pw
|
||||
white-space pre-wrap
|
||||
snippet whs:p
|
||||
white-space pre
|
||||
snippet wid
|
||||
widows ${0}
|
||||
snippet w
|
||||
width ${0}
|
||||
snippet w:a
|
||||
width auto
|
||||
snippet wob
|
||||
word-break ${0}
|
||||
snippet wob:ba
|
||||
word-break break-all
|
||||
snippet wob:bs
|
||||
word-break break-strict
|
||||
snippet wob:k
|
||||
word-break keep-all
|
||||
snippet wob:l
|
||||
word-break loose
|
||||
snippet wob:n
|
||||
word-break normal
|
||||
snippet wos
|
||||
word-spacing ${0}
|
||||
snippet wow
|
||||
word-wrap ${0}
|
||||
snippet wow:no
|
||||
word-wrap none
|
||||
snippet wow:n
|
||||
word-wrap normal
|
||||
snippet wow:s
|
||||
word-wrap suppress
|
||||
snippet wow:u
|
||||
word-wrap unrestricted
|
||||
snippet z
|
||||
z-index ${0}
|
||||
snippet z:a
|
||||
z-index auto
|
||||
snippet zoo
|
||||
zoom 1
|
||||
snippet :h
|
||||
:hover
|
||||
snippet :fc
|
||||
:first-child
|
||||
snippet :lc
|
||||
:last-child
|
||||
snippet :nc
|
||||
:nth-child(${0})
|
||||
snippet :nlc
|
||||
:nth-last-child(${0})
|
||||
snippet :oc
|
||||
:only-child
|
||||
snippet :a
|
||||
:after
|
||||
snippet :b
|
||||
:before
|
||||
snippet ::a
|
||||
::after
|
||||
snippet ::b
|
||||
::before
|
||||
snippet if
|
||||
if ${0}
|
||||
snippet mix
|
||||
${1}(${0})
|
||||
snippet for
|
||||
for ${1:i} in ${0}
|
||||
snippet keyf
|
||||
@keyframes ${0}
|
Reference in New Issue
Block a user