Compare commits
7 Commits
4500cf9cb5
...
c021061dc5
Author | SHA1 | Date | |
---|---|---|---|
|
c021061dc5 | ||
|
a2e0b17332 | ||
|
a67e30d0dd | ||
|
129c5c5975 | ||
|
cc6db44752 | ||
|
c4b7b41521 | ||
|
b114fd0d71 |
@ -20,6 +20,9 @@
|
||||
(defun sp-wrap-single-quote ()
|
||||
(interactive)
|
||||
(sp-wrap-with-pair "'"))
|
||||
(defun sp-wrap-angle-bracket ()
|
||||
(interactive)
|
||||
(sp-wrap-with-pair "<"))
|
||||
(defun sp-after-equals-p (_id action _context)
|
||||
(when (memq action '(insert navigate))
|
||||
(sp--looking-back-p "=>" 2)))
|
||||
@ -66,7 +69,8 @@
|
||||
"g[" #'sp-wrap-square
|
||||
"g{" #'sp-wrap-curly
|
||||
"g\"" #'sp-wrap-double-quote
|
||||
"g'" #'sp-wrap-single-quote))
|
||||
"g'" #'sp-wrap-single-quote
|
||||
"g<" #'sp-wrap-angle-bracket))
|
||||
|
||||
(use-package evil-smartparens
|
||||
:after (evil smartparens)
|
||||
|
@ -10,7 +10,6 @@
|
||||
:custom
|
||||
(prodigy-completion-system 'default)
|
||||
:config
|
||||
(evil-collection-prodigy-setup)
|
||||
(general-def 'normal prodigy-mode-map "`" #'prodigy-display-process-file-or-buffer))
|
||||
(evil-collection-prodigy-setup))
|
||||
|
||||
(provide 'init-prodigy)
|
||||
|
@ -241,6 +241,9 @@
|
||||
(list :command-name "install"
|
||||
:command-line "mvn install"
|
||||
:working-dir local-pom-dir)
|
||||
(list :command-name "install (skip tests)"
|
||||
:command-line "mvn install -DskipTests"
|
||||
:working-dir local-pom-dir)
|
||||
(list :command-name "deploy"
|
||||
:command-line "mvn deploy"
|
||||
:working-dir local-pom-dir)
|
||||
@ -313,6 +316,50 @@
|
||||
:command-line "cargo build --release"
|
||||
:working-dir project-dir)))))
|
||||
|
||||
(defun run-command-recipe-rake ()
|
||||
(when-let* ((rake-dir (or (locate-dominating-file default-directory "Rakefile")
|
||||
(locate-dominating-file default-directory "Rakefile.rb")))
|
||||
(cmds (->> (shell-command-to-string "rake -T")
|
||||
(s-split "\n")
|
||||
(-map (lambda (s) (s-split-up-to " " s 2)))
|
||||
(-map (lambda (l) (s-join " " (-take 2 l))))
|
||||
(-filter (-not 'string-empty-p)))))
|
||||
(-map (lambda (cmd)
|
||||
(list :command-name (cadr (s-split " " cmd))
|
||||
:command-line cmd
|
||||
:working-dir rake-dir))
|
||||
cmds)))
|
||||
|
||||
(defvar run-command-recipe-scripts--script-dirs '("." "bin" "scripts"))
|
||||
|
||||
(defun get-script-run-command (file)
|
||||
(with-temp-buffer
|
||||
(insert-file-contents-literally file)
|
||||
(when-let* ((line (s-trim (thing-at-point 'line t))))
|
||||
(cadr (s-match (rx "#!" (group (1+ anychar))) line)))))
|
||||
|
||||
(defun run-command-recipe-scripts ()
|
||||
(let* ((root-dir (expand-file-name (or (projectile-project-root) default-directory)))
|
||||
(shell (or (getenv "SHELL") "/usr/bin/env bash"))
|
||||
(scripts (-mapcat
|
||||
(lambda (dir)
|
||||
(let ((dir (f-join root-dir dir)))
|
||||
(when (f-dir? dir)
|
||||
(f-files
|
||||
dir
|
||||
(lambda (file)
|
||||
(or (file-executable-p file)
|
||||
(get-script-run-command file)))))))
|
||||
run-command-recipe-scripts--script-dirs)))
|
||||
(-map
|
||||
(lambda (file)
|
||||
(list :command-name (f-relative file root-dir)
|
||||
:command-line (if (file-executable-p file)
|
||||
file
|
||||
(format "%s %s" (get-script-run-command file) file))
|
||||
:working-dir root-dir))
|
||||
scripts)))
|
||||
|
||||
:general
|
||||
(leader-map "\"" #'run-command)
|
||||
:custom
|
||||
@ -332,6 +379,8 @@
|
||||
run-command-recipe-web-ext
|
||||
run-command-recipe-pip
|
||||
run-command-recipe-maven
|
||||
run-command-recipe-cargo)))
|
||||
run-command-recipe-cargo
|
||||
run-command-recipe-rake
|
||||
run-command-recipe-scripts)))
|
||||
|
||||
(provide 'init-run-command)
|
||||
|
@ -5,5 +5,4 @@ fi
|
||||
export PATH="$PATH:/Users/jdormit/.local/bin"
|
||||
eval "$(pyenv init --path)"
|
||||
[[ -d "/opt/homebrew/opt/openjdk@17" ]] && export JAVA_HOME="/opt/homebrew/opt/openjdk@17"
|
||||
export SYSTEM_VERSION_COMPAT=1
|
||||
ulimit -n 524288
|
||||
|
Loading…
Reference in New Issue
Block a user