This repository has been archived on 2022-12-11. You can view files and clone it, but cannot push or open issues or pull requests.
dot-files/.emacs.d/config/misc.el

128 lines
4.7 KiB
EmacsLisp
Raw Normal View History

Modularize emacs config Approximately coincides with the release of emacs 24.4, Though some changes for the emacs 24.4 upgrade are not yet completed; specifically: * replace w3m with the now built in eww * no need to enable electric-indent-mode since it is now enabled by default * other things that I don't know about yet ... Now the main changes are as follows: * Use .emacs.d/init.el for emacs start-up file instead of .emacs; this new init file is much shorter in summary does the following: - auto-loads packages installed using package.el using the package-initialize function - adds .emacs.d/site-lisp-extra to the load-path - sets a few variables and functions and then recursively loads all .el files in .emacs.d/config - contains all variables set by customize at the end of the file * All other configuration is written to files with appropriate names in .emacs.d/config; currently the concatenation of these files is the same as the .emacs in the last commit not including the sexp's that went into .emacs.d/init.el Things that remain the same but are no less important to mention in regards to the setup of this emacs configuration: * custom themes are stored in .emacs.d/themes * custom yasnippets are stored in .emacs.d/snippets * templates (used by .emacs.d/config/insert-templates.el to insert a comment at the beginning of certain files using auto-insert-mode) are located at .emacs.d/templates Note: I've been considering depreciating the use of auto-insert-mode to insert content into new files and instead use yasnippets. Further though is required. Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
2014-10-23 08:09:14 +00:00
;; (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)