11/11/2016

Use emacs on windows

Get Emacs from http://www.gnu.org/software/emacs/download.html
Create a command alias e.bat under C:/bin/e.bat, with content:
@echo off
chcp 437
@echo on

C:\emacs\bin\emacs.exe -nw %1

Add HOME to environment variable: HOME: C:\Users\liangzou.
Add .emacs to this folder. (See the content here)

How to customize the emacs application (GUI version):
Open regedit, find HKEY_CURRENT_USER\SOFTWARE\Classes\Applications\runemacs.exe\shell\open\command, change the value to:
"C:\emacs\bin\runemacs.exe" -fh -geometry 120x59 --load "C:\Users\liangzou\.emacs" "%1"

How to use it in MobaXterm/Cygwin:
===========================
Copy the same .emacs file from C:\Users\liangzou\.emacs to the home directory of MobaXterm.
Add the alias: 
alias ew='/drives/c/emacs/bin/runemacs.exe -fh -geometry 120x53' to the MobaXterm .bashrc file.
Or
/cygdrive/c/emacs/bin/runemacs.exe for Cygwin

No comments: