Showing posts with label emacs. Show all posts
Showing posts with label emacs. Show all posts

Friday, May 16, 2014

Install better Emacs on Mac OS X

Of course, with Homebrew

brew fetch emacs --HEAD --force

brew reinstall emacs --use-git-head --srgb --japanese --with-gnutls --with-cocoa --with-x11 --HEAD --force

brew linkapps emacs

https://github.com/Homebrew/homebrew/blob/master/Library/Formula/emacs.rb

Monday, May 5, 2014

Move .emacs.d to bbatsov/prelude

After a night of Sashimi, I went my friend @superbil's home.



We talked a lot about emacs and other interesting hacking stuffs.

He recommend me to switch my emacs configuration to Bozhidar Batsov's prelude on github.

https://github.com/bbatsov/prelude

Steps:

Backup all stuffs in my .emacs and .emacs.d/ directory.

cd

git clone https://github.com/bbatsov/prelude.git .emacs.d

Copy prelude-modules.el from sample/ to personal/ .

cp sample/prelude-modules.el personal/

Comment (out) modules I need

Launch my emacs.

(waiting for compiling lisp files)

Make prelude up to date

M-x prelude-update

Restart my emacs.

Done!

----

Other settings


Add @superbil's fix-font-org-mode.el under personal/preload/

https://gist.github.com/Superbil/7113937

Switch to color-theme-sanityinc-tomorrow

http://emacsthemes.caisah.info/sanityinc-tomorrow-themes/

And...

github-browse-file mode
twittering-mode
switch-window mode
guide-key mode
ace-jump mode
rebind C-h

https://github.com/xatier/rc-files/blob/master/prelude-modules.el



Big thanks to @superbil (https://twitter.com/superbil)

Thursday, March 21, 2013

Emacs: Flyspell-mode


最近開始拿 Emacs 編寫上課筆記,像我這種英文苦手表示悲劇,常常拼錯自,好在 Emacs 有內建的 flyspell-mode 可以幫我解決這個問題

http://www.emacswiki.org/emacs/FlySpell

在 .emacs 裡面加入  (或是用  hook 綁在某個  mode 上)這行即可

(flyspell-mode 1)

M-TAB 可以幫你 auto correct 回來,就甘心


Tuesday, February 19, 2013

emacs ansi-term mode


身為偉大的作業系統,內建一個支援 ansi 的 Terminal emulator  也是很正常的

M-x ansi-term

比較重要的

C-c C-j line mode    # ling scrolling
C-c C-k char mode





http://www.emacswiki.org/emacs/AnsiTerm

注意事項:


Also note that ansi-term remaps your default ‘C-x’ key to ‘C-c’.

In Emacs 22, try prefixing actions that aren’t recognized by their standard key commands with ‘C-x’. For example, ‘M-x’ becomes ‘C-x M-x’.




搭配 luit 可以開心的上 BBS 惹 ^q^

http://www.pps.univ-paris-diderot.fr/~jch/software/luit/

in bashrc

alias telnet="/usr/bin/luit -encoding big5 /usr/bin/telnet"

不過 BBS 的話可以在 .emacs 裡面寫防 idle 斷線


; anti idle for BBS                                                              
(defvar antiidle)                                                                
(defun enable-anti-idle ()                                                       
  (interactive)                                                                  
    (setq antiidle                                                               
      (run-with-timer 0 180 '(lambda ()                                          
        (term-send-up)                                                           
          (term-send-down)))))                                                   
                                                                                 
(defun disable-anti-idle ()                                                      
  (interactive)                                                                  
    (cancel-timer antiidle))

Thursday, December 13, 2012

emacs beginer's notes


http://www.linux.org.tw/CLDP/OLD/Emacs-Beginner-HOWTO-2.html
http://linux.chinaitlab.com/man/newsoft/Emac/book.html



上下左右
C-p previous line
C-n next line
C-f forward
C-b backward



PageUp/Dn
C-v scroll-up

M-v scroll-down


以字移動
M-f forward-word
M-b backward-word



行首行尾

C-a move-beginning-of-line
C-e move-end-of-line



句首句尾

M-a backward-sentence
M-e forward-sentence



檔頭檔尾

M-< beginning-of-buffer
M-> end-of-buffer



search
M-q C-s forward search
M-q C-r backward search


delete
C-d delete-char
M-d kill-word
C-k kill-line
M-k kill-sentence



yank
C-y yank
M-y yank-pop



buffer
C-x C-b list-buffers

C-x b switch-to-buffer
C-x k kill buffer
C-x C-c save-buffers-kill-emacs
M-x rename-buffer



files
C-x C-f open a file

C-x C-s save
C-x C-w save as 

windows
C-x 0 delete-window
C-x 1 delete-other-windows
C-x 2 split window vertically
C-x 3 split window horizontally
C-x o other-window



misc
C-x u undo
C-x l count-lines-page
M-x execute-extended-command
M-x shell 開啟 shell
C-g keyboard-quit
C-u M-x calendar



help
C-h k describe-key

C-h i info  # 神奇說明書
C-h F Emacs FAQ
C-h b shortcut keys enabled in current buffer