1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00

feat(emacs): added helpful ui components

This commit is contained in:
Ryan Kes 2021-05-04 20:40:43 +02:00
parent f3e3e0dcf3
commit 956f41655d

View File

@ -60,10 +60,16 @@
(setq visible-bell t) (setq visible-bell t)
#+end_src #+end_src
Enable line numbers and customize their format.
#+begin_src emacs-lisp
(column-number-mode)
(global-display-line-numbers-mode t)
#+end_src
** Theme ** Theme
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package zenburn-theme) (use-package doom-themes)
(load-theme 'zenburn t) (load-theme 'doom-molokai t)
#+end_src #+end_src
** Font ** Font
@ -81,7 +87,7 @@
* Keyboard Bindings * Keyboard Bindings
** Escape Cancels All ** Escape Cancels All
#+begin_src emacs_lisp #+begin_src emacs-lisp
(global-set-key (kbd "<escape>") 'keyboard-escape-quit) (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
#+end_src #+end_src
@ -111,7 +117,16 @@ Evil Collection is also installed since it adds 'evil' bindings to parts of Emac
(general-evil-setup t)) (general-evil-setup t))
#+end_src #+end_src
** Keybinding Panel (which-key)
[[https://github.com/justbur/emacs-which-key][which-key]] shows an overview of what keybindings are available based on the prefix keys you entered.
#+begin_src emacs-lisp
(use-package which-key
:init (which-key-mode)
:config(setq which-key-idle-delay 0.3))
#+end_src
* Ivy * Ivy
** General
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package ivy (use-package ivy
:diminish :diminish
@ -131,3 +146,56 @@ Evil Collection is also installed since it adds 'evil' bindings to parts of Emac
:init :init
(ivy-mode 1)) ;; Load keybindings (ivy-mode 1)) ;; Load keybindings
#+end_src #+end_src
** Ivy-rich
[[https://github.com/Yevgnen/ivy-rich][ivy-rich]] comes with rich transformers for commands from ~ivy~ and ~counsel~.
#+begin_src emacs-lisp
(use-package ivy-rich
:after counsel
:init
(ivy-rich-mode 1))
#+end_src
** Counsel
~ivy-mode~ ensures that any Emacs command using ~completing-read-function~ uses ivy for completion.
Counsel takes this further, providing versions of common Emacs commands that are customised to make the best use of Ivy. For example, ~counsel-find-file~ has some additional keybindings. Pressing ~DEL~ will move you to the parent directory.
#+begin_src emacs-lisp
(use-package counsel
:demand t
:bind (("M-x" . counsel-M-x)
("C-x b" . counsel-ibuffer)
("C-x C-f" . counsel-find-file)
;; ("C-M-j" . counsel-switch-buffer)
("C-M-l" . counsel-imenu)
:map minibuffer-local-map
("C-r" . 'counsel-minibuffer-history))
:custom
(counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only)
:config
(setq ivy-initial-inputs-alist nil)) ;; Don't start searches with ^
#+end_src
* Development
** Languages
*** Emacs Lisp
**** Helpful
[[https://github.com/Wilfred/helpful][Helpful]] is an alternative to the built-in Emacs help that provides much more contextual information.
#+begin_src emacs-lisp
(use-package helpful
:custom
(counsel-describe-function-function #'helpful-callable)
(counsel-describe-variable-function #'helpful-variable)
:bind
([remap describe-function] . helpful-function)
([remap describe-symbol] . helpful-symbol)
([remap describe-variable] . helpful-variable)
([remap describe-command] . helpful-command)
([remap describe-key] . helpful-key))
#+end_src
** Productivity
*** Rainbow Delimiters
#+begin_src emacs-lisp
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
#+end_src