diff --git a/functions.el b/functions.el index e810858..26d0934 100644 --- a/functions.el +++ b/functions.el @@ -12,6 +12,20 @@ (mapc 'kill-buffer (buffer-list))) (global-set-key (kbd "C-c k k") 'kill-all-buffers) +(defun split-and-follow-horizontally () + (interactive) + (split-window-below) + (balance-windows) + (other-window 1)) +(global-set-key (kbd "C-x 2") 'split-and-follow-horizontally) + +(defun split-and-follow-vertically () + (interactive) + (split-window-right) + (balance-windows) + (other-window 1)) +(global-set-key (kbd "C-x 3") 'split-and-follow-vertically) + ;; compilation (setq compile-command "make ") (global-set-key "\C-x\C-m" 'compile) diff --git a/init.el b/init.el index 328831b..696a85b 100644 --- a/init.el +++ b/init.el @@ -16,7 +16,7 @@ (set-language-environment "UTF-8") ;; Appearance -(set-frame-font "Terminus 12") +(set-frame-font "DejaVu Sans Mono 10") (set-face-italic 'font-lock-comment-face nil) ; disable italics ; theme set in packages.el (global-linum-mode) @@ -30,8 +30,9 @@ (setq display-time-24hr-format t) (display-time-mode t) -;; Instead of leaving backup files everywhere, have them in this dir -(setq backup-directory-alist `(("." . "~/.emacs.d/backups"))) +;; disable creation of backup files +(setq make-backup-files nil) +(setq auto-save-default nil) ;; Y or N instead of Yes or No (defalias 'yes-or-no-p 'y-or-n-p) @@ -47,10 +48,10 @@ ;; Electric pair mode (setq electric-pair-pairs '((?\( . ?\)) - (?\[ . ?\]) - (?\{ . ?\}) - (?\" . ?\") - )) + (?\[ . ?\]) + (?\{ . ?\}) + (?\" . ?\") + )) (electric-pair-mode t) ;; windmove @@ -75,6 +76,9 @@ (set-face-attribute face nil :weight 'normal)) (face-list)) +;; Eshell +(defalias 'open 'find-file-other-window) +(defalias 'clean 'eshell/clear-scrollback) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -84,7 +88,7 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(package-selected-packages - '(magit expand-region go-mode tao-themes tao-theme almost-mono-themes use-package))) + '(avy swiper auto-package-update magit expand-region go-mode tao-themes tao-theme almost-mono-themes use-package))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/packages.el b/packages.el index 60a7662..0bb0dbc 100644 --- a/packages.el +++ b/packages.el @@ -17,6 +17,19 @@ (package-refresh-contents) (package-install 'use-package)) +;; auto-package-update automatically updates and removes old packages +(use-package auto-package-update + :ensure t + :config + (setq auto-package-update-delete-old-versions t) + (setq auto-package-update-hide-results t) + (auto-package-update-maybe)) + +;; better incremental search with minibuffer +(use-package swiper + :ensure t + :bind ("C-s" . 'swiper)) + (use-package almost-mono-themes :ensure t :init @@ -53,10 +66,17 @@ (global-set-key (kbd "C-=") 'er/expand-region) (pending-delete-mode t)) ; if you start typing while a word is selected, overwrite it +;; jump to definitions and files with M-. (use-package dumb-jump :ensure t :config (add-hook 'xref-backend-functions #'dumb-jump-xref-activate)) +;; avy - jump around files more easily +(use-package avy + :ensure t + :bind ("M-s" . avy-goto-char)) + +;; self explanatory (use-package magit :ensure t)