vim-silicon icon indicating copy to clipboard operation
vim-silicon copied to clipboard

[feature] Auto-remove ident when running Silicon on range

Open GoldsteinE opened this issue 4 years ago • 3 comments

I often have code like this

class SomeClass:
    def some_method(self):
        if condition:
            do_interesting_thing()
            do_something_else()

If I want to screenshot the lines inside if, I need to:

  1. Select them
  2. 3<
  3. gv
  4. :Silicon
  5. u

It would be cool, if something like this would be possible with single command.

GoldsteinE avatar Nov 30 '20 13:11 GoldsteinE

You can do:

command! -range SiliconUnindent :'<,'>le|'<,'>Silicon

segeljakt avatar Dec 02 '20 09:12 segeljakt

Thanks, didn't know about :le.

GoldsteinE avatar Dec 02 '20 11:12 GoldsteinE

Ah.. it does not seem to work like I thought, this:

        if condition:
            do_interesting_thing()
            do_something_else()

becomes:

if condition:
do_interesting_thing()
do_something_else()

I'm not sure how but there should be a fix

segeljakt avatar Dec 03 '20 09:12 segeljakt