Skip to content

Instantly share code, notes, and snippets.

@jadient
Created February 11, 2018 01:12
Show Gist options
  • Save jadient/2e6b2f05fb0e22b795ab88351fc188f4 to your computer and use it in GitHub Desktop.
Save jadient/2e6b2f05fb0e22b795ab88351fc188f4 to your computer and use it in GitHub Desktop.
.emacs on linux
;; .emacs
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(diff-switches "-u")
'(menu-bar-mode -1)
'(tool-bar-mode nil))
;;; uncomment for CJK utf-8 support for non-Asian users
;; (require 'un-define)
;; package mode configuration
;; from https://jblevins.org/projects/markdown-mode/
(require 'package)
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/"))
(package-initialize)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:family "Ubuntu Mono" :foundry "unknown" :slant normal :weight normal :height 113 :width normal)))))
;;---- from Windows .emacs file
(savehist-mode 1) ; save history across sessions
(setq make-backup-files nil) ; no more ~ backup files
(setq ring-bell-function 'ignore) ; disable dings completely; alternatively (setq visible-bell 1)
(set-default 'truncate-lines t) ; do not automatically wrap long lines
(set-default 'cursor-type 'bar) ; use bar-style cursor
(delete-selection-mode 1) ; typed text replaces selection
(recentf-mode 1) ; enable File > Open Recent
(show-paren-mode 1) ; highlight matching paren
(put 'dired-find-alternate-file 'disabled nil) ; allow 'a' in dired-mode
(put 'narrow-to-page 'disabled nil) ; allow narrowing
(put 'narrow-to-region 'disabled nil) ; allow narrowing
(setq whitespace-line-column 250) ; disabling doesn't seem to work...
(global-hi-lock-mode 1) ; allow regexp highlighting (can use Edit > Regexp Highlighting menu)
(which-function-mode 1)
(setq imenu-sort-function 'imenu--sort-by-name)
(setq split-width-threshold 2000) ; stop automatic sideways split (http://tinyurl.com/nadtwgb, http://tinyurl.com/o6h3stq)
(setq uniquify-buffer-name-style 'forward) ; use path instead of <2> etc to make unique buffer names
(setq shell-dirstack-query "cd") ; use with Shell mode M-Ret to resync directory
(ido-mode 'buffers)
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "C-x C-m") 'shell)
(defun switch-to-previous-buffer ()
(interactive)
(switch-to-buffer (other-buffer (current-buffer) 1)))
(global-unset-key (kbd "<f2>")) (global-set-key (kbd "<f2>") 'switch-to-previous-buffer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment