📄 00000018.htm
字号:
<HTML><HEAD> <TITLE>BBS水木清华站∶精华区</TITLE></HEAD><BODY><CENTER><H1>BBS水木清华站∶精华区</H1></CENTER>发信人: yanglc (魂归燕园), 信区: Linux <BR>标 题: Steve's .emacs pure <BR>发信站: BBS 水木清华站 (Sat May 13 20:02:21 2000) <BR> <BR>发信人: pure (青衣~ Shadow in silence), 信区: FreeBSD <BR>标 题: Steve's .emacs <BR>发信站: BBS 水木清华站 (Sat Apr 17 15:55:44 1999) <BR> <BR>Steve's .emacs <BR>January 27th 1999, 01:49:00 PM <BR>Included in this .emacs are a couple of useful functions apart from simple <BR>key rebindings: <BR> <BR>1. Support for wheel mice (mouse buttons 4 & 5 under X), <BR>to scroll windows, do really fast undo/redo, etc... <BR> <BR>2. Buffer switch fix. The default completion list includes the name of the <BR>buffer you're in. This is very annoying if you're editing prog.c, and prog.h <BR>since you have to type either c, or h to switch between these files. This fix <BR>removes the current buffer name from the completion list. <BR> <BR>3. Microsoft style highlighting. Hold down shift and move the cursor <BR>around to define a region. Defining a region then pasting text (via emacs <BR>kill ring, or X cut buffer) will replace the region, among other functions. <BR>Each of these is documented in the file itself. <BR> <BR> <BR> <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR>;; Emacs customizations <BR>;; <BR>;; To use this: <BR>;; - byte compile this file into .emacs-source.elc <BR>;; i.e. go into the Emacs-Lisp menu and select "Byte Compile This File" <BR>;; - in your .emacs file put the line <BR>;; (load-file "~/.emacs-source.elc") <BR>;; to load the byte compiled version of this. This reduces Emacs' start <BR>;; up time. <BR>;; <BR>;; Steve Dodd <BR>;; March 1998 <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR> <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR>;; ASSORTED GLOBAL KEY BINDINGS <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR> <BR>;; Make control+pageup/down scroll the other buffer <BR>(global-set-key [C-next] 'scroll-other-window) <BR>(global-set-key [C-prior] 'scroll-other-window-down) <BR> <BR>;; Rebind C-z to start a shell (use .emacs_shellname for the shells rc file) <BR>(global-set-key "\C-z" 'shell) <BR> <BR>;; This binds word completions to Shift-Tab, and Ctrl+Space <BR>(global-set-key [S-iso-lefttab] 'dabbrev-completion) <BR>(global-unset-key [?\C-\040]) <BR>(global-set-key [?\C-\040] 'dabbrev-completion) <BR> <BR>;; Set up some f-key shortcuts <BR>(global-set-key [f1] 'help) <BR>(global-set-key [S-f1] 'man) <BR>(global-set-key [f2] 'save-buffer) <BR>(global-set-key [f3] 'find-file) <BR>(global-set-key [f4] 'kill-buffer) <BR> <BR>(global-set-key [f5] 'compile) <BR>(global-set-key [f6] 'first-error) <BR>(global-set-key [f7] 'previous-error) <BR>(global-set-key [f8] 'next-error) <BR> <BR>(global-set-key [f9] 'new-frame) <BR>(global-set-key [S-f9] 'delete-frame) <BR>(global-set-key [f10] 'split-window-vertically) <BR>(global-set-key [S-f10] 'delete-other-windows) <BR>(global-set-key [f11] 'undo) <BR>(global-set-key [f12] 'other-window) <BR>(global-set-key [S-f12] 'delete-window) <BR> <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR>;; GENERAL STUFF <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR> <BR>;; Set email address <BR>(setq user-mail-address "<A HREF="mailto:sdodd@undergrad.math.uwaterloo.ca");">sdodd@undergrad.math.uwaterloo.ca");</A> <BR>;;(setq sendmail-program "/usr/sbin/sendmail -i -t -<A HREF="mailto:fsdodd@undergrad.uwaterloo">fsdodd@undergrad.uwaterloo</A> <BR>.ca") <BR>(setq sendmail-program "/usr/sbin/sendmail") <BR> <BR>;; Set extensions <BR>(setq tex-dvi-view-command "xdvi") <BR>(setq compile-command "make") <BR> <BR>;; Show mark'ed text <BR>(setq transient-mark-mode '1) <BR> <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR>;; DIRED MODE <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR>(add-hook 'dired-mode-hook <BR> '(lambda() <BR> (define-key dired-mode-map [delete] 'dired-flag-file-deletion) <BR> (define-key dired-mode-map [return] 'dired-find-file-other-window <BR>) <BR> (define-key dired-mode-map [C-down-mouse-1] 'dired-mouse-find-fil <BR>e-other-window))) <BR> <BR> <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR>;; GNUS <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR>(setq gnus-select-method '(nnspool "")) <BR>(setq nnspool-inews-switches '("-h")) <BR> <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR>;; VM <BR>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; <BR>(setq load-path (append load-path '("/usr/share/emacs/site-lisp/vm"))) <BR> <BR>(autoload 'vm "vm" "Start VM on your primary inbox." t) <BR>(autoload 'vm-other-frame "vm" "Like `vm' but starts in another frame." t) <BR>(autoload 'vm-visit-folder "vm" "Start VM on an arbitrary folder." t) <BR>(autoload 'vm-visit-virtual-folder "vm" "Visit a VM virtual folder." t) <BR>(autoload 'vm-mode "vm" "Ru;; <BR> <BR>(defun s-shift-scroll-up () <BR> (interactive) <BR> (if (not mark-active) (set-mark-command nil) ()) <BR> (if (condition-case nil <BR> (scroll-up) <BR> (error 't)) (goto-char (point-max)) ())) <BR>(defun s-scroll-up () <BR> (interactive) <BR> (if mark-active (set-mark nil) ()) <BR> (if (condition-case nil <BR> (scroll-up) <BR> (error 't)) (goto-char (point-max)) ())) <BR> <BR>(defun s-shift-scroll-down () <BR> (interactive) <BR> (if (not mark-active) (set-mark-command nil) ()) <BR> (if (condition-case nil <BR> (scroll-down) <BR> (error 't)) (goto-char (point-min)) ())) <BR>(defun s-scroll-down () <BR> (interactive) <BR> (if mark-active (set-mark nil) ()) <BR> (if (condition-case nil <BR> (scroll-down) <BR> (error 't)) (goto-char (point-min)) ())) <BR> <BR>;; <BR>;; Cut and paste functions <BR>;; <BR> <BR>(defun s-shift-delete () <BR> (interactive) <BR> (if mark-active (kill-region (point) (mark)) (kill-line)) <BR> (setq s-prev-selection nil)) <BR>(defun s-ctrl-delete () <BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -