Skip to content

Commit

Permalink
Use find-dired
Browse files Browse the repository at this point in the history
  • Loading branch information
condy0919 committed Aug 13, 2024
1 parent 3fe17f3 commit 0c83c56
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions lisp/init-shell.el
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,13 @@
(defun eshell/f (filename &optional dir)
"Search for files matching FILENAME in either DIR or the
current directory."
(let ((cmd (concat
(executable-find "find")
" " (or dir ".")
" -not -path '*/.git*'"
" -and -not -path 'build'" ;; the cmake build directory
" -and"
" -type f"
" -and"
" -iname '*" (format "%s" filename) "*'")))
(eshell-command-result cmd)))
(find-dired (or dir ".")
(concat " -not -path '*/.git*'"
" -and -not -path 'build'" ;; the cmake build directory
" -and"
" -type f"
" -and"
" -iname " (format "'*%s*'" filename))))

(defun eshell/z ()
"cd to directory with completions."
Expand Down

0 comments on commit 0c83c56

Please sign in to comment.