editors

changeset 13:ca68b3aee940

Added sample .emacs file to get people started
author Jeremy Cowgar <jeremy@cowgar.com>
date Tue Oct 26 17:19:30 2010 +0000 (2010-10-26)
parents 86c44acdeb0d
children b9506af9eed1
files emacs/dot_emacs emacs/euphoria-mode.el
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/emacs/dot_emacs	Tue Oct 26 17:19:30 2010 +0000
     1.3 @@ -0,0 +1,149 @@
     1.4 +;;
     1.5 +;; Sample config file from Jeremy Cowgar
     1.6 +;;
     1.7 +;; 95% of this is not required but makes things a bit nicer, I think :-)
     1.8 +;;
     1.9 +;; One thing about Emacs is that you can do anything in it so everyone's
    1.10 +;; config file is going to look quite a bit different. These are just
    1.11 +;; a few select items from my config file to help a newbie get started
    1.12 +;; with their own.
    1.13 +;;
    1.14 +
    1.15 +;;;;;;;;;;;;;;;;;;;;
    1.16 +;; Load Path
    1.17 +;;
    1.18 +;; I place all my local files under ~/.elisp so
    1.19 +;; add it to the loading path so I can just
    1.20 +;; (require ...) files in that directory
    1.21 +;;
    1.22 +;;;;;;;;;;;;;;;;;;;;
    1.23 +
    1.24 +(setq load-path (nconc '( "~/.elisp") load-path))
    1.25 +
    1.26 +;;;;;;;;;;;;;;;;;;;;
    1.27 +;;
    1.28 +;; Some simple likes
    1.29 +;;
    1.30 +;;;;;;;;;;;;;;;;;;;;
    1.31 +
    1.32 +;; Show the date/time in the status bar
    1.33 +
    1.34 +(setq display-time-day-and-date t)
    1.35 +(display-time)
    1.36 +
    1.37 +;; Display in the status bar my current line number, column number
    1.38 +;; and function name
    1.39 +
    1.40 +(line-number-mode 1)
    1.41 +(setq column-number-mode t)
    1.42 +(which-func-mode t)
    1.43 +
    1.44 +;; Completion on buffer switching
    1.45 +(iswitchb-mode)
    1.46 +
    1.47 +;; highlight during query
    1.48 +(setq query-replace-highlight t)
    1.49 +
    1.50 +;; highlight incremental search
    1.51 +(setq search-highlight t)
    1.52 +
    1.53 +;; Recently editing files
    1.54 +(recentf-mode t)
    1.55 +
    1.56 +;; Show matching parens
    1.57 +(show-paren-mode t)
    1.58 +
    1.59 +;; Don't add new lines to the end of the file when using down-arrow
    1.60 +(setq next-line-add-newlines nil)
    1.61 +
    1.62 +;; Make all "yes or no" prompts show "y or n"
    1.63 +(fset 'yes-or-no-p 'y-or-n-p)
    1.64 +
    1.65 +;; Open unidentified files in text mode
    1.66 +(setq default-major-mode 'text-mode)
    1.67 +
    1.68 +;; Windows like selection and key bindings
    1.69 +(pc-bindings-mode)
    1.70 +(pc-selection-mode)
    1.71 +
    1.72 +;; Do only one line scrolling
    1.73 +(setq scroll-step 1)
    1.74 +
    1.75 +;; Always do colors in major editing modes
    1.76 +(require 'font-lock)
    1.77 +(global-font-lock-mode t)
    1.78 +
    1.79 +;; Enable the ability to use italics
    1.80 +(setq w32-enable-italics t)
    1.81 +
    1.82 +;; Keep backup files but in ~/.backups
    1.83 +(setq backup-directory-alist (quote ((".*" . "~/.backups"))))
    1.84 +(setq use-backup-dir t)
    1.85 +
    1.86 +;; Delete trailing whitespace on save
    1.87 +(add-hook 'before-save-hook 'delete-trailing-whitespace)
    1.88 +
    1.89 +(setq tab-width 4)
    1.90 +(setq-default indent-tabs-mode nil)
    1.91 +(setq require-final-newline t)
    1.92 +(setq next-screen-context-lines 8)
    1.93 +
    1.94 +(if (>= emacs-major-version 21)
    1.95 +    (setq show-trailing-whitespace t))
    1.96 +
    1.97 +;; yasnippets is optional but highly productive:
    1.98 +;;
    1.99 +;; http://code.google.com/p/yasnippet/
   1.100 +
   1.101 +(require 'yasnippet-bundle)
   1.102 +(setq yas/root-directory "~/.elisp/yasnippets")
   1.103 +(yas/load-directory "~/.elisp/yasnippets")
   1.104 +
   1.105 +;;;;;;;;;;;;;;;;;;;;;;
   1.106 +;;
   1.107 +;; Euphoria setup
   1.108 +;;
   1.109 +;;;;;;;;;;;;;;;;;;;;;;
   1.110 +
   1.111 +(require 'euphoria-mode)
   1.112 +
   1.113 +;; Set euphoria-mode up for tab-only indentation and
   1.114 +;; also to auto-indent to previous lines indentation.
   1.115 +
   1.116 +(defun my-euphoria-mode-hook ()
   1.117 +  (setq tab-width 4)
   1.118 +  (setq indent-tabs-mode t)
   1.119 +  (local-set-key (kbd "TAB") 'self-insert-command)
   1.120 +  (local-set-key "\C-m" 'newline-and-indent))
   1.121 +
   1.122 +;; Execute my hook when the Euphoria mode runs
   1.123 +(add-hook 'euphoria-mode-hook 'my-euphoria-mode-hook)
   1.124 +
   1.125 +;; This is optional, but mmm mode allows for multiple major
   1.126 +;; modes, thus we can have HTML with Euphoria embedded in it.
   1.127 +;;
   1.128 +;; http://mmm-mode.sourceforge.net/ 
   1.129 +
   1.130 +(require 'mmm-auto)
   1.131 +(require 'mmm-vars)
   1.132 +
   1.133 +(mmm-add-classes
   1.134 + '((html-euphoria
   1.135 +    :submode euphoria-mode
   1.136 +    :face mmm-declaration-submode-face
   1.137 +    :delimiter-mode nil
   1.138 +    :front "<\%"
   1.139 +    :back "\%>")))
   1.140 +
   1.141 +(mmm-add-mode-ext-class nil "\\.etml?\\'" 'html-euphoria)
   1.142 +(mmm-add-mode-ext-class nil "\\.etag?\\'" 'html-euphoria)
   1.143 +
   1.144 +;; Automatically load HTML mode when loading HTML, ETML or ETAG files
   1.145 +(setq auto-mode-alist
   1.146 +      (append
   1.147 +       (list
   1.148 +        '("\\.html$" . html-mode)
   1.149 +        '("\\.etml$" . html-mode)
   1.150 +        '("\\.etag$" . html-mode))
   1.151 +       auto-mode-alist))
   1.152 +
     2.1 --- a/emacs/euphoria-mode.el	Tue Oct 26 10:04:00 2010 +0000
     2.2 +++ b/emacs/euphoria-mode.el	Tue Oct 26 17:19:30 2010 +0000
     2.3 @@ -56,7 +56,7 @@
     2.4  
     2.5  (defconst euphoria-font-lock-keywords-1
     2.6    (list
     2.7 -   '("\\<[+-]?[0-9,_\\.]+\\>" . font-lock-constant-face)
     2.8 +   '("\\<[+-]?[0-9_\\.]+\\>" . font-lock-constant-face)
     2.9     '("\\<[A-Z0-9][^ \t\n\r]*\\>" . font-lock-constant-face)
    2.10     '("\\<\\(atom\\|integer\\|object\\|sequence\\)\\>" . font-lock-type-face)
    2.11     '("\\<\\(a\\(?:nd\\|s\\)\\|b\\(?:reak\\|y\\)\\|c\\(?:ase\\|on\\(?:stant\\|tinue\\)\\)\\|do\\|e\\(?:ls\\(?:e\\(?:def\\)?\\|if\\(?:def\\)?\\)\\|n\\(?:d\\|try\\|um\\)\\|x\\(?:\\(?:i\\|por\\)t\\)\\)\\|f\\(?:or\\|unction\\)\\|g\\(?:lobal\\|oto\\)\\|i\\(?:f\\(?:def\\)?\\|nclude\\)\\|label\\|n\\(?:amespace\\|ot\\)\\|or\\|p\\(?:rocedure\\|ublic\\)\\|ret\\(?:ry\\|urn\\)\\|switch\\|t\\(?:hen\\|o\\|ype\\)\\|w\\(?:hile\\|ith\\(?:out\\)?\\)\\|xor\\)\\>" . font-lock-builtin-face)

SCM Home | OpenEuphoria.org Home