Compare commits

..

No commits in common. "main" and "master" have entirely different histories.
main ... master

5 changed files with 4 additions and 190 deletions

View file

@ -126,7 +126,6 @@
"preexec_functions+=(horizontal-rule)\n"
"precmd_functions+=(horizontal-rule)\n"
"PROMPT=\"%T \\$(spwd) %B%(?.%F{2}.%F{1}[%?])>%b%f \"")
(local-file "zsh/spwd.zsh")
(local-file "zsh/guix-environment.zsh"))))))
(define home-guile-service

View file

@ -15,8 +15,7 @@
#:select (local-file
mixed-text-file))
#:use-module ((oni home config common)
#:select (home-channels-service
home-zsh-service))
#:select (home-channels-service))
#:use-module ((oni home services emacs)
#:select (home-emacs-service-type
home-emacs-configuration
@ -25,9 +24,6 @@
home-emacs-org-journal-service-type))
#:use-module ((oni home services environment)
#:select (home-environment-service))
#:use-module (oni home services zsh)
#:use-module ((oni packages emacs)
#:select (emacs-php-ts-mode))
#:use-module ((oni packages emacs-config)
#:select (emacs-oni-bookmark
emacs-oni-browse-url
@ -54,8 +50,7 @@
emacs-oni-shr
emacs-oni-tramp
emacs-oni-web-mode
emacs-oni-yaml
emacs-oni-lua)))
emacs-oni-yaml)))
(home-environment
(packages (list (specification->package+output "glibc-locales")
@ -88,9 +83,7 @@
emacs-oni-web-mode
emacs-oni-php
emacs-oni-projectile
htop
emacs-php-ts-mode
emacs-oni-lua))
htop))
(services (list home-channels-service
home-environment-service
(service home-emacs-service-type
@ -98,7 +91,6 @@
(configurations
(list
(local-file "../services/emacs/init.el")
(local-file "pop-os/emacs.el")
(mixed-text-file
"init.el"
"(with-eval-after-load 'project (require 'oni-project))\n"
@ -110,12 +102,4 @@
(home-wakatime-configuration
(api-url "https://waka.ryuslash.org/api")
(exclude '("COMMIT_EDITMSG$"
"TAG_EDITMSG$"))))
home-zsh-service
;; This has to be the first extension because it needs to be added to the
;; configuration last.
(service home-zsh-syntax-highlighting-service-type)
(service home-zsh-autosuggestions-service-type)
(service home-zsh-contextual-abbrevs-service-type))))
"TAG_EDITMSG$")))))))

View file

@ -1,117 +0,0 @@
(defun snowball-reformat-chanced-file ()
"Run the current buffer through Pint."
(interactive)
(let ((format-file-name (concat "fmt-" (file-name-nondirectory (buffer-file-name)))))
(unwind-protect
(progn
(write-region (point-min) (point-max) format-file-name)
(shell-command
(format "%s %s"
(expand-file-name "../chanced-scripts/format" (project-root (project-current)))
(file-relative-name format-file-name (project-root (project-current))))
nil nil)
(let ((temp-buffer (find-file-noselect format-file-name)))
(unwind-protect
(replace-buffer-contents temp-buffer)
(kill-buffer temp-buffer))))
(delete-file format-file-name))))
(defun tomwpunt:enable-directory-local-modes ()
"Enable hooks and modes that are bound to specific directory."
(cond
((string-suffix-p "src/social-api/" (or (and-let* ((project (project-current)))
(project-root project))
""))
(local-set-key (kbd "C-c c") #'artisan-transient)
(when (equal major-mode 'php-mode)
(add-hook 'before-save-hook 'snowball-reformat-chanced-file nil t)))))
(add-hook 'find-file-hook 'tomwpunt:enable-directory-local-modes)
(transient-define-prefix artisan-transient ()
"A transient to run artisan commands."
["Punt"
["Composer"
("pci" "Install" artisan-punt-composer-install)]
["Artisan"
("pac" "Run Command" artisan-punt-run-command)
("pam" "Migrate" artisan-punt-migrate)
("pat" "Test" artisan-punt-test)]]
["Chanced"
["Composer"
("cci" "Install" artisan-chanced-composer-install)]
["Artisan"
("cac" "Run Command" artisan-chanced-run-command)
("cam" "Migrate" artisan-chanced-migrate)
("cat" "Test" artisan-chanced-test)]])
(defun artisan-punt-composer-install ()
(interactive)
(let ((default-directory (expand-file-name "punt" (project-root (project-current)))))
(async-shell-command "docker exec -it punt-backend composer install")))
(defun artisan-chanced-composer-install ()
(interactive)
(let ((default-directory (expand-file-name "chanced" (project-root (project-current)))))
(async-shell-command "docker exec -it chanced-backend composer install")))
(defun artisan-punt-run-command (command)
(interactive
(list
(read-string "Command: ")))
(let ((default-directory (expand-file-name "punt" (project-root (project-current)))))
(async-shell-command (format "docker exec -it punt-backend php artisan %s" command))))
(defun artisan-chanced-run-command (command)
(interactive
(list
(read-string "Command: ")))
(let ((default-directory (expand-file-name "chanced" (project-root (project-current)))))
(async-shell-command (format "docker exec -it chanced-backend php artisan %s" command))))
(defun artisan-punt-migrate ()
(interactive)
(let ((default-directory (expand-file-name "punt" (project-root (project-current)))))
(async-shell-command "docker exec -it punt-backend php artisan migrate")))
(defun artisan-chanced-migrate ()
(interactive)
(let ((default-directory (expand-file-name "chanced" (project-root (project-current)))))
(async-shell-command "docker exec -it chanced-backend php artisan migrate")))
(defun artisan-punt-test (pick)
(interactive "P")
(artisan--test-internal pick "punt" "chanced"))
(defun artisan-chanced-test (pick)
(interactive "P")
(artisan--test-internal pick "chanced" "punt"))
(defvar artisan--test-last-command nil
"The last testing commnand that was run in the test buffer.
This variable should always be buffer local and only set in test
buffers.")
(make-variable-buffer-local 'artisan--test-last-command)
(defun artisan--test-internal (pick name ignore)
(let* ((default-directory (expand-file-name name (project-root (project-current))))
(buffer-name (format "*%s Tests*" (capitalize name)))
(buffer (get-buffer-create buffer-name))
(files (cons '("all" . "")
(mapcar (lambda (dir) (cons (file-name-nondirectory dir) dir))
(directory-files-recursively "../" (rx "Test.php") nil (lambda (subdir) (not (or (string-suffix-p "vendor" subdir) (string-suffix-p ignore subdir))))))))
(command (with-current-buffer buffer
(or (and (not pick) artisan--test-last-command)
(format "../../chanced-scripts/test %s %s"
name (map-elt files (completing-read "File: " files nil t))))))
(compilation-scroll-output t))
(cl-letf (((symbol-function 'compilation-buffer-name)
(lambda (&rest args) buffer-name)))
(compile command))
(with-current-buffer buffer
(setq artisan--test-last-command command)
(local-set-key (kbd "g")
(lambda ()
(interactive)
(artisan--test-internal nil name ignore)))
(local-set-key (kbd "q") #'bury-buffer))))

View file

@ -1,27 +0,0 @@
function spwd() {
# From https://stackoverflow.com/a/45336078
paths=(${(s:/:)PWD})
cur_path='/'
cur_short_path='/'
for directory in ${paths[@]}
do
cur_dir=''
for (( i=0; i<${#directory}; i++ )); do
cur_dir+="${directory:$i:1}"
matching=("$cur_path"/"$cur_dir"*/)
if [[ ${#matching[@]} -eq 1 ]]; then
break
fi
done
cur_short_path+="$cur_dir/"
cur_path+="$directory/"
if [[ $cur_path == $HOME/ ]];
then cur_short_path='~/'
fi
done
printf %b "${cur_short_path: : -1}"
echo
}

View file

@ -11,8 +11,6 @@
#:use-module ((gnu packages mail)
#:select (notmuch))
#:use-module (gnu packages ruby)
#:use-module ((gnu packages tree-sitter)
#:select (tree-sitter-php))
#:use-module (rosenthal packages tree-sitter))
(define-public emacs-ace-link-notmuch
@ -665,26 +663,3 @@ new-theme for a while. I couldn't think of a name so I named it after him.")
(synopsis "Add TODO, FIXME, etc highlighting in comments and strings.")
(description "Add TODO, FIXME, etc highlighting in comments and strings.")
(license license:gpl3+))))
(define-public emacs-php-ts-mode
(let ((commit "4e266dc4462b836b90437dc7a4d3c8f4dac89c4a")
(revision "0"))
(package
(name "emacs-php-ts-mode")
(version (git-version "0.0.0" revision commit))
(source
(origin
(uri (git-reference
(url "https://github.com/emacs-php/php-ts-mode")
(commit commit)))
(method git-fetch)
(file-name (git-file-name name version))
(sha256
(base32 "1w96db9mljp67a1jjqxaw30xa2iyr94f9981q52byd42wqislhja"))))
(propagated-inputs
(list tree-sitter-php))
(build-system emacs-build-system)
(home-page "https://github.com/emacs-php/ts-php-mode")
(synopsis "A Tree-sitter based major mode for editing PHP codes")
(description "A Tree-sitter based major mode for editing PHP codes.")
(license license:gpl3))))