Minor edits to config.

This commit is contained in:
Derek Taylor
2021-04-20 18:57:16 -05:00
parent 3ff69c7e1d
commit 15607d097c
4 changed files with 77 additions and 5 deletions

View File

@@ -20,6 +20,7 @@
- [[#configuring-dashboard][Configuring Dashboard]]
- [[#dashboard-in-emacsclient][Dashboard in Emacsclient]]
- [[#elfeed][ELFEED]]
- [[#emojis][EMOJIS]]
- [[#evaluate-elisp-expressions][EVALUATE ELISP EXPRESSIONS]]
- [[#file-manager-dired][FILE MANAGER (DIRED)]]
- [[#keybindings-to-open-dired][Keybindings To Open Dired]]
@@ -43,6 +44,7 @@
- [[#ivy-posframe][Ivy-posframe]]
- [[#language-support][LANGUAGE SUPPORT]]
- [[#magit][MAGIT]]
- [[#neotree][NEOTREE]]
- [[#org-mode][ORG MODE]]
- [[#defining-a-few-things][Defining A Few Things]]
- [[#enabling-org-bullets][Enabling Org Bullets]]
@@ -51,6 +53,7 @@
- [[#source-code-block-tag-expansion][Source Code Block Tag Expansion]]
- [[#source-code-block-syntax-highlighting][Source Code Block Syntax Highlighting]]
- [[#automatically-create-table-of-contents][Automatically Create Table of Contents]]
- [[#perspective][PERSPECTIVE]]
- [[#projectile][PROJECTILE]]
- [[#registers][REGISTERS]]
- [[#scrolling][SCROLLING]]
@@ -60,6 +63,7 @@
- [[#splits-and-window-controls][SPLITS AND WINDOW CONTROLS]]
- [[#theme][THEME]]
- [[#which-key][WHICH KEY]]
- [[#writeroom-mode][Writeroom-Mode]]
* IMPORTANT! PUT THIS IN YOUR INIT.EL
I don't want to use init.el to config Emacs. I want to use an org file to config Emacs because I like literate configs with lots of comments. The following code block should be your init.el. This tells init.el to use the source code blocks from this file (config.org).
@@ -111,6 +115,7 @@ Evil is an extensible 'vi' layer for Emacs. It emulates the main features of Vim
:config
(setq evil-collection-mode-list '(dashboard dired ibuffer))
(evil-collection-init))
(use-package evil-tutor)
#+end_src
** General Keybindings
@@ -216,6 +221,14 @@ An RSS newsfeed reader for Emacs.
(kbd "K") 'elfeed-goodies/split-show-prev)
#+end_src
* EMOJIS
Emojify is an Emacs extension to display emojis. It can display github style emojis like :smile: or plain ascii ones like :).
#+begin_src emacs-lisp
(use-package emojify
:hook (after-init . global-emojify-mode))
#+end_src
* EVALUATE ELISP EXPRESSIONS
I choose to use the format 'SPC e' plus 'key' for these (I also use 'SPC e' for 'eww' keybindings).
@@ -337,7 +350,7 @@ Though 'recentf' is one way to find recent files although I prefer using 'counse
(kill-new file-name))
(error "Buffer not visiting a file"))))
#+end_src
* FONTS
Defining our fonts. Right now I'm using Source Code Pro (SauceCodePro) from the nerd-fonts repository. Installed from the AUR, it does =NOT= include all variations of the font (such as italics). You can download the italics Source Code Pro font from the nerd-fonts GitHub though.
@@ -520,7 +533,48 @@ A git client for Emacs. Often cited as a killer feature for Emacs.
#+begin_src emacs-lisp
(use-package magit)
#+end_src
* NEOTREE
Neotree is a file tree viewer. When you open neotree, it jumps to the current file thanks to neo-smart-open. The neo-window-fixed-size setting makes the neotree width be adjustable. NeoTree provides following themes: classic, ascii, arrow, icons, and nerd. Theme can be configed by setting "two" themes for neo-theme: one for the GUI and one for the terminal. I like to use 'SPC t' for 'toggle' keybindings, so I have used 'SPC t n' for toggle-neotree.
| COMMAND | DESCRIPTION | KEYBINDING |
|----------------+---------------------------+------------|
| neotree-toggle | /Toggle neotree/ | SPC t n |
| neotree- dir | /Open directory in neotree/ | SPC d n |
#+BEGIN_SRC emacs-lisp
;; Function for setting a fixed width for neotree.
;; Defaults to 25 but I make it a bit longer (35) in the 'use-package neotree'.
(defcustom neo-window-width 25
"*Specifies the width of the NeoTree window."
:type 'integer
:group 'neotree)
(use-package neotree
:config
(setq neo-smart-open t
neo-window-width 35
neo-theme (if (display-graphic-p) 'icons 'arrow)
neo-window-fixed-size nil
inhibit-compacting-font-caches t
projectile-switch-project-action 'neotree-projectile-action)
;; truncate long file names in neotree
(add-hook 'neo-after-create-hook
#'(lambda (_)
(with-current-buffer (get-buffer neo-buffer-name)
(setq truncate-lines t)
(setq word-wrap nil)
(make-local-variable 'auto-hscroll-mode)
(setq auto-hscroll-mode nil)))))
;; show hidden files
(setq-default neo-show-hidden-files t)
(nvmap :prefix "SPC"
"t n" '(neotree-toggle :which-key "Toggle neotree file viewer")
"d n" '(neotree-dir :which-key "Open directory in neotree"))
#+END_SRC
* ORG MODE
Org Mode is =THE= killer feature within Emacs. But it does need some tweaking.
@@ -624,6 +678,17 @@ Toc-org helps you to have an up-to-date table of contents in org files without e
:ensure nil)
#+end_src
* PERSPECTIVE
The Perspective package provides multiple named workspaces (or "perspectives") in Emacs, similar to multiple desktops in window managers like Awesome and XMonad. Each perspective has its own buffer list and its own window layout. This makes it easy to work on many separate projects without getting lost in all the buffers. Switching to a perspective activates its window configuration, and when in a perspective, only its buffers are available.
#+begin_src emacs-lisp
(use-package perspective
:bind
("C-x C-b" . persp-list-buffers) ; or use a nicer switcher, see below
:config
(persp-mode))
#+end_src
* PROJECTILE
#+begin_src emacs-lisp
(use-package projectile
@@ -767,3 +832,9 @@ Which-key is a minor mode for Emacs that displays the key bindings following you
which-key-separator "" ))
(which-key-mode)
#+end_src
* Writeroom-Mode
#+begin_src emacs-lisp
(use-package writeroom-mode)
#+end_src

View File

@@ -9,7 +9,8 @@
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages
'(elfeed-goodies sudo-edit ox-man dired smex org-tempo all-the-icons-dired which-key vterm use-package toc-org projectile peep-dired org-bullets magit-todos magit-lfs ivy-rich ivy-posframe haskell-mode general evil-collection eshell-syntax-highlighting doom-themes doom-modeline dired-open dashboard counsel)))
'(writeroom-mode perspective neotree evil-tutor elfeed-goodies sudo-edit ox-man dired smex org-tempo all-the-icons-dired which-key vterm use-package toc-org projectile peep-dired org-bullets magit-todos magit-lfs ivy-rich ivy-posframe haskell-mode general evil-collection eshell-syntax-highlighting doom-themes doom-modeline dired-open dashboard counsel))
'(persp-mode t))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.

View File

@@ -360,7 +360,7 @@ myShowWNameTheme = def
myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats
$ mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout
where
myDefaultLayout = tall
myDefaultLayout = withBorder myBorderWidth tall
||| magnify
||| noBorders monocle
||| floats

View File

@@ -300,7 +300,7 @@ myShowWNameTheme = def
myLayoutHook = avoidStruts $ mouseResize $ windowArrange $ T.toggleLayouts floats
$ mkToggle (NBFULL ?? NOBORDERS ?? EOT) myDefaultLayout
where
myDefaultLayout = tall
myDefaultLayout = withBorder myBorderWidth tall
||| magnify
||| noBorders monocle
||| floats