網頁

顯示具有 emacs 標籤的文章。 顯示所有文章
顯示具有 emacs 標籤的文章。 顯示所有文章

2014年4月2日 星期三

安裝最新版的 emacs ppa

第一步:

加入ubuntu-elisp ppa

sudo add-apt-repository ppa:ubuntu-elisp/ppa

第二步:

更新

sudo apt-get update

第三步:

安裝emacs-snapshot

sudo apt-get install emacs-snapshot

參考資料:

By my own

2013年10月27日 星期日

emacs rainbow-mode and rainbow.el 安裝

 
rainbow-mode 
用途:在特定語句或語法時,會產生顏色
安裝方法:
M-x package install -> rainbow-mode 
結果圖:


rainbow.el 
用途:在對應的delimiters會也相對應的顏色
安裝方法:
MELPA 好像也有這個package,但是好像有點錯誤,不知為何無法下載,感覺像是還沒放到伺服器上。
所以,只好使用老方法下載安裝了~~

git clone https://github.com/jlr/rainbow-delimiters.git
(add-to-list 'load-path "/path/to/rainbow-delimiters/") ;
(require 'rainbow-delimiters)
(global-rainbow-delimiters-mode)

個人感覺,原本的顏色不是很好,因此,透過rainbow-mode,稍微修改了一下rainbow-delimiter.el裡的顏色
;;; Faces:
;; Unmatched delimiter face:
(defface rainbow-delimiters-unmatched-face
  '((((background light)) (:foreground "#ff0000"))
    (((background dark)) (:foreground "#ff0000")))
  "Face to highlight unmatched closing delimiters in."
  :group 'rainbow-delimiters-faces)

;; Faces for highlighting delimiters by nested level:
(defface rainbow-delimiters-depth-1-face
  '((((background light)) (:foreground "#ffa500"))
    (((background dark)) (:foreground "#ffa500")))
  "Nested delimiters face, depth 1 - outermost set."
  :tag "Rainbow Delimiters Depth 1 Face -- OUTERMOST"
  :group 'rainbow-delimiters-faces)

(defface rainbow-delimiters-depth-2-face
  '((((background light)) (:foreground "#ffff00"))
    (((background dark)) (:foreground "#ffff00")))
  "Nested delimiters face, depth 2."
  :group 'rainbow-delimiters-faces)

(defface rainbow-delimiters-depth-3-face
  '((((background light)) (:foreground "#00ff00"))
    (((background dark)) (:foreground "#00ff00")))
  "Nested delimiters face, depth 3."
  :group 'rainbow-delimiters-faces)

(defface rainbow-delimiters-depth-4-face
  '((((background light)) (:foreground "#0000ff"))
    (((background dark)) (:foreground "#0000ff")))
  "Nested delimiters face, depth 4."
  :group 'rainbow-delimiters-faces)

(defface rainbow-delimiters-depth-5-face
  '((((background light)) (:foreground "#5600ef"))
    (((background dark)) (:foreground "#5600ef")))
  "Nested delimiters face, depth 5."
  :group 'rainbow-delimiters-faces)

(defface rainbow-delimiters-depth-6-face
  '((((background light)) (:foreground "#9400f3"))
    (((background dark)) (:foreground "#9400f3")))
  "Nested delimiters face, depth 6."
  :group 'rainbow-delimiters-faces)

(defface rainbow-delimiters-depth-7-face
  '((((background light)) (:foreground "#95ff70"))
    (((background dark)) (:foreground "#95ff70")))
  "Nested delimiters face, depth 7."
  :group 'rainbow-delimiters-faces)

(defface rainbow-delimiters-depth-8-face
  '((((background light)) (:foreground "#f0a880"))
    (((background dark)) (:foreground "#f0a880")))
  "Nested delimiters face, depth 8."
  :group 'rainbow-delimiters-faces)

(defface rainbow-delimiters-depth-9-face
  '((((background light)) (:foreground "#90ffff"))
    (((background dark)) (:foreground "#90ffff")))
  "Nested delimiters face, depth 9."
  :group 'rainbow-delimiters-faces)
結果圖:

2013年8月5日 星期一

emacs 簡繁轉換 -- 使用新同文堂python

需要環境

python2.7

請上官網下載安裝,並加入系統變數裡裡

unicad.el - emacs 識別編碼用

下載並安裝unicad.el

unicad-1.1.4.tar.gz
wget "http://unicad.googlecode.com/files/unicad-1.1.4.tar.gz"
tar -zxv -f unicad-1.1.4.tar.gz

在.emcac加入下面這兩行

(add-to-list 'load-path "/path/to/unicad_folder") ;這行要指定路徑
(require 'unicad)

安裝教學

git clone "https://github.com/monkey413/tongwen-emacs.git

在.emcac加入下面這兩行

(add-to-list 'load-path "/path/to/tongwen-emacs") ;這行要指定路徑
(require 'hanconvert)

使用教學

M-x hanconvert-to

2013年6月29日 星期六

quicklisp and slime installation

 
quicklisp :quicklisp官網 http://www.quicklisp.org/beta/ 有教學,不多說:
slime:下載最新slimehttp://common-lisp.net/project/slime/#downloading
.emacs設定
(set-language-environment "utf-8")
;(setq inferior-lisp-program "/usr/share/emacs/24.0.94/ccl/lx86cl64") ;your Lisp system
(setq inferior-lisp-program "/usr/bin/sbcl") ;your Lisp system
(add-to-list 'load-path "/usr/share/emacs/24.2/slime-2013-04-05/") ;your SLIME directory
(require 'slime)
(slime-setup)
(setq slime-net-coding-system 'utf-8-unix)
(slime-setup '(slime-fancy))
;(require 'slime-autoloads)
(defun lisp-indent-or-complete (&optional arg)
  (interactive "p")
  (if (or (looking-back "^\\s-*") (bolp))
      (call-interactively 'lisp-indent-line)
      (call-interactively 'slime-indent-and-complete-symbol)))
(eval-after-load "lisp-mode"
  '(progn
     (define-key lisp-mode-map (kbd "TAB") 'lisp-indent-or-complete)))