Skip to content

Instantly share code, notes, and snippets.

@MarcelFox
Last active March 15, 2023 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcelFox/01b038883f3af37bbf0842e4d1779f00 to your computer and use it in GitHub Desktop.
Save MarcelFox/01b038883f3af37bbf0842e4d1779f00 to your computer and use it in GitHub Desktop.
Personal .emacs file
;; inhibit-startup-echo-area-message MUST be set to a hardcoded
;; string of your login name
;; Disable slash screen:
(setq inhibit-splash-screen t)
;; Set global text-mode and activate auto-fill:
(setq-default major-mode 'text-mode)
(setq-default auto-fill-function 'do-auto-fill)
;; set max line lenght:
(setq-default fill-column 80)
;; Remove scratch message:
(setq initial-scratch-message "")
;; Switch to a temp.txt file:
(switch-to-buffer "temp.txt")
;; Set tab to 4 spaces:
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq indent-line-function 'insert-tab)
;; Load theme wombat:
(load-theme 'wombat)
;; Bottom-line function:
(defun bottom-line ()
"Open file with the pointer at the bottom line."
(interactive)
(end-of-buffer))
;; Hook for every file opened, execute the bottom-line function:
(add-hook 'find-file-hook 'bottom-line)
;; Date Function:
(defun insert-current-date ()
(interactive)
(insert (shell-command-to-string "date")))
;; Set the f4 key to bind the insert-current-date function:
(global-set-key (quote [f4]) (quote insert-current-date))
;; MISC:
;;
;; Optimal 'agenda' alias on .bashrc to open 'agenda.txt' file and insert the Date:
;; alias agenda='emacs ~/Data/Dropbox/agenda.txt --eval "(with-current-buffer \"agenda.txt\" (insert-current-date))"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment