Re: Konfiguration av Emacs
Hej Peter!
Bifogad .emacs-fil kanske innehåller en del saker som är intressanta. En
trevlig grej är om man i .Xdefaults skriver nått i stil med (beroende på
vilken skärmupplösning man använder sig av):
emacs.geometry: 80x57+236+0
En trevlig font väljer du nog med:
xfontsel -print
som du sedan kan lägga i din .emacs-fil. Men se upp:
http://www.catb.org/~esr/jargon/html/W/window-shopping.html
mvh(lsd)
> Hejsan!
>
> Hade tänkt kravla mig över den enorma inlärningströskeln
> som verkar finnas för att lära sig använda Emacs.
>
> Men skulle ändå vilja gå händelserna lite i förväg genom
> att skapa en ~/.emacs för att fixa så Emacs startar upp
> med rätt fönsterstorlek, fontstorlek m.m. och undrar om
> någon kan tipsa mig om var jag kan läsa om vilka parametrar
> som går att sätta. Kan sedan tidigare en del Lisp så det
> gäller egentligen bara att hitta dokumentation om namnen
> på parametrarna.
>
> Vänliga hälsningar,
> Peter Carlsson
>
>
> --
> To UNSUBSCRIBE, email to debian-user-swedish-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
; my tiny .emacs file
;
(set-default-font
"-*-Lucidatypewriter-medium-*-*-*-12-*-*-*-*-*-*-*"
; "-adobe-courier-medium-r-normal--*-130-*-*-m-*-iso8859-1"
)
;;
(require 'font-lock)
(global-font-lock-mode t)
; Some custom colors
(set-face-foreground font-lock-comment-face "DarkGray")
(set-face-foreground font-lock-string-face "PaleGreen")
(set-face-foreground font-lock-keyword-face "cyan")
(set-face-foreground font-lock-function-name-face "Wheat")
(set-face-foreground font-lock-type-face "antiquewhite")
(set-face-foreground font-lock-variable-name-face "antiquewhite")
(set-face-foreground font-lock-constant-face "cyan")
; Modeline-stuff
(setq display-time-day-and-date t)
(display-time)
(line-number-mode t)
(column-number-mode t)
; real men turns these off ;)
(scroll-bar-mode nil)
(menu-bar-mode nil)
; size of emacs window 80*57 for 768*1024
;(setq default-frame-alist (append (list
;'(width . 80)
;'(height . 57)) default-frame-alist))
; Saved my life more than once
(setq version-control t)
(setq kept-new-versions 7)
(setq delete-old-versions t)
; Hungry delete-key in C-mode
(setq c-hungry-delete-key 1)
; Nice colors
(set-background-color "DarkSlateGray")
(set-foreground-color "Wheat")
(set-cursor-color "blue")
; Makes making fun - executes make file in current dir.
(global-set-key "\C-cm" 'compile)
; Deletekey delete:s to the right
(global-set-key [delete] 'delete-char)
; My secret dir
(add-to-list 'load-path "~/.emacs-files/")
; Buffer cycling with Ctrl-Tab
(require 'ibs)
; loads dabbrev
(require 'dabbrev)
;dabbrev-expand "magic" completer on "section" key.
(global-set-key [?\247] 'dabbrev-expand)
; A must have
(require 'backup-dir)
(setq bkup-backup-directory-info
'((t "~/.backup" ok-create full-path)))
(defun up-slightly () (interactive) (scroll-up 3))
(defun down-slightly () (interactive) (scroll-down 3))
(global-set-key [mouse-4] 'down-slightly)
(global-set-key [mouse-5] 'up-slightly)
(defun up-a-lot () (interactive) (scroll-up))
(defun down-a-lot () (interactive) (scroll-down))
(global-set-key [C-mouse-4] 'down-a-lot)
(global-set-key [C-mouse-5] 'up-a-lot)
; Warns for weird stuff
(require 'cwarn)
(global-cwarn-mode t)
; loads ssh
(require 'ssh)
;Configures calendar
(setq european-calendar-style 't)
(setq calendar-week-start-day 1)
;points to diary-file
(setq diary-file (expand-file-name "~/.diary"))
; activates calendar on startup
;(calendar)
; Prevents opening of binary files.
(setq completion-ignored-extensions
(cons ".o" completion-ignored-extensions))
; Removes startup message
(setq inhibit-startup-message t)
; Ends files with only carrige-return
; (setq require-final-newline t)
; will disallow creation of new lines when you press the
; "arrow-down key" at end of the buffer.
(setq next-line-add-newlines nil)
;turns on autofillmode
(setq text-mode-hook
'(lambda ()
(setq fill-column 75)
(auto-fill-mode 1)))
; Makes softtabs by default
(setq-default indent-tabs-mode nil)
; will highlight region between point and mark.
(transient-mark-mode t)
; Sets new meaning for the home/end keys
(global-set-key [home] 'beginning-of-line)
(global-set-key [end] 'end-of-line)
(global-set-key [C-home] 'beginning-of-buffer)
(global-set-key [C-end] 'end-of-buffer)
;; Insertion of Dates.
(defun insert-date-string ()
"Insert a nicely formated date string."
(interactive)
(insert (format-time-string "%Y-%m-%d")))
;convert a buffer from dos ^M end of lines to unix end of lines
(defun dos2unix ()
(interactive)
(goto-char (point-min))
(while (search-forward "\r" nil t) (replace-match "")))
;vice versa
(defun unix2dos ()
(interactive)
(goto-char (point-min))
(while (search-forward "\n" nil t) (replace-match "\r\n")))
Reply to: