Documentation
This commit is contained in:
parent
b6c876a2c5
commit
2049a07e59
268
config.org
268
config.org
|
|
@ -6,22 +6,32 @@ Welcome to my Emacs configuration!
|
||||||
* Config
|
* Config
|
||||||
** Appearance
|
** Appearance
|
||||||
*** Remove Tool Bar
|
*** Remove Tool Bar
|
||||||
|
Remove the Tool bar at the top for more room.
|
||||||
|
Set mode to false:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(tool-bar-mode -1)
|
(tool-bar-mode -1)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Remove Menu Bar
|
*** Remove Menu Bar
|
||||||
|
Remove the Menu Bar at the top for more room.
|
||||||
|
Set mode to false:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(menu-bar-mode -1)
|
(menu-bar-mode -1)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Remove Scroll Bar
|
*** Remove Scroll Bar
|
||||||
|
Remove the Scroll Bar at the side for more room.
|
||||||
|
Set mode to false:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(scroll-bar-mode -1)
|
(scroll-bar-mode -1)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Display Line Numbers
|
*** Display Line Numbers
|
||||||
|
Display line numbers for all Programming Modes.
|
||||||
|
Add hook to enable display-line-numbers-mode on all programming major modes:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
|
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Modern Fringes
|
*** Modern Fringes
|
||||||
|
Modern Fringes is a package that makes the side fringes of Emacs much more cleaner and modern.
|
||||||
|
Install the package, enable it and ensure that it always is installed:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package modern-fringes
|
(use-package modern-fringes
|
||||||
:ensure t
|
:ensure t
|
||||||
|
|
@ -29,6 +39,8 @@ Welcome to my Emacs configuration!
|
||||||
(modern-fringes-invert-arrows))
|
(modern-fringes-invert-arrows))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Theming
|
*** Theming
|
||||||
|
The theme for Emacs.
|
||||||
|
Install and set the theme, ensuring that it is always installed:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package dracula-theme
|
(use-package dracula-theme
|
||||||
:ensure t
|
:ensure t
|
||||||
|
|
@ -36,12 +48,15 @@ Welcome to my Emacs configuration!
|
||||||
(load-theme 'dracula t))
|
(load-theme 'dracula t))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** All The Icons
|
*** All The Icons
|
||||||
|
All The Icons is a package to display cool icons within Emacs.
|
||||||
|
Install the package, enable it and ensure that it always is installed:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package all-the-icons
|
(use-package all-the-icons
|
||||||
:ensure t)
|
:ensure t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
All The Icons for Ivy/Counsel
|
All The Icons Support for Ivy/Counsel. Which are autocompletion tools in emacs
|
||||||
|
Install the package, enable it and ensure that it always is installed:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package all-the-icons-ivy
|
(use-package all-the-icons-ivy
|
||||||
:ensure t
|
:ensure t
|
||||||
|
|
@ -50,6 +65,8 @@ All The Icons for Ivy/Counsel
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Mode Line
|
*** Mode Line
|
||||||
**** Spaceline
|
**** Spaceline
|
||||||
|
Spaceline is the modeline of Spacemacs.
|
||||||
|
Install the package, enable it and ensure that it always is installed. Then make sure that the default spaceline config is enabled and that the seperators are arrows, for a powerline effect:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package spaceline
|
(use-package spaceline
|
||||||
:ensure t
|
:ensure t
|
||||||
|
|
@ -59,19 +76,21 @@ All The Icons for Ivy/Counsel
|
||||||
(spaceline-spacemacs-theme))
|
(spaceline-spacemacs-theme))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Display the time on the Mode Line, this is more useful for EXWM.
|
Display the time on the Mode Line, this is more useful for EXWM:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq display-time-default-load-average nil)
|
(setq display-time-default-load-average nil)
|
||||||
(display-time-mode t)
|
(display-time-mode t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
**** Diminish
|
**** Diminish
|
||||||
With Diminish you can optionally remove some of the names of the modes in the Mode Line.
|
With Diminish you can optionally remove some of the names of the minor modes in the Mode Line.
|
||||||
|
Install the package, enable it and ensure that it always is installed:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package diminish
|
(use-package diminish
|
||||||
:ensure t)
|
:ensure t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Emacs Dashboard
|
*** Emacs Dashboard
|
||||||
Install the Emacs Dashboard :
|
A startup dashboard for Emacs, replacing the boring old one.
|
||||||
|
Install the package, enable it and ensure that it always is installed:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package dashboard
|
(use-package dashboard
|
||||||
:ensure t
|
:ensure t
|
||||||
|
|
@ -80,7 +99,8 @@ Install the Emacs Dashboard :
|
||||||
|
|
||||||
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
|
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
Emacs Dashboard Config :
|
|
||||||
|
**** Emacs Dashboard Configuration
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
;; Set the title
|
;; Set the title
|
||||||
(setq dashboard-banner-logo-title "Welcome to Bloxie's Emacs!")
|
(setq dashboard-banner-logo-title "Welcome to Bloxie's Emacs!")
|
||||||
|
|
@ -136,27 +156,10 @@ Emacs Dashboard Config :
|
||||||
("?" "" "?/h" #'show-help nil "<" ">"))
|
("?" "" "?/h" #'show-help nil "<" ">"))
|
||||||
))
|
))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Dynamic Window Tiling
|
|
||||||
*** Edwina
|
|
||||||
Edwina is a dynamic window manager for Emacs.
|
|
||||||
It automatically arranges your Emacs panes (called “windows” in Emacs parlance) into predefined layouts, dwm-style.
|
|
||||||
+BEGIN_SRC emacs-lisp
|
|
||||||
(use-package edwina
|
|
||||||
:ensure t
|
|
||||||
:config
|
|
||||||
(setq display-buffer-base-action '(display-buffer-below-selected))
|
|
||||||
(edwina-setup-dwm-keys)
|
|
||||||
(edwina-mode 1))
|
|
||||||
+END_SRC
|
|
||||||
*** Golden Ratio
|
|
||||||
+BEGIN_SRC emacs-lisp
|
|
||||||
(use-package golden-ratio
|
|
||||||
:ensure t
|
|
||||||
:init
|
|
||||||
(golden-ratio-mode 1))
|
|
||||||
+END_SRC
|
|
||||||
** Custom
|
** Custom
|
||||||
*** Resizing Buffers
|
*** Resizing Buffers
|
||||||
|
These are controls to resize the width and height of windows.
|
||||||
|
Set keys:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(global-set-key (kbd "<C-up>") 'shrink-window)
|
(global-set-key (kbd "<C-up>") 'shrink-window)
|
||||||
(global-set-key (kbd "<C-down>") 'enlarge-window)
|
(global-set-key (kbd "<C-down>") 'enlarge-window)
|
||||||
|
|
@ -164,6 +167,8 @@ It automatically arranges your Emacs panes (called “windows” in Emacs parlan
|
||||||
(global-set-key (kbd "<C-right>") 'enlarge-window-horizontally)
|
(global-set-key (kbd "<C-right>") 'enlarge-window-horizontally)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Fullscreen Function
|
*** Fullscreen Function
|
||||||
|
Emacs does not begin fullscreen,
|
||||||
|
this function will automatically fullscreen Emacs on startup:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defun fullscreen (&optional f)
|
(defun fullscreen (&optional f)
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|
@ -177,15 +182,64 @@ Call Function on Startup
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(fullscreen)
|
(fullscreen)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Evil Mode
|
** Autosave
|
||||||
|
Default Emacs will store backup and "temporary" files in the edited files directory, instead this changes it to move it to the UNIX Temporary Directory.
|
||||||
|
Set backup/temporary file directories:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package evil
|
(setq backup-directory-alist
|
||||||
:ensure t
|
`((".*" . ,temporary-file-directory)))
|
||||||
:init
|
(setq auto-save-file-name-transforms
|
||||||
(evil-mode 1))
|
`((".*" ,temporary-file-directory t)))
|
||||||
|
#+END_SRC
|
||||||
|
** Wind Move
|
||||||
|
Windmove is built into Emacs. It lets you move point from window to window using Shift and the arrow keys. This is easier to type than ‘C-x o’ when there are multiple windows open.
|
||||||
|
Enable Wind Move:
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(when (fboundp 'windmove-default-keybindings)
|
||||||
|
(windmove-default-keybindings))
|
||||||
|
#+END_SRC
|
||||||
|
** Global Revert Mode
|
||||||
|
Global Revert Mode is a minor mode that automatically refreshes opened buffers when an external tool has changed their data.
|
||||||
|
Enable Global Revert Mode:
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(global-auto-revert-mode t)
|
||||||
|
#+END_SRC
|
||||||
|
** Rainbow Delimiters
|
||||||
|
This Minor Mode will mark pairs of brackets with colours.
|
||||||
|
Install the package, enable it and ensure that it always is installed.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package rainbow-delimiters
|
||||||
|
:ensure t)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
Set Minor Mode as Global :
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(define-globalized-minor-mode global-rainbow-delimiters-mode rainbow-delimiters-mode
|
||||||
|
(lambda () (rainbow-delimiters-mode 1)))
|
||||||
|
|
||||||
|
(global-rainbow-delimiters-mode 1)
|
||||||
|
#+END_SRC
|
||||||
|
** Rainbow Mode
|
||||||
|
This Minor Mode will highlight RGB/HEX values with their respective colours.
|
||||||
|
Install the package, enable it and ensure that it always is installed.
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package rainbow-mode
|
||||||
|
:ensure t)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
Set Minor Mode as Global :
|
||||||
|
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(define-globalized-minor-mode global-rainbow-mode rainbow-mode
|
||||||
|
(lambda () (rainbow-mode 1)))
|
||||||
|
|
||||||
|
(global-rainbow-mode 1)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Org Mode
|
** Org Mode
|
||||||
*** Simple Org Mode Preview in HTML
|
*** Simple Org Mode Preview
|
||||||
|
These are a simple set of functions that will automatically refresh the other buffer, which presumably has the Org Mode PDF open.
|
||||||
|
This workflow expects you to have 2 window panes open, which can be in any orientation. The Org Mode File you are editing, and the PDF Document to view the changes you are making.
|
||||||
|
Define functions and set keybindings:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defun update-other-buffer ()
|
(defun update-other-buffer ()
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|
@ -211,6 +265,10 @@ Call Function on Startup
|
||||||
(define-key org-mode-map (kbd "C-c rb") 'org-compile-beamer-and-update-other-buffer)
|
(define-key org-mode-map (kbd "C-c rb") 'org-compile-beamer-and-update-other-buffer)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** LateX Preview
|
*** LateX Preview
|
||||||
|
This package will automatically convert LaTeX Snippets into viewable LaTeX in your Org Mode Documents.
|
||||||
|
LaTeX Snippets can be defined with text between dollar signs. Example : $ax+bx^2$
|
||||||
|
These LaTeX snippets will also show up when converting to PDF.
|
||||||
|
Install the package, enable it and ensure that it always is installed:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package org-fragtog
|
(use-package org-fragtog
|
||||||
:ensure t
|
:ensure t
|
||||||
|
|
@ -218,6 +276,8 @@ Call Function on Startup
|
||||||
(add-hook 'org-mode-hook 'org-fragtog-mode))
|
(add-hook 'org-mode-hook 'org-fragtog-mode))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Org Bullets
|
*** Org Bullets
|
||||||
|
Org Bullets convert the Asterisks of Org Mode headers into unicode Bullet point with multiple styles.
|
||||||
|
Install the package, enable it and ensure that it always is installed, then add a hook to enable the Bullet Points when on Org Major Mode:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package org-bullets
|
(use-package org-bullets
|
||||||
:ensure t
|
:ensure t
|
||||||
|
|
@ -225,24 +285,41 @@ Call Function on Startup
|
||||||
(add-hook 'org-mode-hook (lambda () (org-bullets-mode))))
|
(add-hook 'org-mode-hook (lambda () (org-bullets-mode))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Enable Indent Mode
|
*** Enable Indent Mode
|
||||||
|
A hook that will autmatically make sure that indenting of headers are enabled by default, this is visually useful and emulates code hierarchy.
|
||||||
|
Install the package, enable it and ensure that it always is installed, then add a hook to enable the Indentation when on Org Major Mode:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(add-hook 'org-mode-hook 'org-indent-mode)
|
(add-hook 'org-mode-hook 'org-indent-mode)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Enable Beamer Support
|
*** Enable Beamer Support
|
||||||
|
A hook that will automatically make sure that Beamer Org Mode templates and exportion are enabled by default, for slideshow creation with LaTeX.
|
||||||
|
Install the package, enable it and ensure that it always is installed, then add a hook to enable the Beamer Mode when on Org Major Mode:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(add-hook 'org-mode-hook 'org-beamer-mode)
|
(add-hook 'org-mode-hook 'org-beamer-mode)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Agenda
|
** Agenda
|
||||||
Set Agenda Directory :
|
For Org-Agenda, you can set a location of your Org Agenda file here.
|
||||||
|
Set Agenda Directory:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq org-agenda-files (quote("~/.emacs.d/agenda.org")))
|
(setq org-agenda-files (quote("~/.emacs.d/agenda.org")))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
Calendar/Diary integration :
|
|
||||||
|
This is will integrate the Calendar/Diary into Org-Agenda, so you can get access to dates on public holidays etc.
|
||||||
|
Set diary to true:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq org-agenda-include-diary t)
|
(setq org-agenda-include-diary t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
** Evil Mode
|
||||||
|
Evil Mode, a package designed to emulate modal editing and vim keybindings in Emacs.
|
||||||
|
Install the package, enable it and ensure that it always is installed, and then make sure that evil-mode is enabled by default:
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package evil
|
||||||
|
:ensure t
|
||||||
|
:init
|
||||||
|
(evil-mode 1))
|
||||||
|
#+END_SRC
|
||||||
** Projectile
|
** Projectile
|
||||||
Install Projectile:
|
Projectile is a project manager, like a dynamic bookmarking system. It will automatically add repositories as projects which you can access via Dired or Ivy completion.
|
||||||
|
Install the package, enable it and ensure that it always is installed, and then make sure that projectile-mode is enabled by default:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package projectile
|
(use-package projectile
|
||||||
:ensure t
|
:ensure t
|
||||||
|
|
@ -251,6 +328,8 @@ Install Projectile:
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Auto Completion
|
** Auto Completion
|
||||||
*** Ivy
|
*** Ivy
|
||||||
|
Ivy is an autocompletion framework, it will automatically fuzzy find search words for you. This includes file managing, searching, and more via its extensibility and the Counsel package.
|
||||||
|
Install the package, enable it and ensure that it always is installed, and then make sure that ivy-mode is enabled by default:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package ivy
|
(use-package ivy
|
||||||
:ensure t
|
:ensure t
|
||||||
|
|
@ -260,18 +339,22 @@ Install Projectile:
|
||||||
("C-s" . swiper))
|
("C-s" . swiper))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Ivy Configuration :
|
Ivy Configuration
|
||||||
|
Set an option to make Ivy show previously opened/edited buffers in the buffer selection :
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq ivy-use-virtual-buffers t)
|
(setq ivy-use-virtual-buffers t)
|
||||||
(setq enable-recursive-minibuffers t)
|
;(setq enable-recursive-minibuffers t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Counsel
|
*** Counsel
|
||||||
|
A collection of Ivy-enhanced versions of common Emacs commands.
|
||||||
|
Install the package, enable it and ensure that it always is installed:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package counsel
|
(use-package counsel
|
||||||
:ensure t)
|
:ensure t)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Counsel for Projectile
|
Counsel Support in Projectile.
|
||||||
|
Install the package, enable it and ensure that it always is installed, and then set up bindings for the Projectile specific prefix:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package counsel-projectile
|
(use-package counsel-projectile
|
||||||
:ensure t
|
:ensure t
|
||||||
|
|
@ -281,14 +364,16 @@ Counsel for Projectile
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Company
|
*** Company
|
||||||
**** Company Base
|
**** Company Base
|
||||||
|
Company is a text completion framework for Emacs. The name stands for "complete anything". It uses pluggable back-ends and front-ends to retrieve and display completion candidates.
|
||||||
|
Install the package, enable it and ensure that it always is installed, and then make sure that company-mode is enabled by default:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package company
|
(use-package company
|
||||||
:ensure t
|
:ensure t
|
||||||
:init
|
:init
|
||||||
(add-hook 'prog-mode-hook 'company-mode))
|
(company-mode))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Configuration :
|
***** Configuration
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
; No delay in showing suggestions.
|
; No delay in showing suggestions.
|
||||||
|
|
@ -306,6 +391,8 @@ Configuration :
|
||||||
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
**** Company Quickhelp
|
**** Company Quickhelp
|
||||||
|
Company Quickhelp is an extension to company which introduces documentation popups that appears when idling on a company completion candidate.
|
||||||
|
Install the package, enable it and ensure that it always is installed, and then make sure that company-quickhelp-mode is enabled by default:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package company-quickhelp
|
(use-package company-quickhelp
|
||||||
:ensure t
|
:ensure t
|
||||||
|
|
@ -313,14 +400,38 @@ Configuration :
|
||||||
(company-quickhelp-mode))
|
(company-quickhelp-mode))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
*** Which Key
|
*** Which Key
|
||||||
|
Which Key is an insanely useful package that will automatically show you the possible key combinations to finish a command.
|
||||||
|
Install the package, enable it and ensure that it always is installed, and then make sure that which-key is enabled by default:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
:ensure t
|
:ensure t
|
||||||
:init
|
:init
|
||||||
(which-key-mode))
|
(which-key-mode))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** LSP Mode
|
** Multiple Cursors
|
||||||
|
The Multiple Cursors package is pretty self explanatory; you can select and manipulate multiple lines of the same text at the same time; move the cursors in unison. Etc.
|
||||||
|
Install the package, enable it and ensure that it always is installed, and then bind the useful functions to a mnenomic key chord:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package multiple-cursors
|
||||||
|
:ensure t
|
||||||
|
:bind
|
||||||
|
("C-c m" . 'mc/mark-next-like-this)
|
||||||
|
:bind
|
||||||
|
("C-c C-m" . 'mc/mark-all-like-this))
|
||||||
|
#+END_SRC
|
||||||
|
** Expand Region
|
||||||
|
Auto selects a region of text/code, if executed multiple times it will wrap further, like layers of a binary onion.
|
||||||
|
Install the package, enable it and ensure that it always is installed, and then bind the useful functions to a mnenomic key chord:
|
||||||
|
#+BEGIN_SRC emacs-lisp
|
||||||
|
(use-package expand-region
|
||||||
|
:ensure t
|
||||||
|
:bind
|
||||||
|
("C-c e" . 'er/expand-region))
|
||||||
|
#+END_SRC
|
||||||
|
** LSP Mode
|
||||||
|
LSP mode will give you IDE capabilities in Emacs, using Microsoft's Universal Language Server Protocol. The same one that VSCode uses for linting, autocompletion. Etc.
|
||||||
|
Install the package, enable it and ensure that it always is installed, add a hook to make sure it only is activated on Programming Related Major Modes, and set a keychord for the custom prefix.
|
||||||
|
+BEGIN_SRC emacs-lisp
|
||||||
|
|
||||||
;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
|
;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
|
||||||
(setq lsp-keymap-prefix "s-l")
|
(setq lsp-keymap-prefix "s-l")
|
||||||
|
|
@ -332,7 +443,10 @@ Configuration :
|
||||||
;; if you want which-key integration
|
;; if you want which-key integration
|
||||||
(lsp-mode . lsp-enable-which-key-integration))
|
(lsp-mode . lsp-enable-which-key-integration))
|
||||||
:commands lsp)
|
:commands lsp)
|
||||||
|
+END_SRC
|
||||||
|
|
||||||
|
*** Configuration
|
||||||
|
+BEGIN_SRC emacs-lisp
|
||||||
;; optionally
|
;; optionally
|
||||||
(use-package lsp-ui :commands lsp-ui-mode
|
(use-package lsp-ui :commands lsp-ui-mode
|
||||||
:ensure t)
|
:ensure t)
|
||||||
|
|
@ -350,80 +464,4 @@ Configuration :
|
||||||
(use-package dap-mode
|
(use-package dap-mode
|
||||||
:ensure t)
|
:ensure t)
|
||||||
;; (use-package dap-LANGUAGE) to load the dap adapter for your language
|
;; (use-package dap-LANGUAGE) to load the dap adapter for your language
|
||||||
#+END_SRC
|
|
||||||
** Spell Correction
|
|
||||||
*** Flyspell Correct Ivy
|
|
||||||
+BEGIN_SRC emacs-lisp
|
|
||||||
(use-package flyspell-correct-ivy
|
|
||||||
:ensure t
|
|
||||||
:bind ("C-;" . flyspell-correct-wrapper)
|
|
||||||
:init
|
|
||||||
(setq flyspell-correct-interface #'flyspell-correct-ivy)
|
|
||||||
(add-hook 'org-mode-hook 'flyspell-mode)
|
|
||||||
(setq-default ispell-program-name "aspell"))
|
|
||||||
+END_SRC
|
+END_SRC
|
||||||
** Multiple Cursors
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(use-package multiple-cursors
|
|
||||||
:ensure t
|
|
||||||
:bind
|
|
||||||
("C-c m" . 'mc/mark-next-like-this)
|
|
||||||
:bind
|
|
||||||
("C-c C-m" . 'mc/mark-all-like-this))
|
|
||||||
#+END_SRC
|
|
||||||
** Expand Region
|
|
||||||
Auto selects a region of text/code.
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(use-package expand-region
|
|
||||||
:ensure t
|
|
||||||
:bind
|
|
||||||
("C-c e" . 'er/expand-region))
|
|
||||||
#+END_SRC
|
|
||||||
** Rainbow Delimiters
|
|
||||||
This Minor Mode will mark pairs of brackets with colours.
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(use-package rainbow-delimiters
|
|
||||||
:ensure t)
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
Set Minor Mode as Global :
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(define-globalized-minor-mode global-rainbow-delimiters-mode rainbow-delimiters-mode
|
|
||||||
(lambda () (rainbow-delimiters-mode 1)))
|
|
||||||
|
|
||||||
(global-rainbow-delimiters-mode 1)
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
** Rainbow Mode
|
|
||||||
This Minor Mode will highlight RGB/HEX values with their respective colours.
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(use-package rainbow-mode
|
|
||||||
:ensure t)
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
Set Minor Mode as Global :
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(define-globalized-minor-mode global-rainbow-mode rainbow-mode
|
|
||||||
(lambda () (rainbow-mode 1)))
|
|
||||||
|
|
||||||
(global-rainbow-mode 1)
|
|
||||||
#+END_SRC
|
|
||||||
** Autosave
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(setq backup-directory-alist
|
|
||||||
`((".*" . ,temporary-file-directory)))
|
|
||||||
(setq auto-save-file-name-transforms
|
|
||||||
`((".*" ,temporary-file-directory t)))
|
|
||||||
#+END_SRC
|
|
||||||
** Global Revert Mode
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(global-auto-revert-mode t)
|
|
||||||
#+END_SRC
|
|
||||||
** Wind Move
|
|
||||||
Windmove is built into Emacs. It lets you move point from window to window using Shift and the arrow keys. This is easier to type than ‘C-x o’ when there are multiple windows open.
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(when (fboundp 'windmove-default-keybindings)
|
|
||||||
(windmove-default-keybindings))
|
|
||||||
#+END_SRC
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue