Per Erik Strandberg /cv /kurser /blog

I sometimes discover that I have added some goodies in my .emacs-file that are missing on a clean install. Here is a summary of the things I think I might have added over the years.


;; Unique buffer names
(require 'uniquify)
  uniquify-buffer-name-style 'post-forward
  uniquify-separator "|")

;; Cleanup whitespace on save
(add-hook 'before-save-hook 'delete-trailing-whitespace)

;; Set title
(setq-default frame-title-format
                (format "%s@%s: %s %s"
                        (or (file-remote-p default-directory 'user)
                        (or (file-remote-p default-directory 'host)
                          (concat "(" buffer-file-truename ")"))
                          (concat "{" dired-directory "}"))
                          "[no file]")))))

(global-set-key [M-left] 'windmove-left)          ; move to left windnow
(global-set-key [M-right] 'windmove-right)        ; move to right window
(global-set-key [M-up] 'windmove-up)              ; move to upper window
(global-set-key [M-down] 'windmove-down)          ; move to downer window

;;Enable column and line number mode
(setq column-number-mode t)

(defun my-run-python-script ()
  "Use compile to run python programs"
  (compile (concat "python " (buffer-name))))
(setq compilation-scroll-output t)

(defun my-file-name ()
  "Show the full path file name in the minibuffer."
  (message (buffer-file-name))
  (kill-new (file-truename buffer-file-name))

This page belongs in Kategori Emacs
This page belongs in Kategori Mallar