;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;; do m-x benchmark-init to see some benchmark stats
-;;(add-to-list 'load-path "~/.emacs.d/src/benchmark-init-el/")
+;;(add-to-list 'load-path (concat user-emacs-directory "src/benchmark-init-el/")
;;(require 'benchmark-init-loaddefs)
;;(benchmark-init/activate)
;; these need to be done before the hook in order to satisfy the byte compiler or batch mode
-;; this is the builtin org mode
-;;(add-to-list 'load-path "~/.emacs.d/emacs/site-lisp/org")
-
-(add-to-list 'load-path "~/.emacs.d/src/readline-complete")
+(add-to-list 'load-path (concat user-emacs-directory "src/readline-complete"))
;; disabled since not used.
-;;(add-to-list 'load-path "~/.emacs.d/src/bbdb-csv-import")
-;;(add-to-list 'load-path "~/.emacs.d/src/ghci-completion")
-;;(add-to-list 'load-path "~/.emacs.d/src/mediawiki-el")
-;;(add-to-list 'load-path "~/.emacs.d/src/spray")
+;;(add-to-list 'load-path (concat user-emacs-directory "src/bbdb-csv-import"))
+;;(add-to-list 'load-path (concat user-emacs-directory "src/spray"))
-(add-to-list 'load-path "~/.emacs.d/src/visible-mark")
+(add-to-list 'load-path (concat user-emacs-directory "src/visible-mark"))
;; keep our init.el clean, by moving customization elisp to it's own file
-(setq custom-file "~/.emacs.d/custom.el")
+(setq custom-file (concat user-emacs-directory "custom.el"))
;; empty atm
;;(load custom-file 'noerror)
(setq
save-place-version-control 'nospecial
save-place-limit 4000
- save-place-file "~/.emacs.d/places")
+ save-place-file (concat user-emacs-directory "places"))
(save-place-mode 1))
;; save every minute
savehist-autosave-interval 60
;; keep the home clean
- savehist-file "~/.emacs.d/.savehist")
+ savehist-file (concat user-emacs-directory ".savehist"))
(savehist-mode 1))
;;; dired
shift-select-mode nil
truncate-partial-width-windows nil
uniquify-buffer-name-style 'forward
- oddmuse-directory "~/.emacs.d/oddmuse"
+ oddmuse-directory (concat user-emacs-directory "oddmuse")
echo-keystrokes 0.1
mark-ring-max 160
sort-fold-case t ; case insensitive line sorting
imenu-auto-rescan t
indicate-empty-lines t) ; mark end of buffer
-(require 'smooth-scroll)
-;; long gnus summary buffers lags too much with this,
-;; but I like it enough to leave it enabled by default
-;; and crank up the step size to be faster
-;; and it doesn't have a way to enable it only for certain modes etc.
-;; todo sometime, make it work for certain modes only
-(smooth-scroll-mode t)
-;; its too slow with the default of 2
-(setq smooth-scroll/vscroll-step-size 6)
-;; sublimity doesn't work as good going fast by default
-;; smooth-scrolling.el, does not do smooth scrolling. its about cursor location
-
(blink-cursor-mode '(-4))
(menu-bar-mode -1)
;; worth the benefit of only having one concept in my mind.
(dolist
(r `(
- (?i (file . ,"~/.emacs.d/init.el"))
+ (?i (file . ,(concat user-emacs-directory "init.el")))
(?o (file . ,"/a/work.org"))
(?t (file . ,"/a/t.org"))
(?s (file . ,"/usr/share/doc/exim4-base/spec.txt.gz"))
(use-package undo-tree
:config
;; more resilient undo-tree-history if we have its location set up front.
- (setq undo-tree-history-directory-alist '(("." . "~/.undo-tree-history"))
+ (setq undo-tree-history-directory-alist '(("." . (concat user-emacs-directory ".undo-tree-history")))
undo-outer-limit 100000000 ; per undo command
undo-limit 500000000 ; undo history limit
undo-strong-limit 600000000 ; undo history limit plus some extra
(define-key comint-mode-map (kbd "C-r") 'comint-history-isearch-backward-regexp)))
;;;;; M-r ?? unused
+
+
;;;;; C-a copy buffer
(defun copy-all ()
(global-set-key (kbd "M-d") 'run)
-;;;;; C-M-d - swap buffer across windows
-;; from http://www.emacswiki.org/emacs/TransposeWindows
+;;;;; C-M-d - split-window-horizontally
+
+(global-set-key (kbd "C-M-c") 'split-window-horizontally)
-(setq swapping-buffer nil)
-(setq swapping-window nil)
-(defun swap-buffers-in-windows ()
- "Swap buffers between two windows"
- (interactive)
- (if (and swapping-window
- swapping-buffer)
- (let ((this-buffer (current-buffer))
- (this-window (selected-window)))
- (if (and (window-live-p swapping-window)
- (buffer-live-p swapping-buffer))
- (progn (switch-to-buffer swapping-buffer)
- (select-window swapping-window)
- (switch-to-buffer this-buffer)
- (select-window this-window)
- (message "Swapped buffers."))
- (message "Old buffer/window killed. Aborting."))
- (setq swapping-buffer nil)
- (setq swapping-window nil))
- (progn
- (setq swapping-buffer (current-buffer))
- (setq swapping-window (selected-window))
- (message "Buffer and window marked for swapping."))))
-
-(global-set-key (kbd "C-M-d") 'swap-buffers-in-windows)
;;;;; C-f - kill-whole-line
;; todo; check out smex-show-unbound-commands shows frequently used commands that have no key bindings.
;; this must be before smex-initialize
(setq
- smex-save-file "~/.emacs.d/.smex-items")
+ smex-save-file (concat user-emacs-directory ".smex-items"))
;; this uses smex
(global-set-key (kbd "M-x") 'counsel-M-x)
;;;;; C-M-c - copy-to-register
-(global-set-key (kbd "C-M-c") 'copy-to-register)
+(global-set-key (kbd "C-M-d") 'copy-to-register)
;;;;; C-v - yank
(progn (basic-save-buffer) (delete-frame))
(save-buffers-kill-terminal t))))
-;;;;; C-* - split-window-horizontally
-(global-set-key (kbd "C-*") 'split-window-horizontally)
+;;;;; C-* - --- terminal
;;;;; C-M-* - calc-dispatch
(global-set-key (kbd "C-M-*") 'calc-dispatch)
(defun vim-style-join-line ()
(interactive)
(join-line '(4)))
+;; terminal
+(global-set-key (kbd "C-_") 'vim-style-join-line)
+;; gui
(global-set-key (kbd "C-/") 'vim-style-join-line)
(define-key undo-tree-map (kbd "C-/") nil)
+(define-key undo-tree-map (kbd "C-_") nil)
;;;;; C-M-/ - copy-buffer-file-name
(setq mode-line (concat mode-line flymake-mode-line-status))
(setq flymake-mode-line mode-line)
(force-mode-line-update)))
+
+
+
+
+;; this seems like it could be useful, but I havent been using it, so disabled
+;; from http://www.emacswiki.org/emacs/TransposeWindows
+(setq swapping-buffer nil)
+(setq swapping-window nil)
+(defun swap-buffers-in-windows ()
+ "Swap buffers between two windows"
+ (interactive)
+ (if (and swapping-window
+ swapping-buffer)
+ (let ((this-buffer (current-buffer))
+ (this-window (selected-window)))
+ (if (and (window-live-p swapping-window)
+ (buffer-live-p swapping-buffer))
+ (progn (switch-to-buffer swapping-buffer)
+ (select-window swapping-window)
+ (switch-to-buffer this-buffer)
+ (select-window this-window)
+ (message "Swapped buffers."))
+ (message "Old buffer/window killed. Aborting."))
+ (setq swapping-buffer nil)
+ (setq swapping-window nil))
+ (progn
+ (setq swapping-buffer (current-buffer))
+ (setq swapping-window (selected-window))
+ (message "Buffer and window marked for swapping."))))
+
+(global-set-key (kbd "C-M-d") 'swap-buffers-in-windows)