mirror of
https://github.com/Foltik/dotfiles
synced 2024-11-27 13:13:12 -05:00
Compare commits
4 Commits
3818023a94
...
ade35c7240
Author | SHA1 | Date | |
---|---|---|---|
ade35c7240 | |||
0a9b273dcc | |||
b4d05e3c63 | |||
08fd57b5d6 |
2
.doom.d/.gitignore
vendored
Normal file
2
.doom.d/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
config.el
|
||||
env.el
|
@ -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)
|
||||
(".rs" (my/rust/workspace-root))
|
||||
(_ nil)))
|
||||
(apply lsp--find-root-interactively args)))
|
||||
(pcase ($ext t)
|
||||
(".rs" (my/rust/workspace-root))
|
||||
(_ 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 (bound-and-true-p 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
|
||||
|
@ -76,7 +76,7 @@
|
||||
eshell ; the elisp shell that works everywhere
|
||||
;;shell ; simple shell REPL for Emacs
|
||||
;;term ; basic terminal emulator for Emacs
|
||||
;;vterm ; the best terminal emulation in Emacs
|
||||
vterm ; the best terminal emulation in Emacs
|
||||
|
||||
:checkers
|
||||
syntax ; tasing you for every semicolon you forget
|
||||
|
Loading…
Reference in New Issue
Block a user