scalpel icon indicating copy to clipboard operation
scalpel copied to clipboard

Edit all in scope

Open Crazor opened this issue 8 years ago • 3 comments

A nice feature would be a function akin to Xcode's "Edit all in scope". It basically allows you to rename a local variable throughout a function.

Crazor avatar Sep 03 '17 09:09 Crazor

This would be a neat feature but probably requires a level of context-sensitive (language-aware) intelligence that Scalpel doesn't (and isn't likely to) posses.

Still if somebody wanted to take a stab at implementing it I'd be open to the idea. Thanks for the suggestion. Will add some appropriate labels.

wincent avatar Sep 06 '17 00:09 wincent

Well, at least Vim knows about methods, right? I can navigate sources with { and }. So maybe not a semantically perfect version like Xcode has, but one limited to the text object that { and } refer to?

Crazor avatar Sep 11 '17 05:09 Crazor

{ and } are just jumping to the previous/next blank line, so not super sophisticated. Any "knowledge" of the code structure that Vim has is actually in the runtime files (language-specific ftplugins and syntax). I also know of some plugins that define some kind of "syntax-aware" text objects (these are probably built using pretty crude heuristics though). So there is something in there for a motivated individual to dig into, I think.

wincent avatar Sep 11 '17 19:09 wincent