VSCode extension used by my personal Talon scripts.
Available in the vscode marketplace as Andreas Talon
Note If you find this extension helpful, consider sponsoring!
Many of the commands take arguments and return values that can only be used with the Command server
andreas.getFilename(): string
Get filename of active file.andreas.copyFilename()
Copy filename of active file to clipboard.andreas.newFile(name?: string)
Create new file. Uses selected text and current file extension as suggestion.andreas.duplicateFile(name?: string)
Create duplicate/copy of active file.andreas.renameFile(name?: string)
Rename active file.andreas.removeFile()
Remove/delete the active file.andreas.moveFile()
Move active file to new directory.andreas.formatWorkspaceFiles()
Format workspace files.andreas.formatSelectedFiles()
Format selected files. Used by file explorer context menu.
andreas.generateRange(start: number = 1)
Generate numerical range. Starts from 1 by defaultandreas.increment(value?: number)
Increment selected number.andreas.decrement(value?: number)
Decrement selected number.
andreas.openEditorAtIndex(index: number)
Open editor/tab at given index. Negative indices are counted from the back.andreas.focusTab(hint: string)
Focus tab by hint. Hints range [A-ZZ].andreas.goToLine(line: number)
Go to line number.andreas.selectTo(line: number)
Select from current location to specified line.andreas.lineMiddle()
Move cursor to middle of the current line.
andreas.getDocumentText(): string | null
Get document text.andreas.getSelectedText(): string[] | null
Get selected text.andreas.getDictationContext(): {before: string, after: string} | null
Get text before and after selection. Used for context sensitive dictation.andreas.getClassName(): string | null
Get class name. Useful for inserting constructors in C++/Java.andreas.getOpenTagName(): string | null
Get name for open tag. Useful to close tag in HTML/XML.
andreas.getGitFileURL({ useSelection: boolean, useBranch: boolean }): string
Get URL to Git repository file webpage. Optionally include selected line numbers.andreas.getGitRepoURL(): string
Get URL to Git repository webpage.andreas.getGitIssuesURL(): string
Get URL to Git repository issues webpage.andreas.getGitNewIssueURL(): string
Get URL to Git repository new issue webpage.andreas.getGitPullRequestsURL(): string
Get URL to Git repository pull requests webpage.
andreas.getSetting(section: string, defaultValue?: T): T | undefined
Get setting from vscodeandreas.setSetting(section: string, value: any, configurationTarget?: "global" | "workspace" | "workspaceFolder")
Set setting for vscode, either globally or for the current workspace/folderandreas.executeCommands(commands: string[])
Sequentially execute multiple commands. Useful for keybindings.andreas.printCommands()
Print available commands.
- Adds document formatter for Talon files.
- Adds (go to) definitions for Talon actions, lists (incl dynamic) and captures.
- Adds hover for Talon actions, lists (incl dynamic) and captures.
- Adds code completion for Talon actions, lists and captures.
By applying the column width setting for the Talon formatter the left hand side of a command will be padded so the right hand column will be aligned
andreas.talonFormatter.columnWidth: null
foo: "foo"
foo bar baz: "foo bar baz"
andreas.talonFormatter.columnWidth: 15
foo: "foo"
foo bar baz: "foo bar baz"
The same setting exists for Talon list files
andreas.talonListFormatter.columnWidth: 15
"[talon]": {
"editor.formatOnSave": false
},
"[talon-list]": {
"editor.formatOnSave": false
}
- Convert line and block comments to JS/Java doc comments
- Adds document formatter for scm files.
- Adds syntax highlight for snippet files.
- Adds document formatter for snippet files.
- Adds code completion for fields in snippet files.
tab {self.letter} [{self.letter}]:
user.run_rpc_command("andreas.focusTab", "{letter_1}{letter_2 or ''}")
generate range [from <number_small>]:
user.run_rpc_command("andreas.generateRange", number_small or 1)
YouTube - On hover and go to definition
YouTube - Format selected files
$ npm install -g vsce
$ vsce package