Added: win32 install function & project arguments
This commit is contained in:
parent
d7a1224578
commit
1a5c11dec0
|
|
@ -1,4 +1,3 @@
|
||||||
;; rhjr/paths
|
|
||||||
(defconst rhjr/base-config-dir
|
(defconst rhjr/base-config-dir
|
||||||
(if (eq system-type 'windows-nt)
|
(if (eq system-type 'windows-nt)
|
||||||
"C:\\Users\\Rhjr\\AppData\\Roaming\\.emacs.d\\"
|
"C:\\Users\\Rhjr\\AppData\\Roaming\\.emacs.d\\"
|
||||||
|
|
@ -137,6 +136,10 @@
|
||||||
("C-f" . consult-find)
|
("C-f" . consult-find)
|
||||||
("C-s" . consult-ripgrep))
|
("C-s" . consult-ripgrep))
|
||||||
|
|
||||||
|
:config
|
||||||
|
(setq consult-find-args
|
||||||
|
"find . -not -path \"*/.git/*\"")
|
||||||
|
|
||||||
:init
|
:init
|
||||||
;; use consult to select xref locations with preview.
|
;; use consult to select xref locations with preview.
|
||||||
(setq xref-show-xrefs-function #'consult-xref
|
(setq xref-show-xrefs-function #'consult-xref
|
||||||
|
|
@ -260,6 +263,15 @@
|
||||||
;;rhjr/comp
|
;;rhjr/comp
|
||||||
(setq compilation-directory-locked nil)
|
(setq compilation-directory-locked nil)
|
||||||
|
|
||||||
|
(defvar project-command-arg nil
|
||||||
|
"Stored argument used by project commands.")
|
||||||
|
|
||||||
|
(defun set-project-command-arg (arg)
|
||||||
|
"Set and remember ARG for project commands."
|
||||||
|
(interactive "sSet project argument: ")
|
||||||
|
(setq project-command-arg arg)
|
||||||
|
(message "Project argument set to: %s" project-command-arg))
|
||||||
|
|
||||||
(defun find-project-directory-recursive (command)
|
(defun find-project-directory-recursive (command)
|
||||||
"Recursively search upward until COMMAND exists."
|
"Recursively search upward until COMMAND exists."
|
||||||
(if (file-exists-p command)
|
(if (file-exists-p command)
|
||||||
|
|
@ -289,32 +301,41 @@
|
||||||
(setq last-compilation-directory default-directory))))
|
(setq last-compilation-directory default-directory))))
|
||||||
|
|
||||||
(defun run-project-command (command)
|
(defun run-project-command (command)
|
||||||
"Run COMMAND from the project root without prompting."
|
"Run COMMAND from the project root using stored argument."
|
||||||
(interactive)
|
(interactive)
|
||||||
(find-project-directory command)
|
(find-project-directory command)
|
||||||
(compile command)
|
(compile
|
||||||
|
(if project-command-arg
|
||||||
|
(concat command " " project-command-arg)
|
||||||
|
command))
|
||||||
(other-window 1))
|
(other-window 1))
|
||||||
|
|
||||||
(global-set-key [f1] (lambda () (interactive)
|
(global-set-key [f1] (lambda () (interactive)
|
||||||
(run-project-command "./build.sh")))
|
(run-project-command "build.bat")))
|
||||||
|
|
||||||
(global-set-key [f2] (lambda () (interactive)
|
(global-set-key [f2] (lambda () (interactive)
|
||||||
(run-project-command "./start.sh")))
|
(run-project-command "start.bat")))
|
||||||
|
|
||||||
|
(global-set-key [f3] #'set-project-command-arg)
|
||||||
|
|
||||||
;;rhjr/fix
|
;;rhjr/fix
|
||||||
(setq minibuffer-prompt-properties ;; cursor in minibuffer-prompt
|
(setq minibuffer-prompt-properties ;; cursor in minibuffer-prompt
|
||||||
'(read-only t cursor-intangible t face minibuffer-prompt))
|
'(read-only t cursor-intangible t face minibuffer-prompt))
|
||||||
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
||||||
|
|
||||||
|
;;;rhjr/styling
|
||||||
|
(set-face-attribute 'default nil
|
||||||
|
:family "Consolas"
|
||||||
|
:height 150
|
||||||
|
:weight 'normal)
|
||||||
|
|
||||||
(custom-set-variables
|
(custom-set-variables
|
||||||
;; custom-set-variables was added by Custom.
|
;; custom-set-variables was added by Custom.
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
;; Your init file should contain only one such instance.
|
;; Your init file should contain only one such instance.
|
||||||
;; If there is more than one, they won't work right.
|
;; If there is more than one, they won't work right.
|
||||||
'(package-selected-packages
|
'(package-selected-packages
|
||||||
'(cape consult corfu corfu-candidate-overlay gruber-darker-theme
|
'(cape consult corfu corfu-candidate-overlay gruber-darker-theme highlight-parentheses magit orderless vertico)))
|
||||||
highlight-parentheses magit orderless vertico)))
|
|
||||||
(custom-set-faces
|
(custom-set-faces
|
||||||
;; custom-set-faces was added by Custom.
|
;; custom-set-faces was added by Custom.
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
@echo off
|
||||||
|
set SOURCE=%USERPROFILE%\AppData\Roaming\dotfiles\.config\emacs
|
||||||
|
set DEST=%USERPROFILE%\Appdata\Roaming\.emacs.d
|
||||||
|
|
||||||
|
if not exist "%SOURCE%" (
|
||||||
|
echo Source directory does not exist: %SOURCE%
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
if not exist "%DEST%" (
|
||||||
|
mkdir "%DEST%"
|
||||||
|
)
|
||||||
|
|
||||||
|
xcopy "%SOURCE%\*" "%DEST%\" /E /I /Y /H
|
||||||
|
|
||||||
|
echo Copy completed.
|
||||||
Loading…
Reference in New Issue
Block a user