Selection or Line to File
Append the current selection or the line under your cursor to a target archive file — a minimal and focused refiling tool for VS Code.
Inspired by Emacs Org-mode’s org-refile command, this extension lets you move selections or lines into an archive or notes file using a single shortcut.
Demos
You can append the line under your cursor to a preconfigured archive file.

You can also send current selection to an archive file.

✨ Features
- Send Selection or Line — Move the active selection or current line to a target archive file.
- Open Target Archive File — Jump to the current archive file.
- Set Target Archive File — Choose or change the archive file for refiling.
- Safety Guards:
- Prevents refiling while the archive is open.
- Preserves unsaved edits.
- Provides status bar feedback for all operations.
Example workflow:
- Set the target archive file.
- Use Shift+Enter to refile.
- Use Ctrl+Shift+Enter to open the archive.
- Edit or view later if needed.
Commands
| Description |
Default Keybinding |
Command Name |
| Refile: Send Selection or Line |
Shift+Enter |
selection-or-line-to-file.refile |
| Refile: Set Target Archive File |
— |
selection-or-line-to-file.setTarget |
| Refile: Open Target Archive File |
Ctrl+Shift+Enter |
selection-or-line-to-file.openTarget |
Tip: Quick Access
Access all Refile commands via the Command Palette:
- Press
Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows/Linux)
- Type
Refile: to see and execute commands.

Command Details
Refile: Send Selection or Line
Sends the currently selected text or the current line to the target archive file. Deletes the text from the original location and appends it to the archive.
Look to the section: More Demos
Refile: Set Target Archive File
Opens a file picker to select or change the archive file used as the target for refile operations.
Setting it to another value

Refile: Open Target Archive File
Opens the currently set archive file in VS Code for viewing. If the archive file is already open, the command ensures safe focus without risking edits from other tabs.
This command has a toggle behaviour, it can return back
to your file if you are done with the archive file.
Refile: Open Target Archive File

More Demos
Sending selections

Sending lines repeatedly

Sending lines repeatedly

All refile operations give messaging from status bar.

🧾 Release Notes
0.1.0
- Initial working version.
- Refile, open archive, and set archive commands implemented.
- Safety and feedback mechanisms added.
Enjoy a lightweight notetaking workflow in VS Code.