Salvador Dali
Salvador Dali

Reputation: 222461

code/text manipulation with pycharm

I do not know the exact word for the manipulation I am looking for, so I will try to explain it with an example.

A couple of days ago I saw a programming podcast, where a person was doing text manipulation in IDE (I will give you an example of what he did, because I do not remember the youtube link). For example starting with text

one 1
two 2
three 3
four 4
five 5
six 6
seven 7
eight 8 
nine 9

he transformed it to

"One", 1
"Two", 2
"Three", 3
"Four", 4
"Five", 5
"Six", 6
"Seven", 7
"Eight", 8
"Nine", 9

with just a 2-4 key combinations (select text, add left ", right " and ,). I felt really bad because I was always spending significant amount of time formatting such text or if the text is big, writing a program to do this.

The question is: how to do this with pycharm

Upvotes: 1

Views: 63

Answers (1)

proxy
proxy

Reputation: 509

(Windows key bindings)

  1. Make single selection with one caret per line with MMB+drag or alt+shift+insert on selected text.
  2. Move to line start with home.
  3. Type ".
  4. Select first characters with shift+right
  5. Toggle case with ctrl+shift+u
  6. Move to word end with ctrl+right
  7. Type ", "

Read Multiple Selections in PyCharm blog post for more info.

Upvotes: 1

Related Questions