2020-07-30 23:02:28 +02:00
|
|
|
|
;; Persist command history
|
|
|
|
|
(savehist-mode 1)
|
|
|
|
|
|
|
|
|
|
;;;; 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)
|
|
|
|
|
|
2020-07-31 03:25:07 +02:00
|
|
|
|
(use-package yasnippet
|
|
|
|
|
:config (yas-global-mode 1))
|
|
|
|
|
|
2020-07-31 00:41:04 +02:00
|
|
|
|
(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)
|
|
|
|
|
|
2020-07-30 23:02:28 +02:00
|
|
|
|
;;;; 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
|
2021-06-08 09:30:36 +02:00
|
|
|
|
evil-undo-system 'undo-tree
|
2020-07-30 23:02:28 +02:00
|
|
|
|
evil-want-C-u-scroll t)
|
|
|
|
|
:config ;; tweak evil after loading it
|
2021-06-08 09:30:36 +02:00
|
|
|
|
(use-package undo-tree)
|
2020-07-30 23:02:28 +02:00
|
|
|
|
(evil-mode)
|
|
|
|
|
(setq evil-want-C-u-scroll t)
|
|
|
|
|
(eval-after-load "evil-maps"
|
2020-07-31 00:41:04 +02:00
|
|
|
|
;; Unset Evil's "M-." keymap to enable symbol definition following.
|
2020-07-30 23:02:28 +02:00
|
|
|
|
(define-key evil-normal-state-map "\M-." nil)))
|
|
|
|
|
|
2021-06-08 09:30:36 +02:00
|
|
|
|
(add-hook 'evil-local-mode-hook 'turn-on-undo-tree-mode)
|
2020-07-30 23:02:28 +02:00
|
|
|
|
|
|
|
|
|
;;;; 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)))
|
|
|
|
|
|
2021-05-11 09:31:13 +02:00
|
|
|
|
(setq frame-title-format
|
|
|
|
|
(list (format "%s %%S: %%j " (system-name))
|
|
|
|
|
'(buffer-file-name "%f" (dired-directory dired-directory "%b"))))
|
|
|
|
|
|
|
|
|
|
(use-package better-defaults)
|
|
|
|
|
|
2020-07-30 23:02:28 +02:00
|
|
|
|
(provide 'jenga-init)
|