aboutsummaryrefslogtreecommitdiff
path: root/shoshimacs.org
diff options
context:
space:
mode:
authorGrant Shangreaux <shoshin@cicadas.surf>2023-02-27 19:23:59 -0600
committerGrant Shangreaux <shoshin@cicadas.surf>2023-02-27 19:23:59 -0600
commitb703719204e712d39ce61ce4d88cb8fb21c1a58c (patch)
treebb8e5ad97067af321a53d2a685d09e174765dd6f /shoshimacs.org
parent563cde73b661fcb84ca1c42b79e8b2db121796dd (diff)
Add: a bunch of stuff for slime, telephone-line config, company
Diffstat (limited to 'shoshimacs.org')
-rw-r--r--shoshimacs.org123
1 files changed, 104 insertions, 19 deletions
diff --git a/shoshimacs.org b/shoshimacs.org
index 65e4590..a7c35ba 100644
--- a/shoshimacs.org
+++ b/shoshimacs.org
@@ -545,7 +545,7 @@ this is implemented with the ~vertico-directory~ extension.
(define-key vertico-map (kbd "M-j") #'vertico-quick-insert)
#+end_src
-** corfu
+** COMMENT corfu
#+begin_src emacs-lisp
(package-install 'corfu)
@@ -562,6 +562,29 @@ this is implemented with the ~vertico-directory~ extension.
(unless (display-graphic-p)
(corfu-terminal-mode +1))
#+end_src
+** company - complete anywhere
+
+Company is a modular completion framework. Modules for retrieving completion
+candidates are called backends, modules for displaying them are frontends.
+
+Company comes with many backends, e.g. `company-etags'. These are
+distributed in separate files and can be used individually.
+
+Enable `company-mode' in all buffers with M-x global-company-mode. For
+further information look at the documentation for `company-mode' (C-h f
+company-mode RET).
+
+#+begin_src emacs-lisp
+ (package-install 'company)
+
+ (setq company-minimum-prefix-length 2
+ company-idle-delay 0.3) ;; default is 0.2
+
+ (add-hook 'after-init-hook 'global-company-mode)
+#+end_src
+
+
+
** which-key
which-key is an excellent package that helps provide guide posts for command
@@ -590,7 +613,7 @@ which has a command to show prefix key continuations.
:PROPERTIES:
:header-args:emacs-lisp: :noweb-ref editing :noweb-sep "\n\n" :results silent
:END:
-** [[info:emacs#Matching][electric pair mode]]
+** COMMENT [[info:emacs#Matching][electric pair mode]]
I've been using smartparens -> (bookmark-jump "smartparens package") in my
main config. electric pair mode does some of what smartparens does out of
@@ -601,6 +624,18 @@ config might get what i want with vanilla built ins.
#+begin_src emacs-lisp
(electric-pair-mode)
#+end_src
+** smartparens
+
+Going back to smartparens for some of the paredit behavior I want, plus
+the paren balancing. We'll see how it goes
+
+#+begin_src emacs-lisp
+ (package-install 'smartparens)
+ (require 'smartparens-config)
+ (smartparens-global-mode 1)
+ ;(sp-local-pair 'sly-mrepl-mode "'" nil :actions nil)
+ (sp-local-pair 'slime-repl-mode "'" nil :actions nil)
+#+end_src
** markdown mode
#+begin_src emacs-lisp
@@ -665,6 +700,13 @@ There are many settings for how it presents available, but I usually
just set them on the fly, depending on the presentation, rather than
in my main config.
+*** Structure Templates
+ #+begin_src emacs-lisp
+ (add-to-list 'org-structure-template-alist '("se" . "src emacs-lisp"))
+ (add-to-list 'org-structure-template-alist '("sr" . "src ruby"))
+ (add-to-list 'org-structure-template-alist '("ss" . "src shell"))
+ #+end_src
+
** recentf-mode
this tracks recently operated on files (by default) and enables quick selection
@@ -699,6 +741,12 @@ I primarily use SBCL, so I set it as the ~inferior-lisp-program~
(setq inferior-lisp-program "sbcl")
#+end_src
+*** COMMENT SLY
+
+#+begin_src emacs-lisp
+ (package-install 'sly)
+#+end_src
+
*** Slime
The ~slime~ package v2.26.1 in the nongnu repo seems to have an issue with
emacs 28.1 (?) so I'm installing it from source.
@@ -713,6 +761,7 @@ emacs 28.1 (?) so I'm installing it from source.
(format "git clone %s %s" slime-repo slime-src-dir)))
(add-to-list 'load-path slime-src-dir)
+ (require 'slime-autoloads)
#+end_src
There is a command ~slime-info~ to read the locally built manual file,
@@ -726,13 +775,31 @@ but i need to ensure it is built:
(shell-command "make slime.info" "*slime-make-info*")))
#+end_src
-_SLIME CONTRIBS_
+**** Slime company
+
+Company backend for slime
+
+#+begin_src emacs-lisp
+ (defvar slime-company-repo "https://github.com/anwyn/slime-company")
+ (defvar slime-company-src-dir (expand-file-name "~/src/slime-company/"))
+
+ (unless (file-directory-p slime-company-src-dir)
+ (shell-command
+ (format "git clone %s %s" slime-company-repo slime-company-src-dir)))
+
+ (add-to-list 'load-path slime-company-src-dir)
+ (setq slime-company-completion 'fuzzy
+ slime-company-display-arglist 1)
+#+end_src
+
+**** SLIME CONTRIBS
#+name: slime-contribs
#+begin_src emacs-lisp
(setq slime-contribs
'(
slime-fancy ;; default value, includes many fundamental contribs
+ slime-company
slime-mrepl
inferior-slime
slime-fuzzy
@@ -744,10 +811,20 @@ _SLIME CONTRIBS_
slime-quicklisp
))
- (require 'slime-autoloads)
(slime-setup)
#+end_src
+Slime Presentations
+
+#+begin_src emacs-lisp
+ (defun my-slime-return (_)
+ "Function to advise `slime-repl-return' to make <RET> inspect the presentation at point."
+ (when (slime-presentation-around-or-before-point-p)
+ (slime-inspect-presentation-at-point (point))))
+
+ (advice-add 'slime-repl-return :before #'my-slime-return)
+#+end_src
+
** Javascript
#+begin_src emacs-lisp
@@ -786,7 +863,10 @@ I prefer pry when its available, and it generally is on my system:
(setq inf-ruby-default-implementation "pry"))
#+end_src
-*** ruby-end
+*** COMMENT ruby-end
+
+automatically inserts ~end~ in ruby mode for blocks that need it. conflicts/doubles
+with smartparens, so its currently off.
#+begin_src
(package-install 'ruby-end)
@@ -902,7 +982,7 @@ Emacs MultiMedia System.
erc-hide-list '("JOIN" "PART" "QUIT"))
#+end_src
-** nov.el major mode for reading EPUBs
+** COMMENT nov.el major mode for reading EPUBs
#+name: install-nov.el
#+begin_src emacs-lisp
@@ -1157,19 +1237,24 @@ for theme development.
*** telephone line
#+begin_src emacs-lisp
-(setq telephone-line-lhs
- '((evil . (telephone-line-evil-tag-segment))
- (accent . (telephone-line-vc-segment
- telephone-line-erc-modified-channels-segment
- telephone-line-process-segment))
- (nil . (telephone-line-minor-mode-segment
- telephone-line-buffer-segment))))
-(setq telephone-line-rhs
- '((nil . (telephone-line-misc-info-segment))
- (accent . (telephone-line-major-mode-segment))
- (evil . (telephone-line-airline-position-segment))))
-
-(telephone-line-mode t)
+ (setq telephone-line-lhs
+ '((evil . (telephone-line-evil-tag-segment))
+ (accent . (telephone-line-vc-segment
+ telephone-line-erc-modified-channels-segment
+ telephone-line-process-segment))
+ (nil . (
+ ;; telephone-line-minor-mode-segment
+ telephone-line-buffer-segment))))
+ (setq telephone-line-rhs
+ '((nil . (telephone-line-misc-info-segment
+ telephone-line-flymake-segment))
+ (accent . (telephone-line-major-mode-segment))
+ (evil . (telephone-line-airline-position-segment))))
+
+ (set-face-background 'telephone-line-evil-normal "deep pink")
+ (set-face-background 'telephone-line-evil-insert "Dark Turquoise")
+
+ (telephone-line-mode t)
#+end_src
** SVG Screenshot