Full Refactor and history reset

This commit is contained in:
2026-03-19 10:47:32 -05:00
commit c5d7d9e3da
65 changed files with 4632 additions and 0 deletions

85
dotfiles/alacritty.toml Normal file
View File

@@ -0,0 +1,85 @@
# test
[colors.primary]
background = "#292D3E"
foreground = "#C6D0F5"
dim_foreground = "#C6D0F5"
bright_foreground = "#C6D0F5"
[colors.cursor]
text = "#303446"
cursor = "#F2D5CF"
[colors.vi_mode_cursor]
text = "#303446"
cursor = "#BABBF1"
[colors.search.matches]
foreground = "#303446"
background = "#A5ADCE"
[colors.search.focused_match]
foreground = "#303446"
background = "#A6D189"
[colors.footer_bar]
foreground = "#303446"
background = "#A5ADCE"
[colors.hints.start]
foreground = "#303446"
background = "#E5C890"
[colors.hints.end]
foreground = "#303446"
background = "#A5ADCE"
[colors.selection]
text = "#303446"
background = "#F2D5CF"
[colors.normal]
black = "#51576D"
red = "#E78284"
green = "#A6D189"
yellow = "#E5C890"
blue = "#8CAAEE"
magenta = "#F4B8E4"
cyan = "#81C8BE"
white = "#B5BFE2"
[colors.bright]
black = "#626880"
red = "#E78284"
green = "#A6D189"
yellow = "#E5C890"
blue = "#8CAAEE"
magenta = "#F4B8E4"
cyan = "#81C8BE"
white = "#A5ADCE"
[colors.dim]
black = "#51576D"
red = "#E78284"
green = "#A6D189"
yellow = "#E5C890"
blue = "#8CAAEE"
magenta = "#F4B8E4"
cyan = "#81C8BE"
white = "#B5BFE2"
[[colors.indexed_colors]]
index = 16
color = "#EF9F76"
[[colors.indexed_colors]]
index = 17
color = "#F2D5CF"
[window]
opacity = 0.9
[font]
normal = { family = "PragmataPro Mono Liga", style = "Regular" }
bold = { family = "PragmataPro Mono Liga", style = "Bold" }
italic = { family = "PragmataPro Mono Liga", style = "Italic" }
size = 12

View File

@@ -0,0 +1,75 @@
[colors.primary]
background = "#eff1f5"
foreground = "#4c4f69"
dim_foreground = "#8c8fa1"
bright_foreground = "#4c4f69"
[colors.cursor]
text = "#eff1f5"
cursor = "#dc8a78"
[colors.vi_mode_cursor]
text = "#eff1f5"
cursor = "#7287fd"
[colors.search.matches]
foreground = "#eff1f5"
background = "#6c6f85"
[colors.search.focused_match]
foreground = "#eff1f5"
background = "#40a02b"
[colors.footer_bar]
foreground = "#eff1f5"
background = "#6c6f85"
[colors.hints.start]
foreground = "#eff1f5"
background = "#df8e1d"
[colors.hints.end]
foreground = "#eff1f5"
background = "#6c6f85"
[colors.selection]
text = "#eff1f5"
background = "#dc8a78"
[colors.normal]
black = "#bcc0cc"
red = "#d20f39"
green = "#40a02b"
yellow = "#df8e1d"
blue = "#1e66f5"
magenta = "#ea76cb"
cyan = "#179299"
white = "#5c5f77"
[colors.bright]
black = "#acb0be"
red = "#d20f39"
green = "#40a02b"
yellow = "#df8e1d"
blue = "#1e66f5"
magenta = "#ea76cb"
cyan = "#179299"
white = "#6c6f85"
[colors.dim]
black = "#bcc0cc"
red = "#d20f39"
green = "#40a02b"
yellow = "#df8e1d"
blue = "#1e66f5"
magenta = "#ea76cb"
cyan = "#179299"
white = "#5c5f77"
[[colors.indexed_colors]]
index = 16
color = "#fe640b"
[[colors.indexed_colors]]
index = 17
color = "#dc8a78"

2
dotfiles/config.nu Normal file
View File

@@ -0,0 +1,2 @@

415
dotfiles/emacs/config.org Normal file
View File

@@ -0,0 +1,415 @@
#+PROPERTY: header-args :tangle config.el
* My Info
Basic info for some templates
#+begin_src elisp
(setq user-full-name "Joe Bellus"
user-mail-address "joe@5sigma.io")
#+end_src
* Appearance
** Fonts
Setup default fonts and faces.
#+begin_src elisp
(setq doom-font (font-spec :family "PragmataPro Mono Liga" :size 16 :weight 'bold)
doom-variable-pitch-font (font-spec :family "Iosevka" :size 16 :weight 'light)
doom-big-font (font-spec :family "Iosevka" :size 22. :weight 'medium)
doom-themes-enable-bold t
doom-themes-enable-italic t
)
#+End_src
** Window Size
#+begin_src elisp
;; (setq default-frame-alist '((width . 200) (height . 55)))
#+end_src
** Theme
#+begin_src elisp
(setq doom-theme 'doom-palenight)
;; (after! doom-themes
;; (load-theme 'doom-nano-light t))
;; (use-package! doom-nano-modeline
;; :config
;; (doom-nano-modeline-mode 1)
;; (global-hide-mode-line-mode nil))
#+end_src
** Translucency
Setup some translucency to make things look nice.
#+begin_src emacs-lisp
(doom/set-frame-opacity 100)
(set-frame-parameter nil 'alpha-background 100)
(add-to-list 'default-frame-alist '(alpha-background . 100))
#+end_src
* Startup
** Load custom scripts
#+begin_src elisp
;; (add-to-list 'load-path "~/.config/doom/el")
#+end_src
** Startup buffer
#+begin_src elisp
(setq +doom-dashboard-menu-sections '
(
("Recently opened files" :icon
(nerd-icons-faicon "nf-fa-file_text" :face 'doom-dashboard-menu-title)
:action recentf-open-files)
("Open org-agenda"
:icon (nerd-icons-octicon "nf-oct-calendar" :face 'doom-dashboard-menu-title)
:when (fboundp 'org-agenda)
:action org-agenda)
("Open Notes"
:icon (nerd-icons-faicon "nf-fa-file_text" :face 'doom-dashboard-menu-title)
:action +default/browse-notes)
))
(remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-shortmenu)
(remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-banner)
(remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-footer)
(remove-hook '+doom-dashboard-functions #'doom-dashboard-widget-loaded)
(setq +doom-dashboard-banner-padding '(1 . 1))
(add-hook! '+doom-dashboard-functions :append 'doom-dashboard-widget-shortmenu)
(add-hook! '+doom-dashboard-functions :append 'doom-dashboard-widget-loaded)
#+end_src
* Editor
** Line numbering
Enable basic line numbering
#+begin_src elisp
(setq display-line-numbers-type t)
#+end_src
** Quit Confirmation
Don't prompt to quit
#+begin_src elisp
(setq confirm-kill-emacs nil)
#+end_src
** Horizontal scrolling
#+begin_src elisp
(setq mouse-wheel-tilt-scroll t)
#+end_src
** Precision mouse scrolling
#+begin_src elisp
(setq pixel-scroll-precision-mode t)
#+end_src
* Org Mode
** General settings
#+begin_src elisp
(require 'org)
(setq org-ellipsis ""
org-hide-emphasis-markers t
org-src-fontify-natively t
org-fontify-quote-and-verse-blocks t
org-src-tab-acts-natively t
org-hide-block-startup nil
org-startup-folded 'content
org-cycle-separator-lines 2
org-directory "~/org/"
org-agenda-files '("~/org/" "~/org/agenda/" "~/org/agenda/projects/")
)
(setq-default prettify-symbols-alist '(("#+BEGIN_SRC" . "")
("#+END_SRC" . "")
("#+begin_src" . "")
("#+end_src" . "")))
(setq prettify-symbols-unprettify-at-point 'right-edge)
(defun org-setup ()
(setq-local display-line-numbers nil))
(add-hook 'org-mode-hook 'org-setup)
#+end_src
** Visual fill column
#+begin_src elisp
(setq visual-fill-column-width 110
visual-fill-column-center-text t)
#+end_src
** Org presentation
#+begin_src elisp
(defun my/org-present-start ()
(visual-fill-column-mode 1)
(setq header-line-format " ")
(visual-line-mode 1)
(hide-mode-line-mode)
(setq-local
hl-line-mode nil)
(setq-local face-remapping-alist
'((default (:height 1.5) variable-pitch)
(header-line (:height 4.0) variable-pitch)
(org-document-title (:height 1.75) org-document-title)
(org-code (:height 1.55) org-code)
(org-verbatim (:height 1.55) org-verbatim)
(org-block (:height 1.25) org-block)
(org-block-begin-line (:height 0.7) org-block)))
)
(defun my/org-present-end ()
(visual-fill-column-mode 0)
(hide-mode-line-mode)
(visual-line-mode 0)
(setq header-line-format nil)
(setq-local face-remapping-alist nil
hl-line-mode t))
(add-hook 'org-present-mode-hook 'my/org-present-start)
(add-hook 'org-present-mode-quit-hook 'my/org-present-end)
#+end_src
** Setup org header faces
#+begin_src elisp
(dolist
(face '((org-level-1 . 1.2)
(org-level-2 . 1.1)
(org-level-3 . 1.05)
(org-level-4 . 1.0)
(org-level-5 . 1.0)
(org-level-6 . 1.0)
(org-level-7 . 1.0)
(org-level-8 . 1.0)))
(set-face-attribute (car face) nil
:font "Iosevka"
:weight 'medium
:height (cdr face)))
(set-face-attribute 'org-document-title nil :font "Iosevka" :weight 'bold :height 1.3)
(set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch)
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
(set-face-attribute 'org-formula nil :inherit 'fixed-pitch)
(set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)
(set-face-attribute 'bold nil :foreground "#c678dd" :weight 'extrabold)
#+end_src
** Bullets
#+begin_src elisp
(use-package org-bullets
:after org
:hook (org-mode . org-bullets-mode)
:custom
(org-bullets-bullet-list '("" "" "" "" "" "" "" "")))
#+end_src
** Capture templates
#+begin_src elisp
(setq +org-capture-todo-file "agenda/tasks.org")
(setq +org-capture-notes-file "notes/personal/index.org")
(setq org-capture-templates
'(
("n" "Notes")
("nq" "Quikerve notes" entry
(file+headline "notes/quikserve/index.org" "Inbox")
"* %u %?\n%i\n%a" :prepend t)
("np" "Personal notes" entry
(file+headline +org-capture-notes-file "Inbox")
"* %u %?\n%i\n%a" :prepend t)
("t" "Tasks")
("tp" "Personal todo" entry
(file+headline +org-capture-todo-file "Inbox")
"* TODO %?\n%i\n%a" :prepend t)
("tq" "Quikserve todo" entry
(file+headline "agenda/quikserve.org" "Inbox")
"* TODO %?\n%i\n%a" :prepend t)
("j" "Journal")
("jp" "Personal journal" entry
(file+olp+datetree "journal/personal.org")
"* %U %?\n%i\n%a" :prepend t)
("jq" "Quikserve journal" entry
(file+olp+datetree "journal/quikserve.org")
"* %U %?\n%i\n%a" :prepend t)
("p" "Templates for projects")
("pt" "Project TODO" entry (file+headline project-agenda-file "Inbox")
"* TODO %?\n%i\n%a" :prepend t)
("pn" "Project notes" entry (file+headline project-notes-file "Quicknotes")
"* %U %?\n%i\n%a" :prepend t)
("pc" "Project-local changelog" entry
(file+headline +org-capture-project-changelog-file "Unreleased")
"* %U %?\n%i" :prepend t)))
(defun project-agenda-file ()
(expand-file-name (concat "agenda/projects/" (project-name (project-current)) ".org") org-directory))
(defun project-notes-file ()
(expand-file-name (concat "notes/projects/" (project-name (project-current)) ".org") org-directory))
#+end_src
** Don't show before schedule time
Hide items in the TODO list and agenda if they have a scheduled time that has not passed
#+begin_src elisp
(setq org-agenda-todo-ignore-scheduled 'future)
(setq org-agenda-todo-ignore-with-date t)
(setq org-agenda-tags-todo-honor-ignore-options t)
(setq org-agenda-skip-deadline-prewarning-if-scheduled 'pre-scheduled)
#+end_src
** Latex
#+begin_src elisp
(setq org-export-with-author t)
(setq org-export-with-date t)
(setq org-export-with-toc t)
(setq org-export-with-section-numbers nil)
(setq org-latex-toc-command "\\tableofcontents \\clearpage")
(setq org-latex-tables-centered nil)
(setq org-latex-tables-booktabs nil)
(setq org-latex-default-class "document")
(add-to-list 'org-latex-packages-alist '("" "listings"))
(add-to-list 'org-latex-packages-alist '("" "color"))
(with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes
'("quikserve"
"
\\documentclass{article}
[DEFAULT-PACKAGES]
\\include{/home/joe/org/assets/quikserve.tex}
[EXTRA]
"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
)
)
#+end_src
** Verb
#+begin_src elisp
(with-eval-after-load 'org
(define-key org-mode-map (kbd "C-c C-r") verb-command-map))
#+end_src
* Email
#+begin_src elisp
(setq mu4e-drafts-folder "/fivesigma/Drafts"
mu4e-sent-folder "/fivesigma/Sent"
mu4e-trash-folder "/fivesigma/Trash"
mu4e-refile-folder "/fivesigme/Archive"
user-full-name "Joe Bellus"
user-mail-address "joe@5sigma.io")
(setq mu4e-update-interval 120)
(setq sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it
smtpmail-stream-type 'starttls
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function #'message-send-mail-with-sendmail
mu4e-bookmarks '(
(:name "Inbox" :query "maildir:/fivesigma/Inbox" :key ?i)
(:name "Today's messages" :query "date:today..now" :key ?t)
(:name "Last 7 days" :query "date:7d..now" :hide-unread t :key ?r)
("flag:flagged" "Flagged messages" ?f)))
(setq mu4e-hide-index-messages t)
(setq mu4e-html2text-command 'mu4e-shr2text)
(setq shr-color-visible-luminance-min 60)
(setq shr-color-visible-distance-min 5)
(setq shr-use-colors nil)
(setq mu4e-get-mail-command "true")
#+end_src
* Language Server
#+begin_src elisp
(setq lsp-auto-execute-action nil)
#+end_src
* Clock table
Add a key bind to show a 'clocktable' report in a new buffer
#+begin_src elisp
(defun kb/show-clocktable ()
(interactive)
(get-buffer-create "clocktable")
(with-current-buffer "clocktable"
(org-mode)
(erase-buffer)
(setq-local org-link-descriptive (not org-link-descriptive))
(insert (org-clock-get-clocktable :scope 'agenda :fileskip0 t :stepskip0 t :link t))
)
(switch-to-buffer "clocktable")
)
(map! :leader
:desc "Show clocktable"
"o C" #'kb/show-clocktable)
#+end_src
* Tramp
Set tramp to default to ssh
#+begin_src elisp
(setq tramp-default-method "ssh")
#+end_src
* Misc Key binds
** Project management
#+begin_src elisp
(map! :leader
:desc "Project terminal"
"p v" #'projectile-run-vterm-other-window)
(map! :leader "p F" nil)
(map! :leader "p g" nil)
(map! :leader "p t" nil)
(map! :leader "p C" nil)
(map! :leader "p c" nil)
(map! :leader "p s" nil)
#+end_src
** Utilities
#+begin_src elisp
(map! :leader "f c" (lambda () (interactive) (doom-project-browse "~/.config/nix/")))
#+end_src
** Code
#+begin_src elisp
(map! :leader "c X" #'flymake-show-project-diagnostics)
#+end_src
* Direnv
#+begin_src elisp
(direnv-mode)
(setq direnv-always-show-summary nil)
#+end_src
* Elixir
** LSP
#+begin_src elisp
(with-eval-after-load 'eglot
(setf (alist-get 'elixir-mode eglot-server-programs)
(if (and (fboundp 'w32-shell-dos-semantics)
(w32-shell-dos-semantics))
'("language_server.bat")
(eglot-alternatives
'("language_server.sh" "lexical")))))
(with-eval-after-load 'eglot
(setf (alist-get 'elixir-ts-mode eglot-server-programs)
(if (and (fboundp 'w32-shell-dos-semantics)
(w32-shell-dos-semantics))
'("language_server.bat")
(eglot-alternatives
'("language_server.sh" "lexical")))))
#+end_src
* Fix mu4e
#+begin_src elisp
;;(defalias 'mu4e~compose-remap-faces 'mu4e--compose-remap-faces)
;;(defalias 'mu4e~compose-setup-completion 'mu4e--compose-setup-completion)
;;(defalias 'mu4e~request-contacts 'mu4e--request-contacts-maybe)
;; (mu4e-compat-define-aliases-backwards)
;; (mu4e-compat-define-aliases-forwards)
#+end_src

View File

@@ -0,0 +1,196 @@
;;; el/conduct.el -*- lexical-binding: t; -*-
(require 'shell)
(define-derived-mode conduct-mode shell-mode "Conduct"
"Conduct process buffer" :interactive nil
(read-only-mode)
(evil-define-key 'insert conduct-mode-map "q" 'conduct/buffer-kill)
(evil-define-key 'normal conduct-mode-map "r" 'conduct/buffer-restart)
(evil-define-key 'normal conduct-mode-map "r" 'conduct/buffer-restart)
(evil-define-key 'normal conduct-mode-map "q" 'conduct/buffer-kill))
(provide 'conduct-mode)
(defun conduct/buffer-restart () (interactive) (conduct/restart-task current-task))
(defun conduct/buffer-kill () (interactive) (conduct/kill-task current-task))
(defun conduct-run ()
"Run a task or task group defined in the current project"
(interactive)
(let* (
(config-data (conduct/load-config))
(tasks (alist-get 'tasks config-data))
(groups (alist-get 'groups config-data))
(select-tasks (append (mapcar 'conduct/format-task-name tasks) nil))
(select-groups (append (mapcar 'conduct/format-group-name groups) nil))
(items (seq-remove #'conduct/is-running (append select-tasks select-groups)))
(selected-name (conduct/extract-name-from-selection (completing-read "Task: " items)))
(task-names (conduct/get-task-name selected-name config-data))
(group-names (conduct/get-group-name selected-name config-data))
(names (append task-names group-names)))
(dolist (name names)
(unless (conduct/get-task-buffer (conduct/get-named-task name config-data))
(conduct/run-task (conduct/get-named-task name config-data))))))
(defun conduct-kill ()
"Kill a defined project task"
(interactive)
(let* (
(config-data (conduct/load-config))
(tasks (alist-get 'tasks config-data))
(groups (alist-get 'groups config-data))
(select-tasks (seq-filter #'conduct/is-running (append (mapcar 'conduct/format-task-name tasks) nil)))
(select-groups (append (mapcar 'conduct/format-group-name groups) nil))
(items (append select-tasks select-groups))
(selected-name (conduct/extract-name-from-selection (completing-read "Task: " items)))
(task-names (conduct/get-task-name selected-name config-data))
(group-names (conduct/get-group-name selected-name config-data))
(names (append task-names group-names)))
(dolist (name names)
(conduct/kill-task (conduct/get-named-task name config-data)))))
(defun conduct-show ()
"Kill a defined project task"
(interactive)
(let* (
(config-data (conduct/load-config))
(tasks (alist-get 'tasks config-data))
(select-tasks (seq-filter #'conduct/is-running (append (mapcar 'conduct/format-task-name tasks) nil)))
(selected-name (conduct/extract-name-from-selection (completing-read "Task: " select-tasks))))
(switch-to-buffer (format "task-%s" selected-name))))
(defun conduct-restart ()
"Kill a defined project task"
(interactive)
(let* (
(config-data (conduct/load-config))
(tasks (alist-get 'tasks config-data))
(select-tasks (seq-filter #'conduct/is-running (append (mapcar 'conduct/format-task-name tasks) nil)))
(selected-name (conduct/extract-name-from-selection (completing-read "Task: " select-tasks)))
(task (conduct/get-named-task selected-name config-data)))
(conduct/restart-task task)))
(defun conduct/create-task-path (task)
"Generate a new path based on the project root and the path for TASK"
(concat
(file-name-as-directory (project-root (project-current)))
(or (alist-get 'path task) ".")))
(defun conduct/load-config ()
"Load the conduct.json config file from the current project root"
(let* (
(config-file (concat
(file-name-as-directory (project-root (project-current)))
"conduct.json")))
(json-read-file config-file)))
(defun conduct/get-named-task (name data)
"Return the task for NAME. NAME is assumed to be a string"
(assoc (intern name) (alist-get 'tasks data)))
(defun conduct/get-task-name (name data)
"Returns the name of the task as a single item list. If it exists in DATA"
(when-let (name (assoc (intern name) (alist-get 'tasks data)))
(list (symbol-name (car name)))))
(defun conduct/get-group-name (name data)
"Returns a list of all tasks for the group named NAME in DATA"
(append (cdr (assoc (intern name) (alist-get 'groups data))) nil))
(defun conduct/run-task (task)
"Run the given task definition"
(let* (
(name (concat "task-" (symbol-name (car task))))
(buffer (concat "task-" (symbol-name (car task))))
(raw-cmd (alist-get 'command (cdr task)))
(task-cmd (concat "cd " (conduct/create-task-path (cdr task)) " && " raw-cmd))
(command (list "/bin/sh" "-c" task-cmd))
(process (make-process :name name :buffer buffer :command command :sentinel 'conduct/task-sentinal)))
(with-current-buffer buffer
(conduct-mode)
(setq-local current-task task)
(set-process-query-on-exit-flag process nil)
(set-process-filter process 'comint-output-filter)
(display-buffer buffer)
buffer)))
(defun conduct/get-task-buffer (task)
"Get the buffer related to a TASK defintiion"
(get-buffer (concat "task-" (symbol-name (car task)))))
(defun conduct/restart-task (task)
"Kill the process and buffer for a TASK"
(if-let* ((buffer (conduct/get-task-buffer task))
(old-process (get-buffer-process buffer))
(raw-cmd (alist-get 'command (cdr task)))
(task-cmd (concat "cd " (conduct/create-task-path (cdr task)) " && " raw-cmd))
(command (list "/bin/sh" "-c" task-cmd))
(name (concat "task-" (symbol-name (car task)))))
(with-current-buffer buffer
(set-process-sentinel old-process (lambda(_process _event) (set-process-filter (make-process :name name :buffer buffer :command command :sentinel 'conduct/task-sentinal) 'comint-output-filter)))
(kill-process old-process))
(message "Task buffer not found for %s" (alist-get 'name task))))
(defun conduct/kill-task (task)
"Kill the process and buffer for a TASK"
(if-let* ((buffer (conduct/get-task-buffer task))
(process (get-buffer-process buffer)))
(progn
(kill-process (get-buffer-process buffer)))
(message "Task buffer not found for %s" (alist-get 'name task))))
(defun conduct/format-group-name (group)
"Format the name for GROUP that can be used in the popup selection"
(concat
(propertize (symbol-name (car group)) 'face 'outline-1)
(propertize "|" 'invisible t)
" "
(propertize (mapconcat #'identity (cdr group) ", ") 'face 'org-archived)))
(defun conduct/extract-name-from-selection (selection)
(car (split-string selection "|")))
(defun conduct/is-running (task-name)
(let* ((process-name (concat "task-" (conduct/extract-name-from-selection task-name))))
(member process-name (mapcar #'process-name (process-list)))))
(defun conduct/format-task-name (task)
"Format the name for TASK to be used in the popup selection"
(let* (
(task-name (symbol-name (car task))))
(concat
(propertize task-name 'face 'bold)
(propertize "|" 'invisible t)
(propertize " ")
(propertize (alist-get 'command (cdr task)) 'face 'org-archived))))
(defun conduct/check-signal (sig s)
"Check the process signal against a value"
(and (> (length s) (length sig)) (equal sig (substring s 0 (length sig)))))
(defun conduct/task-sentinal (process event)
"Monitor the task process and close the buffer if it ends"
(cond
((conduct/check-signal "finished" event)
(message "Task ended: %s" (buffer-name (process-buffer process)))
(kill-buffer (process-buffer process)))
((conduct/check-signal "exited" event) (kill-buffer (process-buffer process)))
((conduct/check-signal "deleted" event) (kill-buffer (process-buffer process)))
((conduct/check-signal "failed" event)
(message "Task failed: %s" (buffer-name (process-buffer process)))
(kill-buffer (process-buffer process)))
((conduct/check-signal "killed" event)
(kill-buffer (process-buffer process)))
(t (message (format "Process: %s had the event '%s'" process event)))))

193
dotfiles/emacs/init.el Normal file
View File

@@ -0,0 +1,193 @@
;;; init.el -*- lexical-binding: t; -*- This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
;; documentation. There you'll find a link to Doom's Module Index where all
;; of our modules are listed, including what flags they support.
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
;; 'C-c c k' for non-vim users) to view its documentation. This works on
;; flags as well (those symbols that start with a plus).
;;
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
;; directory (for easy access to its source code).
(doom! :input
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
;;chinese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
:completion
(company +childframe) ; the ultimate code completion backend
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;ivy ; a search engine for love and life
vertico ; the search engine of the future
:ui
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
;;(emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
;;indent-guides ; highlighted indent columns
ligatures ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
(modeline) ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink cursor line after big motions
;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on
(popup +defaults) ; tame sudden yet inevitable temporary windows
;;tabs ; a tab bar for Emacs
;;treemacs ; a project drawer, like neotree but cooler
;;unicode ; extended unicode support for various languages
(vc-gutter +pretty) ; vcs diff in the fringe
;;vi-tilde-fringe ; fringe tildes to mark beyond EOB
;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces
;;zen ; distraction-free coding or writing
:editor
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
(format +onsave) ; automated prettiness
;;god ; run Emacs commands without modifier keys
;;lispy ; vim for lisp, for people who don't like vim
;;multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
parinfer ; turn lisp into python, sort of
;;rotate-text ; cycle region at point between text candidates
snippets ; my elves. They type so I don't have to
;;word-wrap ; soft wrapping with language-aware indent
:emacs
(dired +icons) ; making dired pretty [functional]
electric ; smarter, keyword-based electric-indent
;;ibuffer ; interactive buffer management
undo ; persistent, smarter undo for your inevitable mistakes
vc ; version-control and Emacs, sitting in a tree
:term
;;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
:checkers
syntax ; tasing you for every semicolon you forget
(spell +flyspell) ; tasing you for misspelling mispelling
grammar ; tasing grammar mistake every you make
:tools
;;ansible
;;biblio ; Writes a PhD for you (citation needed)
;;collab ; buffers with friends
;;debugger ; FIXME stepping through code, to help you add bugs
;;direnv
docker
;;editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
(eval +overlay) ; run code, run (also, repls)
;;gist ; interacting with github gists
lookup ; navigate your code and its documentation
(lsp +eglot) ; M-x vscode
(magit +forge) ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
;; rgb ; creating color strings
;;taskrunner ; taskrunner for all your projects
;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
tree-sitter ; syntax and parsing, sitting in a tree...
;;upload ; map local to remote projects via ssh/ftp
:os
(:if IS-MAC macos) ; improve compatibility with macOS
;;tty ; improve the terminal Emacs experience
:lang
;;agda ; types of types of types of types...
;;beancount ; mind the GAAP
(cc +lsp) ; C > C++ == 1
;;clojure ; java with a lisp
;;common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
;;data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
;;dhall
(elixir +lsp +tree-sitter) ; erlang done right
;;elm ; care for a cup of TEA?
emacs-lisp ; drown in parentheses
;;erlang ; an elegant language for a more civilized age
;;ess ; emacs speaks statistics
;;factor
;;faust ; dsp, but you get to keep your soul
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
;;fsharp ; ML stands for Microsoft's Language
;;fstar ; (dependent) types and (monadic) effects and Z3
;;gdscript ; the language you waited for
;;(go +lsp) ; the hipster dialect
;;(graphql +lsp) ; Give queries a REST
;;(haskell +lsp) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris ; a language you can depend on
(json +lsp +tree-sitter) ; At least it ain't XML
;;(java +lsp) ; the poster child for carpal tunnel syndrome
javascript ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
latex ; writing papers in Emacs has never been so fun
;;lean ; for folks with too much to prove
ledger ; be audit you can be
lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c
(nix +lsp) ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org +present +pandoc +roam2) ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
(python +lsp) ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6
rest ; Emacs as a REST client
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
(rust +lsp +tree-sitter) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
(web +lsp +tree-sitter) ; the tubes
yaml ; JSON, but readable
;;zig ; C, but simpler
:email
(mu4e +org)
;;notmuch
;;(wanderlust +gmail)
:app
;;calendar
;;emms
;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
;;(rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
:config
literate
(default +bindings +smartparens))

View File

@@ -0,0 +1,68 @@
;; -*- no-byte-compile: t; -*-
;;; $DOOMDIR/packages.el
;; To install a package with Doom you must declare them here and run 'doom sync'
;; on the command line, then restart Emacs for the changes to take effect -- or
;; use 'M-x doom/reload'.
(package! org-ql)
(package! org-bullets)
(package! org-present)
(package! visual-fill-column)
(package! direnv)
;(package! doom-nano-modeline
; :recipe (:repo "ronisbr/doom-nano-modeline" :host github))
(package! yuck-mode)
(package! org-ql)
(package! verb)
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
;; (package! some-package)
;; To install a package directly from a remote git repo, you must specify a
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
;; https://github.com/radian-software/straight.el#the-recipe-format
;; (package! another-package
;; :recipe (:host github :repo "username/repo"))
;; If the package you are trying to install does not contain a PACKAGENAME.el
;; file, or is located in a subdirectory of the repo, you'll need to s)kpecify
;; `:files' in the `:recipe':
;; (package! this-package
;; :recipe (:host github :repo "username/repo"
;; :files ("some-file.el" "src/lisp/*.el")))
;; If you'd like to disable a package included with Doom, you can do so here
;; with the `:disable' property:
;; (package! builtin-package :disable t)
;; You can override the recipe of a built in package without having to specify
;; all the properties for `:recipe'. These will inherit the rest of its recipe
;; from Doom or MELPA/ELPA/Emacsmirror:
;; (package! builtin-package :recipe (:nonrecursive t))
;; (package! builtin-package-2 :recipe (:repo "myfork/package"))
;; Specify a `:branch' to install a package from a particular branch or tag.
;; This is required for some packages whose default branch isn't 'master' (which
;; our package manager can't deal with; see radian-software/straight.el#279)
;; (package! builtin-package :recipe (:branch "develop"))
;; Use `:pin' to specify a particular commit to install.
;; (package! builtin-package :pin "1a2b3c4d5e")
;; Doom's packages are pinned to a specific commit and updated from release to
;; release. The `unpin!' macro allows you to unpin single packages...
;; (unpin! pinned-package)
;; ...or multiple packages
;; (unpin! pinned-package another-pinned-package)
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
;; (unpin! t)

4
dotfiles/ghostty.conf Normal file
View File

@@ -0,0 +1,4 @@
theme = dankcolors
app-notifications = no-clipboard-copy,no-config-reload
font-family = "JetBrainsMono NF Regular"

34
dotfiles/hypridle.conf Normal file
View File

@@ -0,0 +1,34 @@
general {
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
before_sleep_cmd = loginctl lock-session # lock before suspend.
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
}
listener {
timeout = 150 # 2.5min.
on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor.
on-resume = brightnessctl -r # monitor backlight restore.
}
# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight.
listener {
timeout = 150 # 2.5min.
# on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 # turn off keyboard backlight.
# on-resume = brightnessctl -rd rgb:kbd_backlight # turn on keyboard backlight.
}
listener {
timeout = 1800 # 5min
on-timeout = loginctl lock-session # lock screen when timeout has passed
}
listener {
timeout = 2000 # 5.5min
on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed
on-resume = hyprctl dispatch dpms on && brightnessctl -r # screen on when activity is detected after timeout has fired.
}
listener {
timeout = 1800 # 30min
on-timeout = systemctl suspend # suspend pc
}

170
dotfiles/hyprland.base.conf Normal file
View File

@@ -0,0 +1,170 @@
exec-once = dms run
exec-once = systemctl --user start kanshi
exec-once = systemctl --user start hypridle
exec-once = systemctl --user start hyprpolkitagent
input {
kb_layout = us
follow_mouse = 1
sensitivity = 0.5
touchpad {
natural_scroll = no
}
}
general {
gaps_in = 30
gaps_out = 5, 20, 20, 20
border_size = 0
col.active_border = rgba(ffffff88)
col.inactive_border = rgba(ffffff22)
layout = master
# layout = master
}
master {
orientation = center
}
decoration {
active_opacity = 1
inactive_opacity = 1
dim_inactive = true
dim_strength = 0.2
dim_special = 0
rounding = 5
border_part_of_window = false
blur {
enabled = true
size = 5
passes = 2
brightness = 0.8
}
shadow {
enabled = true
range = 30
render_power = 4
color = rgba(00000099)
}
}
# Ultraide gaps
# workspace = w[t1] m[DP-4] s[false], gapsout:10 1500
# workspace = w[t1] m[DP-4] s[true], gapsout:10 1800
# workspace = w[t2] m[DP-4] s[true], gapsout:10 1000
gesture = 4, horizontal, workspace
gesture = 4, down, mod: ALT, close
gesture = 4, up, mod: SUPER, fullscreen
group {
col.border_active = rgba(7d32a899) rgba(da16f099) 45deg
col.border_inactive = rgba(cccccc88)
groupbar {
font_family = "Iosevka Bold"
font_size = 10
height = 22
text_color = 0xccccccff
col.active = rgba(7d32a899)
col.inactive = rgba(00000088)
}
}
animations {
enabled = yes
}
animation = specialWorkspace, 1, 10, default, fade
misc {
disable_hyprland_logo=true
}
windowrule=float on,pin on,opaque on,no_dim on,no_shadow on, no_blur on, border_size 0, match:title Picture-in-Picture
# windowrule = opacity 0.5, class:kitty
$mainMod = SUPER
bindle = ,XF86MonBrightnessUp, exec, brightnessctl set +10%
bindle = ,XF86MonBrightnessDown, exec, brightnessctl set 10%-
bindle=, XF86AudioRaiseVolume, exec, amixer sset Master 5%+
bindle=, XF86AudioRaiseVolume, exec, eww update volume=$(amixer sget Master | awk -F"[][]" '/Left:/ { print $2 }' | tr -d '%')
bindle=, XF86AudioLowerVolume, exec, amixer sset Master 5%-
bindle=, XF86AudioLowerVolume, exec, eww update volume=$(amixer sget Master | awk -F"[][]" '/Left:/ { print $2 }' | tr -d '%')
bindle=, XF86AudioMute, exec, amixer sset Master 1+ toggle
bindle=, XF86AudioMute, exec, eww update volume=$(amixer sget Master | awk -F"[][]" '/Left:/ { print $2 }' | tr -d '%')
bindle=, XF86Calculator, exec, kitty -e octave
bindle=, XF86AudioPlay, exec, playerctl play-pause
bindle=, XF86AudioNext, exec, playerctl next
bindle=, XF86AudioPrev, exec, playerctl previous
bind = $mainMod, F9, exec, hyprctl keyword monitor "DP-4, 2560x1440@60, 0x0, 1"
bind = $mainMod, F10, exec, hyprctl keyword monitor "DP-4, 5120x1440@60, 0x0, 1"
bind = $mainMod, RETURN, exec, kitty
bind = $mainMod, W, killactive,
bind = $mainMod SHIFT, F, togglefloating,
bind = $mainMod, SPACE, exec, dms ipc call spotlight toggle
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, V, togglesplit, # dwindle
bind = $mainMod, G, togglegroup,
bind = $mainMod SHIFT, G, moveoutofgroup,
bind = $mainMod, TAB, changegroupactive,
bind = $mainMod, F, fullscreen
bind = $mainMod, b, exec, eww open --toggle side-panel
bind = $mainMod, Print, exec, grim -g "$(slurp -d)" - | wl-copy
bind = $mainMod SHIFT, S, exec, grim -g "$(slurp -d)" - | wl-copy
bind = $mainMod, h, movefocus, l
bind = $mainMod, l, movefocus, r
bind = $mainMod, k, movefocus, u
bind = $mainMod, j, movefocus, d
bind = $mainMod SHIFT, h, movewindow, l
bind = $mainMod SHIFT, l, movewindow, r
bind = $mainMod SHIFT, k, movewindow, u
bind = $mainMod SHIFT, j, movewindow, d
# Switch workspaces with mainMod + [0-9]
bind=SUPER,1,moveworkspacetomonitor,1 current
bind=SUPER,1,workspace,1
bind=SUPER,2,moveworkspacetomonitor,2 current
bind=SUPER,2,workspace,2
bind=SUPER,3,moveworkspacetomonitor,3 current
bind=SUPER,3,workspace,3
bind=SUPER,4,moveworkspacetomonitor,4 current
bind=SUPER,4,workspace,4
bind=SUPER,5,moveworkspacetomonitor,5 current
bind=SUPER,5,workspace,5
bind=SUPER,6,moveworkspacetomonitor,6 current
bind=SUPER,6,workspace,6
bind=SUPER,7,moveworkspacetomonitor,7 current
bind=SUPER,7,workspace,7
bind=SUPER,8,moveworkspacetomonitor,8 current
bind=SUPER,8,workspace,8
bind=SUPER,9,moveworkspacetomonitor,9 current
bind=SUPER,9,workspace,9
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10
# Example special workspace (scratchpad)
bind = $mainMod, grave, togglespecialworkspace, magic
bind = $mainMod SHIFT, grave, movetoworkspace, special:magic
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

View File

@@ -0,0 +1,5 @@
source = ./base.conf
# monitor = eDP-2, 2560x1600@165, 0x0, 1
# monitor = DP-4, 2560x1440@120, 0x0, 1
# monitor = DP-3, 1280x800, 2560x1440, 1
monitor = , preferred, auto, 1

78
dotfiles/hyprlock.conf Normal file
View File

@@ -0,0 +1,78 @@
$font = Monospace
general {
hide_cursor = false
}
auth {
fingerprint {
enabled = true
ready_message = Scan fingerprint to unlock
present_message = Scanning...
retry_delay = 250
}
}
animations {
enabled = true
bezier = linear, 1, 1, 0, 0
animation = fadeIn, 1, 5, linear
animation = fadeOut, 1, 5, linear
animation = inputFieldDots, 1, 2, linear
}
background {
monitor =
path = screenshot
blur_passes = 3
}
input-field {
monitor =
size = 20%, 5%
outline_thickness = 3
inner_color = rgba(0, 0, 0, 0.0) # no fill
outer_color = rgba(e208ffee) rgba(9008ffee) 45deg
check_color = rgba(00ff99ee) rgba(ff6633ee) 120deg
fail_color = rgba(ff6633ee) rgba(ff0066ee) 40deg
font_color = rgb(143, 143, 143)
fade_on_empty = false
rounding = 15
font_family = $font
placeholder_text = Input password...
fail_text = $PAMFAIL
dots_spacing = 0.3
# hide_input = true
position = 0, -20
halign = center
valign = center
}
label {
monitor =
text = $TIME
font_size = 90
font_family = $font
position = -30, 0
halign = right
valign = top
}
# DATE
label {
monitor =
text = cmd[update:60000] date +"%A, %d %B %Y"
font_size = 25
font_family = $font
position = -30, -150
halign = right
valign = top
}

View File

@@ -0,0 +1,13 @@
wallpaper {
monitor = eDP-2
path = ~/Pictures/aishot-1745.jpg
fit_mode = cover
}
wallpaper {
monitor = DP-4
path = ~/Pictures/creature.jpg
fit_mode = cover
}
splash = false

78
dotfiles/kitty/kitty.conf Normal file
View File

@@ -0,0 +1,78 @@
font_size 12.0
# font_family PragmataPro Mono Liga
font_family JetBrainsMono Nerd Font
# bold_font Iosevka
# italic_font Iosevka
# bold_italic_font Iosevka
hide_window_decorations yes
tab_bar_style powerline
enable_audio_bell no
cursor_shape beam
confirm_os_window_close 0
update_check_interval 0
window_padding_width 5
# background #292D3E
# background_opacity 0.6
# vim:ft=kitty
background #1a1b26
foreground #c0caf5
selection_background #283457
selection_foreground #c0caf5
url_color #73daca
cursor #c0caf5
cursor_text_color #1a1b26
# Tabs
active_tab_background #7aa2f7
active_tab_foreground #16161e
inactive_tab_background #292e42
inactive_tab_foreground #545c7e
#tab_bar_background #15161e
# Windows
active_border_color #7aa2f7
inactive_border_color #292e42
# normal
color0 #15161e
color1 #f7768e
color2 #9ece6a
color3 #e0af68
color4 #7aa2f7
color5 #bb9af7
color6 #7dcfff
color7 #a9b1d6
# bright
color8 #414868
color9 #ff899d
color10 #9fe044
color11 #faba4a
color12 #8db0ff
color13 #c7a9ff
color14 #a4daff
color15 #c0caf5
# extended colors
color16 #ff9e64
color17 #db4b4b
# map ctrl+j kitten pass_keys.py neighboring_window bottom ctrl+j
# map ctrl+k kitten pass_keys.py neighboring_window top ctrl+k
# map ctrl+h kitten pass_keys.py neighboring_window left ctrl+h
# map ctrl+l kitten pass_keys.py neighboring_window right ctrl+l
allow_remote_control yes
listen_on unix:@mykitty
enabled_layouts tall:bias=50;full_size=1;mirrored=false
remember_window_size no
include dank-tabs.conf
include dank-theme.conf

27
dotfiles/lazygit.yml Normal file
View File

@@ -0,0 +1,27 @@
services:
'git.5sigma.io': 'gitea:git.5sigma.io'
gui:
theme:
activeBorderColor:
- '#b4befe'
- bold
inactiveBorderColor:
- '#a6adc8'
optionsTextColor:
- '#89b4fa'
selectedLineBgColor:
- '#313244'
cherryPickedCommitBgColor:
- '#45475a'
cherryPickedCommitFgColor:
- '#b4befe'
unstagedChangesColor:
- '#f38ba8'
defaultFgColor:
- '#cdd6f4'
searchingActiveBorderColor:
- '#f9e2af'
authorColors:
'*': '#b4befe'

7
dotfiles/mako.conf Normal file
View File

@@ -0,0 +1,7 @@
border-radius=5
border-size=0
default-timeout=60000
background-color=#000000cc
height=200
width=500
padding=25

652
dotfiles/niri.kdl Normal file
View File

@@ -0,0 +1,652 @@
// This config is in the KDL format: https://kdl.dev
// "/-" comments out the following node.
// Check the wiki for a full description of the configuration:
// https://yalter.github.io/niri/Configuration:-Introduction
// Input device configuration.
// Find the full list of options on the wiki:
// https://yalter.github.io/niri/Configuration:-Input
input {
keyboard {
xkb {
// You can set rules, model, layout, variant and options.
// For more information, see xkeyboard-config(7).
// For example:
// layout "us,ru"
// options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
// If this section is empty, niri will fetch xkb settings
// from org.freedesktop.locale1. You can control these using
// localectl set-x11-keymap.
}
// Enable numlock on startup, omitting this setting disables it.
numlock
}
// Next sections include libinput settings.
// Omitting settings disables them, or leaves them at their default values.
// All commented-out settings here are examples, not defaults.
touchpad {
// off
// tap
dwt
dwtp
// drag false
// drag-lock
natural-scroll
// accel-speed 0.2
// accel-profile "flat"
// scroll-method "two-finger"
disabled-on-external-mouse
}
mouse {
// off
// natural-scroll
// accel-speed 0.2
// accel-profile "flat"
// scroll-method "no-scroll"
}
trackpoint {
// off
// natural-scroll
// accel-speed 0.2
// accel-profile "flat"
// scroll-method "on-button-down"
// scroll-button 273
// scroll-button-lock
// middle-emulation
}
// Uncomment this to make the mouse warp to the center of newly focused windows.
// warp-mouse-to-focus
// Focus windows and outputs automatically when moving the mouse into them.
// Setting max-scroll-amount="0%" makes it work only on windows already fully on screen.
// focus-follows-mouse max-scroll-amount="0%"
}
gestures {
dnd-edge-view-scroll {
trigger-width 30
delay-ms 100
max-speed 1500
}
dnd-edge-workspace-switch {
trigger-height 50
delay-ms 100
max-speed 1500
}
hot-corners {
// off
top-left
// top-right
// bottom-left
// bottom-right
}
}
// You can configure outputs by their name, which you can find
// by running `niri msg outputs` while inside a niri instance.
// The built-in laptop monitor is usually called "eDP-1".
// Find more information on the wiki:
// https://yalter.github.io/niri/Configuration:-Outputs
// Remember to uncomment the node by removing "/-"!
output "eDP-2" {
mode "2560x1600@165"
scale 1
}
output "DP-4" {
// Uncomment this line to disable this output.
// off
// Resolution and, optionally, refresh rate of the output.
// The format is "<width>x<height>" or "<width>x<height>@<refresh rate>".
// If the refresh rate is omitted, niri will pick the highest refresh rate
// for the resolution.
// If the mode is omitted altogether or is invalid, niri will pick one automatically.
// Run `niri msg outputs` while inside a niri instance to list all outputs and their modes.
// mode custom=true "5120x1440@60"
// You can use integer or fractional scale, for example use 1.5 for 150% scale.
scale 1
// Transform allows to rotate the output counter-clockwise, valid values are:
// normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
transform "normal"
// Position of the output in the global coordinate space.
// This affects directional monitor actions like "focus-monitor-left", and cursor movement.
// The cursor can only move between directly adjacent outputs.
// Output scale and rotation has to be taken into account for positioning:
// outputs are sized in logical, or scaled, pixels.
// For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080,
// so to put another output directly adjacent to it on the right, set its x to 1920.
// If the position is unset or results in an overlap, the output is instead placed
// automatically.
position x=0 y=0
}
// Settings that influence how windows are positioned and sized.
// Find more information on the wiki:
// https://yalter.github.io/niri/Configuration:-Layout
layout {
// Set gaps around windows in logical pixels.
gaps 30
// When to center a column when changing focus, options are:
// - "never", default behavior, focusing an off-screen column will keep at the left
// or right edge of the screen.
// - "always", the focused column will always be centered.
// - "on-overflow", focusing a column will center it if it doesn't fit
// together with the previously focused column.
center-focused-column "never"
// You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between.
preset-column-widths {
// Proportion sets the width as a fraction of the output width, taking gaps into account.
// For example, you can perfectly fit four windows sized "proportion 0.25" on an output.
// The default preset widths are 1/3, 1/2 and 2/3 of the output.
proportion 0.33333
proportion 0.5
proportion 0.66667
// Fixed sets the width in logical pixels exactly.
// fixed 1920
}
// You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between.
// preset-window-heights { }
// You can change the default width of the new windows.
default-column-width { proportion 0.5; }
// If you leave the brackets empty, the windows themselves will decide their initial width.
// default-column-width {}
// By default focus ring and border are rendered as a solid background rectangle
// behind windows. That is, they will show up through semitransparent windows.
// This is because windows using client-side decorations can have an arbitrary shape.
//
// If you don't like that, you should uncomment `prefer-no-csd` below.
// Niri will draw focus ring and border *around* windows that agree to omit their
// client-side decorations.
//
// Alternatively, you can override it with a window rule called
// `draw-border-with-background`.
// You can change how the focus ring looks.
focus-ring {
// Uncomment this line to disable the focus ring.
off
// How many logical pixels the ring extends out from the windows.
width 1
// Colors can be set in a variety of ways:
// - CSS named colors: "red"
// - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa"
// - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
// Color of the ring on the active monitor.
active-color "#7fc8ff"
// Color of the ring on inactive monitors.
//
// The focus ring only draws around the active window, so the only place
// where you can see its inactive-color is on other monitors.
inactive-color "#505050"
// You can also use gradients. They take precedence over solid colors.
// Gradients are rendered the same as CSS linear-gradient(angle, from, to).
// The angle is the same as in linear-gradient, and is optional,
// defaulting to 180 (top-to-bottom gradient).
// You can use any CSS linear-gradient tool on the web to set these up.
// Changing the color space is also supported, check the wiki for more info.
//
// active-gradient from="#80c8ff" to="#c7ff7f" angle=45
// You can also color the gradient relative to the entire view
// of the workspace, rather than relative to just the window itself.
// To do that, set relative-to="workspace-view".
//
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
}
// You can also add a border. It's similar to the focus ring, but always visible.
border {
// The settings are the same as for the focus ring.
// If you enable the border, you probably want to disable the focus ring.
// off
width 1
active-color "rgba(200,200,200,0.5)"
inactive-color "rgba(0,0,0,0.5)"
// Color of the border around windows that request your attention.
urgent-color "#9b0000"
// Gradients can use a few different interpolation color spaces.
// For example, this is a pastel rainbow gradient via in="oklch longer hue".
//
// active-gradient from="#e5989b" to="#ffb4a2" angle=45 relative-to="workspace-view" in="oklch longer hue"
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
}
// You can enable drop shadows for windows.
shadow {
// Uncomment the next line to enable shadows.
// on
// By default, the shadow draws only around its window, and not behind it.
// Uncomment this setting to make the shadow draw behind its window.
//
// Note that niri has no way of knowing about the CSD window corner
// radius. It has to assume that windows have square corners, leading to
// shadow artifacts inside the CSD rounded corners. This setting fixes
// those artifacts.
//
// However, instead you may want to set prefer-no-csd and/or
// geometry-corner-radius. Then, niri will know the corner radius and
// draw the shadow correctly, without having to draw it behind the
// window. These will also remove client-side shadows if the window
// draws any.
//
// draw-behind-window true
// You can change how shadows look. The values below are in logical
// pixels and match the CSS box-shadow properties.
// Softness controls the shadow blur radius.
softness 30
// Spread expands the shadow.
spread 5
// Offset moves the shadow relative to the window.
offset x=0 y=5
// You can also change the shadow color and opacity.
color "#0007"
}
// Struts shrink the area occupied by windows, similarly to layer-shell panels.
// You can think of them as a kind of outer gaps. They are set in logical pixels.
// Left and right struts will cause the next window to the side to always be visible.
// Top and bottom struts will simply add outer gaps in addition to the area occupied by
// layer-shell panels and regular gaps.
struts {
// left 64
// right 64
// top 64
// bottom 64
}
}
// Add lines like this to spawn processes at startup.
// Note that running niri as a session supports xdg-desktop-autostart,
// which may be more convenient to use.
// See the binds section below for more spawn examples.
// spawn-at-startup ""
// To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup:
spawn-sh-at-startup "systemctl --user start kanshi"
hotkey-overlay {
// Uncomment this line to disable the "Important Hotkeys" pop-up at startup.
skip-at-startup
}
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
// If the client will specifically ask for CSD, the request will be honored.
// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners.
// This option will also fix border/focus ring drawing behind some semitransparent windows.
// After enabling or disabling this, you need to restart the apps for this to take effect.
prefer-no-csd
// You can change the path where screenshots are saved.
// A ~ at the front will be expanded to the home directory.
// The path is formatted with strftime(3) to give you the screenshot date and time.
// screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
// You can also set this to null to disable saving screenshots to disk.
screenshot-path null
// Animation settings.
// The wiki explains how to configure individual animations:
// https://yalter.github.io/niri/Configuration:-Animations
animations {
// Uncomment to turn off all animations.
// off
// Slow down all animations by this factor. Values below 1 speed them up instead.
// slowdown 3.0
}
// Window rules let you adjust behavior for individual windows.
// Find more information on the wiki:
// https://yalter.github.io/niri/Configuration:-Window-Rules
// Work around WezTerm's initial configure bug
// by setting an empty default-column-width.
window-rule {
// This regular expression is intentionally made as specific as possible,
// since this is the default config, and we want no false positives.
// You can get away with just app-id="wezterm" if you want.
match app-id=r#"^org\.wezfurlong\.wezterm$"#
default-column-width {}
}
// Open the Firefox picture-in-picture player as floating by default.
window-rule {
// This app-id regular expression will work for both:
// - host Firefox (app-id is "firefox")
// - Flatpak Firefox (app-id is "org.mozilla.firefox")
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
open-floating true
}
// Example: block out two password managers from screen capture.
// (This example rule is commented out with a "/-" in front.)
/-window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.gnome\.World\.Secrets$"#
block-out-from "screen-capture"
// Use this instead if you want them visible on third-party screenshot tools.
// block-out-from "screencast"
}
// Example: enable rounded corners for all windows.
// (This example rule is commented out with a "/-" in front.)
/-window-rule {
geometry-corner-radius 12
clip-to-geometry true
}
binds {
// Keys consist of modifiers separated by + signs, followed by an XKB key name
// in the end. To find an XKB name for a particular key, you may use a program
// like wev.
//
// "Mod" is a special modifier equal to Super when running on a TTY, and to Alt
// when running as a winit window.
//
// Most actions that you can bind here can also be invoked programmatically with
// `niri msg action do-something`.
// Mod-Shift-/, which is usually the same as Mod-?,
// shows a list of important hotkeys.
Mod+Shift+Slash { show-hotkey-overlay; }
// Suggested binds for running programs: terminal, app launcher, screen locker.
Mod+Return hotkey-overlay-title="Kitty" { spawn "kitty"; }
Mod+Space hotkey-overlay-title="Launcher" { spawn-sh "dms ipc call spotlight toggle"; }
Super+Alt+L hotkey-overlay-title="Lock the Screen" { spawn-sh "dms ipc call lock lock"; }
Mod+F10 hotkey-overlay-title="Max Resolution" { spawn-sh "niri msg output DP-4 custom-mode 5120x1440@60"; }
Mod+F9 hotkey-overlay-title="Max Resolution" { spawn-sh "niri msg output DP-4 custom-mode 2560x1440@60"; }
// Example volume keys mappings for PipeWire & WirePlumber.
// The allow-when-locked=true property makes them work even when the session is locked.
// Using spawn-sh allows to pass multiple arguments together with the command.
// "-l 1.0" limits the volume to 100%.
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+ -l 1.0"; }
XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; }
XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; }
XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; }
// Example media keys mapping using playerctl.
// This will work with any MPRIS-enabled media player.
XF86AudioPlay allow-when-locked=true { spawn-sh "playerctl play-pause"; }
XF86AudioStop allow-when-locked=true { spawn-sh "playerctl stop"; }
XF86AudioPrev allow-when-locked=true { spawn-sh "playerctl previous"; }
XF86AudioNext allow-when-locked=true { spawn-sh "playerctl next"; }
// Example brightness key mappings for brightnessctl.
// You can use regular spawn with multiple arguments too (to avoid going through "sh"),
// but you need to manually put each argument in separate "" quotes.
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+10%"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "10%-"; }
Mod+O repeat=false { toggle-overview; }
Mod+F14 repeat=false { toggle-overview; }
Mod+W repeat=false { close-window; }
Mod+Left { focus-column-left; }
Mod+Down { focus-window-down; }
Mod+Up { focus-window-up; }
Mod+Right { focus-column-right; }
Mod+H { focus-column-left; }
Mod+J { focus-window-down; }
Mod+K { focus-window-up; }
Mod+L { focus-column-right; }
Mod+Shift+Left { move-column-left; }
Mod+Shift+Down { move-window-down; }
Mod+Shift+Up { move-window-up; }
Mod+Shift+Right { move-column-right; }
Mod+Shift+H { move-column-left; }
Mod+Shift+J { move-window-down; }
Mod+Shift+K { move-window-up; }
Mod+Shift+L { move-column-right; }
// Alternative commands that move across workspaces when reaching
// the first or last window in a column.
// Mod+J { focus-window-or-workspace-down; }
// Mod+K { focus-window-or-workspace-up; }
// Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
// Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
Mod+Home { focus-column-first; }
Mod+End { focus-column-last; }
Mod+Ctrl+Home { move-column-to-first; }
Mod+Ctrl+End { move-column-to-last; }
Mod+Ctrl+Left { focus-monitor-left; }
Mod+Ctrl+Down { focus-monitor-down; }
Mod+Ctrl+Up { focus-monitor-up; }
Mod+Ctrl+Right { focus-monitor-right; }
Mod+Ctrl+H { focus-monitor-left; }
Mod+Ctrl+J { focus-monitor-down; }
Mod+Ctrl+K { focus-monitor-up; }
Mod+Ctrl+L { focus-monitor-right; }
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
// Alternatively, there are commands to move just a single window:
// Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
// ...
// And you can also move a whole workspace to another monitor:
// Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
// ...
Mod+Page_Down { focus-workspace-down; }
Mod+Page_Up { focus-workspace-up; }
Mod+U { focus-workspace-down; }
Mod+I { focus-workspace-up; }
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
Mod+Ctrl+U { move-column-to-workspace-down; }
Mod+Ctrl+I { move-column-to-workspace-up; }
// Alternatively, there are commands to move just a single window:
// Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
// ...
Mod+Shift+Page_Down { move-workspace-down; }
Mod+Shift+Page_Up { move-workspace-up; }
Mod+Shift+U { move-workspace-down; }
Mod+Shift+I { move-workspace-up; }
// You can bind mouse wheel scroll ticks using the following syntax.
// These binds will change direction based on the natural-scroll setting.
//
// To avoid scrolling through workspaces really fast, you can use
// the cooldown-ms property. The bind will be rate-limited to this value.
// You can set a cooldown on any bind, but it's most useful for the wheel.
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
Mod+WheelScrollRight { focus-column-right; }
Mod+WheelScrollLeft { focus-column-left; }
Mod+Ctrl+WheelScrollRight { move-column-right; }
Mod+Ctrl+WheelScrollLeft { move-column-left; }
// Usually scrolling up and down with Shift in applications results in
// horizontal scrolling; these binds replicate that.
Mod+Shift+WheelScrollDown { focus-column-right; }
Mod+Shift+WheelScrollUp { focus-column-left; }
Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
// Similarly, you can bind touchpad scroll "ticks".
// Touchpad scrolling is continuous, so for these binds it is split into
// discrete intervals.
// These binds are also affected by touchpad's natural-scroll, so these
// example binds are "inverted", since we have natural-scroll enabled for
// touchpads by default.
// Mod+TouchpadScrollDown { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02+"; }
// Mod+TouchpadScrollUp { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.02-"; }
// You can refer to workspaces by index. However, keep in mind that
// niri is a dynamic workspace system, so these commands are kind of
// "best effort". Trying to refer to a workspace index bigger than
// the current workspace count will instead refer to the bottommost
// (empty) workspace.
//
// For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on
// will all refer to the 3rd workspace.
Mod+Ctrl+1 { focus-column 1; }
Mod+Ctrl+2 { focus-column 2; }
Mod+Ctrl+3 { focus-column 3; }
Mod+Ctrl+4 { focus-column 4; }
Mod+Ctrl+5 { focus-column 5; }
Mod+1 { focus-workspace 1; }
Mod+2 { focus-workspace 2; }
Mod+3 { focus-workspace 3; }
Mod+4 { focus-workspace 4; }
Mod+5 { focus-workspace 5; }
Mod+6 { focus-workspace 6; }
Mod+7 { focus-workspace 7; }
Mod+8 { focus-workspace 8; }
Mod+9 { focus-workspace 9; }
Mod+Shift+1 { move-column-to-workspace 1; }
Mod+Shift+2 { move-column-to-workspace 2; }
Mod+Shift+3 { move-column-to-workspace 3; }
Mod+Shift+4 { move-column-to-workspace 4; }
Mod+Shift+5 { move-column-to-workspace 5; }
Mod+Shift+6 { move-column-to-workspace 6; }
Mod+Shift+7 { move-column-to-workspace 7; }
Mod+Shift+8 { move-column-to-workspace 8; }
Mod+Shift+9 { move-column-to-workspace 9; }
// Alternatively, there are commands to move just a single window:
// Mod+Ctrl+1 { move-window-to-workspace 1; }
// Switches focus between the current and the previous workspace.
// Mod+Tab { focus-workspace-previous; }
// The following binds move the focused window in and out of a column.
// If the window is alone, they will consume it into the nearby column to the side.
// If the window is already in a column, they will expel it out.
Mod+BracketLeft { consume-or-expel-window-left; }
Mod+BracketRight { consume-or-expel-window-right; }
// Consume one window from the right to the bottom of the focused column.
Mod+Comma { consume-window-into-column; }
// Expel the bottom window from the focused column to the right.
Mod+Period { expel-window-from-column; }
Mod+R { switch-preset-column-width; }
// Cycling through the presets in reverse order is also possible.
// Mod+R { switch-preset-column-width-back; }
Mod+Shift+R { switch-preset-window-height; }
Mod+Ctrl+R { reset-window-height; }
Mod+F { maximize-column; }
Mod+Shift+F { fullscreen-window; }
// Expand the focused column to space not taken up by other fully visible columns.
// Makes the column "fill the rest of the space".
Mod+Ctrl+F { expand-column-to-available-width; }
Mod+C { center-column; }
// Center all fully visible columns on screen.
Mod+Ctrl+C { center-visible-columns; }
// Finer width adjustments.
// This command can also:
// * set width in pixels: "1000"
// * adjust width in pixels: "-5" or "+5"
// * set width as a percentage of screen width: "25%"
// * adjust width as a percentage of screen width: "-10%" or "+10%"
// Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
// set-column-width "100" will make the column occupy 200 physical screen pixels.
Mod+Minus { set-column-width "-10%"; }
Mod+Equal { set-column-width "+10%"; }
// Finer height adjustments when in column with other windows.
Mod+Shift+Minus { set-window-height "-10%"; }
Mod+Shift+Equal { set-window-height "+10%"; }
// Move the focused window between the floating and the tiling layout.
Mod+V { toggle-window-floating; }
Mod+Shift+V { switch-focus-between-floating-and-tiling; }
// Toggle tabbed column display mode.
// Windows in this column will appear as vertical tabs,
// rather than stacked on top of each other.
Mod+Tab { toggle-column-tabbed-display; }
// Actions to switch layouts.
// Note: if you uncomment these, make sure you do NOT have
// a matching layout switch hotkey configured in xkb options above.
// Having both at once on the same hotkey will break the switching,
// since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
// Mod+Space { switch-layout "next"; }
// Mod+Shift+Space { switch-layout "prev"; }
Print { screenshot; }
Ctrl+Print { screenshot-screen; }
Alt+Print { screenshot-window; }
// Applications such as remote-desktop clients and software KVM switches may
// request that niri stops processing the keyboard shortcuts defined here
// so they may, for example, forward the key presses as-is to a remote machine.
// It's a good idea to bind an escape hatch to toggle the inhibitor,
// so a buggy application can't hold your session hostage.
//
// The allow-inhibiting=false property can be applied to other binds as well,
// which ensures niri always processes them, even when an inhibitor is active.
Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
// The quit action will show a confirmation dialog to avoid accidental exits.
Mod+Shift+E { quit; }
Ctrl+Alt+Delete { quit; }
// Powers off the monitors. To turn them back on, do any input like
// moving the mouse or pressing any other key.
Mod+Shift+P { power-off-monitors; }
}

View File

@@ -0,0 +1,7 @@
require("nvchad.mappings")
local map = vim.keymap.set
map("n", "<leader>tr", function()
vim.lsp.codelens.run()
end, { desc = "Run codelense" })

View File

@@ -0,0 +1,7 @@
require("nvchad.mappings")
local map = vim.keymap.set
map("n", "<leader>ca", function()
vim.cmd.RustLsp("codeAction")
end, { silent = true, buffer = bufnr, desc = "LSP Code action" })

2
dotfiles/nvim/init.lua Normal file
View File

@@ -0,0 +1,2 @@
require "init"
require "extraConfig"

View File

@@ -0,0 +1,24 @@
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua
-- Please read that file to know all available options :(
---@type ChadrcConfig
local M = {}
M.base46 = {
theme = "catppuccin",
-- hl_override = {
-- Comment = { italic = true },
-- ["@comment"] = { italic = true },
-- },
}
-- M.nvdash = { load_on_startup = true }
-- M.ui = {
-- tabufline = {
-- lazyload = false
-- }
--}
return M

View File

@@ -0,0 +1,21 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
elixir = { "mix" },
javascript = { "prettier" },
css = { "prettier" },
html = { "prettier" },
html = { "prettier" },
heex = { "mix" },
nix = { "nixfmt" },
json = { "prettier" },
},
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 2000,
lsp_fallback = true,
},
}
return options

View File

@@ -0,0 +1,47 @@
return {
defaults = { lazy = true },
install = { colorscheme = { "nvchad" } },
ui = {
icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
},
},
performance = {
rtp = {
disabled_plugins = {
"2html_plugin",
"tohtml",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
-- "ftplugin",
},
},
},
}

View File

@@ -0,0 +1,28 @@
-- load defaults i.e lua_lsp
require("nvchad.configs.lspconfig").defaults()
local lspconfig = require("lspconfig")
-- lspconfig.elixirls.setup({
-- cmd = { "elixir-ls" },
-- })
-- EXAMPLE
local servers = { "html", "cssls" }
local nvlsp = require("nvchad.configs.lspconfig")
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup({
on_attach = nvlsp.on_attach,
on_init = nvlsp.on_init,
capabilities = nvlsp.capabilities,
})
end
-- configuring single server, example: typescript
-- lspconfig.ts_ls.setup {
-- on_attach = nvlsp.on_attach,
-- on_init = nvlsp.on_init,
-- capabilities = nvlsp.capabilities,
-- }

View File

@@ -0,0 +1,11 @@
require("telescope").setup({
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
-- the default case_mode is "smart_case"
},
},
})

View File

@@ -0,0 +1,37 @@
vim.g.base46_cache = vim.fn.stdpath("data") .. "/base46/"
vim.g.mapleader = " "
-- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
local repo = "https://github.com/folke/lazy.nvim.git"
vim.fn.system({ "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(lazypath)
local lazy_config = require("configs.lazy")
-- load plugins
require("lazy").setup({
{
"NvChad/NvChad",
lazy = false,
branch = "v2.5",
import = "nvchad.plugins",
},
{ import = "plugins" },
}, lazy_config)
-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
require("options")
require("nvchad.autocmds")
vim.schedule(function()
require("mappings")
end)

View File

@@ -0,0 +1,54 @@
require("nvchad.mappings")
-- add yours here
local map = vim.keymap.set
local builtin = require("telescope.builtin")
local nomap = vim.keymap.del
local nvim_tmux_nav = require("nvim-tmux-navigation")
map("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>")
map("n", "<leader>tt", function()
require("base46").toggle_transparency()
end, { desc = "Toggle transparency" })
map("i", "<C-CR>", function()
vim.fn.feedkeys(vim.fn["copilot#Accept"](), "")
end, { desc = "Copilot Accept", silent = true, nowait = true, expr = true, noremap = true })
map("n", "@c", function()
require("CopilotChat").open()
end, { desc = "Copilot chat" })
map("n", "@p", function()
require("copilot.panel").open()
end, { desc = "Copilot chat" })
map("n", "@d", function()
require("copilot.panel").ask("Create documentation for the this code")
end, { desc = "Copilot chat" })
map("n", "<leader>si", function()
builtin.lsp_document_symbols()
end, { desc = "LSP Definitions" })
map("n", "<leader>sd", function()
builtin.lsp_definitions()
end, { desc = "LSP Definitions" })
map("n", "<leader>sr", function()
builtin.lsp_references()
end, { desc = "LSP References" })
map("n", "<leader>ss", function()
builtin.lsp_workspace_symbols()
end, { desc = "LSP workspace symbols" })
nomap("n", "<leader>h")
nomap("n", "<leader>v")
map("n", "<C-h>", nvim_tmux_nav.NvimTmuxNavigateLeft, { desc = "Navigate left" })
map("n", "<C-j>", nvim_tmux_nav.NvimTmuxNavigateDown, { desc = "Navigate down" })
map("n", "<C-k>", nvim_tmux_nav.NvimTmuxNavigateUp, { desc = "Navigate up" })
map("n", "<C-l>", nvim_tmux_nav.NvimTmuxNavigateRight, { desc = "Navigate right" })

View File

@@ -0,0 +1,7 @@
require("nvchad.options")
-- add yours here!
-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!
--

View File

@@ -0,0 +1,145 @@
return {
{ import = "nvchad.blink.lazyspec" },
{
"stevearc/conform.nvim",
event = "BufWritePre", -- uncomment for format on save
opts = require("configs.conform"),
},
-- These are some examples, uncomment them if you want to see them work!
{
"neovim/nvim-lspconfig",
config = function()
require("configs.lspconfig")
end,
},
{
"nvim-tree/nvim-tree.lua",
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
opts = function()
return {
filters = { dotfiles = false },
disable_netrw = true,
hijack_cursor = true,
sync_root_with_cwd = true,
update_focused_file = {
enable = true,
update_root = false,
},
view = {
width = 30,
adaptive_size = true,
preserve_window_proportions = true,
},
renderer = {
root_folder_label = false,
highlight_git = true,
indent_markers = { enable = true },
icons = {
glyphs = {
default = "󰈚",
folder = {
default = "",
empty = "",
empty_open = "",
open = "",
symlink = "",
},
git = { unmerged = "" },
},
},
},
}
end,
},
-- {
-- "hrsh7th/nvim-cmp",
-- dependencies = {
-- {
-- "zbirenbaum/copilot-cmp",
-- config = function()
-- require("copilot_cmp").setup()
-- end,
-- },
-- },
-- opts = {
-- sources = {
-- { name = "nvim_lsp", group_index = 2 },
-- { name = "copilot", group_index = 2 },
-- { name = "luasnip", group_index = 2 },
-- { name = "buffer", group_index = 2 },
-- { name = "nvim_lua", group_index = 2 },
-- { name = "path", group_index = 2 },
-- },
-- },
-- },
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release",
},
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim",
"nvim-telescope/telescope.nvim",
},
config = true,
},
{
lazy = false,
"CopilotC-Nvim/CopilotChat.nvim",
dependencies = {
{ "zbirenbaum/copilot.lua" }, -- or zbirenbaum/copilot.lua
{ "nvim-lua/plenary.nvim", branch = "master" }, -- for curl, log and async functions
},
build = "make tiktoken", -- Only on MacOS or Linux
opts = {
-- See Configuration section for options
},
-- See Commands section for default commands if you want to lazy load on them
},
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
config = function()
require("copilot").setup({
suggestion = { enabled = false },
panel = { enabled = false },
})
end,
},
{
"giuxtaposition/blink-cmp-copilot",
dependencies = {
{ "zbirenbaum/copilot.lua" },
},
},
-- {
-- "zbirenbaum/copilot-cmp",
-- config = function()
-- require("copilot_cmp").setup()
-- end,
-- },
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"vim",
"lua",
"vimdoc",
"html",
"css",
"elixir",
"rust",
"heex",
"javascript",
},
},
},
{
"alexghergh/nvim-tmux-navigation",
lazy = false,
},
}

View File

@@ -0,0 +1,33 @@
return {
{
"elixir-tools/elixir-tools.nvim",
version = "*",
event = { "BufReadPre", "BufNewFile" },
config = function()
local elixir = require("elixir")
local elixirls = require("elixir.elixirls")
elixir.setup({
nextls = { enable = true },
elixirls = {
enable = true,
settings = elixirls.settings({
dialyzerEnabled = false,
enableTestLenses = true,
}),
on_attach = function(client, bufnr)
vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", { buffer = true, noremap = true })
vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", { buffer = true, noremap = true })
vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", { buffer = true, noremap = true })
end,
},
projectionist = {
enable = true,
},
})
end,
dependencies = {
"nvim-lua/plenary.nvim",
},
},
}

View File

@@ -0,0 +1,7 @@
return {
{
"mrcjkb/rustaceanvim",
version = "^5", -- Recommended
lazy = false, -- This plugin is already lazy
},
}

7
dotfiles/ranger.conf Normal file
View File

@@ -0,0 +1,7 @@
set preview_images true
set preview_images_method kitty
set draw_borders true
map ;e fm.execute_console('shell unzip %f')
map ;e fm.execute_console('shell gwenview %f')

66
dotfiles/tmux.conf Normal file
View File

@@ -0,0 +1,66 @@
set-option -sa terminal-overrides ",xterm*:Tc"
set -g mouse on
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# Vim style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# UseAlt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Shift Alt vim keys to switch windows
bind -n M-H previous-window
bind -n M-L next-window
set -g @plugin 'dreamsofcode-io/catppuccin-tmux'
set -g @catppuccin_flavour 'mocha'
# set -g @plugin 'niksingh710/minimal-tmux-status'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g status-bg default
set -g status-style bg=default
set -g status-left-length 100
set -g status-left-style default
set -g status-left " "
set -g status-right-length 100
set -g status-right-style default
set -g status-right " "
# set vi-mode
set-window-option -g mode-keys vi
# keybindings
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
bind-key b set-option status
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"