mirror of
https://github.com/Foltik/dotfiles
synced 2025-03-01 10:14:10 -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
|
#+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 (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
|
#+END_SRC
|
||||||
|
|
||||||
** Counsel Search
|
** Counsel Search
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
eshell ; the elisp shell that works everywhere
|
eshell ; the elisp shell that works everywhere
|
||||||
;;shell ; simple shell REPL for Emacs
|
;;shell ; simple shell REPL for Emacs
|
||||||
;;term ; basic terminal emulator for Emacs
|
;;term ; basic terminal emulator for Emacs
|
||||||
;;vterm ; the best terminal emulation in Emacs
|
vterm ; the best terminal emulation in Emacs
|
||||||
|
|
||||||
:checkers
|
:checkers
|
||||||
syntax ; tasing you for every semicolon you forget
|
syntax ; tasing you for every semicolon you forget
|
||||||
|
Loading…
Reference in New Issue
Block a user