區區的好友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,學習就沒個頭,呵呵。