1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 23:49:19 +08:00

Add function for get sid (#2350)

* Add function for get sid

* Add sid func

* Update wiki
This commit is contained in:
Wang Shidong 2018-12-16 23:10:59 +08:00 committed by GitHub
parent b34febce91
commit 8989f86023
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 1 deletions

View File

@ -13,6 +13,8 @@
let s:self = {}
let s:DICT = SpaceVim#api#import('data#dict')
let s:self._cache = {}
function! s:self._capture(command) abort
@ -44,6 +46,17 @@ function! s:self.scriptnames() abort
endfor
return sdict
endfunction
function! s:self.get_sid_from_path(path) abort
let path = self._unify_path(a:path)
let scriptnames = s:DICT.swap(self.scriptnames())
if has_key(scriptnames, path)
return scriptnames[path]
else
return -1
endif
endfunction
function! SpaceVim#api#vim#sid#get() abort
return deepcopy(s:self)
endfunction

View File

@ -46,7 +46,12 @@ endfunction
function! s:eval_cursor() abort
let is_keyword = &iskeyword
set iskeyword+=:
echo expand('<cword>') 'is' eval(expand('<cword>'))
let cword = expand('<cword>')
if cword =~# '^g:'
echo cword . ' is ' eval(cword)
elseif cword =~# '^s:'
else
endif
let &iskeyword = is_keyword
endfunction

View File

@ -12,6 +12,7 @@
- Add `lang#scheme` layer ([#2248](https://github.com/SpaceVim/SpaceVim/pull/2248))
- Add log for bootstrap function ([#2232](https://github.com/SpaceVim/SpaceVim/pull/2323))
- Add findstr support in flygrep ([#2344](https://github.com/SpaceVim/SpaceVim/pull/2344))
- Add API: `get_sid_from_path` ([#2350](https://github.com/SpaceVim/SpaceVim/pull/2350))
### 功能改进

View File

@ -12,6 +12,7 @@ The next release is v1.0.0.
- Add `lang#scheme` layer ([#2248](https://github.com/SpaceVim/SpaceVim/pull/2248))
- Add log for bootstrap function ([#2232](https://github.com/SpaceVim/SpaceVim/pull/2323))
- Add findstr support in flygrep ([#2344](https://github.com/SpaceVim/SpaceVim/pull/2344))
- Add API: `get_sid_from_path` ([#2350](https://github.com/SpaceVim/SpaceVim/pull/2350))
### Improvement