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:
parent
3818023a94
commit
08fd57b5d6
1056
.doom.d/config.el
Normal file
1056
.doom.d/config.el
Normal file
File diff suppressed because it is too large
Load Diff
@ -197,16 +197,25 @@ returned by `request`."
|
|||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(defun path! (&rest components)
|
(defun path! (&rest components)
|
||||||
(apply #'f-join components))
|
(apply #'f-join components))
|
||||||
|
|
||||||
|
(defun home! (&rest components)
|
||||||
|
(apply #'path! (cons ($home) components)))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC elisp
|
||||||
|
(defun advice! (fn components)
|
||||||
|
(apply #'f-join components))
|
||||||
|
#+END_SRC
|
||||||
** Magic Vars
|
** Magic Vars
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(defun $file () buffer-file-name)
|
(defun $file () buffer-file-name)
|
||||||
(defun $ext () (f-ext ($file)))
|
(defun $ext (&optional dot) (f-ext ($file) dot))
|
||||||
(defun $cwd (&optional dir)
|
(defun $cwd (&optional dir)
|
||||||
(if dir
|
(if dir
|
||||||
dir
|
dir
|
||||||
(f-dirname ($file))))
|
(f-dirname ($file))))
|
||||||
|
(defun $home ()
|
||||||
|
(expand-file-name "~/"))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Appearance
|
* Appearance
|
||||||
@ -1202,18 +1211,19 @@ Setup: run =M-x dap-go-setup=
|
|||||||
;; (setq projectile-project-search-path
|
;; (setq projectile-project-search-path
|
||||||
;; '("~/Code"))
|
;; '("~/Code"))
|
||||||
|
|
||||||
(defun my/projectile-project-ignored-p (root)
|
(defun my/project-ignored-p (root)
|
||||||
(or (doom-project-ignored-p root)
|
(or (doom-project-ignored-p root)
|
||||||
(file-in-directory-p root "/opt/ts/fuse/artfs_mounts")
|
(f-descendant-of-p root (home! ".rustup"))
|
||||||
(file-in-directory-p root "/home/tsdist/vats_deployments")))
|
(f-descendant-of-p root "/opt/ts/fuse/artfs_mounts")
|
||||||
(setq projectile-ignored-project-function #'my/projectile-project-ignored-p)
|
(f-descendant-of-p root "/home/tsdist/vats_deployments")))
|
||||||
|
(setq projectile-ignored-project-function #'my/project-ignored-p)
|
||||||
|
|
||||||
(defun my/projectile-switch-project ()
|
(defun my/projectile-switch-project ()
|
||||||
(interactive)
|
(interactive)
|
||||||
;; Prune projects which no longer exist
|
;; Prune projects which no longer exist
|
||||||
(when (boundp 'projectile-known-projects)
|
(when (boundp 'projectile-known-projects)
|
||||||
(dolist (project projectile-known-projects)
|
(dolist (project projectile-known-projects)
|
||||||
(unless (file-directory-p project)
|
(unless (f-dir-p project)
|
||||||
(projectile-remove-known-project project))))
|
(projectile-remove-known-project project))))
|
||||||
(call-interactively #'counsel-projectile-switch-project))
|
(call-interactively #'counsel-projectile-switch-project))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
@ -1227,15 +1237,22 @@ Setup: run =M-x dap-go-setup=
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC elisp
|
#+BEGIN_SRC elisp
|
||||||
(defun my/lsp-find-root (lsp--find-root-interactively &rest args)
|
(defun my/lsp-find-root (&rest args)
|
||||||
(or
|
(or
|
||||||
(and (ts/repo/p)
|
(pcase ($ext t)
|
||||||
(pcase (f-ext ($file) t)
|
(".rs" (my/rust/workspace-root))
|
||||||
(".rs" (my/rust/workspace-root))
|
(_ nil))))
|
||||||
(_ nil)))
|
|
||||||
(apply lsp--find-root-interactively args)))
|
|
||||||
|
|
||||||
(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
|
#+END_SRC
|
||||||
|
|
||||||
** Counsel Search
|
** Counsel Search
|
||||||
|
2
.doom.d/env.el
Normal file
2
.doom.d/env.el
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
("DISPLAY=:0"
|
||||||
|
"SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh")
|
Loading…
Reference in New Issue
Block a user