Sublime Forum

Paste or copy last used var

#1

Idea: it would speed up some of my work if there was a shortcut to copy and/or paste the last variable that I typed. Sometimes you need to type, for example, an if-statement in which you need to perform multiple checks on a variable. You start typing $long_variable_name_array’key_1’]‘but_this_is_nested_so_wtf_even_longer’], then you need to type it again and you think “omg no not again…”. You end up selecting and copy/pasting the text, but that requires some mouse action. In scenarios like this one I would be delighted if there was a way to simply copy(/paste) the last variable I typed quickly in the spot where I need it again.

0 Likes

#2

Okay I don’t normally bump stuff but I am still longing for this feature :astonished:.

0 Likes

#3

Not sure if this would work but it’s an idea. Use expand to scope (crrl+shift+space on windows) to expand the selection to what you need, then copy. You might have to play with this as it might select more than what you’re after. Then just copy and paste as usual. Just an FYI, there’s also a paste history option in ST3(ctrl+k, ctrl+v) which will list the last x number of items copied. This Might be helpful as well.

0 Likes

#4

Thanks for the tips! Not really what I was looking for, but good to know :smile:.

0 Likes