Closed smjonas closed 1 year ago
Thanks for your long feedback! I would definitely consider to add more complicated actions for detection. My first goal is to add the general delete + insert motion into change motion.
As for:
ciwsample
=> suggestcbs
instead
This kind of detection is more complicated and I'll try to implement after finishing the first one.
btw these two are already in hardtime.nvim:
$
+a
=>A
;^
+i
=>I
maybe f\<char>h should trigger a warning "Use t\<char> instead of f\<char>h" and the reverse ("F\<char>l" -> "T\<char>" and "t\<char>l" -> "f\<char>" and "T\<char>h" -> "F\<char>")
ah I just thought of more. "diwi" should be shortened to "ciw". basically "d something i" -> "c something". I don't know the operator mode would work though.
My first goal is to add the general delete + insert motion into change motion.
Yeah this is just what I want to do first. Thanks!
Thanks for the plugin! While I haven't tried it myself, it seems like the scope of this plugin is currently mostly focused around Vim movements such as
hjkl
. In the past, there have been other requests for a plugin that can detect more complex actions / Vim motions and suggest better alternatives. So my first question is: is that even something you would consider for this plugin or should it stay relatively simple in scope?As an example, I could imagine things like:
daw
+i
, suggestcaw
instead$
+a
=>A
;^
+i
=>I
;y$
=>Y
(y$
has been remapped toY
by default in Neovim)While the above suggestions should be relatively simple to implement, there are many many others that can get arbitrarily more complicated since they require analyzing a part of the buffer's edit history (i.e. the last
n
changes). Examples:ex|ample
(|
is the cursor position) tosample
but usesciwsample
=> suggestcbs
instead<c-i>
(blockwise visual mode) or the norm commandOne could even suggest plugins to simplify certain actions:
local x
to-- local x
in a Lua file but enters insert mode (e.g.I-- <esc>
) => suggest a commenting plugin such asmini.comment
some |word here
tosome (word)| here
but enters insert mode (e.g.i(<esc>ea)<esc>
) => suggest a surrounding plugin such asnvim-surround
Ideally, it should be possible to dismiss certain suggestions in which case it won't be shown for the current session or never again. Let me know if you could imagine such suggestions as part of the plugin or not! :)