emacs.d/modules/jenga-init.el

109 lines
3.2 KiB
EmacsLisp
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;; Persist command history
(savehist-mode 1)
;; Enable C-r in evil
(use-package undo-tree
:ensure t)
;;;; TAGS configuration.
;; Goto tag with M-.
(global-set-key "\M-." 'etags-select-find-tag)
;; Automatically load TAGS file (if exists) when opening emacs.
(let ((my-tags-file (locate-dominating-file default-directory "TAGS")))
(when my-tags-file
(message "Loading tags file: %s" my-tags-file)
(visit-tags-table my-tags-file)))
;; Resize windows
(global-set-key (kbd "S-C-h") 'shrink-window-horizontally)
(global-set-key (kbd "S-C-l") 'enlarge-window-horizontally)
(global-set-key (kbd "S-C-j") 'shrink-window)
(global-set-key (kbd "S-C-k") 'enlarge-window)
(use-package yasnippet
:config (yas-global-mode 1))
(use-package which-key
:diminish
:config
(which-key-mode)
(which-key-setup-side-window-bottom)
(setq which-key-idle-delay 0.1))
(use-package diminish
:defer 5
:config
(diminish 'org-indent-mode))
;; Note that uniquify is builtin.
(require 'uniquify)
(setq uniquify-separator "/" ;; The separator in buffer names.
uniquify-buffer-name-style 'forward) ;; names/in/this/style
(use-package rg
:config
(global-set-key (kbd "M-s g") 'rg)
(global-set-key (kbd "M-s d") 'rg-dwim))
(use-package helm-rg)
;;;; Company configuration.
(use-package company
:ensure t
:defer t
:init (global-company-mode)
:config
(progn
(add-to-list 'completion-styles 'initials t)
(bind-key "M-<tab>" #'company-complete company-mode-map)
(setq company-tooltip-align-annotations t
tab-always-indent 'complete)
(setq company-dabbrev-downcase nil))
:diminish company-mode)
;;;; Evil mode configuration.
(use-package evil
:ensure t
:init ;; tweak evil's configuration before loading it
(setq evil-search-module 'evil-search
evil-ex-complete-emacs-commands nil
evil-vsplit-window-right t
evil-split-window-below t
evil-shift-round nil
evil-want-C-u-scroll t)
:config ;; tweak evil after loading it
(evil-mode)
(setq evil-want-C-u-scroll t)
(eval-after-load "evil-maps"
;; Unset Evil's "M-." keymap to enable symbol definition following.
(define-key evil-normal-state-map "\M-." nil)))
(use-package undo-tree
:ensure t)
;;;; Heml mode configuration.
(use-package helm
:diminish
:init (helm-mode t)
:bind
("M-x" . helm-M-x)
("C-x C-f" . helm-find-files)
("C-x b" . helm-mini) ;; See buffers & recent files; more useful.
("C-x r b" . helm-filtered-bookmarks)
("C-x C-r" . helm-recentf) ;; Search for recently edited files
("C-c i" . helm-imenu)
("C-c h" . helm-command-prefix)
("C-h a" . helm-apropos)
:config
(setq helm-autoresize-max-height 0
helm-autoresize-min-height 20
helm-split-window-in-side-p t
helm-move-to-line-cycle-in-source t
helm-ff-search-library-in-sexp t
helm-scroll-amount 8
helm-ff-file-name-history-use-recentf t
helm-echo-input-in-header-line t)
(when (executable-find "firefox")
(setq helm-google-suggest-use-curl-p t)))
(provide 'jenga-init)