Compare commits

...

35 Commits

Author SHA1 Message Date
8322ef1997 Weird LFS bug 2025-11-06 18:59:02 +01:00
96416217ba [emacs] Clean lsp-inline-comment-mode integration
Cleanly integrate it with company and other.
2025-10-30 22:24:56 +01:00
f16574af53 Adds completion for some custom tools 2025-10-30 09:56:15 +01:00
0daf243692 Adds completion for some utilities 2025-10-30 08:59:49 +01:00
c6cf796f15 Adds a setting to spawn a new instance.
With stacking in my WM like cosmic, it is almost all I need. Goodbye gnome-terminal.
2025-10-30 00:05:56 +01:00
d1a7c54680 Adds alacritty support 2025-10-30 00:00:22 +01:00
65d7b932d4 Fixes electric indentation 2025-10-29 23:11:46 +01:00
4f7cf6bf36 [emacs] Fixes quelpa-use-package git repo path 2025-10-22 12:03:51 +02:00
62c33db5fa Adds stule for cosmic-terminal.
Not in script.
2025-10-17 21:50:19 +02:00
11bdeaedb3 Uses quelpa instead of straight.
I was getting tired of the message. Also just configure it for github remote.
2025-10-17 21:49:43 +02:00
3afb8761d4 Enables .c <-> .h projectile switch 2025-10-17 19:15:03 +02:00
993fa7eec3 Fixes fish version check 2025-10-17 19:14:45 +02:00
5f80da627b [emacs] add spdx 2025-04-11 13:14:03 +02:00
51a438c12a Updates to emacs 30.1 2025-02-26 11:40:46 +01:00
98d609d561 Updates to emacs 29.4 fresh install 2025-01-23 19:56:39 +01:00
d9d4ff91e3 Formats cmake file only if a project-wide configuration file is found
Otherwise do nothing.
2024-12-18 10:31:23 +01:00
4f4d5a4109 Better completion 2024-12-18 09:55:30 +01:00
a486930b32 Forces a newer version of fish from the PPA 2024-10-23 14:48:22 +02:00
4b6ff16d03 Uses opencl-c-mode instead of opencl-mode 2024-08-14 10:10:58 +02:00
d855e8dc9d Adds string-inflection 2024-08-13 14:49:00 +02:00
a0916297ce Polymode PIO 2024-06-22 08:43:35 +02:00
c0e142ff40 Adds pio-mode support through polymode 2024-04-16 11:33:49 +02:00
c94ff5b11c Corrects whitelisting of arm-none-eabi-(gcc|g++) 2024-04-11 11:53:05 +02:00
0d77b01922 Whitelist driver for arm-none-eabi 2024-04-11 11:43:00 +02:00
b33d4e4545 automatically parallelize C/C++ cmake builds 2024-01-19 10:18:46 +01:00
e6d452cac2 Uses yasnippet-licenses through straight 2023-11-30 16:20:58 +01:00
44f4ee000f [emacs] Updates go-compile-commande 2023-11-20 13:57:17 +01:00
1d0c8b75a3 [emacs] Fixes atu/jupyter-ascending-sync 2023-11-20 13:38:26 +01:00
1b8095559b [emacs] jupyter-ascending integration via code-cells
Do not edit .ipynb files in the browser anymore.
2023-11-06 10:33:56 +01:00
b33cf55170 Improves cmake-before-save-hook
Do not erase wrongly formatted buffer
Keeps the current region
Writes nice message to buffer
2023-10-13 12:08:44 +02:00
0cf9d0d134 Groups snippet after other completion 2023-10-13 11:59:49 +02:00
c944c410c4 Enables projectile switching between C/C++ files 2023-10-05 12:31:59 +02:00
4cbf8c3088 Optimizes vertico 2023-10-04 17:30:55 +02:00
21a1f64a1e Adds consult/embark/vertico in emacs. 2023-10-04 13:38:40 +02:00
7cf57b9ab8 Makes company speaks yasnippet 2023-09-30 13:15:35 +02:00
10 changed files with 691 additions and 165 deletions

58
.config/alacritty.toml Normal file
View File

@@ -0,0 +1,58 @@
[font]
size = 12.0
[font.bold]
family = "UbuntuMono Nerd Font Mono"
style = "Bold"
[font.bold_italic]
family = "UbuntuMono Nerd Font Mono"
style = "Bold Italic"
[font.normal]
family = "UbuntuMono Nerd Font Mono"
style = "Regular"
[font.italic]
family = "UbuntuMono Nerd Font Mono"
style = "Italic"
[colors.primary]
foreground = "#C5C8C6"
background = "#282A2E"
[colors.cursor]
text = '#1d1f21'
cursor='#F6F6F6'
[colors.normal]
black= "#282A2E"
red= "#CC6666"
green= "#B5BD68"
yellow= "#F0C674"
blue= "#81A2BE"
magenta= "#B294BB"
cyan= "#8ABEB7"
white= "#969896"
[colors.bright]
black= "#373B41"
red= "#FF9999"
green= "#E5ED98"
yellow= "#FFF6A4"
blue= "#B1D2EE"
magenta= "#E2C4EB"
cyan= "#BAEEE7"
white= "#C5C8C6"
[keyboard]
bindings = [
{ key = "T", mods = "Control|Shift", action = "SpawnNewInstance" }
]
[window]
decorations = "Full"
# Local Variables:
# vc-follow-symlinks: t
# End:

View File

@@ -0,0 +1 @@
complete -c arkedump -f -a "(GO_FLAGS_COMPLETION=1 arkedump (string split ' ' (commandline -cp)))"

View File

@@ -0,0 +1 @@
complete -c arkesend -f -a "(GO_FLAGS_COMPLETION=1 arkesend (string split ' ' (commandline -cp)))"

View File

@@ -0,0 +1 @@
complete -c leto-cli -f -a "(GO_FLAGS_COMPLETION=1 leto-cli (string split ' ' (commandline -cp)))"

View File

@@ -0,0 +1 @@
complete -c zeus-cli -f -a "(GO_FLAGS_COMPLETION=1 zeus-cli (string split ' ' (commandline -cp)))"

View File

@@ -1,6 +1,6 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR __fish_initialized:3100
SETUVAR __fish_initialized:3400
SETUVAR fish_color_autosuggestion:969896
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:b294bb

View File

@@ -7,8 +7,3 @@
tool = meld
[init]
defaultBranch = main
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f

635
.emacs
View File

@@ -10,15 +10,20 @@
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(c-basic-offset 4)
'(c-default-style
'((c++-mode . "tuleu-c++")
(java-mode . "java")
(awk-mode . "awk")
(other . "gnu")))
'(company-idle-delay 20.0)
'(compilation-scroll-output 'first-error)
'(custom-safe-themes
'("162201cf5b5899938cfaec99c8cb35a2f1bf0775fc9ccbf5e63130a1ea217213" "e3daa8f18440301f3e54f2093fe15f4fe951986a8628e98dcd781efbec7a46f2" "6622bb651e72d8ebd66454bd86db6c3990324243ff4325c1b6df252aba63b13e" "2f8eadc12bf60b581674a41ddc319a40ed373dd4a7c577933acaff15d2bf7cc6" "f458b92de1f6cf0bdda6bce23433877e94816c3364b821eb4ea9852112f5d7dc" "016f665c0dd5f76f8404124482a0b13a573d17e92ff4eb36a66b409f4d1da410" "13096a9a6e75c7330c1bc500f30a8f4407bd618431c94aeab55c9855731a95e1" "8b148cf8154d34917dfc794b5d0fe65f21e9155977a36a5985f89c09a9669aa0" "bf948e3f55a8cd1f420373410911d0a50be5a04a8886cabe8d8e471ad8fdba8e" "680f62b751481cc5b5b44aeab824e5683cf13792c006aeba1c25ce2d89826426" "631c52620e2953e744f2b56d102eae503017047fb43d65ce028e88ef5846ea3b" default))
'("162201cf5b5899938cfaec99c8cb35a2f1bf0775fc9ccbf5e63130a1ea217213"
"e3daa8f18440301f3e54f2093fe15f4fe951986a8628e98dcd781efbec7a46f2"
"6622bb651e72d8ebd66454bd86db6c3990324243ff4325c1b6df252aba63b13e"
"2f8eadc12bf60b581674a41ddc319a40ed373dd4a7c577933acaff15d2bf7cc6"
"f458b92de1f6cf0bdda6bce23433877e94816c3364b821eb4ea9852112f5d7dc"
"016f665c0dd5f76f8404124482a0b13a573d17e92ff4eb36a66b409f4d1da410"
"13096a9a6e75c7330c1bc500f30a8f4407bd618431c94aeab55c9855731a95e1"
"8b148cf8154d34917dfc794b5d0fe65f21e9155977a36a5985f89c09a9669aa0"
"bf948e3f55a8cd1f420373410911d0a50be5a04a8886cabe8d8e471ad8fdba8e"
"680f62b751481cc5b5b44aeab824e5683cf13792c006aeba1c25ce2d89826426"
"631c52620e2953e744f2b56d102eae503017047fb43d65ce028e88ef5846ea3b"
default))
'(display-time-24hr-format t)
'(display-time-default-load-average nil)
'(doom-modeline-github t)
@@ -41,19 +46,19 @@
'(lisp-simple-loop-indentation 4)
'(lisp-tag-body-indentation 4)
'(lisp-tag-indentation 4)
'(lsp-copilot-enabled t)
'(lsp-inline-completion-idle-delay 99999999)
'(org-agenda-files '("~/org/1.TODO.org"))
'(package-enable-at-startup nil)
'(package-selected-packages
'(clang-format+ cmake-format xterm-color dockerfile-mode web-mode prettier json-mode py-isort blacken pyvenv yaml-mode lsp-pyright ng2-mode lsp-ltex lsp-treemacs treemacs-nerd-icons treemacs-projectile treemacs lsp-ui lsp-mode which-key flycheck vterm projectile yasnippet-snippets yasnippet aggressive-indent doom-themes company-go zenburn-theme langtool smart-tabs-mode typescript-mode protobuf-mode opencl-mode glsl-mode go-mode markdown-mode srefactor irony cmake-mode company magit use-package))
'(package-selected-packages nil)
'(safe-local-variable-values
'((vc-follow-symlinks . t)
(TeX-master . t)
(TeX-parse-self . t)))
'((vc-follow-symlinks . t) (TeX-master . t) (TeX-parse-self . t)))
'(system-packages-noconfirm t)
'(tab-width 4)
'(warning-suppress-log-types '((comp)))
'(whitespace-style
'(face trailing tabs lines-tail newline space-before-tab::tab space-before-tab::space space-before-tab tab-mark)))
'(face trailing tabs lines-tail newline space-before-tab::tab
space-before-tab::space space-before-tab tab-mark)))
(if (display-graphic-p)
(if (fboundp 'tool-bar-mode)
@@ -75,21 +80,30 @@
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")))
(package-initialize)
(eval-when-compile
(unless (package-installed-p 'use-package)
(unless package-archive-contents
(package-refresh-contents))
(package-install 'use-package)
)
(require 'use-package)
)
(require 'use-package)
(unless (package-installed-p 'quelpa)
(with-temp-buffer
(url-insert-file-contents "https://raw.githubusercontent.com/quelpa/quelpa/master/quelpa.el")
(eval-buffer)
(quelpa-self-upgrade)))
(setq quelpa-checkout-melpa-p nil)
(setq quelpa-use-package-inhibit-loading-quelpa t)
(quelpa
'(quelpa-use-package
:fetcher github
:repo "quelpa/quelpa-use-package"))
(require 'quelpa-use-package)
(require 'use-package-ensure)
(setq use-package-always-ensure t)
(use-package system-packages)
;(use-package use-package-ensure-system-package)
(use-package use-package-ensure-system-package)
;; required because vterm wants this before loading.
(use-package emacs
@@ -98,9 +112,206 @@
(cmake . cmake)
("/usr/include/vterm.h" . libvterm-dev)
)
:init
;; Add prompt indicator to `completing-read-multiple'.
;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
(defun crm-indicator (args)
(cons (format "[CRM%s] %s"
(replace-regexp-in-string
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
crm-separator)
(car args))
(cdr args)))
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
;; Do not allow the cursor in the minibuffer prompt
(setq minibuffer-prompt-properties
'(read-only t cursor-intangible t face minibuffer-prompt))
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
;; Emacs 28: Hide commands in M-x which do not work in the current mode.
;; Vertico commands are hidden in normal buffers.
(setq read-extended-command-predicate
#'command-completion-default-include-p)
;; Enable recursive minibuffers
(setq enable-recursive-minibuffers t)
(defconst atu/numprocs
(string-to-number (shell-command-to-string "nproc"))
"The number of processor on the system")
)
;; Enable vertico
(use-package vertico
:init
(vertico-mode)
;; Different scroll margin
;; (setq vertico-scroll-margin 0)
;; Show more candidates
(setq vertico-count 10)
;; Grow and shrink the Vertico minibuffer
(setq vertico-resize t)
;; Optionally enable cycling for `vertico-next' and `vertico-previous'.
(setq vertico-cycle t)
:config
(vertico-reverse-mode)
(keymap-set vertico-map "TAB" #'minibuffer-complete)
)
;; Persist history over Emacs restarts. Vertico sorts by history position.
(use-package savehist
:init
(savehist-mode))
;; Optionally use the `orderless' completion style.
(use-package orderless
:init
;; Configure a custom style dispatcher (see the Consult wiki)
;; (setq orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch)
;; orderless-component-separator #'orderless-escapable-split-on-space)
(setq completion-styles '(partial-completion orderless basic)
;;completion-category-defaults nil
completion-category-overrides '((file (styles basic partial-completion ))))
)
;; Example configuration for Consult
(use-package consult
;; Replace bindings. Lazily loaded due by `use-package'.
:bind (;; C-c bindings in `mode-specific-map'
("C-c M-x" . consult-mode-command)
("C-c h" . consult-history)
("C-c k" . consult-kmacro)
("C-c M" . consult-man)
("C-c i" . consult-info)
([remap Info-search] . consult-info)
;; C-x bindings in `ctl-x-map'
("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
("C-x b" . consult-buffer) ;; orig. switch-to-buffer
("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame
("C-x r b" . consult-bookmark) ;; orig. bookmark-jump
("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer
;; Custom M-# bindings for fast register access
("M-#" . consult-register-load)
("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
("C-M-#" . consult-register)
;; Other custom bindings
("M-y" . consult-yank-pop) ;; orig. yank-pop
;; M-g bindings in `goto-map'
("M-g e" . consult-compile-error)
("M-g f" . consult-flymake) ;; Alternative: consult-flycheck
("M-g g" . consult-goto-line) ;; orig. goto-line
("M-g M-g" . consult-goto-line) ;; orig. goto-line
("M-g o" . consult-outline) ;; Alternative: consult-org-heading
("M-g m" . consult-mark)
("M-g k" . consult-global-mark)
("M-g i" . consult-imenu)
("M-g I" . consult-imenu-multi)
;; M-s bindings in `search-map'
("M-s d" . consult-find) ;; Alternative: consult-fd
("M-s D" . consult-locate)
("M-s g" . consult-grep)
("M-s G" . consult-git-grep)
("M-s r" . consult-ripgrep)
("M-s l" . consult-line)
("M-s L" . consult-line-multi)
("M-s k" . consult-keep-lines)
("M-s u" . consult-focus-lines)
;; Isearch integration
("M-s e" . consult-isearch-history)
:map isearch-mode-map
("M-e" . consult-isearch-history) ;; orig. isearch-edit-string
("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string
("M-s l" . consult-line) ;; needed by consult-line to detect isearch
("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch
;; Minibuffer history
:map minibuffer-local-map
("M-s" . consult-history) ;; orig. next-matching-history-element
("M-r" . consult-history)) ;; orig. previous-matching-history-element
:init
;; Optionally configure the register formatting. This improves the register
;; preview for `consult-register', `consult-register-load',
;; `consult-register-store' and the Emacs built-ins.
(setq register-preview-delay 0.5
register-preview-function #'consult-register-format)
;; Optionally tweak the register preview window.
;; This adds thin lines, sorting and hides the mode line of the window.
(advice-add #'register-preview :override #'consult-register-window)
;; Use Consult to select xref locations with preview
(setq xref-show-xrefs-function #'consult-xref
xref-show-definitions-function #'consult-xref)
:config
;; Optionally configure preview. The default value
;; is 'any, such that any key triggers the preview.
;; (setq consult-preview-key 'any)
;; (setq consult-preview-key "M-.")
;; (setq consult-preview-key '("S-<down>" "S-<up>"))
;; For some commands and buffer sources it is useful to configure the
;; :preview-key on a per-command basis using the `consult-customize' macro.
(consult-customize
consult-theme :preview-key '(:debounce 0.2 any)
consult-ripgrep consult-git-grep consult-grep
consult-bookmark consult-recent-file consult-xref
consult--source-bookmark consult--source-file-register
consult--source-recent-file consult--source-project-recent-file
;; :preview-key "M-."
:preview-key '(:debounce 0.4 any))
;; Optionally configure the narrowing key.
;; Both < and C-+ work reasonably well.
(setq consult-narrow-key "<") ;; "C-+"
(autoload 'projectile-project-root "projectile")
(setq consult-project-function (lambda (_) (projectile-project-root)))
)
(use-package marginalia
:config
(marginalia-mode))
(use-package embark
:bind
("C-x m" . embark-act) ;; pick some comfortable binding
("M-." . embark-dwim) ;; good alternative: M-.
("C-h B" . embark-bindings) ;; alternative for `describe-bindings'
:init
;; Optionally replace the key help with a completing-read interface
(setq prefix-help-command #'embark-prefix-help-command)
;; Show the Embark target at point via Eldoc. You may adjust the Eldoc
;; strategy, if you want to see the documentation from multiple providers.
(add-hook 'eldoc-documentation-functions #'embark-eldoc-first-target)
;; (setq eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly)
:config
;; Hide the mode line of the Embark live/completions buffers
(add-to-list 'display-buffer-alist
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
nil
(window-parameters (mode-line-format . none)))))
;; Consult users will also want the embark-consult package.
(use-package embark-consult
:demand t
:hook
(embark-collect-mode . consult-preview-at-point-mode))
(use-package doom-modeline
:init
@@ -149,12 +360,6 @@
)
)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(use-package xterm-color
:config
@@ -167,49 +372,6 @@
)
(use-package smart-tabs-mode
:config
(setq-default tab-width 4) ; or any other preferred value
(setq cua-auto-tabify-rectangles nil)
(smart-tabs-advice c-indent-line c-basic-offset)
(smart-tabs-advice c-indent-region c-basic-offset)
(smart-tabs-add-language-support cmake cmake-mode-hook
(
(cmake-indent . cmake-tab-width)
)
)
(smart-tabs-add-language-support protobuf protobuf-mode-hook
(
(c-indent-line . c-basic-offset)
(c-indent-region . c-basic-offset)
)
)
(smart-tabs-add-language-support glsl glsl-mode-hook
(
(c-indent-line . c-basic-offset)
(c-indent-region . c-basic-offset)
)
)
(smart-tabs-add-language-support opencl opencl-mode-hook
(
(c-indent-line . c-basic-offset)
(c-indent-region . c-basic-offset)
)
)
(smart-tabs-add-language-support elisp emacs-lisp-mode-hook
(
(lisp-indent-line . lisp-indent-offset)
(lisp-indent-region . lisp-indent-offset)
)
)
(smart-tabs-insinuate 'c 'c++ 'cmake 'nxml 'protobuf 'glsl 'elisp)
)
(use-package aggressive-indent
:hook
@@ -226,49 +388,140 @@
(magit-credential-cache-daemon-socket nil)
)
(use-package yasnippet
:delight yas-minor-mode
:bind ( :map yas-minor-mode-map
("TAB" . nil)
)
)
(use-package yasnippet-snippets
:after yasnippet
)
(use-package company
:after yasnippet
:delight
:bind ( ("M-TAB" . company-complete) )
:init
(defun atu/company-prog-mode ()
"Starts yas company and set up backends accordingly"
(yas-minor-mode)
(company-mode)
)
:config
(global-company-mode t)
(setq
company-minimum-prefix-length 1
company-idle-delay 0.5)
(setq company-backends
'(
(company-capf :separate company-yasnippet)
company-files
company-keywords
)
)
:hook
(prog-mode . atu/company-prog-mode)
)
(use-package cmake-mode
:ensure-system-package (
(cmake . cmake)
(pip . python3-pip)
(cmake-format . "pip install --user cmakelang[YAML]")
(pipx . pipx)
(cmake-format . "pipx install cmakelang[YAML]")
(cmake-language-server . "pipx install cmake-language-server")
)
:config
(setq cmake-tab-width 4)
(defun atu/create-or-erase-buffer (buffer-name)
""
(let ((existing-buffer (get-buffer buffer-name)))
(when existing-buffer
(with-current-buffer existing-buffer
(erase-buffer)))
(get-buffer-create buffer-name))
)
(defun atu/cmake-format-buffer ()
"Formats the current buffer using cmake-format"
(interactive)
(shell-command-on-region
;; region to execute on
(let (
(error-buffer (atu/create-or-erase-buffer "*cmake-format:stderr*"))
(cmake-format-config-file-exists
(file-exists-p (projectile-expand-root ".cmake-format.yaml"))
)
)
(setq-local atu/after-save-message nil)
(if cmake-format-config-file-exists
(if (eq 0 (call-process-region
;;region
(point-min)
(point-max)
;; command
"cmake-format -"
;; replace
t
;; name of the error bufer
"* cmake-format Error Buffer *"
;;
t))
"cmake-format"
nil ;do not delete buffer
;; discard stdout copy stderr to buffer
error-buffer
nil ;dont-redisplay buffer
"-"
))
(let ((current-point (point)))
(call-process-region
(point-min) (point-max)
"cmake-format"
t t t; replace current buffer and redisplay it
"--log-level=error" "-"
)
(goto-char (+ (point-min) current-point))
nil
)
(message
"cmake-format: could not format %s see buffer %s for details"
(buffer-name) error-buffer)
(current-message)
)
(message "cmake-format: skipping as no configuration file found")
)
)
)
(defun atu/cmake-before-save-hook ()
""
(setq-local atu/after-save-message (atu/cmake-format-buffer))
)
(defun atu/cmake-after-save-hook ()
""
(when atu/after-save-message
(message atu/after-save-message)
)
)
:hook
(cmake-mode . lsp-deferred)
(cmake-mode . (lambda () (add-hook 'before-save-hook 'atu/cmake-format-buffer nil 'local)))
(cmake-mode . (lambda ()
(add-hook 'before-save-hook 'atu/cmake-before-save-hook nil 'local)
(add-hook 'after-save-hook 'atu/cmake-after-save-hook nil 'local))
)
)
(use-package cc-mode
:ensure nil
:ensure-system-package
(clangd . clangd)
:config
(setq lsp-clients-clangd-args
'("--header-insertion-decorators=0" "--query-driver=/**/arm-none-eabi-*" "--log=verbose"))
:hook
(c-mode . lsp-deferred)
(c++-mode . lsp-deferred)
(c++-mode . (lambda () (setq-local lsp-enable-on-type-formatting nil)))
)
(use-package clang-format+
@@ -278,20 +531,31 @@
(c-mode-common . clang-format+-mode)
)
(use-package yasnippet
:delight yas-minor-mode
:config
(yas-global-mode)
:after (company)
:bind ( :map yas-minor-mode-map
("TAB" . nil)
)
(use-package string-inflection
:bind
("C-c u" . string-inflection-all-cycle)
)
(use-package yasnippet-snippets
:after (yasnippet)
(use-package polymode
:config
(define-hostmode poly-pio-hostmode
:mode 'asm-mode)
(define-auto-innermode poly-pio-c-innermode
:mode 'c-mode
:head-matcher "^%c-sdk{$"
:tail-matcher "^%}$"
:head-mode 'host
:tail-mode 'host)
(define-polymode poly-pio-mode
:hostmode 'poly-pio-hostmode
:innermodes '(poly-pio-c-innermode))
(add-to-list 'auto-mode-alist '("\\.pio$" . poly-pio-mode))
)
(use-package projectile
:bind ( :map projectile-mode-map
( "C-c p" . 'projectile-command-map)
@@ -306,8 +570,97 @@
:test "ng test --progress=false"
:run "ng serve"
:test-suffix ".spec")
(defun atu/cmake-cc-inference (dir)
"Detects if the current root is a CMake C/C++ project"
(let ((cmakelists-file (projectile-expand-root "CMakeLists.txt" dir)))
(if (file-exists-p cmakelists-file)
(with-temp-buffer
(insert-file-contents cmakelists-file)
(goto-char (point-min))
(re-search-forward "project[[:space:]]*([^)]+\\([[:space:]]C\\(XX\\)?[[:space:]]\\)[^)]+)" nil t)
)))
)
(defun atu/cc-related-files (path)
"Returns related files path for a C/C++ file for a given path"
(let* (
(ext (file-name-extension path))
(basename (file-name-base path))
(dirpath (file-name-directory path))
(impl-rx "\\([.-]?[Ii]mp[l]?\\)$")
)
(if (member ext '("h" "hh" "hpp"))
(if (string-match impl-rx basename)
(list :other (concat dirpath
(string-replace
(match-string 1 basename)
""
basename)
"."
ext))
(list :other
(mapcar (lambda (sfx) (concat dirpath basename sfx))
(list
(concat "Imp." ext)
(concat "Impl." ext)
(concat "imp." ext)
(concat "impl." ext)
(concat ".Imp." ext)
(concat ".Impl." ext)
(concat ".imp." ext)
(concat ".impl." ext)
(concat "-Imp." ext)
(concat "-Impl." ext)
(concat "-imp." ext)
(concat "-impl." ext)
".cpp"
".c"
)))
)
(when (member ext '("c" "cc" "cpp"))
(list :other
(mapcar (lambda (sfx) (concat dirpath basename sfx))
'( ".h" ".hh" ".hpp" )))
)
)
)
)
(projectile-register-project-type 'cmake-cc #'atu/cmake-cc-inference
:project-file "CMakeLists.txt"
:configure "cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=On"
:compile (format "cmake --build build -j %d" atu/numprocs)
:test (format "cmake --build build -j %d --target check" atu/numprocs)
:related-files-fn
(list
#'atu/cc-related-files
(projectile-related-files-fn-test-with-suffix "cpp" "Test")
(projectile-related-files-fn-test-with-suffix "cpp" "UTest")
)
)
)
;; (use-package polymode
;; :config
;; (define-hostmode poly-pio-hostmode
;; :mode 'asm-mode)
;; (define-innermode poly-pio-c-innermode
;; :mode 'c-mode
;; :head-matcher "^% c-sdk {$"
;; :tail-matcher "^%}$"
;; :head-mode 'host
;; :tail-mode 'host)
;; (define-polymode poly-pio-mode
;; :hostmode 'poly-pio-hostmode
;; :innermodes '(poly-pio-c-innermode))
;; (add-to-list 'auto-mode-alist '("\\.pio$" . poly-pio-mode))
;; )
(use-package vterm)
(use-package flycheck
@@ -348,23 +701,26 @@
(setq lsp-keymap-prefix "C-c l")
:bind-keymap ("C-c l" . lsp-command-map)
:config
(yas-minor-mode)
(if (display-graphic-p)
(setq lsp-ui-doc-use-webkit t)
)
(add-to-list 'lsp-language-id-configuration '("\\.postcss\\'" . "css"))
(advice-add 'lsp :before
(lambda (&rest _args)
(eval '(setf (lsp-session-server-id->folders (lsp-session)) (ht)
(defun atu/lsp-inline-completion-display-toggle-key ()
"Add or remove `i` key from the lsp-command-map` depending on `lsp-inline-completion-mode`"
(if lsp-inline-completion-mode
(define-key lsp-command-map (kbd "i") #'lsp-inline-completion-display)
(define-key lsp-command-map (kbd "i") nil)))
(with-eval-after-load 'lsp-inline-completion
(define-key lsp-inline-completion-active-map (kbd "C-j") #'lsp-inline-completion-accept)
)
)
)
)
:bind (
("C-c C-d" . lsp-ui-doc-toggle)
)
:hook
:bind (("C-c C-d" . lsp-ui-doc-toggle))
:hook (
(lsp-mode . lsp-enable-which-key-integration)
(lsp-inline-completion-mode . lsp-inline-completion-company-integration-mode)
(lsp-inline-completion-mode . atu/lsp-inline-completion-display-toggle-key)
)
:commands
(lsp lsp-deferred)
)
@@ -538,8 +894,52 @@
(add-hook 'before-save-hook 'py-isort-before-save)))
)
(use-package code-cells
:mode ("\\.sync.py'" . code-cells-mode)
(add-to-list 'auto-mode-alist '("\\.h\\'" . c-c++-header))
:config
(defun atu/jupyter-ascending-sync ()
"Runs synchronization with jupyter-ascending "
(interactive)
(when (string-match-p ".sync.py\\'" (buffer-name))
(unless (and (boundp 'atu/jupyter-sync-inhibit) atu/jupyter-sync-inhibit)
(call-process "python"
nil nil nil
"-m" "jupyter_ascending.requests.sync" "--filename" (buffer-file-name)
)
)
)
)
(defun atu/jupyter-ascending-eval (start end)
"Runs cell via jupyter-ascending or python-shell-send-region"
(interactive)
(if (not (string-match-p ".sync.py\\'" (buffer-name)))
(python-shell-send-region start end)
(setq-local atu/jupyter-sync-inhibit t)
(save-buffer)
(setq-local atu/jupyter-sync-inhibit nil)
(call-process "python"
nil nil nil
"-m" "jupyter_ascending.requests.execute"
"--filename" (buffer-file-name)
"--linenumber" (number-to-string (line-number-at-pos))
)
)
)
(setq code-cells-eval-region-commands
(mapcar (lambda (pair)
(if (eq (car pair) 'python-mode)
(cons 'python-mode 'atu/jupyter-ascending-eval)
pair))
code-cells-eval-region-commands))
:hook
(python-mode . code-cells-mode-maybe)
(code-cells-mode . (lambda ()
(add-hook 'after-save-hook 'atu/jupyter-ascending-sync nil 'local)))
)
(use-package markdown-mode)
@@ -547,17 +947,19 @@
:after (projectile)
:config
(unbind-key "C-c C-d" go-mode-map)
(defun go-compile-command ()
(defun atu/go-compile-command ()
"returns a string to compile a go project"
(setq project-makefile (concat (file-name-as-directory (projectile-project-root)) "Makefile"))
(interactive)
(let ((project-makefile (concat (file-name-as-directory (projectile-project-root)) "Makefile")))
(if (file-exists-p project-makefile)
"make"
"go build && go test && go vet"
)
)
)
(projectile-update-project-type
'go
:compile 'go-compile-command)
:compile 'atu/go-compile-command)
:hook
(go-mode . lsp-deferred)
(go-mode . (lambda ()
@@ -567,7 +969,7 @@
)
(use-package glsl-mode)
(use-package opencl-mode)
(use-package opencl-c-mode)
(use-package protobuf-mode
:mode "\\.proto\\'"
@@ -619,6 +1021,15 @@
)
(use-package spdx
:quelpa (spdx :fetcher github :repo "condy0919/spdx.el")
:bind (:map prog-mode-map
("C-c i l" . spdx-insert-spdx))
:custom
(spdx-copyright-holder 'auto)
(spdx-project-detection 'auto))
;; Local Variables:
;; vc-follow-symlinks: t

View File

@@ -0,0 +1,37 @@
(
name: "Tomorrow Night - Tweeked",
foreground: "#C5C8C6",
background: "#282A2E",
cursor: "#F6F6F6",
dim_foreground: "#282A2E",
normal: (
black: "#282A2E",
red: "#CC6666",
green: "#B5BD68",
yellow: "#F0C674",
blue: "#81A2BE",
magenta: "#B294BB",
cyan: "#8ABEB7",
white: "#969896",
),
bright: (
black: "#373B41",
red: "#FF9999",
green: "#E5ED98",
yellow: "#FFF6A4",
blue: "#B1D2EE",
magenta: "#E2C4EB",
cyan: "#BAEEE7",
white: "#C5C8C6",
),
dim: (
black: "#1f1d21",
red: "#BB5555",
green: "#A4AC57",
yellow: "#DFB563",
blue: "#7091AD",
magenta: "#A183AA",
cyan: "#79ADA6",
white: "#858785",
),
)

View File

@@ -102,7 +102,8 @@ files=".config/fish \
.config/starship.toml \
.local/share/omf \
.emacs \
.tmux.conf.local"
.tmux.conf.local \
.config/alacritty.toml"
@@ -151,10 +152,30 @@ function load_gnome_terminal_profiles() {
function install_fish() {
echo "--- Ensuring fish is current shell"
local fish_good=0
if ! which fish 1>/dev/null
then
echo "+++ Installing fish"
run sudo apt-get install -y fish
fish_good=1
fi
local current_version=$(fish --version | cut -d " " -f 3)
local current_version_test=$(cat <<EOF
${current_version}
3.4.0
EOF
)
if [ $(echo "${current_version_test}" | sort -n | head -1) != "3.4.0" ]
then
echo "Wrong version of fish ${current_version}"
fish_good=1
fi
if [ $fish_good -eq 1 ]
then
echo "+++ Installing fish from PPA"
run sudo add-apt-repository -y ppa:fish-shell/release-3
run sudo apt update
run sudo apt install -y fish
else
echo "+++ Fish is installed"
fi