Sublime text provides two helpful features that will make pasting text a lot easier.
Paste From History
The first helpful feature is “Paste from History”. This exists inside the Edit menu item but can be found using the shortcut command+option+v or ctrl+alt+v depending on your operating system of choice. I learned this using command+k, command+v but I haven’t been able to figure out why it’s different in the menu bar. When you use this shortcut or menu item this the following menu will be displayed:
Then you can use your mouse or keyboard to select the entry you want to paste into the current location.
I find this to be helpful when you’re replacing the same couple strings over and over again and don’t want to (or can’t) do a global search and replace.
Paste and Indent
The next helpful feature is “Paste and Indent”. This exists to allow you to match the current indentation level. For example, let’s say we have code that exists at no indentation and we want to paste it into an existing function with indentation.
If we use the normal paste option (command+v or ctrl+v) it will keep the existing indentation on any of the lines after the first one:
But if we do a paste and indent (command+shift+v or ctrl+shift+v) it will be formatted correctly:
Scott is the Director of Technology at WeCare Connect where he strives to provide solutions for his customers needs. He's the father of two and can be found most weekends working on projects around his house with his loving partner.