Sfoglia il codice sorgente

Underscore treated as word letter in some modes

Plus changed the font back to the variable font version as default.
Might be interesting to toggle that setting on a per-mode basis.

ALso wrote a little bit more about the rationale behind this setup and
fixed a typo.
Eiyeron Fulmincendii 6 anni fa
parent
commit
01a7b78dae
1 ha cambiato i file con 40 aggiunte e 6 eliminazioni
  1. 40 6
      config.org

+ 40 - 6
config.org

@@ -6,6 +6,18 @@ am. Having multiple files with a poor consistence or a directed goal always bit
 me in the back relatively quickly. So this time, I'll try to write something
 documenting my process to warn my future me about my current configuration
 mishaps.
+
+Because I'm trying to make this setup my daily driver for personal programming
+and writing, I'm going to list here the programming/writing languages I might
+use in the future with that setup, so expect this configuration to be revolving
+around this list:
+- Python
+- Lua
+- Markdown
+  - CSS/HTML (to tweak my blog's skeleton)
+- Org
+- Bash (eventually zsh)
+- and of course, emacs-lisp
 * The first steps in the look&feel
 ** The colors
 Lately, I have been partial towards Gruvbox, for multiple reasons, the first
@@ -19,12 +31,15 @@ colorscheme.
 ** The fonts
 The other basic configuration I usually do first too is setting a font.
 PragmataPro has been my newest typographic friend as it's /really/ good for what
-it's made for: displaying text in a flexible yet consistent way. I really like
-the small touches like the ligatures
+it's made for: displaying text in a flexible yet consistent way. Wait, I just
+described fonts. Yet, Pragmata is neicely designed and made in a way I'm still
+discovering little details after weeks of daily usage, like properly managing
+combining characters like F⃣. I really like those small touches and of course the
+mighty ligatures.
 #+BEGIN_SRC emacs-lisp
 (let ((base-size 12))
   (setq doom-font (font-spec
-                   :family "PragmataPro Mono Liga"
+                   :family "PragmataPro Liga"
                    :size base-size)
         doom-variable-pitch-font (font-spec
                                   :family "PragmataPro Liga"
@@ -37,9 +52,10 @@ the small touches like the ligatures
                        :size (* base-size 2))))
 #+END_SRC
 
-PragmataPro's ligatures have been toggled within ~init.el~ though the
+PragmataPro's ligatures have been enabled within ~init.el~ though the
 ~pretty-code~ layer and it's optional specialization for this font. No more
-setting is to be done for this font.
+setting is to be done for this font. Yet I wonder if I want to determine how to
+add specific replacements (like ~lambda → λ~ ).
 ** Tweaks
 *** Window borders
 Nothing really fancy yet, I'm content with how Doom looks right now. In the
@@ -235,7 +251,7 @@ convert it automatically into mp4 and webm."
             :caller 'chicken/convert-post-gif))
 #+END_SRC
 
-*** TODO A shortcutmapping
+*** TODO A shortcut mapping
 Finally, I would like to make a shortcut to launch the conversion function to
 quickly get things done. I need to find a proper wrapper for that and to read
 more Doom Emacs' documentation to figure how and where to scope the mapping.
@@ -302,3 +318,21 @@ available.
       :leader
       :desc "Everything" "sE" #'chicken/search-everything)
 #+END_SRC
+* Unsorted Tweaks
+** Treat the underscore as a word character
+According to Doom Emacs' [[https://github.com/hlissner/doom-emacs/blob/develop/docs/faq.org#how-do-i-bind-my-own-keys-or-change-existing-ones][FAQ]], the Evil mode considers the underscore as a word
+delimiter because that's the default Emacs behiavour, not following vim's own
+motion.
+To fix this, there is the possibility of changing the underscore's entry in the
+syntax table:
+#+begin_src emacs-lisp :tangle no
+(modify-syntax-entry ?_ "w")
+#+end_src
+
+But again, the FAQ suggests using hooks to limit the tweak to specific modes.
+#+begin_src emacs-lisp
+(defun chicken/alter-underscore-entry()
+  (modify-syntax-entry ?_ "w"))
+
+(add-hook! (python-mode lua-mode markdown-mode) #'chicken/alter-underscore-entry)
+#+end_src