国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 操作系統(tǒng) > 正文

Ag (the_silver_searcher) 安裝使用

2024-06-28 13:25:44
字體:
供稿:網(wǎng)友
Ag (the_silver_searcher) 安裝使用## if (I am a Programmer || I have a strong sense of time) I use ag___##1. 安裝命令行ag(代碼中行首的“//”是多余的)```bash/#!/usr/bin/env bash/#Author Leslie Guan/#make sure you have the root permission/#Usage . install_ag.shset -xTEMP_DIR=$(mktemp -d Leslie.Guan.XXXXXX)cd ${TEMP_DIR}wget https://github.com/ggreer/the_silver_searcher/archive/master.zipTAR_DIR=$(unzip *.zip)TAR_DIR=${TAR_DIR%%/*}TAR_DIR=${TAR_DIR##*:}cd ${TAR_DIR}apt-get install -y automake pkg-config libpcre3-dev zlib1g-dev liblzma-dev --force-yes./build.sh && make installcd ../../rm -rf ${TEMP_DIR}ag -Vset +x ```ubuntu13.10以后可以直接運行```bashapt-get install silversearcher-ag```[ag_GitHub](https://github.com/ggreer/the_silver_searcher)##2. 安裝Vim插件(*必須先安裝ag命令行工具*)(代碼中行首的“//”是多余的)```bash/#!/usr/bin/env bash/#Author Leslie Guan/#make sure you have the root permission/#Usage . install_Ag4Vim.shset -xTEMP_DIR=$(mktemp -d Leslie.Guan.XXXXXX)cd ${TEMP_DIR}wget https://github.com/rking/ag.vim/archive/master.zipTAR_DIR=$(unzip *.zip)TAR_DIR=${TAR_DIR%%/*}TAR_DIR=${TAR_DIR##*:}cd ${TAR_DIR}cp cp {plugin,autoload,doc} /usr/share/vim/vimcurrent/ -rf cd ../../rm -rf ${TEMP_DIR} set +x```[ag.vim_GitHub](https://github.com/rking/ag.vim)##3. 使用命令行使用```bashag HelloWorldag HelloWorld path/to/search``````bashAg HelloWorldAg HelloWorld path/to/search```在Ag查找出來的quickfix窗口中,你可以使用下列命令:```bashe to open file and close the quickfix windowo to open (same as enter)go to preview file (open but maintain focus on ag.vim results)t to open in new tabT to open in new tab silentlyh to open in horizontal splitH to open in horizontal split silentlyv to open in vertical splitgv to open in vertical split silentlyq to close the quickfix window```*詳細(xì)使用方法請查看幫助:*```bashman ag```##4. Why ag*速度對比ag>ack>grep*在android全部源碼中查找(測試環(huán)境20線程32GB內(nèi)存):```bashtime ag -i activityreal2m42.568suser0m16.049ssys1m29.358s``````bashtime ack -i activityreal5m17.780suser1m35.830ssys0m17.521s``````bashtime grep -Hrni activity .real49m27.518suser43m13.918ssys0m38.178s```[What's so great about Ag?](https://ruby-china.org/topics/8728)```bashIt searches code about 3–5× faster than ack.It ignores file patterns from your .gitignore and .hgignore.If there are files in your source repo you don't want to search, just add their patterns to a .agignore file. *cough* extern *cough*The command name is 33% shorter than ack!```
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 宜兰市| 大宁县| 诏安县| 丰都县| 铜山县| 资兴市| 洛隆县| 安庆市| 永平县| 原阳县| 博白县| 隆德县| 怀柔区| 玉环县| 大埔区| 万安县| 汶上县| 平度市| 西畴县| 佛山市| 建湖县| 门头沟区| 宜都市| 南汇区| 神木县| 塔河县| 同江市| 涞源县| 延安市| 若羌县| 德兴市| 延川县| 北流市| 泰安市| 固阳县| 白河县| 天水市| 淄博市| 新乡市| 桂林市| 禄丰县|