Skip to content

Hanaasagi/inflection.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inflection.vim

Binding the Python inflection in Vim.

Normal Mode

normal-mode

Visual Mode

visaul-mode

Insert Mode

insert-mode

Requirements

  • Vim 7.3 or higher.
  • Enable +Python feature in Vim.

Installation

Depend on the package manager you are using. Give an example of manual installation.

git clone --depth=1 --recursive https://github.com/Hanaasagi/inflection.vim ~/.vim/bundle/inflection.vim

For Lazy.nvim user.

{
    "Hanaasagi/inflection.vim",
    config = function()
        vim.api.nvim_create_user_command(
            "Inflection",
            "call inflection#inflect_current_word()",
            {}
        )

        vim.api.nvim_create_user_command(
            "InflectionVisual",
            "call inflection#inflect_visaul_block()",
            { range = 0 }
        )
        vim.keymap.set(
            "i",
            "<C-l>",
            [[<ESC>:call inflection#inflect_current_word_in_insert_mode()<CR>]],
            { silent = false, noremap = true, desc = "inflect a word"}
        )
    end,
},

Usage

For vim user, edit the vimrc file, and add following code. You can change the keybinding as you want.

command! Inflection call inflection#inflect_current_word()
command! -range InflectionVisual call inflection#inflect_visaul_block()
inoremap <C-l> <ESC>:call inflection#inflect_current_word_in_insert_mode()<CR>

Inflection Form

shortcut form description
U uppercase Convert to uppercase.
L lowercase Convert to lowercase.
_ underscore Make an underscored, lowercase form from the expression in the string.
c camelize Convert to CamelCase.
C Camelize Convert to CamelCase and convert the first char to uppercase.
- dasherize Replace underscores with dashes in the string.
P pluralize Return the plural form of a word.
S singularize Return the singular form of a word, the reverse of pluralize.

License

BSD 3-Clause License Copyright (c) 2021, 秋葉.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published