Sublime Forum

Add a space after cursor but keep cursor in it's place

#1

Is there a shortcut to add a space after the cursor but keep the cursor in it’s place?

0 Likes

#2

You could create a snippet where the contents of the data segment is: "$0 " excluding the quotes… $0 is where the cursor would end up ( it works this way for settings files so it should work for snippets too ) and then save the snippet under some command or create a macro to execute the snippet and bind it to a key…

This is kind of an odd request though - why do you want to do this? There may be a better way than I described - you could create a plugin and handle placement of these depending on when you need them and why which will help my understanding to give a better answer…

0 Likes

#3

Thank you for your quick response! It is an odd request haha There are times when my cursor is right next to an ending tag or bracket and I want to do a text expansion so instead of being able to push the ending tag or cursor across by one space enabling me to do the text expansion I have to create the space first then go back to the original place where the cursor was and then type the text expansion and tab to get the desired results. It would be nice to just be able to push the ending tag or cursor out of the way with say CMD + space or something like that and then I’d be able to do the text expansion right away instead of having to make the space and then move back then do the expansion.

0 Likes

#4

One of the reasons why I got rid of automatic tag / bracket ending entries is because Sublime Text didn’t add logic for all scenarios - example: Typing in function( … adds: function( … ) and if you then add another ( or ) it’ll never properly match up…

I had to 95% of the time, with it enabled, go back and fix an error with a quote which wasn’t added, or one too many was added, etc…

If that’s the system which is causing the issue, I’d highly recommend disabling it until they fix all of the bugs with it… It’s nice in theory, but ST didn’t implement that feature properly causing more problems with other supporting features than it is worth…

0 Likes