Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mhinz/vim-lookup

Jump to the definition of variables or functions in VimL code.
https://github.com/mhinz/vim-lookup

lookup neovim search vim vim-plugin viml

Last synced: 1 day ago
JSON representation

Jump to the definition of variables or functions in VimL code.

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/mhinz/vim-lookup.svg?branch=master)](https://travis-ci.org/mhinz/vim-lookup)

# vim-lookup

This plugin is meant for VimL programmers. It jumps to definitions of variables,
functions, and commands as if tags were used, without needing a tags file. It simply
uses your [runtimepath](https://neovim.io/doc/user/options.html#'rtp').

- [x] `s:var`
- [x] `s:func()`
- [x] `func()`
- [x] `autoload#foo#var`
- [x] `autoload#foo#func()`
- [x] `'autoload#foo#func'`
- [x] `Command`

Sometimes a function `foo#func()` is not found in `autoload/foo.vim` but
`plugin/foo.vim`. This case is handled as well.

It also works for global functions if they're defined or found in the current
file:

- [x] `GlobalFunc()`
- [x] `g:GlobalFunc()`

### Usage

- Use `lookup#lookup()` to jump to the defintion of the identifier under the
cursor.
- Use `lookup#pop()` (or the default mapping
[``](https://github.com/mhinz/vim-galore/#changelist-jumplist)) to jump
back.

### Configuration

```viml
autocmd FileType vim nnoremap :call lookup#lookup()
```

Alternatively, you can replace the default mappings Vim uses for
[tagstack](https://neovim.io/doc/user/tagsrch.html#tag-stack) navigation:

```viml
autocmd FileType vim nnoremap :call lookup#lookup()
autocmd FileType vim nnoremap :call lookup#pop()
```

### Other useful VimL plugins

- [exception.vim](https://github.com/tweekmonster/exception.vim)
- [helpful.vim](https://github.com/tweekmonster/helpful.vim)
- [vim-scriptease](https://github.com/tpope/vim-scriptease)