Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>move-code-blocksNew to Visual Studio Code? Get it now.
move-code-blocks

move-code-blocks

Avishay Tal

|
22 installs
| (0) | Free
A VS Code extension that automates the process of moving code blocks between designated markers into a specified file, creating the necessary folder and file structure if they don't already exist.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Code Block Mover

A VS Code extension that automates the process of moving code blocks between designated markers into a specified file, creating the necessary folder and file structure if they don't already exist.

Features

  • Automatically moves code between // @start - <path> and // @end markers to a specified file.
  • Supports dynamic paths specified in the @start marker.
  • Creates the target folder and file if they do not already exist.
  • Ensures seamless integration and organization of your codebase.

Usage

  1. Add the // @start and // @end markers around the code you want to move in any file. Specify the target path in the @start marker:

    import './App.css';
    // @start - src/styles/index.ts;
    import styled from 'styled-components';
    
    export const AppContainer = styled.div`
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    `
    
    export const AppHeader = styled.header`
      background-color: #282c34;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    `
    
    export const AppLogo = styled.img`
      height: 40vmin;
      pointer-events: none;
    `
    // @end;
    
    // @start - src/navigate/index.ts;
    const Navigation = () => {
      return (
        <div className="App">
          <header className="App-header"> 
            <p>
              Edit <code>src/App.js</code> and save to reload.
            </p>
            <a
              className="App-link"
              href="https://reactjs.org"
              target="_blank"
              rel="noopener noreferrer"
            >
              Learn React
            </a>
          </header>
        </div>)
    }
    // @end;
    
    function App() {
      return (
        <Navigation />
      );
    }
    
    export default App;
    
  2. Run the move-code-blocks command from the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS).

  3. The code between the markers will be moved to the specified file, creating the folder and file if they do not already exist.

Requirements

  • Visual Studio Code

Extension Settings

This extension does not currently have any settings.

Known Issues

  • Ensure the // @start and // @end markers are correctly placed in the code to avoid any unexpected behavior.
  • The extension currently supports only moving code to a single file as specified by the marker.

Release Notes

1.0.3

  • Initial release of Code Block Mover

License

This extension is licensed under the MIT License.

Created By

Avishay Tal
avishaytl@gmail.com

Feel free to submit issues and feature requests.

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