+straight and telephone line to custom emacs

This commit is contained in:
dx
2020-05-17 09:27:53 +01:00
parent 546e3b1804
commit 224b9d9759
2 changed files with 77 additions and 31 deletions

2
.gitignore vendored
View File

@@ -2,3 +2,5 @@ TAGS
Doom/.doom.d/bin/*.el Doom/.doom.d/bin/*.el
mpd/* mpd/*
ncmpcpp/* ncmpcpp/*
Emacs/.config/emacs/transient/*
Emacs/.config/emacs/straight/*

View File

@@ -1,35 +1,42 @@
(require 'package) (setq straight-use-package-by-default t)
(add-to-list 'package-archives (cons "melpa" "https://melpa.org/packages/") t) (defvar bootstrap-version)
(let ((bootstrap-file
(package-initialize) (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(package-install 'use-package) (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) (setq ring-bell-function 'ignore)
(tool-bar-mode -1)
(load-theme 'tango-dark) (load-theme 'tango-dark)
(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"
:states 'normal :states 'normal
:keymaps 'override) :keymaps 'override)
(general-create-definer localleader (general-create-definer localleader
:prefix "," :prefix ","
:states 'normal :states 'normal
@@ -49,7 +56,9 @@
:infix "b" :infix "b"
"n" #'next-buffer "n" #'next-buffer
"p" #'prev-buffer "p" #'prev-buffer
"b" #') "b" #'counsel-switch-buffer
"i" #'ibuffer)
(leader (leader
:infix "f" :infix "f"
@@ -59,7 +68,6 @@
: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)
@@ -67,29 +75,65 @@
: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
:keymaps 'ivy-mode-map
"C-j" #'ivy-next-line-or-history
"C-k" #'ivy-previous-line-or-history)
:config :config
(counsel-mode +1)) (counsel-mode +1))
(use-package org (use-package org)
:ensure t)
(use-package evil-magit (use-package magit)
:ensure t
:defer t)
(use-package magit (use-package evil-magit)
:ensure t)
(custom-set-variables (use-package telephone-line
;; custom-set-variables was added by Custom. :hook (after-init . telephone-line-mode)
;; If you edit it by hand, you could mess it up, so be careful. :init
;; Your init file should contain only one such instance. ; Faces
;; If there is more than one, they won't work right. (defface my-accent-dark '((t (:foreground "Black" :background "Cadet Blue"))) "")
'(package-selected-packages (defface my-evil-dark '((t (:foreground "White" :background "Black"))) "")
'(evil-surround which-key counsel swiper general use-package))) (defface my-accent-light '((t (:foreground "black" :background "Light Slate Grey"))) "")
(custom-set-faces (defface my-evil-light '((t (:foreground "black" :background "Sky Blue"))) "")
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; Set telephone line faces
;; Your init file should contain only one such instance. (setq telephone-line-faces
;; If there is more than one, they won't work right. '((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))