zoukankan      html  css  js  c++  java
  • Emacs 文件中的查找操作

    1,在本文件中查找

    list-matching-lines 命令会列出本文件中所有出现text的地方。下面是它的一个输出示例:

    7 matches for "ngx_http_wait_request_handler" in buffer: ngx_http_request.c                                             
         13:static void ngx_http_wait_request_handler(ngx_event_t *ev);
        312:    rev->handler = ngx_http_wait_request_handler;
        374:ngx_http_wait_request_handler(ngx_event_t *rev)
        740:        rev->handler = ngx_http_wait_request_handler;
        741:        ngx_http_wait_request_handler(rev);
        796:        c->read->handler = ngx_http_wait_request_handler;
        801:        ngx_http_wait_request_handler(c->read);
    

      将光标定位到某一行再按回车键会跳转到该行。

    2,在一组文件或者一个目录中查找

    M-x grep 命令会在一组文件或者一个目录中查找所有text出现的地方。

    默认情况下,grep会在当前文件所属的目录下查找,

    grep -nH -e "ngx_http_ssl" *.c 会在当前目录的所有.c文件中查找ngx_http_ssl出现的地方,输出跟上面的输出类似,将光标定位到某一行再按回车会跳转到该行。

    M-x rgrep 的交互性会更好。它会先让你输入要查找的字符串,然后让你输入文件,最后让你选择查找的目录。上面的输入都可以用正则表达式来写。

    3,在一个目录中查找文件

    M-x find-name-dired 

  • 相关阅读:
    严格模式
    排序,求最大值最小值
    原型继承
    android 系统
    BASE64Decoder
    jstl
    list  遍历
    2015GitWebRTC编译实录9
    2015GitWebRTC编译实录8
    2015GitWebRTC编译实录7
  • 原文地址:https://www.cnblogs.com/cobbliu/p/3745474.html
Copyright © 2011-2022 走看看