(Emacs)~= -> ~ code tag
This commit is contained in:
@@ -115,7 +115,7 @@ files on after-save-hook.
|
|||||||
(add-hook 'after-save-hook (quote ,func-name)))))
|
(add-hook 'after-save-hook (quote ,func-name)))))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Procedure
|
** Procedure
|
||||||
The =lambda= macro provides a function with possible arguments. A
|
The ~lambda~ macro provides a function with possible arguments. A
|
||||||
procedure is a type of form that takes no arguments. This macro
|
procedure is a type of form that takes no arguments. This macro
|
||||||
returns an anonymous function with no arguments with all the forms
|
returns an anonymous function with no arguments with all the forms
|
||||||
provided. It returns it in 'backquoted' form as that is the most
|
provided. It returns it in 'backquoted' form as that is the most
|
||||||
@@ -221,8 +221,8 @@ the borders for Emacs. Incredible, must be done.
|
|||||||
** General
|
** General
|
||||||
Setup general, a good package for defining keys. In this case, I
|
Setup general, a good package for defining keys. In this case, I
|
||||||
generate a new definer for the "LEADER" keys. Leader is bound to
|
generate a new definer for the "LEADER" keys. Leader is bound to
|
||||||
=SPC= and it's functionally equivalent to the doom/spacemacs leader.
|
~SPC~ and it's functionally equivalent to the doom/spacemacs leader.
|
||||||
Local leader is bound to =SPC ,= and it's similar to doom/spacemacs
|
Local leader is bound to ~SPC ,~ and it's similar to doom/spacemacs
|
||||||
leader but doesn't try to fully assimilate the local-leader map
|
leader but doesn't try to fully assimilate the local-leader map
|
||||||
instead just picking stuff I think is useful.
|
instead just picking stuff I think is useful.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
@@ -445,7 +445,7 @@ Along with frameworks, there is a configuration for the
|
|||||||
completions-list, which is actually the original and default method of
|
completions-list, which is actually the original and default method of
|
||||||
completion within Emacs. When you first install Emacs without a
|
completion within Emacs. When you first install Emacs without a
|
||||||
config, any 'completing-read' function leverages the completions-list when
|
config, any 'completing-read' function leverages the completions-list when
|
||||||
=TAB= is used.
|
~TAB~ is used.
|
||||||
|
|
||||||
Though I believe Ido is a better completion system than the
|
Though I believe Ido is a better completion system than the
|
||||||
completions-list, it still has it's place and can be used in tandem
|
completions-list, it still has it's place and can be used in tandem
|
||||||
@@ -766,7 +766,7 @@ that makes it easy to manage the various buffers created by packages.
|
|||||||
forms)))))
|
forms)))))
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Setup default display records
|
*** Setup default display records
|
||||||
Using the =:display= keyword, setup up some =display-buffer-alist=
|
Using the ~:display~ keyword, setup up some ~display-buffer-alist~
|
||||||
records.
|
records.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package window
|
(use-package window
|
||||||
@@ -954,7 +954,7 @@ Setup global mode after evil mode has been loaded
|
|||||||
** Mode line
|
** Mode line
|
||||||
A mode line in an editor can provide a LOT of information, or very
|
A mode line in an editor can provide a LOT of information, or very
|
||||||
little. I customised the Emacs modeline to give me a bit of info,
|
little. I customised the Emacs modeline to give me a bit of info,
|
||||||
=telephone-line= to give me a lot.
|
~telephone-line~ to give me a lot.
|
||||||
*** Emacs Mode-line
|
*** Emacs Mode-line
|
||||||
Check out [[*Telephone-line][this package]] for my current modeline.
|
Check out [[*Telephone-line][this package]] for my current modeline.
|
||||||
|
|
||||||
@@ -1076,7 +1076,7 @@ with colouring and a ton of presentations to choose from.
|
|||||||
#+end_src
|
#+end_src
|
||||||
** Olivetti
|
** Olivetti
|
||||||
Olivetti provides a focus mode for Emacs, which makes it look a bit
|
Olivetti provides a focus mode for Emacs, which makes it look a bit
|
||||||
nicer with fringes. I also define =+olivetti-mode= which will
|
nicer with fringes. I also define ~+olivetti-mode~ which will
|
||||||
remember and clear up any window configurations on the frame, then
|
remember and clear up any window configurations on the frame, then
|
||||||
when turned off will reinsert them - provides a nice way to quickly
|
when turned off will reinsert them - provides a nice way to quickly
|
||||||
focus on a buffer.
|
focus on a buffer.
|
||||||
@@ -1173,8 +1173,8 @@ which is really useful.
|
|||||||
(counsel-projectile-mode +1))
|
(counsel-projectile-mode +1))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Avy
|
** Avy
|
||||||
Setup avy with leader. As I use =avy-goto-char-timer= a lot, use the
|
Setup avy with leader. As I use ~avy-goto-char-timer~ a lot, use the
|
||||||
=C-s= bind which replaces isearch. Switch isearch to M-s in case I
|
~C-s~ bind which replaces isearch. Switch isearch to M-s in case I
|
||||||
need to use it.
|
need to use it.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package avy
|
(use-package avy
|
||||||
@@ -1204,7 +1204,7 @@ window can provide some nicer chords for higher management of windows
|
|||||||
#+end_src
|
#+end_src
|
||||||
** Helpful
|
** Helpful
|
||||||
Basic setup that replaces commands and configures
|
Basic setup that replaces commands and configures
|
||||||
=display-buffer-alist= for helpful.
|
~display-buffer-alist~ for helpful.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package helpful
|
(use-package helpful
|
||||||
:after ivy
|
:after ivy
|
||||||
@@ -1252,18 +1252,18 @@ the ability to search a given file but also to search multiple files
|
|||||||
within a directory (which is usually only done by composing the
|
within a directory (which is usually only done by composing the
|
||||||
program find with grep to search multiple files). It is incredibly
|
program find with grep to search multiple files). It is incredibly
|
||||||
fast by virtue of its regex optimisations and the use of ignore files
|
fast by virtue of its regex optimisations and the use of ignore files
|
||||||
such as =.gitignore= to filter files when searching.
|
such as ~.gitignore~ to filter files when searching.
|
||||||
|
|
||||||
Grep has default Emacs utilities that use a =compilation= style buffer
|
Grep has default Emacs utilities that use a ~compilation~ style buffer
|
||||||
to search a variety of differing data sets. =grep= searches files,
|
to search a variety of differing data sets. ~grep~ searches files,
|
||||||
=rgrep= searches in a directory using the =find= binary and =zgrep=
|
~rgrep~ searches in a directory using the ~find~ binary and ~zgrep~
|
||||||
searches archives. This is a great solution for most computer
|
searches archives. This is a great solution for most computer
|
||||||
environments as basically all of them will have grep and find
|
environments as basically all of them will have grep and find
|
||||||
installed. Even when you =ssh= into a remote machine, they're likely
|
installed. Even when you ~ssh~ into a remote machine, they're likely
|
||||||
to have these tools.
|
to have these tools.
|
||||||
|
|
||||||
The ripgrep package provides utilities to ripgrep projects and files
|
The ripgrep package provides utilities to ripgrep projects and files
|
||||||
for strings via the rg binary. Though [[*Ivy][ivy]] comes with =counsel-rg=
|
for strings via the rg binary. Though [[*Ivy][ivy]] comes with ~counsel-rg~
|
||||||
using it makes me dependent on the ivy framework, and this
|
using it makes me dependent on the ivy framework, and this
|
||||||
configuration is intentionally built to be modular and switchable. Of
|
configuration is intentionally built to be modular and switchable. Of
|
||||||
course, this requires installing the rg binary which is available in
|
course, this requires installing the rg binary which is available in
|
||||||
@@ -1515,7 +1515,7 @@ Uses fd for finding file results in a directory: ~find-dired~ ->
|
|||||||
Xwidget is a package (must be compiled at source) which allows for the
|
Xwidget is a package (must be compiled at source) which allows for the
|
||||||
insertion of arbitrary xwidgets into Emacs through buffers. One of its
|
insertion of arbitrary xwidgets into Emacs through buffers. One of its
|
||||||
premier uses is in navigating the web which it provides through the
|
premier uses is in navigating the web which it provides through the
|
||||||
function =xwidget-webkit-browse-url=. This renders a fully functional
|
function ~xwidget-webkit-browse-url~. This renders a fully functional
|
||||||
web browser within Emacs.
|
web browser within Emacs.
|
||||||
|
|
||||||
Though I am not to keen on using Emacs to browse the web /via/ xwidget
|
Though I am not to keen on using Emacs to browse the web /via/ xwidget
|
||||||
@@ -1551,14 +1551,14 @@ results of work very quickly without switching windows or workspaces.
|
|||||||
"G" #'xwidget-webkit-scroll-bottom))
|
"G" #'xwidget-webkit-scroll-bottom))
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Xwidget Extensions
|
*** Xwidget Extensions
|
||||||
Define a function =+xwidget/render-file= that reads a file name and
|
Define a function ~+xwidget/render-file~ that reads a file name and
|
||||||
presents it in an xwidget. If the current file is an HTML file, ask
|
presents it in an xwidget. If the current file is an HTML file, ask
|
||||||
if user wants to open current file. Bind it to =aU= in the leader.
|
if user wants to open current file. Bind it to ~aU~ in the leader.
|
||||||
|
|
||||||
Also define a function =+xwidget/search-query= that first asks the
|
Also define a function ~+xwidget/search-query~ that first asks the
|
||||||
user what search engine they want to use ([[https://duckduckgo.com][Duck Duck Go]] and [[https://devdocs.io][DevDocs]]
|
user what search engine they want to use ([[https://duckduckgo.com][Duck Duck Go]] and [[https://devdocs.io][DevDocs]]
|
||||||
currently) then asks for a query, which it parses then presents in an
|
currently) then asks for a query, which it parses then presents in an
|
||||||
xwidget window. Bind to =as= in the leader.
|
xwidget window. Bind to ~as~ in the leader.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package xwidget
|
(use-package xwidget
|
||||||
:straight nil
|
:straight nil
|
||||||
@@ -1604,18 +1604,16 @@ computing environment' moniker that Emacs gets.
|
|||||||
It may be argued that Emacs integrates within itself many of the
|
It may be argued that Emacs integrates within itself many of the
|
||||||
functionalities that one would use within a shell or terminal. Stuff
|
functionalities that one would use within a shell or terminal. Stuff
|
||||||
like compilation, file management, large scale text manipulation could
|
like compilation, file management, large scale text manipulation could
|
||||||
be done through Emacs' own tools (=compile=, =dired= and =occur= come
|
be done through Emacs' own tools (~compile~, ~dired~ and ~occur~ come
|
||||||
to mind). However, I'd argue that eshell's greatest ability comes from
|
to mind). However, I'd argue that eshell's greatest ability comes from
|
||||||
it's separation (or perhaps better phrased, *integration*) of two
|
it's separation (or perhaps better phrased, *integration*) of two
|
||||||
'parsers': the Lisp parser and the Shell parser. With these parsers
|
'parsers': the Lisp parser and the Shell parser. With these parsers
|
||||||
you can mix and match at will for use in the shell, which grants
|
you can mix and match at will for use in the shell, which grants
|
||||||
greater power than many shells I know of.
|
greater power than many shells I know of.
|
||||||
|
|
||||||
*** Eshell Core
|
Setup a function that /toggles/ the eshell window rather than just
|
||||||
Setup a function that /toggles/ the eshell window rather than
|
opening it via ~+dx/toggle-buffer~. Along with that setup the prompt
|
||||||
just opening it via =+dx/toggle-buffer=.
|
so it looks a bit nicer and add pretty symbols to eshell.
|
||||||
Along with that setup the prompt so it looks a bit nicer and add
|
|
||||||
pretty symbols to eshell.
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package eshell
|
(use-package eshell
|
||||||
:commands +shell/toggle-shell
|
:commands +shell/toggle-shell
|
||||||
@@ -1806,7 +1804,7 @@ Core proced config, just a few bindings and evil collection setup.
|
|||||||
(evil-collection-proced-setup)))
|
(evil-collection-proced-setup)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Along with that I setup the package =proced-narrow= which allows
|
Along with that I setup the package ~proced-narrow~ which allows
|
||||||
further filtering of the process list.
|
further filtering of the process list.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package proced-narrow
|
(use-package proced-narrow
|
||||||
@@ -1850,7 +1848,7 @@ algebraic notation mode).
|
|||||||
(evil-collection-calc-setup)))
|
(evil-collection-calc-setup)))
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Calctex
|
*** Calctex
|
||||||
=calc-mode= also has a 3rd party package called =calctex=. It renders
|
~calc-mode~ also has a 3rd party package called ~calctex~. It renders
|
||||||
mathematical expressions within calc as if they were rendered in TeX.
|
mathematical expressions within calc as if they were rendered in TeX.
|
||||||
You can also copy the expressions in their TeX forms, which is pretty
|
You can also copy the expressions in their TeX forms, which is pretty
|
||||||
useful when writing a paper. I've set a very specific lock on this
|
useful when writing a paper. I've set a very specific lock on this
|
||||||
@@ -2090,7 +2088,7 @@ highlighting.
|
|||||||
("WAIT" . "#00CC00"))))
|
("WAIT" . "#00CC00"))))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Hide-show mode
|
** Hide-show mode
|
||||||
Turn on =hs-minor-mode= for all prog-mode.
|
Turn on ~hs-minor-mode~ for all prog-mode.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package hideshow
|
(use-package hideshow
|
||||||
:straight nil
|
:straight nil
|
||||||
@@ -2106,9 +2104,9 @@ For example if I were editing an org document which I was eventually
|
|||||||
compiling into a PDF, my workflow would be much smoother with a PDF
|
compiling into a PDF, my workflow would be much smoother with a PDF
|
||||||
viewer within Emacs that I can open on another pane.
|
viewer within Emacs that I can open on another pane.
|
||||||
*** PDF tools
|
*** PDF tools
|
||||||
=pdf-tools= provides the necessary functionality for viewing PDFs.
|
~pdf-tools~ provides the necessary functionality for viewing PDFs.
|
||||||
There is no proper PDF viewing without this package.
|
There is no proper PDF viewing without this package.
|
||||||
=evil-collection= provides a setup for this mode, so use that.
|
~evil-collection~ provides a setup for this mode, so use that.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package pdf-tools
|
(use-package pdf-tools
|
||||||
:straight t
|
:straight t
|
||||||
@@ -2141,7 +2139,7 @@ to standard grep (but for PDFs!).
|
|||||||
(setq sql-display-sqli-buffer-function nil))
|
(setq sql-display-sqli-buffer-function nil))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Ada
|
** Ada
|
||||||
Check out [[file:elisp/ada-mode.el][ada-mode*]], my custom =ada-mode= that replaces the default one.
|
Check out [[file:elisp/ada-mode.el][ada-mode*]], my custom ~ada-mode~ that replaces the default one.
|
||||||
This mode just colourises stuff, and uses eglot to do the important
|
This mode just colourises stuff, and uses eglot to do the important
|
||||||
stuff.
|
stuff.
|
||||||
|
|
||||||
@@ -2627,7 +2625,7 @@ mouthful). It's quite a beautiful language and really learning it will
|
|||||||
change the way you think about programming.
|
change the way you think about programming.
|
||||||
|
|
||||||
Here I configure the REPL for Haskell via the
|
Here I configure the REPL for Haskell via the
|
||||||
=haskell-interactive-mode= as well.
|
~haskell-interactive-mode~ as well.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package haskell-mode
|
(use-package haskell-mode
|
||||||
:hook
|
:hook
|
||||||
@@ -2654,7 +2652,7 @@ Here I configure the REPL for Haskell via the
|
|||||||
haskell-interactive-bring))
|
haskell-interactive-bring))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Python
|
** Python
|
||||||
Works well for python. If you have =pyls= it should be on your path, so
|
Works well for python. If you have ~pyls~ it should be on your path, so
|
||||||
just run eglot if you need. But an LSP server is not necessary for a
|
just run eglot if you need. But an LSP server is not necessary for a
|
||||||
lot of my time in python.
|
lot of my time in python.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|||||||
Reference in New Issue
Block a user