Counsel-rg omit long maching line

225 Views Asked by At

I utilize the counsel-rg to search the pattern of "~[a-z]+~", it displays the desired results but omit long matching line:

enter image description here

How could enable it to get long-matching-line displayed?

1

There are 1 best solutions below

0
On

Here is an example usage:

;; counsel-rg (&optional initial-input initial-directory extra-rg-args rg-prompt)
(defun ugt-counsel-rg ()
  "Add initial search text into minibuffer."
  (interactive)
  (let ((initial-input "^\\*+ ")    ;; Search only org headers
        (initial-directory "~/org")
        (extra-rg-args "--max-columns 300") ;; <== THIS
        (rg-prompt "rg: Search org file headers (narrow with =S-SPC= or =!keyword=: "))
    (counsel-rg initial-input
                initial-directory
                extra-rg-args
                rg-prompt)))
(global-set-key (kbd "s-u") 'ugt-counsel-rg)