Skip to content

Add 'snake' vim plugin to the list#998

Closed
rajaravivarma-r wants to merge 1 commit intovinta:masterfrom
rajaravivarma-r:add-snake
Closed

Add 'snake' vim plugin to the list#998
rajaravivarma-r wants to merge 1 commit intovinta:masterfrom
rajaravivarma-r:add-snake

Conversation

@rajaravivarma-r
Copy link

  • This plugin allows users to write vim plugins in Python,
    by giving us a wrapper around Vim's vim Python module.

What is this Python project?

Snake is a Python module for Vim that let's you use Python to its fullest extent to enhance Vim.

What's the difference between this Python project and similar ones?

There are no similar libraries available.

--
Anyone who agrees with this pull request could vote for it by adding a 👍 to it, and usually, the maintainer will merge it when votes reach 20.

* This plugin allows users to write vim plugins in Python,
  by giving us a wrapper around Vim's `vim` Python module.
@rajaravivarma-r
Copy link
Author

rajaravivarma-r commented Jan 2, 2018

Pasting a snippet from the original README.md to show how good this plugin is.

import snake

@snake.key_map("<leader>c")
def toggle_snake_case_camel_case():
    """ take the word under the cursor and toggle it between snake-case and
    camel-case """

    word = snake.get_word()

    # is it snake case?
    if "_" in word:
        chunks = word.split("_")
        camel_case = chunks[0] + "".join([chunk.capitalize() for chunk in
            chunks[1:]])
        snake.replace_word(camel_case)

    # is it camel case?
    else:
        # split our word on capital letters followed by non-capital letters
        chunks = filter(None, re.split("([A-Z][^A-Z]*)", word))
        snake_case = "_".join([chunk.lower() for chunk in chunks])
        snake.replace_word(snake_case)

@vinta vinta force-pushed the master branch 2 times, most recently from 23abd09 to 40cd98b Compare June 6, 2019 19:55
@stale
Copy link

stale bot commented Oct 30, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 30, 2019
@stale stale bot closed this Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants