Skip to content

Commit

Permalink
emacs: style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tiborpilz committed Mar 28, 2024
1 parent 17238f8 commit 4ebf9c4
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 28 deletions.
17 changes: 16 additions & 1 deletion home/config/doom/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,16 @@

(setq projectile-project-search-path '(("~/Code/" . 1)))

(setq +workspaces-on-switch-project-behavior nil)

(use-package! jest
:after (typescript-mode js-mode typescript-tsx-mode)
:hook (typescript-mode . jest-minor-mode))

;; (advice-add 'lsp
;; :before (lambda (&rest _args)
;; (setf (lsp-session-server-id->folders (lsp-session)) (ht))))

(use-package! svelte-mode
:mode "\\.svelte\\'")

Expand Down Expand Up @@ -566,6 +572,10 @@ for what debugger to use. If the prefix ARG is set, prompt anyway."

(setq doom-modeline-hud t)

(setq doom-modeline-buffer-encoding nil)
(setq doom-modeline-modal nil)
(setq doom-modeline-column-format "")

(use-package! spacious-padding
:config
(setq spacious-padding-width '(
Expand Down Expand Up @@ -600,7 +610,7 @@ for what debugger to use. If the prefix ARG is set, prompt anyway."

(defun minibuffer-format-candidate (orig cand prefix suffix index _start)
(let ((prefix (if (= vertico--index index)
" " " ")))
" > " " ")))
(funcall orig cand prefix suffix index _start)))

(advice-add #'vertico--format-candidate
Expand All @@ -610,6 +620,11 @@ for what debugger to use. If the prefix ARG is set, prompt anyway."

(setq vertico-posframe-width 200)

(setq vertico-posframe-parameters
'((left-fringe . 16)
(right-fringe . 8)
(border-width . 16)))

(use-package! xwwp-full
:after xwidget-webkit
:custom
Expand Down
53 changes: 40 additions & 13 deletions home/config/doom/config.org
Original file line number Diff line number Diff line change
Expand Up @@ -541,13 +541,19 @@ no modeline.
(org-capture)))
#+END_SRC

* Projectile
** Project Search Path
* Workspaces & Projects
** Projectile Project Search Path
Search for projects in ~~/Code/~, but only one level deep.
#+begin_src elisp
(setq projectile-project-search-path '(("~/Code/" . 1)))
#+end_src
** Disable Automatic Workspace Creation
Per default, emacs creates a workspace for every project - prohibiting, for
instance, side-by-side editing. I'm disabling this behavior.

#+begin_src elisp
(setq +workspaces-on-switch-project-behavior nil)
#+end_src
* Development
** Language-Specific Settings
*** Web Dev (JS/TS/CSS)
Expand All @@ -562,6 +568,22 @@ Search for projects in ~~/Code/~, but only one level deep.
:after (typescript-mode js-mode typescript-tsx-mode)
:hook (typescript-mode . jest-minor-mode))
#+end_src
**** TODO Eslint
Eslint keeps track of all projects it has been run in, and - even if only one
workspace is open, will start to run in all of them.
The following sets it to run only in the current session.

#+begin_src elisp
;; (advice-add 'lsp
;; :before (lambda (&rest _args)
;; (setf (lsp-session-server-id->folders (lsp-session)) (ht))))
#+end_src

Now, this runs into the issue that switching workspaces will not automatically
switch the client, so I'm adding a hook to restart all lsp clients when I'm
switching workspaces.

First, I need to define a function to restart all clients.
**** Svelte
#+begin_src elisp :tangle packages.el
(package! svelte-mode)
Expand Down Expand Up @@ -1407,7 +1429,6 @@ create a color scheme with more nuance via color correcting the applied colors.
** Modeline
*** Doom Modeline
Allow for more characters in the branch name

#+begin_src elisp
(setq doom-modeline-vcs-max-length 50)
#+end_src
Expand All @@ -1416,6 +1437,12 @@ Allow for more characters in the branch name
(setq doom-modeline-hud t)
#+end_src

Disable additional unnecessary information
#+begin_src elisp
(setq doom-modeline-buffer-encoding nil)
(setq doom-modeline-modal nil)
(setq doom-modeline-column-format "")
#+end_src
** UI
*** General Padding
The way windows have been close together always kind of botheres me. Luckily,
Expand Down Expand Up @@ -1548,11 +1575,11 @@ I don't really need the modeline in the treemacs buffer, so I'm disabling it.
(add-hook 'treemacs-mode-hook #'hide-mode-line-mode)
#+end_src
** Vertico
Prefix the current candidte with an arrow
Prefix the current candidate with an arrow
#+begin_src elisp
(defun minibuffer-format-candidate (orig cand prefix suffix index _start)
(let ((prefix (if (= vertico--index index)
" " " ")))
" > " " ")))
(funcall orig cand prefix suffix index _start)))

(advice-add #'vertico--format-candidate
Expand All @@ -1569,6 +1596,14 @@ Make vertico-posframe a little wider
(setq vertico-posframe-width 200)
#+end_src

Add fringe to vertico-posframea
#+begin_src elisp
(setq vertico-posframe-parameters
'((left-fringe . 16)
(right-fringe . 8)
(border-width . 16)))
#+end_src

** Xwidget Webkit
*** Emacs xwidget-webkit enhancement suite

Expand Down Expand Up @@ -1620,12 +1655,4 @@ Various tweaks to improve the overall performance.

;; HTTP requests via babel
(package! ob-http :pin "b1428ea2a63bcb510e7382a1bf5fe82b19c104a7")

;; OrgRoam visualization / webapp

;; automatic latex rendering

;; export github markdown
(package! ox-gfm :pin "99f93011b069e02b37c9660b8fcb45dab086a07f")

#+end_src
14 changes: 7 additions & 7 deletions home/config/doom/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
(company +childframe) ; the ultimate code completion backend
;;ido ; the other *other* search engine...
;;(ivy +fuzzy +icons) ; a search engine for love and lifoe
;;(helm +fuzzy) ; the *other* search engine for love and life
;; (helm +fuzzy +icons +childframe) ; the *other* search engine for love and life
(vertico +icons) ; the search engine of the future

:ui
Expand Down Expand Up @@ -131,10 +131,10 @@
;;(dart +flutter) ; paint ui and not much else
dhall
;;elixir ; erlang done right
elm ; care for a cup of TEA?
;; elm ; care for a cup of TEA?
emacs-lisp
;;erlang ; an elegant language for a more civilized age
ess ; emacs speaks statistics
;; ess ; emacs speaks statistics
;;factor
faust ; dsp, but you get to keep your soul
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
Expand Down Expand Up @@ -163,14 +163,14 @@
(nix +lsp) ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org
+brain
;; +brain
+dragndrop
+gnuplot
+hugo
;; +hugo
+ipython
+journal
;+jupyter
+noter
; +jupyter
;; +noter
+pandoc
+pomodoro
+present
Expand Down
7 changes: 0 additions & 7 deletions home/config/doom/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,3 @@

;; HTTP requests via babel
(package! ob-http :pin "b1428ea2a63bcb510e7382a1bf5fe82b19c104a7")

;; OrgRoam visualization / webapp

;; automatic latex rendering

;; export github markdown
(package! ox-gfm :pin "99f93011b069e02b37c9660b8fcb45dab086a07f")

0 comments on commit 4ebf9c4

Please sign in to comment.