Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/sloria/vim-ped

:athletic_shoe: Quickly open Python modules in vim
https://github.com/sloria/vim-ped

python vim

Last synced: 16 days ago
JSON representation

:athletic_shoe: Quickly open Python modules in vim

Awesome Lists containing this project

README

        

# ped.vim

Quickly open Python modules based on Python import paths.

This is particularly useful for viewing/editing third-party packages in a virtual environment.

## Quickstart

```vim
:Ped
```

### Examples

```vim
:Ped django.shortcuts
:Ped django.views.generic.TemplateView

" Partial matches work, too
:Ped django.views.generic.Templ
```

## Installation

Requires the [ped](https://pypi.python.org/pypi/ped) Python package (installable with `pip`).

```bash
$ pip install -U ped
```

Then add this plugin using your favorite plugin manager.

Using [vim-plug](https://github.com/junegunn/vim-plug):

```vim
" ~/.vimrc
Plug 'sloria/vim-ped'
```
## Defining mappings

- `PedPrompt`: Shortcut to input `:Ped ` in the command line.
- `PedVword`: Input `:Ped pkg` in the command line, where "pkg" is the current visual selection.
- `PedVwordExec`: Like `PedVword`, but executes immediately.
- `PedCword`: Input `:Ped pkg` in the command line, where "pkg" is the current word under the cursor.
- `PedCwordExec`: Like `PedCword`, but executes immediately.

### Example mappings

```vim
nmap e PedPrompt
nmap E PedCwordExec
vmap e PedVwordExec
```

## Configuration

```vim
" Vim command to open files, defaults to 'edit'
" Examples: 'tabedit', 'split', 'vsplit'
let g:ped_edit_command = 'edit'

" ped executable, defaults to 'ped'
let g:ped_executable = 'ped'
```

## License

[MIT Licensed](http://sloria.mit-license.org).