Binding the Python inflection in Vim.
- Vim 7.3 or higher.
- Enable
+Pythonfeature in Vim.
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.vimFor 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,
},
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>| 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. |
BSD 3-Clause License Copyright (c) 2021, 秋葉.