/lovable-integrations

Lovable and Sublime Text integration: Step-by-Step Guide 2025

Easily integrate Lovable with Sublime Text using our step-by-step guide. Boost your coding workflow and enhance productivity in just a few simple steps.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to integrate Lovable with Sublime Text?

 

Step 1: Creating the Sublime Integration TypeScript Module

 
  • Create a new file in your Lovable project under the folder src/integrations called sublimeIntegration.ts.
  • This file will contain the TypeScript code that calls the Sublime Text executable to open a file.
  • Copy and paste the following code snippet into the newly created file:
    • import { exec } from 'child_process';
      
      

      /**

      • SublimeIntegration class provides methods to integrate Lovable
      • with Sublime Text. It uses the built-in child_process.exec function
      • to call Sublime Text's command line interface.

      /
      class SublimeIntegration {
      /
      *

      • Opens the specified file in Sublime Text.
      • @param filePath - The full path to the file to open.
        */
        public openFileInSublime(filePath: string): void {
        // Adjust the command if your Sublime Text executable is not 'subl'
        const command = subl "${filePath}";
        exec(command, (error, stdout, stderr) => {
        if (error) {
        console.error(Error opening file in Sublime Text: ${error.message});
        return;
        }
        console.log(Successfully opened file in Sublime Text: ${filePath});
        });
        }
        }

      export default SublimeIntegration;



 

Step 2: Integrating the Module with Your Lovable Project

 
  • Locate your main TypeScript file where the core logic of your Lovable project resides (for example, index.ts).
  • Import the SublimeIntegration module and use it when needed—for example, when you want to open a file from your Lovable interface in Sublime Text.
  • Insert the following code snippet at an appropriate location in your index.ts file:
    • import SublimeIntegration from './integrations/sublimeIntegration';
      
      

      // Example usage: open a specific file in Sublime Text when a certain action occurs in Lovable.
      const sublime = new SublimeIntegration();

      // Replace 'path/to/your/file.txt' with the actual file path you wish to open.
      sublime.openFileInSublime('path/to/your/file.txt');




  • This snippet shows how to initialize the integration and call the method to open a file in Sublime Text.

 

Step 3: Handling Dependencies Without a Terminal

 
  • Since Lovable does not have an integrated terminal, you need to manually declare any dependencies in your project’s package.json file.
  • The provided code utilizes Node’s built-in child_process module so no external installation is required.
  • Ensure your package.json includes the correct engine version if necessary. For example, add or verify the following entry in your package.json file:
    • {
        "engines": {
          "node": ">=12.0.0"
        }
        // other package.json configurations
      }
  • If in the future you add third-party dependencies, insert them in the dependencies object of package.json manually and follow any additional instructions provided by the dependency documentation.

 

Step 4: Testing the Sublime Integration in Lovable

 
  • Once you have saved the new file and updated your main file, trigger the action in your Lovable project that calls openFileInSublime.
  • Check the console output for a success message or any errors. The message Successfully opened file in Sublime Text: path/to/your/file.txt indicates that the integration is working correctly.
  • If you encounter issues, verify that the subl command is available on your system’s PATH, or adjust the command in sublimeIntegration.ts to match the location of your Sublime Text executable.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022