From 224b9d9759d6987dec4b393ce233b0fe34364e53 Mon Sep 17 00:00:00 2001 From: dx Date: Sun, 17 May 2020 09:27:53 +0100 Subject: +straight and telephone line to custom emacs --- Emacs/.config/emacs/init.el | 112 ++++++++++++++++++++++++++++++-------------- 1 file changed, 78 insertions(+), 34 deletions(-) (limited to 'Emacs/.config') diff --git a/Emacs/.config/emacs/init.el b/Emacs/.config/emacs/init.el index 77163f9..c8291fd 100644 --- a/Emacs/.config/emacs/init.el +++ b/Emacs/.config/emacs/init.el @@ -1,35 +1,42 @@ -(require 'package) -(add-to-list 'package-archives (cons "melpa" "https://melpa.org/packages/") t) - -(package-initialize) -(package-install 'use-package) +(setq straight-use-package-by-default t) +(defvar bootstrap-version) +(let ((bootstrap-file + (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) + (bootstrap-version 5)) + (unless (file-exists-p bootstrap-file) + (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 ring-bell-function 'ignore) +(tool-bar-mode -1) (load-theme 'tango-dark) (use-package evil - :ensure t :config (evil-mode +1)) (use-package evil-surround - :ensure t :after (evil) :config (evil-surround-mode +1)) (use-package which-key - :ensure t :config (which-key-mode +1)) (use-package general - :ensure t :config (general-create-definer leader :prefix "SPC" :states 'normal :keymaps 'override) + (general-create-definer localleader :prefix "," :states 'normal @@ -49,7 +56,9 @@ :infix "b" "n" #'next-buffer "p" #'prev-buffer - "b" #') + "b" #'counsel-switch-buffer + "i" #'ibuffer) + (leader :infix "f" @@ -59,7 +68,6 @@ :wk "Open init.el"))) (use-package counsel - :ensure t :general (leader "SPC" #'counsel-M-x) @@ -67,29 +75,65 @@ :infix "s" "s" #'(swiper :wk "Search buffer") "r" #'(counsel-rg :wk "Ripgrep")) + (general-def + :keymaps 'ivy-mode-map + "C-j" #'ivy-next-line-or-history + "C-k" #'ivy-previous-line-or-history) :config (counsel-mode +1)) -(use-package org - :ensure t) - -(use-package evil-magit - :ensure t - :defer t) - -(use-package magit - :ensure t) - -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(package-selected-packages - '(evil-surround which-key counsel swiper general 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. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - ) +(use-package org) + +(use-package magit) + +(use-package evil-magit) + +(use-package telephone-line + :hook (after-init . telephone-line-mode) + :init + ; Faces + (defface my-accent-dark '((t (:foreground "Black" :background "Cadet Blue"))) "") + (defface my-evil-dark '((t (:foreground "White" :background "Black"))) "") + (defface my-accent-light '((t (:foreground "black" :background "Light Slate Grey"))) "") + (defface my-evil-light '((t (:foreground "black" :background "Sky Blue"))) "") + + ;; Set telephone line faces + (setq telephone-line-faces + '((evil . (my-evil-dark . my-evil-dark)) + (modal . telephone-line-modal-face) + (ryo . telephone-line-ryo-modal-face) + (accent . (my-accent-dark . telephone-line-accent-inactive)) + (nil mode-line . mode-line-inactive))) + + ; Seperators + (setq telephone-line-primary-left-separator 'telephone-line-abs-left + telephone-line-secondary-left-separator 'telephone-line-identity-hollow-left + telephone-line-primary-right-separator 'telephone-line-abs-right + telephone-line-secondary-right-separator 'telephone-line-identity-hollow-right) + + ; LSP segment + (telephone-line-defsegment +oreoline-lsp-segment () + (if (bound-and-true-p lsp-mode) + (propertize "") + (propertize ""))) + + ; LHS + (setq telephone-line-lhs + '((evil . (telephone-line-evil-tag-segment + telephone-line-buffer-modified-segment)) + (accent . (telephone-line-vc-segment + telephone-line-filesize-segment + telephone-line-buffer-name-segment + telephone-line-erc-modified-channels-segment + telephone-line-process-segment)) + (nil . ()))) + + ; RHS + (setq telephone-line-rhs + '((nil . (telephone-line-misc-info-segment)) + (accent . (telephone-line-major-mode-segment + +oreoline-lsp-segment + telephone-line-flycheck-segment)) + (evil . (telephone-line-airline-position-segment)))) + :config + (size-indication-mode +1)) -- cgit v1.2.3-13-gbd6f