question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Surround selected text with a command input by the user

See original GitHub issue

This is a follow up on #246 from @jlanza

The current surrounding command only enables the user to select a command from a fixed list. Allowing the user input would help. I am summarising the discussion in #246.

What could be done is to wrap the selections with {...} and put a multi-cursor before the opening {. Quoting @jlanza, other options could be

  1. Something similar to the one you have already implemented. The only difference would be that in case the typed text is not in the list, it should be accepted. For instance, right now \ac for glossaries is not included in the list, so I cannot use the keyboard shortcut.
  2. Another option would be to enable adding new commands to a configuration file, so you will be adding new commands to the list. I guess your current list is hard coded somewhere else. This way you won’t be typing something undesired. It is less friendly.
  3. You can also think on a mix between option 1 and 2. That is, when you type and click enter on a non-included one, it is added to settings.json in your local folder.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jlanzacommented, Jul 24, 2019

We already the user files for \newcommand, see the wiki.

Then, I guess just including this ones in the QuickPick window would be more than enough.

0reactions
tamuratakcommented, Jun 28, 2020

Please open a new issue filling out all the information required in the issue template.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Surround Selection - Visual Studio Marketplace
Surround selected text with your input, inspired by the Sublime Text ... Launch VS Code Quick Open ( Ctrl+P ), paste the following...
Read more >
How to use surround-with code snippets - Visual Studio ...
In the Code Editor, select text to surround. From the Edit menu, select IntelliSense and then select the Surround With command.
Read more >
Visual Studio Code Surround With - Stack Overflow
In VS Code hold Command + Shift + P then write: "> Preferences: Open Keyboard Shortcuts ( ...
Read more >
Adding parenthesis around highlighted text in Vim - Super User
In addtition to Dmitry's suggestion of the surround plugin, adding parenthesis around highlighted text can be done with the following command ...
Read more >
Pass visually-selected text as argument to script
The command works fine when there is no \n character in the selected text (using Visual mode). :vmap <Leader>tts 0y:silent exec ":!/home/user/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found