Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/qualify of life updates #46

Merged
merged 6 commits into from
Mar 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions emacs/config.org
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
(read-shell-command "$ ")))
(start-process-shell-command command nil command))))))


; setup directories we need for emacs
(dolist (directory '("auto-saves" "backups" "locks"))
(unless (file-directory-p (concat user-emacs-directory directory))
(mkdir (concat user-emacs-directory directory))))

(use-package emacs
:ensure nil
:config (recentf-mode t)
Expand Down Expand Up @@ -108,10 +114,10 @@
(setq affe-count 10000)
(setq affe-regexp-function #'orderless-pattern-compiler
affe-highlight-function #'orderless--highlight
affe-find-command "rg --color=never --files --hidden -g !.git/"
affe-grep-command "rg --null --color=never --max-columns=1000 --no-heading --line-number -v ^$ . --hidden -g !.git/")
:bind (("M-s af" . affe-find)
("M-s ag" . affe-grep)))
affe-find-command "rg --color=never --files --hidden -g !.git -g !.venv"
affe-grep-command "rg --null --color=never --max-columns=1000 --no-heading --line-number -v ^$ --hidden -g !.git -g !.venv")
:bind (("M-s a f" . affe-find)
("M-s a g" . affe-grep)))

;; Example configuration for Consult
(use-package consult
Expand Down Expand Up @@ -365,13 +371,15 @@
;; :config
;; (require 'org-download))

(setq treesit-extra-load-path '("/Users/dj_goku/dev/github/casouri/tree-sitter-module/dist"))
(setq treesit-extra-load-path '("~/dev/github/casouri/tree-sitter-module/dist"))
(add-to-list 'major-mode-remap-alist '(python-mode . python-ts-mode))
(use-package heex-ts-mode :ensure t)

(use-package elixir-ts-mode
(use-package treesit-auto
:ensure t
:config (global-subword-mode t))
:custom
(treesit-auto-install 'prompt)
:config
(treesit-auto-add-to-auto-mode-alist 'all)
(global-treesit-auto-mode))

;; M-. xref-find-definitions
;; M-, xref-go-back
Expand All @@ -383,15 +391,17 @@
;; https://github.com/joaotavora/eglot/discussions/1226#discussioncomment-6010670
(add-to-list 'project-vc-ignores "./.venv/")
(setq eldoc-echo-area-use-multiline-p t)
(dolist (mode '(elixir-ts-mode heex-ts-mode))
(add-to-list 'eglot-server-programs `(,mode . ("/Users/dj_goku/dev/github/elixir-lsp/elixir-ls/release/language_server.sh"))))
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
`((elixir-ts-mode heex-ts-mode elixir-mode) .
("nextls" "--stdio=true" :initializationOptions (:experimental (:completions (:enable t)))))))
(add-to-list 'eglot-server-programs '(nix-mode . ("rnix-lsp")))
(add-to-list 'eglot-server-programs
'((python-mode python-ts-mode) "pyright-langserver" "--stdio"))
(add-to-list 'eglot-server-programs '(terraform-mode "terraform-ls" "serve"))
:hook ((elixir-ts-mode . eglot-ensure)
(heex-ts-mode . eglot-ensure)
:hook ((elixir-mode . eglot-ensure)
(elixir-ts-mode . eglot-ensure)
(heex-ts-mode . eglot-ensure)
(python-mode . eglot-ensure)
(python-ts-mode . eglot-ensure)
(nix-mode . eglot-ensure)
Expand Down Expand Up @@ -536,8 +546,7 @@
(use-package buffer-env
:ensure t
:hook (hack-local-variables . buffer-env-update)
:config (setq buffer-env-script-name '(".envrc" ".venv/bin/activate"))
(setq buffer-env-safe-files '(".venv/bin/activate")))
:config (setq buffer-env-script-name '(".envrc" ".venv/bin/activate")))

(use-package buffer-name-relative
:ensure t
Expand Down
Loading