Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Selection or Line to FileNew to Visual Studio Code? Get it now.
Selection or Line to File

Selection or Line to File

Ömer Kasapoğlu

|
1 install
| (0) | Free
Append the current line or selected text to a target archive file.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

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.

Refile Demo

You can also send current selection to an archive file.

Refile Demo

✨ 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:

  1. Set the target archive file.
  2. Use Shift+Enter to refile.
  3. Use Ctrl+Shift+Enter to open the archive.
  4. 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.

Refile Demo


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 Demo

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

Refile Demo


More Demos

Sending selections

Refile Demo

Sending lines repeatedly

Refile Demo

Sending lines repeatedly

Refile Demo

All refile operations give messaging from status bar.

Refile Demo

🧾 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.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft