1
0
Fork 0
mirror of synced 2024-11-17 06:25:35 -05:00

Updated plugins

This commit is contained in:
Amir 2020-06-21 11:50:44 -04:00
parent 1d312d3252
commit e83f5ea2e7
46 changed files with 470 additions and 152 deletions

View file

@ -32,14 +32,29 @@ function! ale_linters#dockerfile#dockerfile_lint#Handle(buffer, lines) abort
let l:line = get(l:object, 'line', -1)
let l:message = l:object['message']
if get(l:object, 'description', 'None') isnot# 'None'
let l:message = l:message . '. ' . l:object['description']
let l:link = get(l:object, 'reference_url', '')
if type(l:link) == v:t_list
" Somehow, reference_url is returned as two-part list.
" Anchor markers in that list are sometimes duplicated.
" See https://github.com/projectatomic/dockerfile_lint/issues/134
let l:link = join(l:link, '')
let l:link = substitute(l:link, '##', '#', '')
endif
let l:detail = l:message
if get(l:object, 'description', 'None') isnot# 'None'
let l:detail .= "\n\n" . l:object['description']
endif
let l:detail .= "\n\n" . l:link
call add(l:messages, {
\ 'lnum': l:line,
\ 'text': l:message,
\ 'type': ale_linters#dockerfile#dockerfile_lint#GetType(l:type),
\ 'detail': l:detail,
\})
endfor
endfor

View file

@ -0,0 +1,21 @@
" Author: Penghui Liao <liaoishere@gmail.com>
" Description: Adds support for revive
call ale#Set('go_revive_executable', 'revive')
call ale#Set('go_revive_options', '')
function! ale_linters#go#revive#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'go_revive_options')
return ale#go#EnvString(a:buffer) . '%e'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' %t'
endfunction
call ale#linter#Define('go', {
\ 'name': 'revive',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#Var(b, 'go_revive_executable')},
\ 'command': function('ale_linters#go#revive#GetCommand'),
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
\})

View file

@ -7,6 +7,7 @@ call ale#Set('java_eclipselsp_path', ale#path#Simplify($HOME . '/eclipse.jdt.ls'
call ale#Set('java_eclipselsp_config_path', '')
call ale#Set('java_eclipselsp_workspace_path', '')
call ale#Set('java_eclipselsp_executable', 'java')
call ale#Set('java_eclipselsp_javaagent', '')
function! ale_linters#java#eclipselsp#Executable(buffer) abort
return ale#Var(a:buffer, 'java_eclipselsp_executable')
@ -100,12 +101,30 @@ function! ale_linters#java#eclipselsp#WorkspacePath(buffer) abort
return ale#path#Dirname(ale#java#FindProjectRoot(a:buffer))
endfunction
function! ale_linters#java#eclipselsp#Javaagent(buffer) abort
let l:rets = []
let l:raw = ale#Var(a:buffer, 'java_eclipselsp_javaagent')
if empty(l:raw)
return ''
endif
let l:jars = split(l:raw)
for l:jar in l:jars
call add(l:rets, ale#Escape('-javaagent:' . l:jar))
endfor
return join(l:rets, ' ')
endfunction
function! ale_linters#java#eclipselsp#Command(buffer, version) abort
let l:path = ale#Var(a:buffer, 'java_eclipselsp_path')
let l:executable = ale_linters#java#eclipselsp#Executable(a:buffer)
let l:cmd = [ ale#Escape(l:executable),
\ ale_linters#java#eclipselsp#Javaagent(a:buffer),
\ '-Declipse.application=org.eclipse.jdt.ls.core.id1',
\ '-Dosgi.bundles.defaultStartLevel=4',
\ '-Declipse.product=org.eclipse.jdt.ls.core.product',

View file

@ -6,6 +6,7 @@ let s:classpath_sep = has('unix') ? ':' : ';'
call ale#Set('java_javac_executable', 'javac')
call ale#Set('java_javac_options', '')
call ale#Set('java_javac_classpath', '')
call ale#Set('java_javac_sourcepath', '')
function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
let l:command = ''
@ -40,10 +41,15 @@ endfunction
function! s:BuildClassPathOption(buffer, import_paths) abort
" Filter out lines like [INFO], etc.
let l:class_paths = filter(a:import_paths[:], 'v:val !~# ''[''')
call extend(
\ l:class_paths,
\ split(ale#Var(a:buffer, 'java_javac_classpath'), s:classpath_sep),
\)
let l:cls_path = ale#Var(a:buffer, 'java_javac_classpath')
if !empty(l:cls_path) && type(l:cls_path) is v:t_string
call extend(l:class_paths, split(l:cls_path, s:classpath_sep))
endif
if !empty(l:cls_path) && type(l:cls_path) is v:t_list
call extend(l:class_paths, l:cls_path)
endif
return !empty(l:class_paths)
\ ? '-cp ' . ale#Escape(join(l:class_paths, s:classpath_sep))
@ -79,6 +85,27 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths, meta) abort
endif
endif
let l:source_paths = []
let l:source_path = ale#Var(a:buffer, 'java_javac_sourcepath')
if !empty(l:source_path) && type(l:source_path) is v:t_string
let l:source_paths = split(l:source_path, s:classpath_sep)
endif
if !empty(l:source_path) && type(l:source_path) is v:t_list
let l:source_paths = l:source_path
endif
if !empty(l:source_paths)
for l:path in l:source_paths
let l:sp_path = ale#path#FindNearestDirectory(a:buffer, l:path)
if !empty(l:sp_path)
call add(l:sp_dirs, l:sp_path)
endif
endfor
endif
if !empty(l:sp_dirs)
let l:sp_option = '-sourcepath '
\ . ale#Escape(join(l:sp_dirs, s:classpath_sep))

View file

@ -163,7 +163,7 @@ function! ale#Queue(delay, ...) abort
endif
endfunction
let s:current_ale_version = [2, 6, 0]
let s:current_ale_version = [2, 7, 0]
" A function used to check for ALE features in files outside of the project.
function! ale#Has(feature) abort

View file

@ -7,8 +7,40 @@ cfn-python-lint *ale-cloudformation-cfn-python-lint*
cfn-python-lint is a linter for AWS CloudFormation template file.
https://github.com/awslabs/cfn-python-lint
Website: https://github.com/awslabs/cfn-python-lint
Installation
-------------------------------------------------------------------------------
Install cfn-python-lint using either pip or brew: >
`pip install cfn-lint`. If pip is not available, run
`python setup.py clean --all` then `python setup.py install`.
Homebrew (macOS):
`brew install cfn-lint`
<
Configuration
-------------------------------------------------------------------------------
To get cloudformation linter to work on only CloudFormation files we must set
the buffer |filetype| to yaml.cloudformation.
This causes ALE to lint the file with linters configured for cloudformation and
yaml files.
Just put:
>
au BufRead,BufNewFile *.template.yaml set filetype=yaml.cloudformation
<
on `ftdetect/cloudformation.vim`
This will get both cloudformation and yaml linters to work on any file with `.template.yaml` ext.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -219,6 +219,25 @@ g:ale_go_govet_options *g:ale_go_govet_options*
This variable can be set to pass additional options to the go vet linter.
===============================================================================
revive *ale-go-revive*
g:ale_go_revive_executable *g:ale_go_revive_executable*
*b:ale_go_revive_executable*
Type: |String|
Default: `'revive'`
This variable can be set to change the revive executable path.
g:ale_go_revive_options *g:ale_go_revive_options*
*b:ale_go_revive_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to the revive
===============================================================================
staticcheck *ale-go-staticcheck*

View file

@ -46,7 +46,7 @@ javac *ale-java-javac*
g:ale_java_javac_classpath *g:ale_java_javac_classpath*
*b:ale_java_javac_classpath*
Type: |String|
Type: |String| or |List|
Default: `''`
This variable can be set to change the global classpath for Java.
@ -67,6 +67,30 @@ g:ale_java_javac_options *g:ale_java_javac_options*
This variable can be set to pass additional options to javac.
g:ale_java_javac_sourcepath *g:ale_java_javac_sourcepath*
*b:ale_java_javac_sourcepath*
Type: |String| or |List|
Default: `''`
This variable can set multiple source code paths, the source code path is a
relative path (relative to the project root directory).
Example:
String type:
Note that the unix system separator is a colon(`:`) window system
is a semicolon(`;`).
>
let g:ale_java_javac_sourcepath = 'build/gen/source/xx/main:build/gen/source'
<
List type:
>
let g:ale_java_javac_sourcepath = [
\ 'build/generated/source/querydsl/main',
\ 'target/generated-sources/source/querydsl/main'
\ ]
<
===============================================================================
google-java-format *ale-java-google-java-format*
@ -222,6 +246,17 @@ g:ale_java_eclipselsp_workspace_path *g:ale_java_eclipselsp_workspace_path*
absolute path of the Eclipse workspace. If not set this value will be set to
the parent folder of the project root.
g:ale_java_eclipselsp_javaagent *g:ale_java_eclipselsp_javaagent*
*b:ale_java_eclipselsp_javaagent*
Type: |String|
Default: `''`
A variable to add java agent for annotation processing such as Lombok.
If you have multiple java agent files, use space to separate them. For example:
>
let g:ale_java_eclipselsp_javaagent='/eclipse/lombok.jar /eclipse/jacoco.jar'
<
===============================================================================
uncrustify *ale-java-uncrustify*

View file

@ -164,6 +164,7 @@ Notes:
* `gosimple`!!
* `gotype`!!
* `go vet`!!
* `revive`!!
* `staticcheck`!!
* GraphQL
* `eslint`

View file

@ -2379,6 +2379,7 @@ documented in additional help files.
gometalinter..........................|ale-go-gometalinter|
gopls.................................|ale-go-gopls|
govet.................................|ale-go-govet|
revive................................|ale-go-revive|
staticcheck...........................|ale-go-staticcheck|
graphql.................................|ale-graphql-options|
eslint................................|ale-graphql-eslint|

View file

@ -173,6 +173,7 @@ formatting.
* [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) :warning: :floppy_disk:
* [gotype](https://godoc.org/golang.org/x/tools/cmd/gotype) :warning: :floppy_disk:
* [go vet](https://golang.org/cmd/vet/) :floppy_disk:
* [revive](https://github.com/mgechev/revive) :warning: :floppy_disk:
* [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) :warning: :floppy_disk:
* GraphQL
* [eslint](http://eslint.org/)

View file

@ -790,6 +790,9 @@ fu! s:BuildPrompt(upd)
if empty(prt[1]) && s:focus
exe 'echoh' hibase '| echon "_" | echoh None'
en
if a:upd
cal s:NotifySearch()
en
endf
" - SetDefTxt() {{{1
fu! s:SetDefTxt()
@ -2609,6 +2612,10 @@ fu! ctrlp#clearmarkedlist()
let s:marked = {}
endf
fu! ctrlp#input()
retu s:getinput()
endf
fu! ctrlp#exit()
cal s:PrtExit()
endf
@ -2735,8 +2742,21 @@ fu! ctrlp#init(type, ...)
en
cal s:BuildPrompt(1)
if s:keyloop | cal s:KeyLoop() | en
return 1
retu 1
endf
" - Events {{{1
fu! s:NotifySearch()
let l:cb = s:getextvar('search')
if l:cb != -1
cal eval(l:cb)
en
endf
fu! ctrlp#update()
cal s:ForceUpdate()
endf
" - Autocmds {{{1
if has('autocmd')
aug CtrlPAug

View file

@ -203,7 +203,7 @@ function! s:goyo_on(dim)
endif
" vim-signify
let t:goyo_disabled_signify = exists('b:sy') && b:sy.active
let t:goyo_disabled_signify = !empty(getbufvar(bufnr(''), 'sy'))
if t:goyo_disabled_signify
SignifyToggle
endif

View file

@ -13,6 +13,7 @@ jobs:
strategy:
matrix:
vim:
- v8.2.1000
- v8.2.0000
- v8.1.0000
- v8.0.0000

View file

@ -2,7 +2,7 @@
" Filename: autoload/lightline.vim
" Author: itchyny
" License: MIT License
" Last Change: 2020/03/16 19:10:15.
" Last Change: 2020/06/19 11:08:46.
" =============================================================================
let s:save_cpo = &cpo
@ -11,27 +11,35 @@ set cpo&vim
let s:_ = 1 " 1: uninitialized, 2: disabled
function! lightline#update() abort
if &buftype ==# 'popup' | return | endif
if s:skip() | return | endif
if s:_
if s:_ == 2 | return | endif
call lightline#init()
call lightline#colorscheme()
endif
if !s:lightline.enable.statusline
return
if s:lightline.enable.statusline
let w = winnr()
let s = winnr('$') == 1 && w > 0 ? [lightline#statusline(0)] : [lightline#statusline(0), lightline#statusline(1)]
for n in range(1, winnr('$'))
call setwinvar(n, '&statusline', s[n!=w])
endfor
endif
let w = winnr()
let s = winnr('$') == 1 && w > 0 ? [lightline#statusline(0)] : [lightline#statusline(0), lightline#statusline(1)]
for n in range(1, winnr('$'))
call setwinvar(n, '&statusline', s[n!=w])
endfor
endfunction
if exists('*win_gettype')
function! s:skip() abort " Vim 8.2.0257 (00f3b4e007), 8.2.0991 (0fe937fd86), 8.2.0996 (40a019f157)
return win_gettype() ==# 'popup' || win_gettype() ==# 'autocmd'
endfunction
else
function! s:skip() abort
return &buftype ==# 'popup'
endfunction
endif
function! lightline#update_disable() abort
if !s:lightline.enable.statusline
return
if s:lightline.enable.statusline
call setwinvar(0, '&statusline', '')
endif
call setwinvar(0, '&statusline', '')
endfunction
function! lightline#enable() abort
@ -190,13 +198,7 @@ function! lightline#colorscheme() abort
let s:lightline.palette = g:lightline#colorscheme#{s:lightline.colorscheme}#palette
finally
if has('win32') && !has('gui_running') && &t_Co < 256
for u in values(s:lightline.palette)
for v in values(u)
for _ in v
let [_[2], _[3]] = [lightline#colortable#gui2cui(_[0], _[2]), lightline#colortable#gui2cui(_[1], _[3])]
endfor
endfor
endfor
call lightline#colortable#gui2cui_palette(s:lightline.palette)
endif
let s:highlight = {}
call lightline#highlight('normal')

View file

@ -5,7 +5,7 @@
" Last Change: 2013/09/07 12:21:04.
" =============================================================================
let s:base03 = [ '#151513', 233 ]
let s:base02 = [ '#30302c ', 236 ]
let s:base02 = [ '#30302c', 236 ]
let s:base01 = [ '#4e4e43', 239 ]
let s:base00 = [ '#666656', 242 ]
let s:base0 = [ '#808070', 244 ]

View file

@ -5,7 +5,7 @@
" Last Change: 2015/11/02 08:23:27.
" =============================================================================
let s:base03 = [ '#151513', 233 ]
let s:base02 = [ '#30302c ', 236 ]
let s:base02 = [ '#30302c', 236 ]
let s:base01 = [ '#4e4e43', 239 ]
let s:base00 = [ '#666656', 242 ]
let s:base0 = [ '#808070', 244 ]

View file

@ -5,7 +5,7 @@
" Last Change: 2018/05/19
" =============================================================================
let s:base03 = [ '#151513', 233 ]
let s:base02 = [ '#30302c ', 236 ]
let s:base02 = [ '#30302c', 236 ]
let s:base01 = [ '#4e4e43', 239 ]
let s:base00 = [ '#666656', 242 ]
let s:base0 = [ '#808070', 244 ]

View file

@ -5,8 +5,8 @@
" Last Change: 2015/11/30 08:37:43.
" =============================================================================
let s:base03 = [ '#242424', 235 ]
let s:base023 = [ '#353535 ', 236 ]
let s:base02 = [ '#444444 ', 238 ]
let s:base023 = [ '#353535', 236 ]
let s:base02 = [ '#444444', 238 ]
let s:base01 = [ '#585858', 240 ]
let s:base00 = [ '#666666', 242 ]
let s:base0 = [ '#808080', 244 ]

View file

@ -2,7 +2,7 @@
" Filename: autoload/lightline/colortable.vim
" Author: itchyny
" License: MIT License
" Last Change: 2015/03/29 06:21:39.
" Last Change: 2020/06/19 11:07:13.
" =============================================================================
let s:save_cpo = &cpo
@ -38,5 +38,15 @@ function! lightline#colortable#gui2cui(rgb, fallback) abort
return rgb[0] + rgb[1] + rgb[2]
endfunction
function! lightline#colortable#gui2cui_palette(palette) abort
for u in values(a:palette)
for v in values(u)
for w in v
let [w[2], w[3]] = [lightline#colortable#gui2cui(w[0], w[2]), lightline#colortable#gui2cui(w[1], w[3])]
endfor
endfor
endfor
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo

View file

@ -0,0 +1,23 @@
if !has("patch-8.2.0996")
finish
endif
let s:suite = themis#suite('autocmd')
let s:assert = themis#helper('assert')
function! s:suite.before_each()
let g:lightline = {}
call lightline#init()
tabnew
tabonly
endfunction
function! s:suite.doautoall()
tabnew
tabnew
tabprevious
doautoall WinEnter
let statusline = getwinvar(1, '&statusline')
call s:assert.match(statusline, 'lightline')
call s:assert.match(statusline, '_active_')
endfunction

View file

@ -4,7 +4,14 @@
version in an unordered list. The format is:
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
-->
#### 6.8
- **.0**: Allow concealed characters to show another character. (PhilRunninger) [#1138](https://github.com/preservim/nerdtree/pull/1138)
#### 6.7
- **.15**: Add curly braces to the list of characters to be escaped. (PhilRunninger) [#1128](https://github.com/preservim/nerdtree/pull/1128)
- **.14**: Use backward-compatible `nerdtree#and()` in one place that was missed. (PhilRunninger) [#1134](https://github.com/preservim/nerdtree/pull/1134)
- **.13**: `cmd.exe /c start "" <filename>` for windows default viewer support. (J. Altayó) [#1130](https://github.com/preservim/nerdtree/pull/1130)
- **.12**: Fixed a bug that caused the file-tree construction to slow down significantly. (Eugenij-W) [#1126](https://github.com/preservim/nerdtree/pull/1126)
- **.11**: Fix exception in NERDTreeFind (on windows OS and If the file is located in the root directory of the disk) (Eugenij-W) [#1122](https://github.com/preservim/nerdtree/pull/1122)
- **.10**: Do not consider the tree root to be "cascadable". (lifecrisis) [#1120](https://github.com/preservim/nerdtree/pull/1120)
- **.9**: Force `:NERDTreeFocus` to allow events to be fired when switching windows. (PhilRunninger) [#1118](https://github.com/preservim/nerdtree/pull/1118)
- **.8**: Fix example code for the `NERDTreeAddKeyMap()` function. (PhilRunninger) [#1116](https://github.com/preservim/nerdtree/pull/1116)

View file

@ -45,7 +45,7 @@ function! nerdtree#slash() abort
endfunction
"FUNCTION: nerdtree#and(x,y) {{{2
" Implements and() function for Vim <= 7.2
" Implements and() function for Vim <= 7.4
function! nerdtree#and(x,y) abort
if exists('*and')
return and(a:x, a:y)

View file

@ -249,7 +249,11 @@ function! s:Creator._pathForString(str)
if dir =~# '^\.'
let dir = getcwd() . g:NERDTreePath.Slash() . dir
endif
let dir = g:NERDTreePath.Resolve(dir)
"hack to prevent removing slash if dir is the root of the file system.
if dir !=# '/'
let dir = g:NERDTreePath.Resolve(dir)
endif
try
let path = g:NERDTreePath.New(dir)

View file

@ -219,7 +219,7 @@ endfunction
" FUNCTION: Opener._openFile() {{{1
function! s:Opener._openFile()
if !self._stay && !and(g:NERDTreeQuitOnOpen,1) && exists('b:NERDTreeZoomed') && b:NERDTreeZoomed
if !self._stay && !nerdtree#and(g:NERDTreeQuitOnOpen,1) && exists('b:NERDTreeZoomed') && b:NERDTreeZoomed
call b:NERDTree.ui.toggleZoom()
endif

View file

@ -332,7 +332,7 @@ function! s:Path._escChars()
return " `\|\"#%&,?()\*^<>$"
endif
return " \\`\|\"#%&,?()\*^<>[]$"
return " \\`\|\"#%&,?()\*^<>[]{}$"
endfunction
" FUNCTION: Path.getDir() {{{1
@ -546,26 +546,36 @@ endfunction
" return 1 if this path is somewhere above the given path in the filesystem.
"
" a:path should be a dir
function! s:Path.isAncestor(path)
if !self.isDirectory
return 0
endif
let this = self.str()
let that = a:path.str()
return stridx(that, this) ==# 0
function! s:Path.isAncestor(child)
return a:child.isUnder(self)
endfunction
" FUNCTION: Path.isUnder(path) {{{1
" return 1 if this path is somewhere under the given path in the filesystem.
function! s:Path.isUnder(path)
if a:path.isDirectory ==# 0
function! s:Path.isUnder(parent)
if a:parent.isDirectory ==# 0
return 0
endif
let this = self.str()
let that = a:path.str()
return stridx(this, that . s:Path.Slash()) ==# 0
if nerdtree#runningWindows() && a:parent.drive !=# self.drive
return 0
endif
let l:this_count = len(self.pathSegments)
if l:this_count ==# 0
return 0
endif
let l:that_count = len(a:parent.pathSegments)
if l:that_count ==# 0
return 1
endif
if l:that_count >= l:this_count
return 0
endif
for i in range(0, l:that_count-1)
if self.pathSegments[i] !=# a:parent.pathSegments[i]
return 0
endif
endfor
return 1
endfunction
" FUNCTION: Path.JoinPathStrings(...) {{{1

View file

@ -431,6 +431,7 @@ function! s:TreeDirNode._initChildren(silent)
endtry
endfor
let g:NERDTreeOldSortOrder = g:NERDTreeSortOrder
call self.sortChildren()
call nerdtree#echo('')

View file

@ -34,6 +34,10 @@ if executable('xdg-open')
call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFileLinux'})
endif
if nerdtree#runningWindows()
call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFileWindows'})
endif
if g:NERDTreePath.CopyingSupported()
call NERDTreeAddMenuItem({'text': '(c)opy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
endif
@ -451,4 +455,15 @@ function! NERDTreeExecuteFileLinux()
call system('xdg-open ' . shellescape(l:node.path.str()))
endfunction
" FUNCTION: NERDTreeExecuteFileWindows() {{{1
function! NERDTreeExecuteFileWindows()
let l:node = g:NERDTreeFileNode.GetSelected()
if empty(l:node)
return
endif
call system('cmd.exe /c start "" ' . shellescape(l:node.path.str()))
endfunction
" vim: set sw=4 sts=4 et fdm=marker:

View file

@ -22,7 +22,7 @@ syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir
"highlighting to conceal the delimiter around the file/dir name
if has('conceal')
exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# conceal containedin=ALL'
setlocal conceallevel=3 concealcursor=nvic
setlocal conceallevel=2 concealcursor=nvic
else
exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# containedin=ALL'
hi! link NERDTreeNodeDelimiters Ignore

View file

@ -298,12 +298,15 @@ syn keyword ngxDirective large_client_header_buffers
syn keyword ngxDirective least_conn
syn keyword ngxDirective least_time
syn keyword ngxDirective limit_conn
syn keyword ngxDirective limit_conn_dry_run
syn keyword ngxDirective limit_conn_log_level
syn keyword ngxDirective limit_conn_status
syn keyword ngxDirective limit_conn_zone
syn keyword ngxDirective limit_except
syn keyword ngxDirective limit_rate
syn keyword ngxDirective limit_rate_after
syn keyword ngxDirective limit_req
syn keyword ngxDirective limit_req_dry_run
syn keyword ngxDirective limit_req_log_level
syn keyword ngxDirective limit_req_status
syn keyword ngxDirective limit_req_zone

View file

@ -67,8 +67,7 @@ syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipw
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end=")" contains=TOP nextgroup=rustMacroRepeatCount
syn match rustMacroRepeatCount ".\?[*+]" contained
syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end="),\=[*+]" contains=TOP
syn match rustMacroVariable "$\w\+"
" Reserved (but not yet used) keywords {{{2
@ -231,6 +230,27 @@ syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError star
syn keyword rustTodo contained TODO FIXME XXX NB NOTE
" asm! macro {{{2
syn region rustAsmMacro matchgroup=rustMacro start="\<asm!\s*(" end=")" contains=rustAsmDirSpec,rustAsmSym,rustAsmConst,rustAsmOptionsGroup,rustComment.*,rustString.*
" Clobbered registers
syn keyword rustAsmDirSpec in out lateout inout inlateout contained nextgroup=rustAsmReg skipwhite skipempty
syn region rustAsmReg start="(" end=")" contained contains=rustString
" Symbol operands
syn keyword rustAsmSym sym contained nextgroup=rustAsmSymPath skipwhite skipempty
syn region rustAsmSymPath start="\S" end=",\|)"me=s-1 contained contains=rustComment.*,rustIdentifier
" Const
syn region rustAsmConstBalancedParens start="("ms=s+1 end=")" contained contains=@rustAsmConstExpr
syn cluster rustAsmConstExpr contains=rustComment.*,rust.*Number,rustString,rustAsmConstBalancedParens
syn region rustAsmConst start="const" end=",\|)"me=s-1 contained contains=rustStorage,@rustAsmConstExpr
" Options
syn region rustAsmOptionsGroup start="options\s*(" end=")" contained contains=rustAsmOptions,rustAsmOptionsKey
syn keyword rustAsmOptionsKey options contained
syn keyword rustAsmOptions pure nomem readonly preserves_flags noreturn nostack att_syntax contained
" Folding rules {{{2
" Trivial folding rules to begin with.
" FIXME: use the AST to make really good folding
@ -278,7 +298,6 @@ hi def link rustIdentifierPrime rustIdentifier
hi def link rustTrait rustType
hi def link rustDeriveTrait rustTrait
hi def link rustMacroRepeatCount rustMacroRepeatDelimiters
hi def link rustMacroRepeatDelimiters Macro
hi def link rustMacroVariable Define
hi def link rustSigil StorageClass
@ -347,6 +366,10 @@ hi def link rustObsoleteExternMod Error
hi def link rustQuestionMark Special
hi def link rustAsync rustKeyword
hi def link rustAwait rustKeyword
hi def link rustAsmDirSpec rustKeyword
hi def link rustAsmSym rustKeyword
hi def link rustAsmOptions rustKeyword
hi def link rustAsmOptionsKey rustAttribute
" Other Suggestions:
" hi rustAttribute ctermfg=cyan

View file

@ -2272,10 +2272,33 @@ augroup END
" Section: :Git
function! s:AskPassArgs(dir) abort
if (len($DISPLAY) || len($TERM_PROGRAM) || has('gui_running')) && fugitive#GitVersion(1, 8) &&
\ empty($GIT_ASKPASS) && empty($SSH_ASKPASS) && empty(FugitiveConfigGetAll('core.askpass', a:dir))
if s:executable(s:ExecPath() . '/git-gui--askpass')
return ['-c', 'core.askPass=' . s:ExecPath() . '/git-gui--askpass']
elseif s:executable('ssh-askpass')
return ['-c', 'core.askPass=ssh-askpass']
endif
endif
return []
endfunction
function! s:RunJobs() abort
return exists('*job_start') || exists('*jobstart')
endfunction
function! s:RunEdit(state, job) abort
if get(a:state, 'request', '') == 'edit'
call remove(a:state, 'request')
let file = readfile(a:state.temp . '.edit')[0]
exe substitute(a:state.mods, '\<tab\>', '-tab', 'g') 'keepalt split' s:fnameescape(file)
set bufhidden=wipe
let s:edit_jobs[bufnr('')] = [a:state, a:job]
return 1
endif
endfunction
function! s:RunReceive(state, job, data, ...) abort
call add(a:state.log, a:data)
let data = type(a:data) == type([]) ? join(a:data, "\n") : a:data
@ -2283,16 +2306,21 @@ function! s:RunReceive(state, job, data, ...) abort
let data = remove(a:state, 'buffer') . data
endif
let escape = "\033]51;[^\007]*"
let a:state.buffer = matchstr(data, escape . "$\\|[\r\n]\\+$")
if len(a:state.buffer)
let data = strpart(data, 0, len(data) - len(a:state.buffer))
let a:state.escape_buffer = matchstr(data, escape . '$')
if len(a:state.escape_buffer)
let data = strpart(data, 0, len(data) - len(a:state.escape_buffer))
endif
let cmd = matchstr(data, escape . "\007")[5:-2]
let data = substitute(data, escape . "\007", '', 'g')
echon substitute(data, "\r\\ze\n", '', 'g')
if cmd =~# '^fugitive:'
let a:state.request = strpart(cmd, 9)
endif
let data = a:state.echo_buffer . data
let a:state.echo_buffer = matchstr(data, "[\r\n]\\+$")
if len(a:state.echo_buffer)
let data = strpart(data, 0, len(data) - len(a:state.echo_buffer))
endif
echon substitute(data, "\r\\ze\n", '', 'g')
endfunction
function! s:RunSend(job, str) abort
@ -2314,7 +2342,7 @@ endif
function! s:RunWait(state, job) abort
let finished = 0
try
while get(a:state, 'request', '') !=# 'edit' && (type(a:job) == type(0) ? jobwait([a:job], 1)[0] == -1 : ch_status(a:job) !=# 'closed')
while get(a:state, 'request', '') !=# 'edit' && (type(a:job) == type(0) ? jobwait([a:job], 1)[0] == -1 : ch_status(a:job) !=# 'closed' || job_status(a:job) ==# 'run')
if !exists('*jobwait')
sleep 1m
endif
@ -2341,13 +2369,7 @@ function! s:RunWait(state, job) abort
endwhile
sleep 1m
echo
if get(a:state, 'request', '') == 'edit'
call remove(a:state, 'request')
let file = readfile(a:state.temp . '.edit')[0]
exe substitute(a:state.mods, '\<tab\>', '-tab', 'g') 'keepalt split' s:fnameescape(file)
set bufhidden=wipe
let s:edit_jobs[bufnr('')] = [a:state, a:job]
endif
call s:RunEdit(a:state, a:job)
let finished = 1
finally
if !finished
@ -2538,7 +2560,14 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort
endif
endif
if s:RunJobs()
let state = {'dir': dir, 'mods': s:Mods(a:mods), 'temp': tempname(), 'log': []}
let state = {
\ 'dir': dir,
\ 'mods': s:Mods(a:mods),
\ 'title': ':Git ' . a:arg,
\ 'echo_buffer': '',
\ 'escape_buffer': '',
\ 'log': [],
\ 'temp': tempname()}
let state.pty = get(g:, 'fugitive_pty', has('unix') && (has('patch-8.0.0744') || has('nvim')))
if !state.pty
let args = s:AskPassArgs(dir) + args
@ -3598,6 +3627,10 @@ function! s:DoToggleHeadHeader(value) abort
call search('\C^index$', 'wc')
endfunction
function! s:DoToggleHelpHeader(value) abort
exe 'help fugitive-map'
endfunction
function! s:DoStagePushHeader(value) abort
let remote = matchstr(a:value, '\zs[^/]\+\ze/')
if empty(remote)
@ -4157,14 +4190,13 @@ function! s:GrepSubcommand(line1, line2, range, bang, mods, options) abort
let args = args[1:-1]
endif
let name_only = s:HasOpt(args, '-l', '--files-with-matches', '--name-only', '-L', '--files-without-match')
let title = [listnr < 0 ? ':Ggrep' : ':Glgrep'] + args
if listnr > 0
exe listnr 'wincmd w'
else
call s:BlurStatus()
endif
redraw
call s:QuickfixCreate(listnr, {'title': (listnr < 0 ? ':Ggrep ' : ':Glgrep ') . s:fnameescape(args)})
call s:QuickfixCreate(listnr, {'title': (listnr < 0 ? ':Git grep ' : ':0Git grep ') . s:fnameescape(args)})
let tempfile = tempname()
let event = listnr < 0 ? 'grep-fugitive' : 'lgrep-fugitive'
silent exe s:DoAutocmd('QuickFixCmdPre ' . event)
@ -4742,18 +4774,6 @@ function! fugitive#FetchComplete(A, L, P, ...) abort
return s:CompleteSub('fetch', a:A, a:L, a:P, function('s:CompleteRemote'), a:000)
endfunction
function! s:AskPassArgs(dir) abort
if (len($DISPLAY) || len($TERM_PROGRAM) || has('gui_running')) && fugitive#GitVersion(1, 8) &&
\ empty($GIT_ASKPASS) && empty($SSH_ASKPASS) && empty(FugitiveConfigGetAll('core.askpass', a:dir))
if s:executable(s:ExecPath() . '/git-gui--askpass')
return ['-c', 'core.askPass=' . s:ExecPath() . '/git-gui--askpass']
elseif s:executable('ssh-askpass')
return ['-c', 'core.askPass=ssh-askpass']
endif
endif
return []
endfunction
function! s:Dispatch(bang, options) abort
let dir = a:options.dir
exe s:DirCheck(dir)
@ -4797,11 +4817,11 @@ endfunction
augroup fugitive_diff
autocmd!
autocmd BufWinLeave *
autocmd BufWinLeave * nested
\ if s:can_diffoff(+expand('<abuf>')) && s:diff_window_count() == 2 |
\ call s:diffoff_all(s:Dir(+expand('<abuf>'))) |
\ endif
autocmd BufWinEnter *
autocmd BufWinEnter * nested
\ if s:can_diffoff(+expand('<abuf>')) && s:diff_window_count() == 1 |
\ call s:diffoff() |
\ endif
@ -6026,7 +6046,7 @@ function! fugitive#MapJumps(...) abort
call s:Map('n', 'czP', ':<C-U>Git stash pop --quiet stash@{<C-R>=v:count<CR>}<CR>')
call s:Map('n', 'czv', ':<C-U>exe "Gedit" fugitive#RevParse("stash@{" . v:count . "}")<CR>', '<silent>')
call s:Map('n', 'czw', ':<C-U>Git stash --keep-index<C-R>=v:count > 1 ? " --all" : v:count ? " --include-untracked" : ""<CR><CR>')
call s:Map('n', 'czz', ':<C-U>Git stash <C-R>=v:count > 1 ? " --all" : v:count ? " --include-untracked" : ""<CR>')
call s:Map('n', 'czz', ':<C-U>Git stash <C-R>=v:count > 1 ? " --all" : v:count ? " --include-untracked" : ""<CR><CR>')
call s:Map('n', 'cz?', ':<C-U>help fugitive_cz<CR>', '<silent>')
call s:Map('n', 'co<Space>', ':Git checkout<Space>')

View file

@ -8,6 +8,9 @@ syn spell notoplevel
syn include @fugitiveDiff syntax/diff.vim
syn match fugitiveHeader /^[A-Z][a-z][^:]*:/ nextgroup=fugitiveHash,fugitiveSymbolicRef skipwhite
syn match fugitiveBareHeader /^Bare:/
syn match fugitiveHelpHeader /^Help:/ nextgroup=fugitiveHelpTag skipwhite
syn match fugitiveHelpTag /\S\+/ contained
syn region fugitiveSection start=/^\%(.*(\d\+)$\)\@=/ contains=fugitiveHeading end=/^$/
syn cluster fugitiveSection contains=fugitiveSection
@ -20,8 +23,8 @@ syn match fugitiveDone /^done\>/ contained containedin=@fugitiveSection nextgrou
syn match fugitiveStop /^stop\>/ contained containedin=@fugitiveSection nextgroup=fugitiveHash skipwhite
syn match fugitiveModifier /^[MADRCU?]\{1,2} / contained containedin=@fugitiveSection
syn match fugitiveSymbolicRef /\.\@!\%(\.\.\@!\|[^[:space:][:cntrl:]\:.]\)\+\.\@<!/ contained
syn match fugitiveHash /^\x\{4,\}\>/ contained containedin=@fugitiveSection
syn match fugitiveHash /\<\x\{4,\}\>/ contained
syn match fugitiveHash /^\x\{4,\}\S\@!/ contained containedin=@fugitiveSection
syn match fugitiveHash /\S\@<!\x\{4,\}\S\@!/ contained
syn region fugitiveHunk start=/^\%(@@\+ -\)\@=/ end=/^\%([A-Za-z?@]\|$\)\@=/ contains=@fugitiveDiff containedin=@fugitiveSection fold
@ -33,7 +36,10 @@ for s:section in ['Untracked', 'Unstaged', 'Staged']
endfor
unlet s:section
hi def link fugitiveBareHeader fugitiveHeader
hi def link fugitiveHelpHeader fugitiveHeader
hi def link fugitiveHeader Label
hi def link fugitiveHelpTag Tag
hi def link fugitiveHeading PreProc
hi def link fugitiveUntrackedHeading PreCondit
hi def link fugitiveUnstagedHeading Macro

View file

@ -440,19 +440,21 @@ function! s:open_hunk_preview_window()
endif
silent! wincmd P
if !&previewwindow
if &previewwindow
file gitgutter://hunk-preview
else
noautocmd execute g:gitgutter_preview_win_location &previewheight 'new gitgutter://hunk-preview'
doautocmd WinEnter
if exists('*win_getid')
let s:winid = win_getid()
else
let s:preview_bufnr = bufnr('')
endif
set previewwindow
setlocal filetype=diff buftype=acwrite bufhidden=delete
" Reset some defaults in case someone else has changed them.
setlocal noreadonly modifiable noswapfile
endif
if exists('*win_getid')
let s:winid = win_getid()
else
let s:preview_bufnr = bufnr('')
endif
setlocal filetype=diff buftype=acwrite bufhidden=delete
" Reset some defaults in case someone else has changed them.
setlocal noreadonly modifiable noswapfile
endfunction
@ -460,17 +462,22 @@ endfunction
" Preview window: assumes cursor is in preview window.
function! s:populate_hunk_preview_window(header, body)
let body_length = len(a:body)
let height = min([body_length, &previewheight])
if g:gitgutter_preview_win_floating
if exists('*nvim_open_win')
let height = min([body_length, &previewheight])
" Assumes cursor is not in previewing window.
call nvim_buf_set_var(winbufnr(s:winid), 'hunk_header', a:header)
let [_scrolloff, &scrolloff] = [&scrolloff, 0]
let width = max(map(copy(a:body), 'strdisplaywidth(v:val)'))
call nvim_win_set_width(s:winid, width)
call nvim_win_set_height(s:winid, height)
let &scrolloff=_scrolloff
call nvim_buf_set_lines(winbufnr(s:winid), 0, -1, v:false, [])
call nvim_buf_set_lines(winbufnr(s:winid), 0, -1, v:false, a:body)
call nvim_buf_set_option(winbufnr(s:winid), 'modified', v:false)
@ -496,12 +503,16 @@ function! s:populate_hunk_preview_window(header, body)
else
let b:hunk_header = a:header
execute 'resize' height
%delete _
call setline(1, a:body)
setlocal nomodified
normal! G$
let height = min([winline(), &previewheight])
execute 'resize' height
1
call clearmatches()
for region in gitgutter#diff_highlight#process(a:body)
let group = region[1] == '+' ? 'GitGutterAddIntraLine' : 'GitGutterDeleteIntraLine'

View file

@ -1,27 +0,0 @@
" Measure how long it takes to unplace signs.
"
" Source this file with `:source %` or `vim -S unplace.vim`
let num = 500
sign define Foo text=*
new
call append(0, range(1, num))
for i in range(1, num)
execute "sign place ".i." line=".i." name=Foo buffer=".bufnr('')
endfor
let start = reltime()
for i in range(1, num)
execute "sign unplace ".i
endfor
let elapsed = reltime(start)
bdelete!
echom split(reltimestr(elapsed))[0]."s to remove ".num." signs"
echom string(reltimefloat(elapsed) * 1000 / num).' ms/sign'
echom string(float2nr(num / reltimefloat(elapsed))).' sign/s'

View file

@ -4,5 +4,5 @@ fun! s:SelectJavascript()
endif
endfun
autocmd BufNewFile,BufRead *.{js,mjs,jsm,es,es6},Jakefile setfiletype javascript
autocmd BufNewFile,BufRead *.{js,mjs,cjs,jsm,es,es6},Jakefile setfiletype javascript
autocmd BufNewFile,BufRead * call s:SelectJavascript()

View file

@ -70,10 +70,10 @@ execute 'syn region mkdLink matchgroup=mkdDelimiter start="\\\@<!!\?\[\ze[^]\n]
" Autolink without angle brackets.
" mkd inline links: protocol optional user:pass@ sub/domain .com, .co.uk, etc optional port path/querystring/hash fragment
" ------------ _____________________ ----------------------------- _________________________ ----------------- __
syn match mkdInlineURL /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/
syn match mkdInlineURL /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?[^] \t]*/
" Autolink with parenthesis.
syn region mkdInlineURL matchgroup=mkdDelimiter start="(\(https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*)\)\@=" end=")"
syn region mkdInlineURL matchgroup=mkdDelimiter start="(\(https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?[^] \t]*)\)\@=" end=")"
" Autolink with angle brackets.
syn region mkdInlineURL matchgroup=mkdDelimiter start="\\\@<!<\ze[a-z][a-z0-9,.-]\{1,22}:\/\/[^> ]*>" end=">"

View file

@ -634,7 +634,8 @@ Given markdown;
Execute (link with url title):
AssertEqual SyntaxOf('https://domain.tld'), 'mkdInlineURL'
AssertEqual SyntaxOf('https://domain.com'), 'mkdInlineURL'
AssertNotEqual SyntaxOf(']'), 'mkdInlineURL'
AssertEqual SyntaxOf('https://domain.com'), 'mkdURL'
AssertNotEqual SyntaxOf('not_a_link'), 'mkdInlineURL'
# Code Blocks

View file

@ -1,11 +1,12 @@
sudo: false
os: linux
dist: bionic
language: ruby
addons:
apt:
packages:
- vim-gtk
- xvfb
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
script:
- xvfb-run bundle exec rake

View file

@ -2,7 +2,7 @@ GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.2.5)
rake (12.3.3)
rake (10.4.2)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)

View file

@ -1,5 +1,5 @@
# vim-multiple-cursors
[![Build Status](https://travis-ci.org/terryma/vim-multiple-cursors.svg)](https://travis-ci.org/terryma/vim-multiple-cursors)
[![Build Status](https://travis-ci.org/terryma/vim-multiple-cursors.svg?branch=master)](https://travis-ci.org/github/terryma/vim-multiple-cursors)
## Contents
- [About](#about)

View file

@ -1285,7 +1285,7 @@ function! s:wait_for_user_input(mode)
call s:start_latency_measure()
" Clears any echoes we might've added
normal! :<Esc>
normal! :
" add chars to s:char if it start like a special/quit key
let is_special_key = 0

View file

@ -136,7 +136,7 @@ endsnippet
snippet detail "Disclosure"
<details${3: open=""}>
${1:summary>${2}</summary>}$0
${1:<summary>${2}</summary>}$0
</details>
endsnippet

View file

@ -17,13 +17,13 @@ pub fn ${1:function_name}($2)${3/..*/ -> /}$3 {
endsnippet
snippet afn "async fn name(?) -> ? {}"
fn ${1:function_name}($2)${3/..*/ -> /}$3 {
async fn ${1:function_name}($2)${3/..*/ -> /}$3 {
${VISUAL}$0
}
endsnippet
snippet pafn "pub async fn name(?) -> ? {}"
pub fn ${1:function_name}($2)${3/..*/ -> /}$3 {
pub async fn ${1:function_name}($2)${3/..*/ -> /}$3 {
${VISUAL}$0
}
endsnippet
@ -44,4 +44,10 @@ snippet .it ".iter()" i
.iter()$0
endsnippet
snippet impl "Struct/Trait implementation" b
impl ${1:Type/Trait}${2: for ${3:Type}} {
$0
}
endsnippet
# vim:ft=snippets:

View file

@ -175,7 +175,7 @@ snippet aside#
${0}
</aside>
snippet audio
<audio src="${1}>${0}</audio>
<audio src="${1}">${0}</audio>
snippet b
<b>${0}</b>
snippet base

View file

@ -122,6 +122,10 @@ snippet ife "if / else"
} else {
${0}
}
snippet ifl "if let (...)"
if let ${1:Some(${2})} = $3 {
${0:${VISUAL}}
}
snippet el "else"
else {
${0:${VISUAL}}
@ -146,6 +150,10 @@ snippet wh "while loop"
while ${1:condition} {
${0:${VISUAL}}
}
snippet whl "while let (...)"
while let ${1:Some(${2})} = $3 {
${0:${VISUAL}}
}
snippet for "for ... in ... loop"
for ${1:i} in ${2} {
${0}
@ -157,21 +165,21 @@ snippet fixme "FIXME comment"
// FIXME: $0
# Struct
snippet st "Struct definition"
struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}${2:<${3:T}>} {
${0}
}
snippet impl "Struct/Trait implementation"
impl ${1:Type/Trait}${2: for ${3:Type}} {
impl$4 ${1:Type/Trait}${2: for ${3:Type}}${4:<${5:T}>} {
${0}
}
snippet stn "Struct with new constructor"
pub struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} {
pub struct ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`}${2:<${3:T}>} {
${0}
}
impl $1 {
pub fn new(${2}) -> Self {
$1 { ${3} }
impl$2 $1$2 {
pub fn new(${4}) -> Self {
$1 { ${5} }
}
}
snippet ty "Type alias"
@ -190,7 +198,7 @@ snippet trait "Trait definition"
${0}
}
snippet drop "Drop trait implementation (destructor)"
impl Drop for ${1:Name} {
impl$2 Drop for ${1:Name}${2:<${3:T}>} {
fn drop(&mut self) {
${0}
}
@ -238,9 +246,11 @@ snippet macro "macro_rules!" b
$3
)
}
snippet box "Box::new()"
snippet boxp "Box::new()"
Box::new(${0:${VISUAL}})
snippet rc "Rc::new()"
Rc::new(${0:${VISUAL}})
snippet unim "unimplemented!()"
unimplemented!()
snippet use "use ...;" b
use ${1:std::${2:io}};