adding tree-sitter back in

This commit is contained in:
Matt Nish-Lapidus 2023-03-29 08:58:08 -04:00
parent 1711f8088f
commit cc34d2e8ee
6 changed files with 111 additions and 79 deletions

View file

@ -4,6 +4,7 @@
(map! :leader (map! :leader
"`" nil "`" nil
(:prefix ("m" . "<localleader>")) ; bound locally
(:prefix-map ("!" . "checkers")) ; bound by flycheck (:prefix-map ("!" . "checkers")) ; bound by flycheck
:desc "M-x" ":" #'execute-extended-command :desc "M-x" ":" #'execute-extended-command
@ -12,8 +13,8 @@
(:prefix-map ("w" . "window") (:prefix-map ("w" . "window")
:desc "ace-window" "w" #'ace-window :desc "ace-window" "w" #'ace-window
:desc "split horizontally" "h" #'split-window-below :desc "split horizontally" "h" #'split-window-horizontally
:desc "split vertically" "v" #'split-window-below :desc "split vertically" "v" #'split-window-vertically
:desc "make taller" "+" #'enlarge-window :desc "make taller" "+" #'enlarge-window
:desc "make taller" "-" #'shrink-window :desc "make taller" "-" #'shrink-window
:desc "make wider" ">" #'enlarge-window-horizontally :desc "make wider" ">" #'enlarge-window-horizontally
@ -310,39 +311,54 @@
:desc "Pull request" "p" #'forge-create-pullreq))) :desc "Pull request" "p" #'forge-create-pullreq)))
(:prefix-map ("c" . "code") (:prefix-map ("c" . "code")
(:when (and (modulep! :tools lsp) (not (modulep! :tools lsp +eglot))) (:when (and (modulep! :tools lsp) (not (modulep! :tools lsp +eglot)))
:desc "LSP Execute code action" "a" #'lsp-execute-code-action :desc "LSP Execute code action" "a" #'lsp-execute-code-action
:desc "LSP Organize imports" "o" #'lsp-organize-imports :desc "LSP Organize imports" "o" #'lsp-organize-imports
:desc "Jump to symbol in current workspace" "j" #'consult-lsp-symbols :desc "Jump to symbol in current workspace" "j" #'consult-lsp-symbols
:desc "Jump to symbol in any workspace" "J" (cmd!! #'consult-lsp-symbols 'all-workspaces) :desc "Jump to symbol in any workspace" "J" (cmd!! #'consult-lsp-symbols 'all-workspaces)
(:when (modulep! :ui treemacs +lsp) (:when (modulep! :ui treemacs +lsp)
:desc "Errors list" "X" #'lsp-treemacs-errors-list :desc "Errors list" "X" #'lsp-treemacs-errors-list
:desc "Incoming call hierarchy" "y" #'lsp-treemacs-call-hierarchy :desc "Incoming call hierarchy" "y" #'lsp-treemacs-call-hierarchy
:desc "Outgoing call hierarchy" "Y" (cmd!! #'lsp-treemacs-call-hierarchy t) :desc "Outgoing call hierarchy" "Y" (cmd!! #'lsp-treemacs-call-hierarchy t)
:desc "References tree" "R" (cmd!! #'lsp-treemacs-references t) :desc "References tree" "R" (cmd!! #'lsp-treemacs-references t)
:desc "Symbols" "S" #'lsp-treemacs-symbols) :desc "Symbols" "S" #'lsp-treemacs-symbols)
:desc "LSP" "l" #'+default/lsp-command-map :desc "LSP" "l" #'+default/lsp-command-map
:desc "LSP Rename" "r" #'lsp-rename) :desc "LSP Rename" "r" #'lsp-rename)
(:when (modulep! :tools lsp +eglot) (:when (modulep! :tools lsp +eglot)
:desc "LSP Execute code action" "a" #'eglot-code-actions :desc "LSP Execute code action" "a" #'eglot-code-actions
:desc "LSP Rename" "r" #'eglot-rename :desc "LSP Rename" "r" #'eglot-rename
:desc "LSP Find declaration" "j" #'eglot-find-declaration :desc "LSP Find declaration" "j" #'eglot-find-declaration
(:when (modulep! :completion vertico) (:when (modulep! :completion vertico)
:desc "Jump to symbol in current workspace" "j" #'consult-eglot-symbols)) :desc "Jump to symbol in current workspace" "j" #'consult-eglot-symbols))
:desc "Compile" "c" #'compile :desc "Compile" "c" #'compile
:desc "Recompile" "C" #'recompile :desc "Recompile" "C" #'recompile
:desc "Jump to definition" "d" #'+lookup/definition :desc "Jump to definition" "d" #'+lookup/definition
:desc "Jump to references" "D" #'+lookup/references :desc "Jump to references" "D" #'+lookup/references
:desc "Evaluate buffer/region" "e" #'+eval/buffer-or-region :desc "Evaluate buffer/region" "e" #'+eval/buffer-or-region
:desc "Evaluate & replace region" "E" #'+eval:replace-region :desc "Evaluate & replace region" "E" #'+eval:replace-region
:desc "Format buffer/region" "f" #'+format/region-or-buffer :desc "Format buffer/region" "f" #'+format/region-or-buffer
:desc "Find implementations" "i" #'+lookup/implementations :desc "Find implementations" "i" #'+lookup/implementations
:desc "Jump to documentation" "k" #'+lookup/documentation :desc "Jump to documentation" "k" #'+lookup/documentation
:desc "Send to repl" "s" #'+eval/send-region-to-repl :desc "Send to repl" "s" #'+eval/send-region-to-repl
:desc "Find type definition" "t" #'+lookup/type-definition :desc "Find type definition" "t" #'+lookup/type-definition
:desc "Delete trailing whitespace" "w" #'delete-trailing-whitespace :desc "Delete trailing whitespace" "w" #'delete-trailing-whitespace
:desc "Delete trailing newlines" "W" #'doom/delete-trailing-newlines :desc "Delete trailing newlines" "W" #'doom/delete-trailing-newlines
:desc "List errors" "x" #'+default/diagnostics) :desc "List errors" "x" #'+default/diagnostics)
;;; <leader> q --- quit/restart
(:prefix-map ("q" . "quit/session")
:desc "Restart emacs server" "d" #'+default/restart-server
:desc "Delete frame" "f" #'delete-frame
:desc "Clear current frame" "F" #'doom/kill-all-buffers
:desc "Kill Emacs (and daemon)" "K" #'save-buffers-kill-emacs
:desc "Quit Emacs" "q" #'kill-emacs
:desc "Save and quit Emacs" "Q" #'save-buffers-kill-terminal
:desc "Quick save current session" "s" #'doom/quicksave-session
:desc "Restore last session" "l" #'doom/quickload-session
:desc "Save session to file" "S" #'doom/save-session
:desc "Restore session from file" "L" #'doom/load-session
:desc "Restart & restore Emacs" "r" #'doom/restart-and-restore
:desc "Restart Emacs" "R" #'doom/restart)
) )
(map! "s-c" #'kill-ring-save (map! "s-c" #'kill-ring-save
@ -358,7 +374,8 @@
;; "M-s-<down>" #'forward-paragraph ;; "M-s-<down>" #'forward-paragraph
"s-<up>" #'beginning-of-buffer "s-<up>" #'beginning-of-buffer
"s-<down>" #'end-of-buffer "s-<down>" #'end-of-buffer
"M-s-v" #'consult-yank-from-kill-ring) "M-s-v" #'consult-yank-from-kill-ring
"s-<return>" #'split-window-below)
(after! which-key (after! which-key
(let ((prefix-re (regexp-opt (list doom-leader-key doom-leader-alt-key)))) (let ((prefix-re (regexp-opt (list doom-leader-key doom-leader-alt-key))))

View file

@ -126,7 +126,7 @@
"s-M-<right>" 'centaur-tabs-forward "s-M-<right>" 'centaur-tabs-forward
"s-M-<left>" 'centaur-tabs-backward)) "s-M-<left>" 'centaur-tabs-backward))
(setq default-frame-alist '( (left . 0) (top . 0) (height . 48) (width . 150) )) (setq default-frame-alist '( (left . 0) (top . 0) (height . 48) (width . 160) ))
;; use kitty for terminal-here ;; use kitty for terminal-here
(setq terminal-here-mac-terminal-command '("kitty")) (setq terminal-here-mac-terminal-command '("kitty"))
@ -155,7 +155,7 @@
(setq sly-lisp-implementations (setq sly-lisp-implementations
'((sbcl ("sbcl")) '((sbcl ("sbcl"))
(ciel ("sbcl" "--core" "/Users/emenel/quicklisp/local-projects/CIEL/ciel-core" "--eval" "(in-package :ciel-user)")))) (ciel ("sbcl" "--core" "/Users/emenel/quicklisp/local-projects/CIEL/ciel-core" "--eval" "(in-package :ciel-user)"))))
(setq sly-default-lisp 'ciel) (setq sly-default-lisp 'sbcl)
(setq sly-complete-symbol-function 'sly-flex-completions)) (setq sly-complete-symbol-function 'sly-flex-completions))
;; make esc close completion from corfu ;; make esc close completion from corfu

View file

@ -7,7 +7,9 @@
'(column-number-mode t) '(column-number-mode t)
'(context-menu-mode t) '(context-menu-mode t)
'(size-indication-mode t) '(size-indication-mode t)
'(tool-bar-mode nil)) '(tool-bar-mode nil)
'(warning-suppress-log-types '((lsp-mode) (lsp-mode) (lsp-mode) (defvaralias)))
'(warning-suppress-types '((lsp-mode) (lsp-mode) (defvaralias))))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
@ -28,3 +30,13 @@
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.

30
init.el
View file

@ -60,10 +60,10 @@
fold ; (nigh) universal code folding fold ; (nigh) universal code folding
format ; automated prettiness format ; automated prettiness
;;god ; run Emacs commands without modifier keys ;;god ; run Emacs commands without modifier keys
;; lispy ; vim for lisp, for people who don't like vim lispy ; vim for lisp, for people who don't like vim
;; multiple-cursors ; editing in many places at once ;; multiple-cursors ; editing in many places at once
;; objed ; text object editing for the innocent ;; objed ; text object editing for the innocent
parinfer ; turn lisp into python, sort of ;; parinfer ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates ;;rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to snippets ; my elves. They type so I don't have to
word-wrap ; soft wrapping with language-aware indent word-wrap ; soft wrapping with language-aware indent
@ -107,7 +107,7 @@
;;taskrunner ; taskrunner for all your projects ;;taskrunner ; taskrunner for all your projects
;;terraform ; infrastructure as code ;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux ;;tmux ; an API for interacting with tmux
;; tree-sitter ; syntax and parsing, sitting in a tree... tree-sitter ; syntax and parsing, sitting in a tree...
;;upload ; map local to remote projects via ssh/ftp ;;upload ; map local to remote projects via ssh/ftp
:os :os
@ -117,9 +117,9 @@
:lang :lang
;;agda ; types of types of types of types... ;;agda ; types of types of types of types...
;;beancount ; mind the GAAP ;;beancount ; mind the GAAP
(cc +lsp) ; java with a lisp (cc +lsp +tree-sitter) ; java with a lisp
common-lisp ; if you've seen one lisp, you've seen them all common-lisp ; if you've seen one lisp, you've seen them all
(clojure +lsp) (clojure +lsp +tree-sitter)
;;coq ; proofs-as-programs ;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c ;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans ;;csharp ; unity, .NET, and mono shenanigans
@ -139,19 +139,19 @@
;;gdscript ; the language you waited for ;;gdscript ; the language you waited for
;;(go +lsp) ; the hipster dialect ;;(go +lsp) ; the hipster dialect
;;(graphql +lsp) ; Give queries a REST ;;(graphql +lsp) ; Give queries a REST
(haskell +lsp) ; a language that's lazier than I am (haskell +lsp +tree-sitter) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python ;;hy ; readability of scheme w/ speed of python
;;idris ; a language you can depend on ;;idris ; a language you can depend on
(json +lsp) ; At least it ain't XML (json +lsp +tree-sitter) ; At least it ain't XML
(java +lsp) ; the poster child for carpal tunnel syndrome (java +lsp +tree-sitter) ; the poster child for carpal tunnel syndrome
(javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) (javascript +lsp +tree-sitter) ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB ;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script) ;;kotlin ; a better, slicker Java(Script)
;;latex ; writing papers in Emacs has never been so fun latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove ;;lean ; for folks with too much to prove
;;ledger ; be audit you can be ;;ledger ; be audit you can be
lua ; one-based indices? one-based indices lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore (markdown +tree-sitter) ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c ;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!" ;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel ;;ocaml ; an objective camel
@ -159,14 +159,14 @@
php ; perl's insecure younger brother php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more ;;plantuml ; diagrams for confusing people more
purescript ; javascript, but functional purescript ; javascript, but functional
(python +lsp) ; beautiful is better than ugly (python +lsp +tree-sitter) ; beautiful is better than ugly
qt ; the 'cutest' gui framework ever qt ; the 'cutest' gui framework ever
(racket +lsp) ; a DSL for DSLs (racket +lsp) ; a DSL for DSLs
;;raku ; the artist formerly known as perl6 ;;raku ; the artist formerly known as perl6
;;rest ; Emacs as a REST client ;;rest ; Emacs as a REST client
;;rst ; ReST in peace ;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() (rust +lsp +tree-sitter) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good ;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps ;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor sh ; she sells {ba,z,fi}sh shells on the C xor
@ -174,8 +174,8 @@
;;solidity ; do you need a blockchain? No. ;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables? ;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance. ;;terra ; Earth and Moon in alignment for performance.
(web +lsp) (web +lsp +tree-sitter)
yaml ; JSON, but readable (yaml +tree-sitter) ; JSON, but readable
;;zig ; C, but simpler ;;zig ; C, but simpler
:email :email

View file

@ -6,18 +6,18 @@
(defun meow/setup-leader () (defun meow/setup-leader ()
(map! :leader (map! :leader
:desc "Meow Cheatsheet" :desc "Meow Cheatsheet"
"?" #'meow-cheatsheet)) "?" #'meow-cheatsheet
;; "/" #'meow-keypad-describe-key)) "/" #'meow-keypad-describe-key
;; "1" #'meow-digit-argument "1" #'meow-digit-argument
;; "2" #'meow-digit-argument "2" #'meow-digit-argument
;; "3" #'meow-digit-argument "3" #'meow-digit-argument
;; "4" #'meow-digit-argument "4" #'meow-digit-argument
;; "5" #'meow-digit-argument "5" #'meow-digit-argument
;; "6" #'meow-digit-argument "6" #'meow-digit-argument
;; "7" #'meow-digit-argument "7" #'meow-digit-argument
;; "8" #'meow-digit-argument "8" #'meow-digit-argument
;; "9" #'meow-digit-argument "9" #'meow-digit-argument
;; "0" #'meow-digit-argument)) "0" #'meow-digit-argument))
;; Keypad ;; Keypad
(defun meow/setup-keypad () (defun meow/setup-keypad ()
@ -327,6 +327,7 @@
(meow/setup-leader)) (meow/setup-leader))
(t (meow/setup-keypad))) (t (meow/setup-keypad)))
(pushnew! meow-mode-state-list '(sly-db-mode . motion)) (pushnew! meow-mode-state-list '(sly-db-mode . motion))
(pushnew! meow-mode-state-list '(sly-inspector-mode . motion))
(map! :map meow-keymap [remap describe-key] #'helpful-key)) (map! :map meow-keymap [remap describe-key] #'helpful-key))
(if (modulep! :editor evil) (if (modulep! :editor evil)
@ -334,3 +335,5 @@
(defun meow-init-local-var-hooks-disable-evil () (defun meow-init-local-var-hooks-disable-evil ()
(remove-hook 'doom-after-modules-config-hook 'evil-mode) (remove-hook 'doom-after-modules-config-hook 'evil-mode)
(evil-mode -1)))) (evil-mode -1))))
;; REVIEW look into better ways to manage key binds, and see if general.el can support meow modes instead of evil modes

View file

@ -1,16 +1,16 @@
;;; editor/meow/init.el -*- lexical-binding: t; -*- ;;; editor/meow/init.el -*- lexical-binding: t; -*-
;; Rewriting the doom-localleader-key! macro to add support for meow mode ;; Rewriting the doom-localleader-key! macro to add support for meow mode
;; (when (featurep! :editor meow +leader)) ;; (when (modulep! :editor meow +leader)
;; (defmacro define-localleader-key! (&rest args) ;; (defmacro define-localleader-key! (&rest args)
;; `(progn ;; `(progn
;; (general-define-key ;; (general-define-key
;; :keymaps '(meow-normal-state-keymap meow-motion-state-keymap) ;; :keymaps '(meow-normal-state-keymap meow-motion-state-keymap)
;; :major-modes t ;; :major-modes t
;; :prefix doom-localleader-key ;; :prefix doom-localleader-key
;; ,@args) ;; ,@args)
;; (general-define-key ;; (general-define-key
;; :keymaps 'meow-insert-state-keymap ;; :keymaps 'meow-insert-state-keymap
;; :major-modes t ;; :major-modes t
;; :prefix doom-localleader-alt-key ;; :prefix doom-localleader-alt-key
;; ,@args)))) ;; ,@args))))