Move to global-mode-string

This commit is contained in:
Eric Dallo 2020-06-05 21:42:36 -03:00
parent 7ddfb6271d
commit c224e2e771
No known key found for this signature in database
GPG key ID: 985DD2B6664886B8
3 changed files with 41 additions and 44 deletions

View file

@ -485,44 +485,6 @@ lines are selected, or the NxM dimensions of a block selection.")
(add-hook 'deactivate-mark-hook #'+modeline-remove-selection-segment-h))
;;; `+modeline-repl'
(progn
(def-modeline-var! +modeline-repl nil
"Display REPL connection status icon."
:local t)
(add-hook! '(cider-connected-hook
cider-disconnected-hook
cider-mode-hook)
(defun +modeline-repl-cider-update ()
"Update repl connection to cider connection state."
(let* ((connected (cider-connected-p))
(face (if connected 'success 'warning))
(label (if connected "Cider connected" "Cider disconnected")))
(setq +modeline-repl
(+modeline-format-icon 'faicon "terminal" "" face label -0.0575))))))
;;; `+modeline-lsp'
(progn
(def-modeline-var! +modeline-lsp nil
"Display LSP connection status icon for the current buffer."
:local t)
(add-hook! '(lsp-before-initialize-hook
lsp-after-initialize-hook
lsp-after-uninitialized-functions
lsp-before-open-hook
lsp-after-open-hook)
(defun +modeline-lsp-update (&rest _)
"Update lsp state."
(let* ((workspaces (lsp-workspaces))
(face (if workspaces 'success 'warning))
(label (if workspaces "LSP Connected" "LSP Disconnected")))
(setq +modeline-lsp
(+modeline-format-icon 'faicon "rocket" "" face label -0.0575))))))
;;; `+modeline-encoding'
(def-modeline-var! +modeline-encoding
`(:eval
@ -555,11 +517,6 @@ lines are selected, or the NxM dimensions of a block selection.")
+modeline-position)
`(""
mode-line-misc-info
" "
+modeline-repl
" "
+modeline-lsp
" "
+modeline-modes
(vc-mode (" "
,(all-the-icons-octicon "git-branch" :v-adjust 0.0)