1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-14 16:59:27 -05:00

28 Oct 2022 10:19:36

This commit is contained in:
Jack Foltz 2022-10-28 10:19:36 -04:00
parent 3818023a94
commit 08fd57b5d6
No known key found for this signature in database
GPG Key ID: 79C872C088D157D1
3 changed files with 1088 additions and 13 deletions

1056
.doom.d/config.el Normal file

File diff suppressed because it is too large Load Diff

View File

@ -197,16 +197,25 @@ returned by `request`."
#+BEGIN_SRC elisp
(defun path! (&rest components)
(apply #'f-join components))
(defun home! (&rest components)
(apply #'path! (cons ($home) components)))
#+END_SRC
#+BEGIN_SRC elisp
(defun advice! (fn components)
(apply #'f-join components))
#+END_SRC
** Magic Vars
#+BEGIN_SRC elisp
(defun $file () buffer-file-name)
(defun $ext () (f-ext ($file)))
(defun $ext (&optional dot) (f-ext ($file) dot))
(defun $cwd (&optional dir)
(if dir
dir
(f-dirname ($file))))
(defun $home ()
(expand-file-name "~/"))
#+END_SRC
* Appearance
@ -1202,18 +1211,19 @@ Setup: run =M-x dap-go-setup=
;; (setq projectile-project-search-path
;; '("~/Code"))
(defun my/projectile-project-ignored-p (root)
(defun my/project-ignored-p (root)
(or (doom-project-ignored-p root)
(file-in-directory-p root "/opt/ts/fuse/artfs_mounts")
(file-in-directory-p root "/home/tsdist/vats_deployments")))
(setq projectile-ignored-project-function #'my/projectile-project-ignored-p)
(f-descendant-of-p root (home! ".rustup"))
(f-descendant-of-p root "/opt/ts/fuse/artfs_mounts")
(f-descendant-of-p root "/home/tsdist/vats_deployments")))
(setq projectile-ignored-project-function #'my/project-ignored-p)
(defun my/projectile-switch-project ()
(interactive)
;; Prune projects which no longer exist
(when (boundp 'projectile-known-projects)
(dolist (project projectile-known-projects)
(unless (file-directory-p project)
(unless (f-dir-p project)
(projectile-remove-known-project project))))
(call-interactively #'counsel-projectile-switch-project))
#+END_SRC
@ -1227,15 +1237,22 @@ Setup: run =M-x dap-go-setup=
#+END_SRC
#+BEGIN_SRC elisp
(defun my/lsp-find-root (lsp--find-root-interactively &rest args)
(defun my/lsp-find-root (&rest args)
(or
(and (ts/repo/p)
(pcase (f-ext ($file) t)
(pcase ($ext t)
(".rs" (my/rust/workspace-root))
(_ nil)))
(apply lsp--find-root-interactively args)))
(_ nil))))
(advice-add 'lsp--find-root-interactively :around #'my/lsp-find-root)
(advice-add 'lsp--find-root-interactively :before-until #'my/lsp-find-root)
(defun my/lsp-buffer-killed ()
(when lsp-mode
(let ((root (lsp-find-session-folder (lsp-session) ($cwd))))
;; If we're in an ignored project, remove it from the LSP session
(when (my/project-ignored-p root)
(lsp-workspace-folders-remove root)))))
(add-hook 'kill-buffer-hook #'my/lsp-buffer-killed)
#+END_SRC
** Counsel Search

2
.doom.d/env.el Normal file
View File

@ -0,0 +1,2 @@
("DISPLAY=:0"
"SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh")