128 lines
4.7 KiB
EmacsLisp
128 lines
4.7 KiB
EmacsLisp
;; (C) Copyright Collin J. Doering 2014
|
|
;;
|
|
;; This program is free software: you can redistribute it and/or modify
|
|
;; it under the terms of the GNU General Public License as published by
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
;; (at your option) any later version.
|
|
;;
|
|
;; This program is distributed in the hope that it will be useful,
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
;; GNU General Public License for more details.
|
|
;;
|
|
;; You should have received a copy of the GNU General Public License
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
;; File: misc.el
|
|
;; Author: Collin J. Doering <collin.doering@rekahsoft.ca>
|
|
;; Date: Oct 21, 2014
|
|
|
|
;; stop renaming of saved files to filename~ which ends up breaking hardlinks
|
|
(setq backup-by-copying-when-linked t)
|
|
|
|
;; Turn off indentation (use spaces instead)
|
|
(setq-default indent-tabs-mode nil)
|
|
|
|
;; Turn on electric-indent-mode
|
|
(electric-indent-mode 1)
|
|
|
|
;; Single spaces denote end sentences for use with sentence commands
|
|
(setq sentence-end-double-space nil)
|
|
|
|
;; Show column number in status bar
|
|
(column-number-mode)
|
|
|
|
;; Set the fill-column for text filling
|
|
(setq fill-column 95)
|
|
|
|
;; fixes color output issues; see: http://wiki.archlinux.org/index.php/Emacs#Colored_output_issues
|
|
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
|
|
|
|
;; Automatically open some config files with an associated major mode
|
|
;; Note: regexp's used to match buffer filenames are intentionally left
|
|
;; unbounded (without '$') to catch cases where the filename may
|
|
;; take the format: filename~
|
|
(add-to-list 'auto-mode-alist '("\\.conkerorrc" . js-mode))
|
|
(add-to-list 'auto-mode-alist '("\\.xmobarrc" . haskell-mode))
|
|
(add-to-list 'auto-mode-alist '("\\.screenrc" . conf-mode))
|
|
(add-to-list 'auto-mode-alist '("\\.stumpwmrc" . lisp-mode))
|
|
(add-to-list 'auto-mode-alist '("\w*\\.service" . conf-mode))
|
|
(add-to-list 'auto-mode-alist '("\w*\\.socket" . conf-mode))
|
|
(add-to-list 'auto-mode-alist '("\\.mpdconf" . conf-mode))
|
|
(add-to-list 'auto-mode-alist '("dunstrc" . conf-mode))
|
|
|
|
;; Define some alias' for commonly M-x'ed commands
|
|
(defalias 'run-sql 'sql-product-interactive)
|
|
|
|
;; Make C-x O cycle backwards a pane (oposite to C-x o)
|
|
(global-set-key "\C-xO" #'(lambda ()
|
|
(interactive)
|
|
(other-window -1)))
|
|
|
|
;; Setup browse-key-ring
|
|
(require 'browse-kill-ring) ;; ELPA
|
|
(global-set-key "\C-cy" 'browse-kill-ring)
|
|
|
|
;; Enjoy a game of Sudoku on some downtime
|
|
(require 'sudoku) ;; ELPA
|
|
|
|
;; setup magit for git (being used though elpa [auto-loaded])
|
|
;;(require 'magit) ;; ELPA
|
|
(global-set-key "\C-xS" 'magit-status)
|
|
(setq magit-commit-signoff t)
|
|
|
|
;; Thing about replacing this as I never use it
|
|
;;setup vc-darcs ;; ELPA
|
|
;(add-to-list 'vc-handled-backends 'DARCS)
|
|
;(autoload 'vc-darcs-find-file-hook "vc-darcs")
|
|
;(add-hook 'find-file-hooks 'vc-darcs-find-file-hook)
|
|
|
|
;; Setup PKGBUILD mode ;; Community (archlinux)
|
|
(autoload 'pkgbuild-mode "pkgbuild-mode.el" "PKGBUILD mode." t)
|
|
(setq auto-mode-alist (append '(("/PKGBUILD$" . pkgbuild-mode)) auto-mode-alist))
|
|
|
|
;; Setup coq-mode ;; AUR: coq
|
|
(require 'coq)
|
|
|
|
;; Setup emacs-lua-mode
|
|
(setq auto-mode-alist (cons '("\.lua$" . lua-mode) auto-mode-alist)) ;; ELPA
|
|
(autoload 'lua-mode "lua-mode" "Lua editing mode." t)
|
|
|
|
;; Setup emacs-erlang-mode (ELPA)
|
|
(setq erlang-root-dir "/usr/lib/erlang")
|
|
(setq exec-path (cons "/usr/lib/erlang/bin" exec-path))
|
|
(setq auto-mode-alist (append '(("\.erl$" . erlang-mode)) auto-mode-alist))
|
|
|
|
;; setup pastebin.el for use with pastebin.com *BROKEN*
|
|
;(require 'pastebin) ;; ELPA
|
|
|
|
;; yasnippet, auto-complete-mode and flyspell do not play nicely with one another due to
|
|
;; a conflict with the context of their tab binding *OLD*
|
|
|
|
;; hideshow-org being depreciated in my config due to conflicting key bindings with yasnippet
|
|
;; and flyspell *TODO*
|
|
|
|
;; Make hs-minor-mode act like org-mode for code folding
|
|
;;(add-to-list 'load-path "/usr/share/emacs/site-lisp/hideshow-org")
|
|
;; (require 'hideshow-org)
|
|
;; (global-set-key "\C-ch" 'hs-org/minor-mode)
|
|
|
|
;; Add automatic activation of hs-org/minor-mode in the below major-modes
|
|
;; (add-hook 'c-mode-common-hook 'hs-org/minor-mode)
|
|
;; (add-hook 'emacs-lisp-mode-hook 'hs-org/minor-mode)
|
|
;; (add-hook 'java-mode-hook 'hs-org/minor-mode)
|
|
;; (add-hook 'lisp-mode-hook 'hs-org/minor-mode)
|
|
;; (add-hook 'sh-mode-hook 'hs-org/minor-mode)
|
|
;; (add-hook 'python-mode-hook 'hs-org/minor-mode)
|
|
;; (add-hook 'scheme-mode-hook 'hs-org/minor-mode)
|
|
|
|
;; This is now done ine ~/.Xresources
|
|
;; Remove menu-bar, tool-bar, and scroll-bars
|
|
(menu-bar-mode -1)
|
|
;;(tool-bar-mode -1)
|
|
;;(scroll-bar-mode -1)
|
|
;;(set-default-font "Terminus-12")
|
|
|
|
;; Stop startup screen
|
|
(setq inhibit-startup-screen t)
|