From 2bb69f620f7f33dd01753c2267f93d1350e11458 Mon Sep 17 00:00:00 2001 From: Ted Kulp Date: Tue, 2 Aug 2022 08:51:32 -0400 Subject: [PATCH] feat: switch to vim-abolish -- add ref. mappings --- .config/lvim/config.lua | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/.config/lvim/config.lua b/.config/lvim/config.lua index 94c9aaf..607142a 100644 --- a/.config/lvim/config.lua +++ b/.config/lvim/config.lua @@ -98,9 +98,6 @@ lvim.plugins = { vim.g.dracula_italic_comment = true end, }, - { - "chiedo/vim-case-convert" - }, { "kylechui/nvim-surround", config = function() @@ -185,6 +182,9 @@ lvim.plugins = { { "tpope/vim-repeat" }, + { + "tpope/vim-abolish", + }, { "vladdoster/remember.nvim", config = function() @@ -461,15 +461,6 @@ lvim.builtin.which_key.mappings["lT"] = { "lua Toggle_lsp_lines()", "To lvim.builtin.which_key.mappings["u"] = { name = "+Text Utils", e = { "PickEverything", "Insert Emoji/Char" }, - c = { - name = "+Convert Case", - c = { "CamelToHyphen!", "Camel => Kebab/Hyphen" }, - C = { "CamelToSnake!", "Camel => Snake" }, - h = { "HyphenToCamel!", "Kebab/Hyphen => Camel" }, - H = { "HyphenToSnake!", "Kebab/Hyphen => Snake" }, - s = { "SnakeToCamel!", "Snake => Camel" }, - S = { "SnakeToHyphen!", "Snake => Kebab/Hyphen" }, - } } lvim.builtin.which_key.vmappings["u"] = { @@ -480,3 +471,23 @@ lvim.builtin.which_key.vmappings["u"] = { d = { ":call base64#v_atob()", "Base64 Decode", noremap = true, silent = true }, } } + +local wk = require('which-key') +wk.register({ + c = { + r = { + name = 'Coerce Case', + c = { "camelCase" }, + m = { "MixedCase" }, + ['_'] = { "snake_case" }, + s = { "snake_case" }, + u = { "SNAKE_UPPERCASE" }, + U = { "SNAKE_UPPERCASE" }, + ['-'] = { "dash-case" }, + k = { "kebab-case" }, + ['.'] = { "dot.case" }, + [' '] = { "space case" }, + t = { "Title Case" }, + }, + }, +}, { prefix = nil, mode = 'n', nowait = true })