Git Product home page Git Product logo

vim-py-anything's Introduction

vim-py-anything

This is vim's plugin which aims to similar functionality to Emacs's anything. This plugin is completely written in python.

Main purpose to create this plugin is to teach me python programming language. So, feature is greatly specific for my development environment.

This plugin require +python feature.

NOTE: this plugin is very very alpha state.

Setting example

.vimrc

nnoremap <D-j> :python anything.start(src=ac_src_cmd, ac_src_dict=ac_src_dict, mode='n')<CR>
vnoremap <D-j> :python anything.start(src=ac_src_cmd, ac_src_dict=ac_src_dict, mode='v')<CR>

nnoremap <D-i> :python anything.start(src=ac_src_command_t)<CR>
nnoremap <C-n> :python anything.start(src=ac_src_buffer)<CR>
vnoremap <C-n> :python anything.start(src=ac_src_buffer)<CR>

directly launch command without using anything window.

au BufNewFile,BufReadPost about_*.py nnoremap <buffer> <D-r> :python anything.run(py_koan)<CR>

anything_source_cmd example

If you want add the new command to anything_source_cmd. See following example.

@anything_command(mode='v')
def this_is_new_cmd(arg1, arg2):
    """This doc string is shown in anytiing window"""

    "you can read user's input by vim.prompt"
    if not header: header = vim.prompt("header? :")
    if not footer: footer = vim.prompt("footer? :")

    " you can use anything.range to get visual selected range"
    cr = anything.range
    new_text = [header] + cr[:] + [footer]
    cr[:] = None
    vim.insert(cr.start,new_text)

Special Thanks

User interface and architecture is greately inspired and borrowed from command-t which is also derived from inspiration from by LustiExplorer.

vim-py-anything's People

Contributors

t9md avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.