Automatically select pasted text in Sublime Text 3

Viewed 863

Is there any way, plugin, macro or something to make Sublime Text 3 automatically select the text that was just pasted?

I need to copy and paste some JSON data, but the pasted text is never in line with the surrounding text. Paste and indent -feature does not work properly for this.

What does work is the reindent feature, but it requires me to select a block of text and pressing a hotkey. So after pasting I would benefit for having the just pasted block of text being automatically selected, so I can just press the reindent hotkey to properly indent what I pasted.

Furthermore, it would be even better if I could bind the whole process to a hotkey, so:

  • Select text
  • Copy
  • Press some self defined hotkey to run a macro(?)
  • This macro the pastes the text, selects the pasted text and runs the reindent hotkey (*)

*So basically I would like to make a keybinding, say, ctrl+shift+b to do the following:

  • ctrl+v
  • Somehow select pasted text
  • ctrl+shift+f
2 Answers

On MacOS you can add:

"find_selected_text": true

to Sublime Text->Preferences->Settings (User Settings View)

Related