88 lines
2.2 KiB
EmacsLisp
88 lines
2.2 KiB
EmacsLisp
;;;; Appearance
|
|
|
|
(defun apply-appearance ()
|
|
;; Set theme
|
|
(load-theme 'my-theme +1)
|
|
;; Hide GTK scroll bar
|
|
(toggle-scroll-bar -1))
|
|
|
|
(apply-appearance)
|
|
(add-hook 'after-make-frame-functions
|
|
(lambda (frame)
|
|
(with-selected-frame frame
|
|
(apply-appearance))))
|
|
|
|
;; Hide ribbon, menu bar
|
|
(menu-bar-mode -1)
|
|
(tool-bar-mode -1)
|
|
|
|
;; Show colum number in status bar
|
|
(column-number-mode +1)
|
|
|
|
;; Show line numbers
|
|
(global-display-line-numbers-mode +1)
|
|
|
|
;; Highlight current line
|
|
(global-hl-line-mode +1)
|
|
|
|
;; Replace yes/no prompts with y/n prompts
|
|
(fset #'yes-or-no-p #'y-or-n-p)
|
|
|
|
;; Fix jumpy scrolling
|
|
(setq mouse-wheel-scroll-amount '(3 ((shift) . 1))
|
|
mouse-wheel-progressive-speed nil
|
|
mouse-wheel-follow-mouse +1
|
|
scroll-step 1) ;; C-n C-p scroll step
|
|
|
|
;;;; Tabs
|
|
(setq custom-tab-width 2)
|
|
|
|
(defun disable-tabs ()
|
|
(indent-tabs-mode -1))
|
|
(defun enable-tabs ()
|
|
(local-set-key (kbd "TAB") 'tab-to-tab-stop)
|
|
(indent-tabs-mode +1)
|
|
(setq tab-width custom-tab-width))
|
|
|
|
(add-hook 'prog-mode-hook 'enable-tabs)
|
|
(add-hook 'lisp-mode-hook 'disable-tabs)
|
|
(add-hook 'emacs-lisp-mode-hook 'disable-tabs)
|
|
|
|
;;;; Packages (straight.el)
|
|
|
|
(defvar bootstrap-version)
|
|
(let ((bootstrap-file
|
|
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
|
(bootstrap-version 6))
|
|
(unless (file-exists-p bootstrap-file)
|
|
(with-current-buffer
|
|
(url-retrieve-synchronously
|
|
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
|
'silent 'inhibit-cookies)
|
|
(goto-char (point-max))
|
|
(eval-print-last-sexp)))
|
|
(load bootstrap-file nil 'nomessage))
|
|
|
|
;; Use-Package
|
|
(straight-use-package 'use-package)
|
|
(setq straight-use-package-by-default t)
|
|
|
|
;; Avy (jump to char)
|
|
(use-package avy
|
|
:bind (("C-;" . avy-goto-char)
|
|
("C-:" . avy-goto-word-1)
|
|
("M-g g" . avy-goto-line)))
|
|
|
|
;; Magit (git frontend)
|
|
(use-package magit)
|
|
|
|
;; Rainbow-Mode (show hex strings in color)
|
|
(use-package rainbow-mode)
|
|
|
|
;; Evil (Vim Emulation)
|
|
(use-package evil)
|
|
(setq evil-move-beyond-eol t)
|
|
(setq evil-want-fine-undo t) ;; multi step undo in insert mode
|
|
(add-hook 'prog-mode-hook (lambda () (evil-mode +1)))
|
|
(add-hook 'change-major-mode-hook (lambda () (evil-mode -1)))
|