GithubHelp home page GithubHelp logo

mezemacas's Introduction

MezeMacs

image

It's important to know that I use Windows, so my configuration is based on my operating system.

Setting Up a .Bat file

I created a .bat file and put the code below:

@echo off
start "" "path\to\emacs folder\bin\runemacs.exe" --daemon
# It is important to note that the path is not to the .emacs.d,
# but the path to the Emacs installation folder.

I opened the Windows Run dialog using the ⊞Win+R keys and typed "shell:startup". This opens a folder called "Startup," and anything you place in there will start along with the Windows initialization. I did this because Emacs with several packages on Windows takes a long time to open. So, without running the server, if we type "emacs test.txt," it will load everything again and won't have the same agility as "vim test.txt."

Creating a shortcut

To connect to the server, I created a shortcut on the desktop by pressing "🖰Lef_bt," and in the field that asks for the item's path, I inserted the following code:

path\to\emacs folder\bin\emacsclientw.exe -c -n -a path\to\emacs folder\bin\runemacs.exe
# It is important to note that the path is not to the .emacs.d,
# but the path to the Emacs installation folder.
  • c: This argument tells emacsclientw.exe to create a new Emacs window if one is not already open.
  • n: This argument instructs emacsclientw.exe not to wait for Emacs to be closed before returning to the command prompt. This allows the command to continue running in the background while Emacs is open.
  • a: path\to\emacs folder\bin\runemacs.exe: This argument specifies the path to the runemacs.exe executable, which is used as an alternative to start Emacs if emacsclientw.exe is not available or cannot connect to an existing Emacs server.

Adding mezemacs as a command in my PowerShell $PROFILE

To be able to use the command "mezemacs test.txt" in the terminal, I added the following function to my $PROFILE:

function MezEmacs {
    param (
        [String]$File
    )
    if ($File) {
        & "path\to\emacs folder\bin\emacsclientw.exe" -c -n -a "path\to\emacs folder\bin\runemacs.exe" $File
    } else {
        & "path\to\emacs folder\bin\emacsclientw.exe" -c -n -a "path\to\emacs folder\bin\runemacs.exe"
    }
}

mezemacas's People

Contributors

menezess42 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.