Friday, March 3, 2017

コマンド一発でソースコード検索&表示できる「peco」改が凄い!

lestrratさんがやってくれました。

ずいぶん前から、ソースコードを検索して読みやすいコマンドはないかなーと思っていました。個人的にはackで検索して見つかったファイルをlessで開いて再びキーワードを入れて当該行までジャンプしていたのですが、毎回毎回めんどくさい感じでした。コマンド一発でインクリメンタル検索してキーワード周辺のソースコードを読めるツールが欲しいなぁって思ってたんです。

とあるslackでお昼時に、mattnさんと「ほしいですよねー」という話から始まって、vimにあるgrepとかも物色しながら「いいのないねー」とか言ってたらkanさんが「@lestrrat 案件だ」って言い出して牧さんが召喚されてついさっきpecoに必要な機能が追加されてました。速いw

ためしにpicotlsの開発ディレクトリでpecoの一行ラッパーperoを起動し、「EVP_Digest」を検索してみました。こんな感じ。


こんなに直感的にソースコードが読める。
コマンドラインになれた人ならイメージ湧くかと思います。インデックスを作るみたいな下準備も何も必要ありません。
ただコマンドを実行するだけで対話的に検索して表示できる。
すばらしい!
こういうのが欲しかったんです。
ただまだ、pecoの本機能はまだtopic/commandブランチからマージされていませんし、バグがあるかもしれません。また高機能にするつもりもないでしょうから使用目的を選ぶのが先決かと思います。

ちなみに、こんな感じの一行ラッパーを書いて使ってます。pero --cc とやれば C のコードが、pero --java とやれば Java のコードだけが検索対象になります。

#! /bin/sh

exec ack "$@" . | peco --exec 'awk -F : '"'"'{print "+" $2 " " $1}'"'"' | xargs less '

ありがたや。ありがたや。

あわせて読みたい:「Big Sky :: ヘッダファイルだけでC++から使えるJSONパーサ「picojson」が凄い!

102 comments:

  1. I am waiting for your coming pictures. I wish you all good luck for your coming blogs and posts. Keep sharing!
    starfall | barney | abcya

    ReplyDelete


  2. The share your really gives us excitement. Thanks for your sharing. If you feel tired at work or study try to participate in our games to bring the most exciting feeling. Thank you!
    hotmail login | red ball | 192.168.1.1

    ReplyDelete
  3. Thanks for your share, hope that you will post more blog soon.
    driving directions

    ReplyDelete
  4. By default, hotmail keeps you logged in until you use the Sign Out button to end the session or 24 hours have passed since you logged on. This can mean that somebody else who passes by your computer while you're away has access to your emails, and can write some from your hotmail account.

    ReplyDelete
  5. Really a great addition. I have read this marvelous post. Thanks for sharing information about it. I really like that. Thanks so lot for your convene.

    - five nights at freddy's

    ReplyDelete
  6. I enjoyed over read your blog post. Your blog have nice information, I got good ideas from this amazing blog. I am always searching like this type blog post. I hope I will see again.

    * super mario world
    * madalin stunt cars 2
    * slope

    ReplyDelete
  7. • Your post has many fine detail information. I read your article and I actually| like it. I want to thank posting this great post.
    * Street view
    * hotmail sign
    * Boy names starting with V

    ReplyDelete
  8. Thank you so much for your suggestion and discuss these important points for blog commenting.
    The points you are listed above, really appreciable and will really help in blog commenting or commenting on other posts or topic.
    http://lootindiadeals.com
    http://Whatsappstatus33.com
    https://healthylifeandshape.com
    https://latestwhatsappstatus.blogspot.com

    ReplyDelete
  9. The blog or and best that is extremely useful to keep I can share the ideas of the future as this is really what I was looking for, I am very comfortable and pleased to come here. Thank you very much.
    animal jam | five nights at freddy's | hotmail login

    ReplyDelete
  10. Truly an amazing post.I really like it.Thanks for sharing with us.
    - trump twitter

    ReplyDelete
  11. The blog or and best that is extremely useful to keep I can share the ideas of the future as this is really what I was looking for, I am very comfortable and pleased to come here. Thank you very much.

    -- happy wheels --

    ReplyDelete
  12. I will make sure to bookmark your blog and may come
    back later in life. I want to encourage continue your great posts,
    have a nice evening!
    Sony Liv Live
    Totalsportek Live Stream
    Supercopa Barcelona vs Real Madrid Live Stream

    ReplyDelete
  13. Awesome Post! Check out Happy Diwali 2017 Facebook Status
    Also download latest movie PIRATES OF THE CARIBBEAN: DEAD MEN TELL NO TALES 2017
    Also Read trending Story Modern Society
    Also Check out Latest vacancy of Government Job BPSC Recruitment 2017

    ReplyDelete

  14. This is great, That's a great website, it really is what I was looking for, thank you for sharing!
    ymail login | ymail sign in |hotmail sign up |hotmail login

    ReplyDelete
  15. شركة نقل عفش
    اهم شركات مكافحة حشرات بالخبر كذلك معرض اهم شركة مكافحة حشرات بالدمام والخبر والجبيل والخبر والاحساء والقطيف كذلك شركة رش حشرات بالدمام ومكافحة الحشرات بالخبر
    شركة مكافحة حشرات بالدمام
    شركة تنظيف خزانات بجدة الجوهرة من افضل شركات تنظيف الخزانات بجدة حيث ان تنظيف خزانات بجدة يحتاج الى مهارة فى كيفية غسيل وتنظيف الخزانات الكبيرة والصغيرة بجدة على ايدى متخصصين فى تنظيف الخزانات بجدة
    شركة تنظيف خزانات بجدة
    شركة كشف تسربات المياه بالدمام
    شركة نقل عفش واثاث

    ReplyDelete
  16. http://emcmee.jimdo.com/%D8%B4%D8%B1%D9%83%D8%A9-%D9%86%D9%82%D9%84-%D8%A7%D8%AB%D8%A7%D8%AB-%D8%A8%D8%A7%D9%84%D8%B1%D9%8A%D8%A7%D8%B6/ شركة نقل عفش بالرياض
    http://emcmee.jimdo.com/%D8%B4%D8%B1%D9%83%D8%A9-%D9%86%D9%82%D9%84-%D8%B9%D9%81%D8%B4-%D8%A8%D8%A7%D9%84%D8%B7%D8%A7%D8%A6%D9%81/ شركة نقل عفش بالطائف
    http://emcmee.jimdo.com/%D8%B4%D8%B1%D9%83%D8%A9-%D9%86%D9%82%D9%84-%D8%B9%D9%81%D8%B4-%D8%A8%D8%A7%D9%84%D8%AF%D9%85%D8%A7%D9%85/ شركة نقل عفش بالدمام
    http://emcmee.jimdo.com/%D8%B4%D8%B1%D9%83%D8%A9-%D9%86%D9%82%D9%84-%D8%A7%D8%AB%D8%A7%D8%AB-%D8%A8%D8%AC%D8%AF%D8%A9/ شركة نقل عفش بجدة
    http://emcmee.jimdo.com/%D8%B4%D8%B1%D9%83%D8%A9-%D9%86%D9%82%D9%84-%D8%B9%D9%81%D8%B4-%D8%A8%D8%A7%D9%84%D9%85%D8%AF%D9%8A%D9%86%D8%A9-%D8%A7%D9%84%D9%85%D9%86%D9%88%D8%B1%D8%A9/ شركة نقل عفش بالمدينة المنورة

    ReplyDelete
  17. Truly unprecedented post. I simply found your blog and foreseen that would express that I have really had a great time exploring your blog portions. Health Defect Anyway, I'll be subscribing to your maintain and I believe you post again soon

    ReplyDelete
  18. www.gmail.comIn order to access Gmail, you need to create a google account first. you heard it. So how do you think you can create a new Gmail account. Just follow the steps.
    gmail.com

    ReplyDelete
  19. Wish your blog site will grow, I look forward to your new article. metal gear survive

    ReplyDelete
  20. دار السلام اهم شركة نقل عفش بالطائف وكذلك اهم شركة نقل عفش بمكة وجدة والمدينة المنورة تقوم الشركة بنقل العفش بحفر الباطن وتبوك وجازان وتقوم بنقل الاثاث بالقصيم
    شركة نقل عفش بالطائف
    شركة نقل عفش بالمدينة المنورة
    شركة نقل عفش بجازان وابها

    ReplyDelete
  21. شركة نقل عفش
    اهم شركات مكافحة حشرات بالخبر كذلك معرض اهم شركة مكافحة حشرات بالدمام والخبر والجبيل والخبر والاحساء والقطيف كذلك شركة رش حشرات بالدمام ومكافحة الحشرات بالخبر
    شركة مكافحة حشرات بالدمام
    شركة تنظيف خزانات بجدة الجوهرة من افضل شركات تنظيف الخزانات بجدة حيث ان تنظيف خزانات بجدة يحتاج الى مهارة فى كيفية غسيل وتنظيف الخزانات الكبيرة والصغيرة بجدة على ايدى متخصصين فى تنظيف الخزانات بجدة
    شركة تنظيف خزانات بجدة
    شركة كشف تسربات المياه بالدمام
    شركة نقل عفش واثاث

    ReplyDelete
  22. http://google.co.bw/url?q=https://plus.google.com/u/0/106159980960849142209

    ReplyDelete
  23. Similar to Bing Microsoft is not happy with just copying a few features from its rivals, but also find other persuasive ways to help users interact effectively with email. Here are some useful features of Hotmail. You can sign in hotmail.com account and use it immediately.

    ReplyDelete
  24. Thank you for sharing this data. Really increase in value the way you have describe everything in this article. Keep up the decent work.
    gmail login | hotmail login | hotmail email login

    ReplyDelete
  25. If you want to install the new product through the old Windows Key, you just copy the Product Key Windows and copy to windows 8.1 product key version 1511 and install the new, during the installation will automatically scan the product. Key and activate Windows for you.

    ReplyDelete
  26. In the midst of budgetary disadvantages, individuals have constantly swung to banks for help. They contract their home, auto or different properties. Some even go to charge card organizations to get cash. quick cash advance Chicago

    ReplyDelete
  27. Good article and knowledge for me! I found a lot of information here! This article is really good for all newbie here. Thank you for sharing with us!
    happy wheels

    ReplyDelete
  28. I like to read your article because it really helps me. Thank you for sharing this post with us.

    Togel Online

    Prediksi Hongkong

    ReplyDelete
  29. Thanks for the information. In case, if you are facing a financial emergency, then you can get the fast cash that you need just by requesting a payday loan online!

    CashOne
    Online payday loans
    Payday loans online
    One hour payday loans
    Emergency Payday Loans
    Holiday Loans

    ReplyDelete
  30. Such intelligent work on the subject and ideal way of writing here. I am really impressed! This post is a helpful overview of the particular topic and very actionable. Interesting approach! Want to recover from an unexpected financial emergency? Get Emergency Payday Loans Online Now.

    Online Payday Loans
    Cash Advance Loan
    Emergency payday Loans Payday Loans
    Bad Credit

    ReplyDelete
  31. Webroot.com/safe is a protection software solution that communicates with the cloud avoiding the hassle to manage the signature updates to deploy. for office setup visit office.com/setup

    ReplyDelete
  32. Students often feel issues in writing assignment, so to make students comfortable in programming assignment we help them to write their assignments. If ever you feel any problem in writing something you can visit our website Programming Assignment Help.

    ReplyDelete
  33. Thank you for this post. This is very interesting information for me. More information about the essay, see how other aspects can affect this kind of check it out
    https://www.learningcrux.com/

    ReplyDelete
  34. Thanks for sharing this nice and informative article. This is a good change. I am really impressed! All the information is dealt with clarity.
    Want to recover from an unexpected financial emergency? Get Emergency Payday Loans Online Now.



    Personal Loans
    Online Payday Loans
    Payday Loans No Credit Check
    Faxless Payday Loans
    Fast Payday Loan

    ReplyDelete
  35. Find a job now
    https://www.recruitmentnewsportal.com/npower-recruitment-form/

    ReplyDelete
  36. The reason for this Brahmin Matrimony Sites is to broaden the administrations of Jeevanrahi Matrimonial Services to go online and help the community on one stage to search the perfect life partner. It is exclusively the vision of our guides that drive our group to work.
    Brahmin Matrimony Sites
    Marwari Matrimony Sites
    Sindhi Matrimonial Sites
    Punjabi Matrimony Sites
    Sikh Matrimony Sites
    Kannada Matrimony Sites

    ReplyDelete
  37. I just want to mention I am beginner to weblog and absolutely enjoyed your web-site. More than likely I’m want to bookmark your blog . You really have very good posts. Appreciate it for revealing your website page.

    FaaastCash
    online Loans
    Cash Advance Loans
    Payday Loans
    Emergency payday Loans

    ReplyDelete
  38. Hey, Your blog is very informative. It is nice to read such high-quality content. Attractive information on your blog, thank you for taking the time and share with us. Myassignmenthelp delivers high-quality content related to student essay writing help.

    ReplyDelete
  39. Thanks for sharing this best stuff with us! Keep sharing! I am new in the blog writing. All types of blogs and posts are not helpful for the reader.

    It's an amazing paragraph in support of all the online people;
    they will take benefit from it I am sure.

    I really enjoyed your blog Thanks for sharing such an informative post.
    Get the best help in
    MyMathLab Answers
    ,
    MyStatLab Answers
    ,
    MyMathLab Answers Key
    ,
    online class help
    .
    If you are looking for
    take my online class
    the visit our website now.

    ReplyDelete
  40. I really enjoyed your blog Thanks for sharing such an informative post.



    I really enjoyed your blog Thanks for sharing such an informative post.
    Get the best help in
    birth certificate translation
    ,

    driver license translation
    ,

    marriage certificate translation
    ,

    translation services australia
    .
    If you are looking for
    translation services Adelaide



    translation services Brisbane



    translation services Melbourne



    translation services Perth



    translation services Sydney



    naati translator







    the visit our website now.

    ReplyDelete
  41. Hey, your article is really great. This is very informative to me. thanks a lot for sharing attractive information with us. Due to poor understanding of any subject matter, the students of the college are unable to write assignments. In such a case, they can get help from online assignment help specialists of ABAssignmentHelp.

    ReplyDelete
  42. Agen Judi Bola Terbaik dan situs judi online terpercaya ialah https://13win.org/ yang telah menjadi tempat bermain judi online online populer dan kepercayaan pecinta judi online di Indonesia yang selalu menghadirkan pelayanan terbaik dan juga keuntungan besar. Adapun profile 13win bisa anda lihat di https://www.voat.co/u/situsjudi13win/

    ReplyDelete
  43. Best and gifted scholars at Students Assignment Help are giving online assignment help administrations. We never miss any of the due dates. Our expert authors are accessible online dependably for understudies help.

    ReplyDelete
  44. Amazing post... Thank you for sharing with us.
    By the way, we are sharing Take my online class for me reviews & Buyonlineclassreview for college or university students that will help every students to sort out any kind of problems with the help of expert tutors.

    ReplyDelete
  45. This comment has been removed by the author.

    ReplyDelete
  46. Schedule of lottery production or closing hours of Singapore lottery market is at 17.31 WIB. The HK market closed at 23.00 WIB, while the Sydney pools Lottery closed at 13.50 Wib. So, keep a track of our website for Togel expense information. Because the related websites usually overload in the initial minutes, and the official website of the production of Singapore Lottery already entered the block of Indonesian government, we will provide the mirroring result as soon as we can.

    nggrandong

    ReplyDelete
  47. Assignment help online is the online administration where students can get full learning in any scholastic session. The subjects are performed by the prerequisite of students as it were.
    Homework Help Canada

    ReplyDelete
  48. Creo Parametric is the 3D CAD solution in the industry of product design. Engineering students are often asked to solve assignments on Creo to enhance their design optimisation skills. It is not easy to solve the Creo assignment problems. You may have other coursework or homework to do or you may have a problem understanding the app. No matter what your problem is, get Creo assignment help from us now.

    ReplyDelete
  49. Amazing post.. Thank you for sharing with us.
    By the way, we are sharing nursing assignment help, nursing homework help & nursing essay help the students so that they get to understand the nursing properly for the benefit of all the people. The services help them in completing all kinds of assignments and essays within the specified time to bag good grades in the subject.

    ReplyDelete
  50. Have you ever stuck in a situation where you have a blank sheet of paper in your hand and having lots of anxieties? It happens if you don't prepare for speech, lack of compelling ideas, and because of lack of best and approaching speech topics.
    Talking of picking informative speech topics, there are lots of tricks to select it so that you can grab the attention of your teaches or audiences. So, I am suggesting some amazing informative speech topics that will definitely blow your mind.

    1. Speech topics on communication
    2. Informative speech topics on education
    3. Speech topics on animals
    4. Presentation speech topics for business
    5. Trending topics on economy
    These are only the area on which you can create speeches but there are various topics that are covered by these areas along with other many areas.

    So, to draft a perfect informative speech topics you can get assistance or help from MyAssignmenthelp.com

    ReplyDelete
  51. Our Pay for informative speech essays, customer access our term paper writing services knowing that they are assured of the best quality essay lest they get their money back.

    ReplyDelete
  52. As you order for nursing papers made easy you must find out if your essay writing company offers extra facilities like making corrections and amendments if there are mistakes made by writers. You can also purchase custom research paper.

    ReplyDelete
  53. StudentsAssignmentHelp.com provides its dissertation writing services UK outstandingly to the students at the low cost. We serve online writing help services to students with the quality content which are free from plagiarism.

    ReplyDelete
  54. Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!

    Alpine payday loans

    ReplyDelete
  55. Thanks for the nice blog. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us,I too always learn something new from your post. https://www.crackslive.com/

    ReplyDelete

Note: Only a member of this blog may post a comment.