<commit_before>#+title:    Smartparens: Automatic Delimiter Insertion
#+author:   <NAME>
#+email:    <EMAIL>
#+date:     2021:03:10
#+property: header-args:emacs-lisp :lexical t
#+tags:
#+STARTUP: fold

=smartparens= is a very popular Emacs plugin that automatically inserts closing
delimiters based on the syntax of the programming language currently in
use. However, =smartparens= can do much more than simply insert closing
delimiters. It can act as a whole editing environment for Lisp dialects similar
to ParEdit. You can think of it like =vim-surround= and =vim-endwise= put
together plus a bunch of language-aware features that neither of the
aforementioned Vim plugins have.

* Notes on =smartparens-mode= and =smartparens-strict-mode=
  This package contains two minor modes for managing delimiters:
  =smartparens-mode= and =smartparens-strict-mode=.

  =smartparens-mode= does /not/ enforce balanced delimiters (i.e., you can
  delete one parenthesis and leave its matching partner dangling).

  =smartparens-strict-mode= /does/ enforce balanced delimiters, meaning that
  there is no way (usually) to leave a dangling delimiter. This mode is more
  suited to editing Lisp dialects where each expression is wrapped in
  delimiters, such as parentheses or brackets, and matching them manually can be
  very challenging. On the other hand, using =smartparens-strict-mode= in
  line-oriented languages, like C++, Java, Python, etc. can be quite frustrating
  since delimiters appear less frequently and are less important to the overall
  structure of the language. Therefore, I do not advise that you globally enable
  =smartparens-strict-mode=.

* =use-package= specification

  #+begin_src emacs-lisp
    (use-package smartparens
      :demand t
      :hook
      ;; Enable strict mode for Lisp dialects.
      ((clojure-mode
        emacs-lisp-mode
        lisp-mode
        lisp-interaction-mode)
       . smartparens-strict-mode)
      :config
      ;; Enable smartparens globally.
      (smartparens-global-mode)
      (require 'smartparens-config))<commit_msg>emacs: Add more smmartparens mode<commit_after>#+title:    Smartparens: Automatic Delimiter Insertion
#+author:   <NAME>
#+email:    <EMAIL>
#+date:     2021:03:10
#+property: header-args:emacs-lisp :lexical t
#+tags:
#+STARTUP: fold

=smartparens= is a very popular Emacs plugin that automatically inserts closing
delimiters based on the syntax of the programming language currently in
use. However, =smartparens= can do much more than simply insert closing
delimiters. It can act as a whole editing environment for Lisp dialects similar
to ParEdit. You can think of it like =vim-surround= and =vim-endwise= put
together plus a bunch of language-aware features that neither of the
aforementioned Vim plugins have.

* Notes on =smartparens-mode= and =smartparens-strict-mode=
  This package contains two minor modes for managing delimiters:
  =smartparens-mode= and =smartparens-strict-mode=.

  =smartparens-mode= does /not/ enforce balanced delimiters (i.e., you can
  delete one parenthesis and leave its matching partner dangling).

  =smartparens-strict-mode= /does/ enforce balanced delimiters, meaning that
  there is no way (usually) to leave a dangling delimiter. This mode is more
  suited to editing Lisp dialects where each expression is wrapped in
  delimiters, such as parentheses or brackets, and matching them manually can be
  very challenging. On the other hand, using =smartparens-strict-mode= in
  line-oriented languages, like C++, Java, Python, etc. can be quite frustrating
  since delimiters appear less frequently and are less important to the overall
  structure of the language. Therefore, I do not advise that you globally enable
  =smartparens-strict-mode=.

* =use-package= specification

  #+begin_src emacs-lisp
    (use-package smartparens
      :demand t
      :hook
      ;; Enable strict mode for Lisp dialects.
      ((cider-repl-mode
        clojure-mode
        clojurec-mode
        clojurescript-mode
        emacs-lisp-mode
        ielm-mode
        lisp-mode
        lisp-interaction-mode
        sly-mrepl-mode)
       . smartparens-strict-mode)
      :config
      ;; Enable smartparens globally.
      (smartparens-global-mode)
      (require 'smartparens-config))
{'fraction_non_alphanumeric': 0.07279514699020065, 'fraction_numerical': 0.003733084461035931, 'mean_word_length': 3.685245901639344, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2392853', 'n_tokens_mistral': 1281, 'n_tokens_neox': 1224, 'n_words': 494}