Skip to content

vim-scripts/vim-snoopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-snoopy 🔎

🎶 Introduction

vim-snoopy ( snoopy.vim ) provides a way to snoop script-local things. You can get <SID>, access script-local functions, and even script-variable from {path}.

It also provides a command to open the <SID> file (:SnoopyOpen), :scriptnames like functions and unite.vim interface for :scriptnames.

This plugin is just a wrapper of Vital.Vim.ScriptLocal and little additional functionality. Please install vital.vim to read this snoopy documentation and if you are a vim plugin developer and want to use vim-snoopy, please use vital's Vital.Vim.ScriptLocal API.

Let's snoop around the script-local things and debug, test them!

🎉 Access script local functions

:let s:sfuncs = Sfuncs('plugin/snoopy.vim')
:echo s:sfuncs
" =>
" {
"   'capitalize': function('<SNR>54_capitalize'),
"   'default_names': function('<SNR>54_default_names'),
"   'define_funcs': function('<SNR>54_define_funcs')
" }

:echo s:f.capitalize('hi there!')
" => Hi there!

👻 Access script local variables

Warning: this is unsafe function. Please use it carefully

:let s:svars = Svars('autoload/unite/sources/snoopy.vim')
:echo s:svars.source
" =>
" {
"   'action_table': {},
"   'alias_table': {},
"   ...
"   'white_globs': []
" }

🔌 Functions

name alias for
Scriptnames() Vital.Vim.ScriptLocal.scriptnames()
Sfuncs({path}) Vital.Vim.ScriptLocal.sfuncs()
Sid({path}) Vital.Vim.ScriptLocal.sid()
Sid2path(<SID>) Vital.Vim.ScriptLocal.sid2path()
Sid2sfuncs(<SID>) Vital.Vim.ScriptLocal.sid2sfuncs()
Sid2svars(<SID>) Vital.Vim.ScriptLocal.sid2svars()
Svars({path}) Vital.Vim.ScriptLocal.svars()

See :h Vital.Vim.ScriptLocal for detail

🔍 Commands

:SnoopyOpen <SID>

Open the file whose is matched with given one.

example:

:SnoopyOpen 14

🐉 Unite

unite-scriptnames

vim-snoopy includes unite.vim sources for :scriptnames. You can see scriptnames in unite interface and open the target file quickly.

:Unite scriptnames

🐦 Author

haya14busa (https://github.com/haya14busa)

📝 Document

:h snoopy.txt

About

snoop around the script-local things

Resources

Stars

Watchers

Forks

Packages

No packages published