https://github.com/todesking/metascope.vim
https://github.com/todesking/metascope.vim
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/todesking/metascope.vim
- Owner: todesking
- License: mit
- Created: 2015-01-22T05:36:02.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-02-06T08:08:26.000Z (over 11 years ago)
- Last Synced: 2026-01-17T16:50:16.589Z (5 months ago)
- Language: VimL
- Size: 145 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# metascope.vim: User-defined scope for variables
## Usage
Example: Define the "current-filetype" scope
```vim
" from plugin/metascope.vim
let s:def = {'name': 'filetype'}
function! s:def.scope_identifier() abort " {{{
return &filetype
endfunction " }}}
call metascope#register(s:def)
unlet s:def
```
```vim
call metascope#set('filetype:foo', 10)
echo metascope#get('filetype:foo')
set ft = xxx
echo metascope#get('filetype:foo') " error: filetype:foo is not found in this scope
```
## Default scopes
* `b`, `w`, `t`, `g`
* Same as VimL's `b:`, `w:`, `t:`, `g:` scope
* `filetype`