@@ -9,6 +9,7 @@ Some of my configuration entries where borrowed from other people, see
* Performances tweaks (part. 1, start)
** Emacs 28 (GccEmacs)
I am currently experimenting with Emacs 28 and, specifically,
GccEmacs that compiles elisp to native binaries. To compile emacs28
to macOs (until it is released):
...
...
@@ -27,6 +28,8 @@ to macOs (until it is released):
)
#+end_src
** Garbage collector
Decrease the GC frequency by setting the threshold high for
configuration loading. The threshold will be set lower at the end of
the configuration to make each GC call faster for normal emacs use.
...
...
@@ -50,7 +53,7 @@ Sets who I am
* Packages management
I use [[https://elpa.gnu.org][Elpa]], [[https://melpa.org][Melpa]] and [[http://orgmode.org][Org mode]] packages repository, thus I need to add them to the =package-archives= list
I use [[https://elpa.gnu.org][Elpa]], [[https://melpa.org][Melpa]] and [[http://orgmode.org][Org mode]] packages repositories, thus I need to add them to the =package-archives= list
For older emacs version, fix some gnutls algorithm priority
...
...
@@ -58,9 +61,7 @@ For older emacs version, fix some gnutls algorithm priority
@@ -70,8 +71,6 @@ For older emacs version, fix some gnutls algorithm priority
(package-initialize)
#+END_SRC
#+RESULTS:
Then, to ensure that packages are installed and that I can launch
Emacs on a new computer and have it setup automatically, I use
...
...
@@ -108,9 +107,10 @@ and I want to be sure that compiled versions of packages are up-to-date
#+begin_src emacs-lisp
(use-package auto-compile
:config (auto-compile-on-load-mode))
:config
(auto-compile-on-load-mode)
(setq load-prefer-newer t)
)
#+end_src
** Non package modules
...
...
@@ -128,42 +128,39 @@ Add a folder for .el files that are not available as packages
I use [[https://github.com/technomancy/better-defaults][better-defaults]] to tweak some annoying Emacs default behaviors. The two most important beeing:
- use =ido= almost everywhere
- put temporary files in a specific folder rather as =~= files everywhere
- use =ido= almost everywhere,
- put temporary files in a specific folder rather as =~= files everywhere.
there is more to =better-defaults=, be sure to have a look at its list
of changed behaviors. In particular, it switches the menu bar off and
I quite like have it around sometimes, so I re-enable it.
There is more to =better-defaults=, be sure to have a look at its list of changed behaviors. In
particular, it switches the menu bar off and I quite like have it around sometimes, so I re-enable
it. Moreover, Ido is not set everywhere by =better-defaults= and I really want it everywhere
#+BEGIN_SRC emacs-lisp
(use-package better-defaults)
;; I want menu bar
#+BEGIN_SRC emacs-lisp
(use-package better-defaults
:config
(menu-bar-mode t)
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
)
#+END_SRC
Ido is not set everywhere by =better-defaults= and I really want it everywhere
Allow pressing only =y= instead of =yes= for fast answer to yes or no question
#+begin_src emacs-lisp
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(fset 'yes-or-no-p 'y-or-n-p)
#+end_src
** MacOS
As I often use Emacs on MacOS, I need the right option (alt) key to
behave *as* an option key and not an Emacs =meta= key.
As I often use Emacs on MacOS, I need the right option (alt) key to behave *as* an option key and
not an Emacs =meta= key.
#+begin_src emacs-lisp
(when (eq system-type 'darwin)
(setq mac-right-option-modifier nil))
#+end_src
Allow pressing only =y= instead of =yes= for fast answer to yes or no question
#+begin_src emacs-lisp
;; Make the y or n suffice for a yes or no question
(fset 'yes-or-no-p 'y-or-n-p)
#+end_src
** Editor tweaks
...
...
@@ -205,19 +202,17 @@ When using =C-k=, kill the whole line (including =\n=)
(setq kill-whole-line t)
#+end_src
When moving the cursor up or down, remember when it was on a line end
and keep it that way even if next line is longer or shorter
When moving the cursor up or down, remember when it was on a line end and keep it that way even
if next line is longer or shorter
#+begin_src emacs-lisp
(setq track-eol t)
#+end_src
Automatically revert buffers if they change on disk. This prevent
keeping an outdated buffer open and makes changes that will overwrite
the newer file on disk. If the buffer was edited since the last
save/revert, Emacs asks what to do.
Automatically revert buffers if they change on disk. This prevent keeping an outdated buffer open
and makes changes that will overwrite the newer file on disk. If the buffer was edited since the
last save/revert, Emacs asks what to do.
#+begin_src emacs-lisp
(global-auto-revert-mode t)
...
...
@@ -226,6 +221,7 @@ save/revert, Emacs asks what to do.
#+end_src
Do not word wrap buffers, truncate long lines
#+begin_src emacs-lisp
;; Truncate lines (don't word wrap)
(setq truncate-lines t)
...
...
@@ -252,9 +248,6 @@ Define a shortcut to re-indent all buffer. This saves the current point, marks w
(global-set-key (kbd "C-c i b") 'mh/indent-buffer)
#+end_src
#+RESULTS:
: mh/indent-buffer
Set the line width for fill command
#+begin_src emacs-lisp
...
...
@@ -262,25 +255,12 @@ Set the line width for fill command
#+end_src
** Undo on steroids
Manage undo as a tree so that we can undo/redo more. Bound by default on =C-x u=
**Deactivated yet**
#+begin_src emacs-lisp
;;(use-package undo-tree
;; :config
;; (global-undo-tree-mode))
#+end_src
* UI and visual tweaks
** Changes to builtin visuals
I always display visual line where the cursor is and I like to have line numbers at the left of the
buffer. I also have Emacs to show me matching parenthesis. Also do not show the welcome screen.
buffer. I also like to have Emacs show me matching parenthesis. Also do not show the welcome screen.
#+BEGIN_SRC emacs-lisp
;; Do not show welcome screen
...
...
@@ -300,10 +280,6 @@ buffer. I also have Emacs to show me matching parenthesis. Also do not show the
(setq-default icon-title-format (list "%b"))
#+END_SRC
#+RESULTS:
| %b |
** Theme
#+BEGIN_SRC emacs-lisp
...
...
@@ -313,22 +289,20 @@ buffer. I also have Emacs to show me matching parenthesis. Also do not show the
)
#+END_SRC
Use Fira Code but do not use ligature everywhere
Select the font I will use depending on the system
#+begin_src emacs-lisp
(use-package fira-code-mode
:config
;(global-fira-code-mode)
(setq fira-code-mode-enable-hex-literal nil)
(if (eq system-type 'darwin)
; Font on MacOS
(setq mh-font "Fira Code-20")
; Font on Other Systems (Linux actually, I do not use emacs on windows)