Skip to content

Commit

Permalink
增加了搜索功能,ag.exe最快文件内容搜索工具
Browse files Browse the repository at this point in the history
  • Loading branch information
jueqingsizhe66 committed Feb 5, 2018
1 parent 3b2d1ad commit d4b792a
Show file tree
Hide file tree
Showing 12 changed files with 830 additions and 6 deletions.
33 changes: 33 additions & 0 deletions GTD/orgBoss/Journal/20180205
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,36 @@
** 11:10 org-mode-help :emacslisp:

LINK:info:org:Top

** 16:55 ag pk ack :Linux:


#+BEGIN_SRC sh
ack test_blah ~/code/ 104.66s user 4.82s system 99% cpu 1:50.03 total

ag test_blah ~/code/ 4.67s user 4.58s system 286% cpu 3.227 total
#+END_SRC

https://github.com/ggreer/the_silver_searcher

** 16:59 vimproc make search files easily :Linux:


#+BEGIN_SRC sh
https://github.com/Shougo/vimproc.vim
#+END_SRC


** 19:38 git config credential省去输入密码 :git:

但是比较危险

#+BEGIN_SRC sh
git config --global credential.helper store
会在~目录下新建一个.git-credential文件,包含用户名和密码,明文显示(特别不安全)
#+END_SRC


** 21:19 counsel-ag navigation.el :emacslisp:

ag (还有 counsel-ag)会忽略在 gitignore 中设置的文件。
2 changes: 2 additions & 0 deletions GTD/orgBoss/Site/www.site.org
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,5 @@ Public Health
人民卫生出版社
** https://mooc.study.163.com/course/2001280005
吴恩达 机器学习
** https://github.com/ggreer/the_silver_searcher
the_silver_searcher
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2857,6 +2857,25 @@ so you should copy `.gitConfig` inside it. Idea came from [ fatal unable to aut
```

[升级版操作:vim as IDE][188]


### 91. 项目中搜索内容和文件

`C-c p f` 项目中搜索文件(嘿嘿,也可以用`C-c k` 调用counsel-ag也是一样的,默认至少输入3个字符)

`C-c p p ` 切换项目

`C-c p s s` 项目中搜索文件内容,已经把ag.exe拷贝到~/.emacs.d中,并安装了`M-x package-install ag`文件。

得经常看看[Counsel-projectile文档][191]

删除editing.el的`C-s`配置,改用[swiper][27]的配置

`C-s` 使用swiper正向搜索

`C-c C-r` 使用swiper反向搜索


<hr/>
<hr/>

Expand Down Expand Up @@ -3049,3 +3068,6 @@ so you should copy `.gitConfig` inside it. Idea came from [ fatal unable to aut
[186]:https://orgmode.org/manual/Storing-searches.html#Storing-searches
[187]:http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/
[188]:http://yannesposito.com/Scratch/en/blog/Vim-as-IDE/
[189]:https://github.com/ggreer/the_silver_searcher
[190]:https://github.com/ericdanan/counsel-projectile#the-counsel-projectile-ag-command
[191]:https://github.com/ericdanan/counsel-projectile
Binary file added ag.exe
Binary file not shown.
6 changes: 3 additions & 3 deletions bookmarks
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
(position . 499))
("org-capture-last-stored"
(filename . "~/.emacs.d/GTD/orgBoss/Site/www.site.org")
(front-context-string . "** https://mooc.")
(rear-context-string . "识整理\n 人民卫生出版社\n")
(position . 9056))
(front-context-string . "** https://githu")
(rear-context-string . "80005\n 吴恩达 机器学习\n")
(position . 9114))
("core.clj"
(filename . "e:/clojure-home/first-example/src/first_example/core.clj")
(front-context-string)
Expand Down
2 changes: 1 addition & 1 deletion customizations/editing.el
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
;;(cua-mode 1)
;; Interactive search key bindings. By default, C-s runs
;; isearch-forward, so this swaps the bindings.
(global-set-key (kbd "C-s") 'isearch-forward-regexp)
;(global-set-key (kbd "C-s") 'isearch-forward-regexp)
(global-set-key (kbd "C-r") 'isearch-backward-regexp)
(global-set-key (kbd "C-M-s") 'isearch-forward)
(global-set-key (kbd "C-M-r") 'isearch-backward)
Expand Down
2 changes: 1 addition & 1 deletion customizations/navigation.el
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

;;Ivy-based interface to standard commands

;;(global-unset-key (kbd "C-s"))
(global-unset-key (kbd "\C-s"))
(global-set-key (kbd "\C-s") 'swiper)
(global-set-key (kbd "M-x") 'counsel-M-x)
(global-set-key (kbd "C-x C-f") 'counsel-find-file)
Expand Down
122 changes: 122 additions & 0 deletions elpa/ag-0.47/ag-autoloads.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
;;; ag-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))

;;;### (autoloads nil "ag" "ag.el" (23160 23559 0 0))
;;; Generated autoloads from ag.el

(autoload 'ag "ag" "\
Search using ag in a given DIRECTORY for a given search STRING,
with STRING defaulting to the symbol under point.
If called with a prefix, prompts for flags to pass to ag.
\(fn STRING DIRECTORY)" t nil)

(autoload 'ag-files "ag" "\
Search using ag in a given DIRECTORY for a given search STRING,
limited to files that match FILE-TYPE. STRING defaults to
the symbol under point.
If called with a prefix, prompts for flags to pass to ag.
\(fn STRING FILE-TYPE DIRECTORY)" t nil)

(autoload 'ag-regexp "ag" "\
Search using ag in a given directory for a given regexp.
The regexp should be in PCRE syntax, not Emacs regexp syntax.
If called with a prefix, prompts for flags to pass to ag.
\(fn STRING DIRECTORY)" t nil)

(autoload 'ag-project "ag" "\
Guess the root of the current project and search it with ag
for the given string.
If called with a prefix, prompts for flags to pass to ag.
\(fn STRING)" t nil)

(autoload 'ag-project-files "ag" "\
Search using ag for a given search STRING,
limited to files that match FILE-TYPE. STRING defaults to the
symbol under point.
If called with a prefix, prompts for flags to pass to ag.
\(fn STRING FILE-TYPE)" t nil)

(autoload 'ag-project-regexp "ag" "\
Guess the root of the current project and search it with ag
for the given regexp. The regexp should be in PCRE syntax, not
Emacs regexp syntax.
If called with a prefix, prompts for flags to pass to ag.
\(fn REGEXP)" t nil)

(defalias 'ag-project-at-point 'ag-project)

(defalias 'ag-regexp-project-at-point 'ag-project-regexp)

(autoload 'ag-dired "ag" "\
Recursively find files in DIR matching PATTERN.
The PATTERN is matched against the full path to the file, not
only against the file name.
The results are presented as a `dired-mode' buffer with
`default-directory' being DIR.
See also `ag-dired-regexp'.
\(fn DIR PATTERN)" t nil)

(autoload 'ag-dired-regexp "ag" "\
Recursively find files in DIR matching REGEXP.
REGEXP should be in PCRE syntax, not Emacs regexp syntax.
The REGEXP is matched against the full path to the file, not
only against the file name.
Results are presented as a `dired-mode' buffer with
`default-directory' being DIR.
See also `find-dired'.
\(fn DIR REGEXP)" t nil)

(autoload 'ag-project-dired "ag" "\
Recursively find files in current project matching PATTERN.
See also `ag-dired'.
\(fn PATTERN)" t nil)

(autoload 'ag-project-dired-regexp "ag" "\
Recursively find files in current project matching REGEXP.
See also `ag-dired-regexp'.
\(fn REGEXP)" t nil)

(autoload 'ag-kill-buffers "ag" "\
Kill all `ag-mode' buffers.
\(fn)" t nil)

(autoload 'ag-kill-other-buffers "ag" "\
Kill all `ag-mode' buffers other than the current buffer.
\(fn)" t nil)

;;;***

;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; ag-autoloads.el ends here
2 changes: 2 additions & 0 deletions elpa/ag-0.47/ag-pkg.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
;;; -*- no-byte-compile: t -*-
(define-package "ag" "0.47" "A front-end for ag ('the silver searcher'), the C ack replacement." '((dash "2.8.0") (s "1.9.0") (cl-lib "0.5")) :commit "f2cfea210b165564e8d44f4c980b2fedac2462c1")
Loading

0 comments on commit d4b792a

Please sign in to comment.