Q: Pycharm - keep highlighted word as argument Does Pycharm have the feature to keep highlighted word as the argument? To better ilustrate what I mean let me show you an example:
some_list = ['abc', 'def', 'ghi', 'jkl']
for i in some_list:
    # Do something

Now what I would like to do is to highlight some_list in for loop and type enumerate where desired output would be enumerate(some_list). This is a feature that I found really handy while using LaTeX.
Hope I was clear enough.

A: You can use surround feature:


*

*Select some_list in IDE

*Click on Code -> Surround With in menu (⌥⌘T shortcut on Mac)

*From drop-down menu choose 1. (expr.)

*Profit!


Alternatively, you can use Surround live templates feature of Live Templates:


*

*Open settings

*Go to Editor > Live Templates

*In python group create new template with such content enumerate($SELECTION$)

*Save it with some name, e.g. tenum

*At the bottom of setting window click on Define link and select Python (otherwise you will get No surround templates defined in this context)

*Select some_list in the IDE

*Press ⌥⌘J

*From the menu select your newly defined template tenum

*Profit!

