• 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 

  • 相关阅读:
    BeautifulSoup_第一节
    第一个python爬虫——保存淘宝mm图片
    面试题:css(一)
    面试:HTML(二)
    websocket
    面试题:HTML篇(一)
    HTML5遗忘知识点(一)
    webpack热更新原理
    webpack按需加载
    什么是process.env?
  • 原文地址:https://www.cnblogs.com/cobbliu/p/3745474.html
Copyright © 2020-2023  润新知