让windows的GNU emacs默认shell启动cygwin bash

区区的好友Victor告知说他打算转用cygwin版的emacs了,为了更加方便的集成他开发MTK时的bash环境。

 

于我这也google了一下cygwin emacs等主题。。

结果在这时(http://www.khngai.com/emacs/cygwin.php)找到一些非常用的定制。。

 

 

(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)))

 

其中的cmdproxy.exe如果改成,bash.exe,就可以让emacs的shell命令在windows下默认选用cygwin bash^_^

 

另外,如果cygwin版emacs非用不可,别忘了启动cygwin前,设定set CYGWIN=glob notitle tty

还有其它一些简要的配置,一并列下:

 

(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 'emacs 'open)

 

(global-set-key [(control down)] #'(lambda () (interactive) (scroll-up 1)))

(global-set-key [(control up)] #'(lambda () (interactive) (scroll-down 1)))

 

 

用上evil的emacs,学习就没个头,呵呵。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值