[parinfer] Switch implementation to parinfer-rust-mode
as parinfer-mode is officially unmaintained now.
This commit is contained in:
parent
b24fccdbff
commit
de55a45dbd
|
@ -17,6 +17,7 @@ controls indentation based on parentheses or vice versa.
|
|||
|
||||
** Features:
|
||||
- Automatic management of parenthesis in clojure, emacs lisp, common-lisp and scheme following the parinfer editing paradigm.
|
||||
- Powered by a native library in the background
|
||||
|
||||
* Install
|
||||
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
|
||||
|
@ -24,11 +25,16 @@ add =parinfer= to the existing =dotspacemacs-configuration-layers= list in this
|
|||
file.
|
||||
|
||||
* Configuration
|
||||
See the official package [[https://github.com/DogLooksGood/parinfer-mode][documentation]] for information about how the parinfer
|
||||
works and how to configure it.
|
||||
This package comes preconfigured to auto install the native library in your cache
|
||||
directory. It uses the new =smart-mode= instead of the =indent-mode= traditionally
|
||||
used with =parinfer=. For the autoinstallation =curl= is required to be in your
|
||||
path.
|
||||
|
||||
If you still want to manually configure it please check the respective package
|
||||
repo [[https://github.com/justinbarclay/parinfer-rust-mode][here]].
|
||||
|
||||
* Key bindings
|
||||
|
||||
| Key binding | Description |
|
||||
|-------------+-----------------------------------------------|
|
||||
| ~SPC t P~ | Toggle between parinfer indent and paren mode |
|
||||
| Key binding | Description |
|
||||
|-------------+-----------------------------------------------------|
|
||||
| ~SPC t P~ | Toggle between parinfer smart indent and paren mode |
|
||||
|
|
|
@ -9,22 +9,29 @@
|
|||
;;
|
||||
;;; License: GPLv3
|
||||
|
||||
(setq parinfer-packages
|
||||
'(parinfer))
|
||||
(defconst parinfer-packages
|
||||
'(parinfer-rust-mode))
|
||||
|
||||
(defun parinfer/init-parinfer ()
|
||||
(use-package parinfer
|
||||
(defun parinfer/init-parinfer-rust-mode ()
|
||||
(use-package parinfer-rust-mode
|
||||
:defer t
|
||||
:diminish parinfer-mode
|
||||
:diminish parinfer-rust-mode
|
||||
:hook emacs-lisp-mode clojure-mode scheme-mode common-lisp-mode
|
||||
:init
|
||||
(progn
|
||||
(spacemacs|add-toggle parinfer-indent
|
||||
:evil-leader "tP"
|
||||
:documentation "Enable Parinfer Indent Mode."
|
||||
:if (bound-and-true-p parinfer-mode)
|
||||
:status (eq parinfer--mode 'indent)
|
||||
:on (parinfer-toggle-mode)
|
||||
:off (parinfer-toggle-mode))
|
||||
(setq parinfer-extensions '(defaults pretty-parens evil smart-yank)))))
|
||||
|
||||
;;; packages.el ends here
|
||||
(setq parinfer-rust-auto-download t
|
||||
;;; TODO smile13241324 07-03-2021
|
||||
;;; Needed to duplicate the lib name algorithm to savely change the lib install directory to our cache folder.
|
||||
;;; This is caused by the folders not having been separated from the system dependent library name.
|
||||
;;; PR has been opened see here https://github.com/justinbarclay/parinfer-rust-mode/pull/39
|
||||
parinfer-rust-library (concat spacemacs-cache-directory "parinfer-rust/" (cond
|
||||
((eq system-type 'darwin) "parinfer-rust-darwin.so")
|
||||
((eq system-type 'gnu/linux) "parinfer-rust-linux.so")
|
||||
((eq system-type 'windows-nt) "parinfer-rust-windows.dll")))
|
||||
(spacemacs|add-toggle parinfer-smart-indent
|
||||
:evil-leader "tP"
|
||||
:documentation "Enable Parinfer Smart Indent Mode."
|
||||
:if (bound-and-true-p parinfer-rust-mode)
|
||||
:status (eq parinfer-rust--mode 'smart)
|
||||
:on (parinfer-rust-toggle-paren-mode)
|
||||
:off (parinfer-rust-toggle-paren-mode))))))
|
||||
|
|
Loading…
Reference in New Issue