-straight and ~formatting

This commit is contained in:
dx
2020-06-27 11:05:08 +01:00
parent cc732e8ee7
commit 5caab1de5d

View File

@@ -1,42 +1,42 @@
(setq user-emacs-directory (expand-file-name "~/.config/emacs/")) ;;; init.el -- My custom emacs config
(setq straight-use-package-by-default t) ;;; Commentary:
;;; Simple Emacs config that uses org-babel to execute org files which contain a literate config
;;; Code:
(defvar bootstrap-version) (require 'package)
(let ((bootstrap-file (add-to-list 'package-archives (cons "melpa" "https://melpa.org/packages/") t)
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (package-initialize)
(bootstrap-version 5)) (unless (fboundp 'use-package)
(unless (file-exists-p bootstrap-file) (package-install 'use-package))
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package) (setq user-emacs-directory (expand-file-name "~/.config/emacs/")
(setq ring-bell-function 'ignore) ring-bell-function 'ignore
inhibit-startup-screen t)
(tool-bar-mode -1) (tool-bar-mode -1)
(scroll-bar-mode -1) (scroll-bar-mode -1)
(tab-bar-mode -1) (tab-bar-mode -1)
(add-hook 'prog-mode-hook #'hs-minor-mode)
(load-theme 'tango-dark) (load-theme 'tango-dark)
(add-hook 'prog-mode-hook #'hs-minor-mode)
(use-package evil (use-package evil
:ensure t
:config :config
(evil-mode +1)) (evil-mode +1))
(use-package evil-surround (use-package evil-surround
:ensure t
:after (evil) :after (evil)
:config :config
(evil-surround-mode +1)) (evil-surround-mode +1))
(use-package which-key (use-package which-key
:ensure t
:config :config
(which-key-mode +1)) (which-key-mode +1))
(use-package general (use-package general
:ensure t
:config :config
(general-create-definer leader (general-create-definer leader
:prefix "SPC" :prefix "SPC"
@@ -53,55 +53,57 @@
"M-s" #'occur) "M-s" #'occur)
(leader (leader
"!" #'async-shell-command "!" #'async-shell-command
"f" '(:ignore t :wk "File") "f" '(:ignore t :wk "File")
"s" '(:ignore t :wk "Search") "s" '(:ignore t :wk "Search")
"b" '(:ignore t :wk "Buffer")) "b" '(:ignore t :wk "Buffer"))
(general-def (general-def
:states 'visual :states 'visual
"gr" #'eval-region) "gr" #'eval-region)
(leader (leader
:infix "b" :infix "b"
"n" #'next-buffer "n" #'next-buffer
"p" #'previous-buffer "p" #'previous-buffer
"b" #'counsel-switch-buffer "b" #'counsel-switch-buffer
"i" #'ibuffer) "i" #'ibuffer)
(leader (leader
:infix "o" :infix "o"
"-" #'dired) "-" #'dired)
(leader (leader
:infix "f" :infix "f"
"s" #'save-buffer "s" #'save-buffer
"f" #'find-file "f" #'find-file
"p" #'((lambda () (interactive) (find-file "~/.config/emacs/init.el")) "p" #'((lambda () (interactive) (find-file "~/.config/emacs/init.el"))
:wk "Open init.el"))) :wk "Open init.el")))
(use-package counsel (use-package counsel
:ensure t
:general :general
(leader (leader
"SPC" #'counsel-M-x) "SPC" #'counsel-M-x)
(leader (leader
:infix "s" :infix "s"
"s" #'(swiper :wk "Search buffer") "s" #'(swiper :wk "Search buffer")
"r" #'(counsel-rg :wk "Ripgrep")) "r" #'(counsel-rg :wk "Ripgrep"))
(general-def (general-def
:keymaps 'ivy-mode-map :keymaps 'ivy-minibuffer-map
"C-j" #'ivy-next-line-or-history "C-j" #'ivy-next-line-or-history
"C-k" #'ivy-previous-line-or-history) "C-k" #'ivy-previous-line-or-history)
:init :init
(counsel-mode +1)) (counsel-mode +1))
(use-package org) (use-package org :ensure t)
(use-package magit) (use-package magit :ensure t)
(use-package evil-magit) (use-package evil-magit :ensure t)
(use-package telephone-line (use-package telephone-line
:ensure t
:hook (after-init . telephone-line-mode) :hook (after-init . telephone-line-mode)
:init :init
; Faces ; Faces
@@ -112,17 +114,17 @@
;; Set telephone line faces ;; Set telephone line faces
(setq telephone-line-faces (setq telephone-line-faces
'((evil . (my-evil-dark . my-evil-dark)) '((evil . (my-evil-dark . my-evil-dark))
(modal . telephone-line-modal-face) (modal . telephone-line-modal-face)
(ryo . telephone-line-ryo-modal-face) (ryo . telephone-line-ryo-modal-face)
(accent . (my-accent-dark . telephone-line-accent-inactive)) (accent . (my-accent-dark . telephone-line-accent-inactive))
(nil mode-line . mode-line-inactive))) (nil mode-line . mode-line-inactive)))
; Seperators ; Seperators
(setq telephone-line-primary-left-separator 'telephone-line-abs-left (setq telephone-line-primary-left-separator 'telephone-line-abs-left
telephone-line-secondary-left-separator 'telephone-line-identity-hollow-left telephone-line-secondary-left-separator 'telephone-line-identity-hollow-left
telephone-line-primary-right-separator 'telephone-line-abs-right telephone-line-primary-right-separator 'telephone-line-abs-right
telephone-line-secondary-right-separator 'telephone-line-identity-hollow-right) telephone-line-secondary-right-separator 'telephone-line-identity-hollow-right)
; LSP segment ; LSP segment
(telephone-line-defsegment +oreoline-lsp-segment () (telephone-line-defsegment +oreoline-lsp-segment ()
@@ -132,22 +134,22 @@
; LHS ; LHS
(setq telephone-line-lhs (setq telephone-line-lhs
'((evil . (telephone-line-evil-tag-segment '((evil . (telephone-line-evil-tag-segment
telephone-line-buffer-modified-segment)) telephone-line-buffer-modified-segment))
(accent . (telephone-line-vc-segment (accent . (telephone-line-vc-segment
telephone-line-filesize-segment telephone-line-filesize-segment
telephone-line-buffer-name-segment telephone-line-buffer-name-segment
telephone-line-erc-modified-channels-segment telephone-line-erc-modified-channels-segment
telephone-line-process-segment)) telephone-line-process-segment))
(nil . ()))) (nil . ())))
; RHS ; RHS
(setq telephone-line-rhs (setq telephone-line-rhs
'((nil . (telephone-line-misc-info-segment)) '((nil . (telephone-line-misc-info-segment))
(accent . (telephone-line-major-mode-segment (accent . (telephone-line-major-mode-segment
+oreoline-lsp-segment +oreoline-lsp-segment
telephone-line-flycheck-segment)) telephone-line-flycheck-segment))
(evil . (telephone-line-airline-position-segment)))) (evil . (telephone-line-airline-position-segment))))
(telephone-line-mode +1) (telephone-line-mode +1)
:config :config
(size-indication-mode +1)) (size-indication-mode +1))