Enable the Windows GNU Emacs shell to start cygwin bash by default.

Source: Internet
Author: User

Victor, a friend of the district, told him that he planned to switch to the cygwin version of Emacs. In order to integrate the bash environment when he developed MTK more conveniently.

 

I also Google cygwin Emacs and other topics here ..

The results found some very useful customization at this moment ..

 

 

(Add-hook 'eshell-mode-hook

'(Lambda Nil

(Eshell/export "epocroot = // somewhere //")

(Let (PATH ))

(Setq path ".; C:/soft/vs9/VC/bin ;")

(Setenv "path" (Concat path (getenv "path ")))

(Local-set-key "/c-u" 'eshell-kill-input ))

))

(Add-hook 'comint-output-filter-Functions

'Shell-strip-Ctrl-M nil T)

(Add-hook 'comint-output-filter-Functions

'Comint-watch-for-password-Prompt nil T)

(Setq explicit-shell-file-name "cmdproxy.exe ")

; For subprocesses invoked via the shell

; (E.g., "shell-C command ")

(Setq shell-file-name explicit-shell-file-name)

 

(Defun eshell/clear ()

"04dec2001-sailor, to clear the eshell buffer ."

(Interactive)

(Let (inhibit-read-only t ))

(Erase-buffer )))

 

In this example, if proxy.exeis changed to bash.exe, emacs shell commands can be set to cygwin bash cmd_^ by default in Windows.

 

In addition, if the cygwin version of Emacs is not available, do not forget to set cygwin = glob notitle tty before starting cygwin.

There are also some other brief configurations, which are listed in parallel:

 

(Setq Info-scroll-prefer-subnodes nil); Info scrolling

(Global-set-key "/m-" 'set-mark-command)

(Global-set-key "" (Quote set-mark-command ))

(Global-set-Key [(control? =)] 'Call-last-KBD-macro)

(Defalias 'Yes-or-no-p' y-or-n-P)

(Global-set-Key [(meta? H)] # '(lambda () (interactive) (find-file "~ /. Emacs ")))

(Transient-mark-mode 1)

(Normal-erase-is-backspace-mode nil)

(Iswitchb-mode t)

(Global-set-key "/C-XK" # '(lambda () (interactive) (kill-buffer (current-buffer ))))

 

(Global-font-lock-mode t)

(Setq truncate-lines T)

(Global-set-key "/C-x/C-B" 'buffer-menu)

 

(Icomplete-mode 1)

(Setq ring-bell-function 'ignore)

(Blink-cursor-mode nil)

(Partial-completion-mode 1)

(Global-set-key "/C-Co" 'occur)

 

(Global-set-key "/C-C/C-M" 'execute-extended-command)

 

(Defalias 'open' find-file)

(Defalias 'openo' find-file-other-window)

(Defalias 'qrr 'query-replace)

(Defalias 'rstr' replace-string)

(Defalias 'ptm' pop-to-mark-command)

(Defalias 'ecs' open)

 

(Global-set-Key [(control down)] # '(lambda () (interactive) (scroll-up 1 )))

(Global-set-Key [(control up)] # '(lambda () (interactive) (scroll-down 1 )))

 

 

When we use Emacs of edevil, we don't have much to learn.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.