CodeXport
Extract the code you highlight in VS Code into a .txt file — one right-click, then name it in the native Save As dialog.
Install
code --install-extension codexport-0.2.0.vsix
Once published, search for CodeXport in the Extensions view
(publisher Zaxckheal101).
Usage
- Open a file (HTML, JS, TS, CSS, JSON… any language).
- Highlight the code you want.
- Right-click → Extract as Txt, or press
Ctrl+Alt+E (Cmd+Alt+E on macOS).
- The OS Save As dialog opens in your Downloads folder with the name
CodeXport.txt pre-selected — accept it, rename it, pick any folder.
The snippet is written verbatim (UTF-8, original newlines). A toast confirms
the result and offers a Reveal File button.
Where files go
CodeXport never creates a folder in your project. The dialog opens in
Downloads the first time, then remembers the folder of your last save. If that
folder is later deleted, it falls back to Downloads.
File names
The dialog always starts with CodeXport.txt. Typing a name without an
extension adds .txt (hero → hero.txt); an explicit extension is respected
(notes.md stays notes.md). Cancelling the dialog writes and creates
nothing.
Development
npm install
npm run compile
Press F5 to launch the Extension Development Host. Press Ctrl+R there to
reload after edits (use npm run watch to keep out/ fresh).
Testing
npm test
Runs the mocha suite inside a real VS Code instance via @vscode/test-cli
(first run downloads VS Code). Covers the fixed default name, dialog prefill,
no-folder-creation on cancel, remembered destination, .txt appending, nested
paths, CRLF preservation, warning paths, and manifest/keybinding registration.
Packaging
npm run package
code --install-extension codexport-0.2.0.vsix
License
MIT — see the LICENSE file.