Compare commits

...

4 Commits

Author SHA1 Message Date
245a3b0d3b Set split-width-threshold to something reasonable 2024-11-14 13:57:02 -05:00
f9a67dde68 Handle carriage return in inf-ruby output
Added a custom function `inf-ruby-process-carriage-return` to clean up unwanted carriage returns from inf-ruby output. This function is now hooked into `comint-preoutput-filter-functions` to process output in `inf-ruby-mode`. This change ensures better handling of newline characters in the output stream.
2024-11-14 13:56:52 -05:00
1327019fdb Add rspec-dired-verify-marked for dired mode testing
Implemented `rspec-dired-verify-marked` function to run RSpec on files marked in dired mode. Bound the new function to the key "C-c , m" in `rspec-dired-mode-map`. This allows for batch testing of selected files within the dired interface, streamlining the testing process for multiple files.
2024-10-29 10:45:08 -04:00
951024ed40 Use rg for grep, find-grep and find-grep-dired 2024-10-29 10:44:55 -04:00
3 changed files with 23 additions and 1 deletions

View File

@ -70,4 +70,12 @@
:general
([remap dabbrev-expand] #'hippie-expand))
(use-package grep
:straight (:type built-in)
:if (executable-find "rg")
:config
(setq grep-program "rg")
:custom
(grep-command "rg --color=always --with-filename --line-number --null -e "))
(provide 'init-built-ins)

View File

@ -18,7 +18,16 @@
:commands (inf-ruby inf-ruby-console-auto)
:general
([remap inf-ruby] #'inf-ruby-console-auto)
:hook (after-init . inf-ruby-switch-setup))
:hook (after-init . inf-ruby-switch-setup)
:config
(defun inf-ruby-process-carriage-return (output)
(let ((processed (replace-regexp-in-string ".*\r" "" output)))
(if (string-match-p "\\`\n" processed)
(replace-regexp-in-string "\\`\n" "" processed)
processed)))
(defun inf-ruby-carriage-return-hook ()
(add-hook 'comint-preoutput-filter-functions #'inf-ruby-process-carriage-return nil t))
(add-hook 'inf-ruby-mode-hook #'inf-ruby-carriage-return-hook))
(use-package rbenv
:hook (after-init . global-rbenv-mode)
@ -60,9 +69,13 @@
"Runs RSpec on all related specs for the Ruby files changed between the current branch and TARGET-BRANCH."
(interactive)
(rspec--run-verify-changed t))
(defun rspec-dired-verify-marked ()
(interactive)
(rspec-run-multiple-files (dired-get-marked-files) (rspec-core-options)))
:general
(rspec-mode-map "C-c , g" #'rspec-verify-changed
"C-c , G" #'rspec-verify-changed-related)
(rspec-dired-mode-map "C-c , m" #'rspec-dired-verify-marked)
(rspec-verifiable-mode-map "C-c , g" #'rspec-verify-changed
"C-c , G" #'rspec-verify-changed-related)
:custom

View File

@ -42,6 +42,7 @@
;; Buffer and window layout management
(setopt switch-to-buffer-in-dedicated-window 'pop
split-height-threshold 116
split-width-threshold 216
window-sides-slots '(1 0 0 1)
display-buffer-alist '(("\\*Help\\*"
(display-buffer-reuse-window