Search This Blog

Friday, August 14, 2009

OpenSource, Emacs

emacs select menu bar
M-x tmm-menubar
emacs deleting and rearranging windows
C-x 0
    Delete the selected window (delete-window). The last character in this key sequence is a zero. 
C-x 1
    Delete all windows in the selected frame except the selected window (delete-other-windows). 
C-x 4 0
    Delete the selected window and kill the buffer that was showing in it (kill-buffer-and-window). The last character in this key sequence is a zero. 
C-x ^
    Make selected window taller (enlarge-window). 
C-x }
    Make selected window wider (enlarge-window-horizontally). 
C-x {
    Make selected window narrower (shrink-window-horizontally). 
C-x -
    Shrink this window if its buffer doesn't need so many lines (shrink-window-if-larger-than-buffer). 
C-x +
    Make all windows the same height (balance-windows). 
portable shell for emacs: eshell
M+x eshell

if you want multiple eshell, just type
M-x rename-buffer to rename the buffer before starting a new eshell.

Nice terminus font

cd /usr/ports/x11-fonts/terminus-font/ && make install clean
xlsfonts | grep term to find the font
(setq default-frame-alist '((font . "-dec-terminal-medium-r-normal--0-0-75-75-c-0-iso8859-1")))

To change the background color in emacs:
M-x customize-face, and specify default

My .emacs file:

M-x customize-face, and specify default

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(inhibit-startup-screen t)
'(transient-mark-mode t))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:stipple nil :background "black" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 105 :width normal :family "dec-terminal")))))

(setq load-path (cons "~/myemacs/" load-path))

(require 'linum)
(global-linum-mode 1)

;(add-to-list 'load-path (expand-file-name "/usr/local/share/emacs/22.2/site-lisp/cedet/common"))
;(require 'cedet)

;(add-to-list 'load-path "/usr/local/share/emacs/22.2/site-lisp")
;(require 'ecb-autoloads)

;; Import C# mode
(add-to-list 'load-path "~/myemacs/")
(autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
(setq auto-mode-alist
(append '(("\\.cs$" . csharp-mode)) auto-mode-alist))

;php-mode
(autoload 'php-mode "php-mode" "Mode for editing PHP source files")
(add-to-list 'auto-mode-alist '("\\.\\(inc\\|php[s34]?\\)" . php-mode))


;;Doesn't work
;; Configuration variables here:
(add-to-list 'load-path "/usr/local/share/emacs/22.3/site-lisp/ecb")
(setq semantic-load-turn-useful-things-on t)
;; Load CEDET
(require 'cedet)
;; Load ECB
(require 'ecb)


;cedet config from the official website
(load-file "/usr/local/share/emacs/22.3/site-lisp/cedet/common/cedet.el")
(global-ede-mode 1) ; Enable the Project management system
(semantic-load-enable-code-helpers) ; Enable prototype help and smart completion
;does not work?
;(global-srecode-minor-mode 1) ; Enable template insertion menu


//set the nice looking font
(setq default-frame-alist '((font . "-dec-terminal-medium-r-normal--0-0-75-75-c-0-iso8859-1")))

No comments: