Skip to content

How can I map a keyboard shortcut to "Add to dictionary"? #282

Answered by valentjn
zetashift asked this question in Q&A
Discussion options

You must be logged in to vote

The usual way to execute a quick fix with the keyboard, such as adding a word to the dictionary, is Ctrl+. (Control and period keys), Arrow-Down, and Return.

ltex.addToDictionary is an internal (undocumented) command. All supported commands are documented here. The reason why ltex.addToDictionary doesn't work for you is that it expects a list of arguments (uri with the document URI and words with the list of words to add). When running the quick fix via the context menu, VS Code supplies the arguments because the language server part (LTEX LS) told it before what values to use in case it wants to run the quick fix. When running it via a keybinding, the arguments are missing, and the comma…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@valentjn
Comment options

@zetashift
Comment options

Answer selected by valentjn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants