日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

vim ctrlp_使用Ctrlp和Ctag使Vim更智能

發布時間:2023/11/29 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 vim ctrlp_使用Ctrlp和Ctag使Vim更智能 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

vim ctrlp

by _haochuan

通過_haochuan

使用Ctrlp和Ctag使Vim更智能 (Make Your Vim Smarter Using Ctrlp and Ctags)

I absolutely love Vim, and I use Vim for all my coding and writing from year to year. Although more are more people, especially for those are working with JavaScript, prefer modern code editors such as Sublime Text or VSCode, I’d rather spend a little time trying to make my toy more intelligent.

我絕對喜歡Vim,并且我每年都使用Vim進行所有編碼和寫作。 盡管有更多的人,特別是對于那些使用JavaScript的人,更喜歡諸如Sublime Text或VSCode之類的現代代碼編輯器,但我還是愿意花一點時間來使我的玩具更智能。

CtrlP (CtrlP)

If you are a Sublime Text, Atom, or VSCode guy, you must use ctrl + p thousands of times to improve productivity. Well, don’t be jealous if you are a Vim guy because this fancy Vim plugin CtrlP will give you all you need.Check this official doc for installation and setup.

如果您是Sublime Text,Atom或VSCode方面的人,則必須使用ctrl + p數千次才能提高生產力。 好吧,如果您是Vim家伙,請不要嫉妒,因為這個花哨的Vim插件CtrlP會為您提供所需的一切。請查看此官方文檔進行安裝和設置。

標簽 (Ctags)

Ctags is a tool that will sift through your code, indexing methods, classes, variables, and other identifiers, storing the index in a tags file. The tags file contains a single tag per line. Depending on command line arguments and the language ctags is run against, a lot of information can be obtained from this index.

Ctags是一種工具,可用于篩選代碼,索引方法,類,變量和其他標識符,并將索引存儲在標簽文件中。 標簽文件每行包含一個標簽。 根據命令行參數和使用的語言ctags,可以從該索引中獲取很多信息。

Ctags currently supports 41 programming languages, and it’s relatively easy to add definitions for more.

Ctags當前支持41種編程語言 ,并且添加更多的定義相對容易。

Ctags makes it much easier to navigate a larger project, particularly if the code you’re working with is unfamiliar. If you’re unsure of what a method does or how it’s supposed to be called, you can jump straight to its definition. If you’re in the downward spiral of a 500+ line Perl script and want to know where a variable was defined three hours ago, you can jump right back to it. And afterward, you can jump right back to where you were working.

Ctags使導航更大的項目變得容易得多,尤其是在您不熟悉所使用的代碼的情況下。 如果不確定方法的作用或方法的調用方式,可以直接轉到其定義。 如果您處于Perl腳本超過500行的螺旋式下降狀態,并且想知道三個小時前在哪里定義了變量,則可以直接跳回到該變量。 然后,您可以跳回到工作地點。

You can install Ctags using Homebrew in OSX:

您可以在OSX中使用Homebrew安裝Ctags:

brew install ctags

Please note that OS X comes with a Ctags executable, but it’s not exuberant-Ctags and is missing most of the useful features. If you see an error like Invalid Parameter when you run ctags, it means that the system is not using the one you installed with Homebrew. To solve this:

請注意,OS X帶有Ctags可執行文件,但它不是旺盛的Ctags,并且缺少大多數有用的功能。 如果在運行ctags時看到諸如Invalid Parameter類的錯誤,則表明系統未使用您通過Homebrew安裝的系統。 要解決這個問題:

$ alias ctags="`brew --prefix`/bin/ctags"

When you’re sitting in the directory you want to index, just run:

當您坐在要索引的目錄中時,只需運行:

ctags -R.

Ctags will walk through the directory recursively, tagging all source files it encounters. For very large projects, this might take a while, but normally it’s pretty fast.

Ctags將遞歸遍歷該目錄,標記它遇到的所有源文件。 對于非常大的項目,這可能需要一段時間,但通常速度很快。

You may also need some extra config for Ctags, below is the ~/.ctags I'm using:

您可能還需要對Ctags進行一些額外的配置,以下是我正在使用的~/.ctags :

--langmap=javascript:.js.es6.es.jsx--javascript-kinds=-c-f-m-p-v--regex-javascript=/^[ \t]*(var|let|const)[ \t]+([A-Za-z0-9_$]+)[ \t]*=[ \t]*\[/\2/A,Array,Arrays/--regex-javascript=/^[ \t]*(var|let|const)[ \t]+([A-Z][A-Za-z0-9_$]+)[ \t]*=[ \t]*function/\2/C,Class,Classes/--regex-javascript=/^[ \t]*class[ \t]+([A-Za-z0-9_$]+)/\1/C,Class,Classes/--regex-javascript=/^[ \t]*export[ \t]?({[ \t]*)*([A-Za-z0-9_\*]*[ \t]as[ \t])([A-Za-z0-9_]+)/\3/E,Export,Exports/--regex-javascript=/^[ \t]*export[ \t]?({[ \t]*)*([A-Za-z0-9_\*]*[ \t]as[ \t])*([A-Za-z0-9_]+),[ \t]*([A-Za-z0-9_\*]*[ \t]as[ \t])([A-Za-z0-9_]+)/\5/E,export,Exports/--regex-javascript=/^[ \t]*export[ \t]?({[ \t]*)*([A-Za-z0-9_\*]*[ \t]as[ \t])*([A-Za-z0-9_]+),[ \t]*([A-Za-z0-9_\*]*[ \t]as[ \t])*([A-Za-z0-9_]+),[ \t]*([A-Za-z0-9_\*]*[ \t]as[ \t])([A-Za-z0-9_]+)/\7/E,Export,Exports/--regex-javascript=/^[ \t]*export[ \t]?(var|let|const)[ \t]+([A_Za-z0-9_$]+)/\2/E,Export,Exports/--regex-javascript=/^[ \t]*export[ \t]?(var|let|const)[ \t]+([A_Za-z0-9_$]+)[ \t]*[^,]+,[ \t]*([A_Za-z0-9_$]+)/\3/E,Export,Exports/--regex-javascript=/^[ \t]*export[ \t]?(var|let|const)[ \t]+([A_Za-z0-9_$]+)[ \t]*[^,]+,[ \t]*([A_Za-z0-9_$]+)[ \t]*[^,]+,[ \t]*([A_Za-z0-9_$]+)/\4/E,Export,Exports/--regex-javascript=/^[ \t]*function[ \t]*([A-Za-z0-9_$]+)[ \t\(]/\1/F,Function,Functions/--regex-javascript=/^[ \t]*[\(]function[ \t]*([A-Za-z0-9_$]+)[ \t\(]/\1/F,Function,Functions/--regex-javascript=/^[ \t]*(var|let|const)[ \t]+([a-z][A-Za-z0-9_$]+)[ \t]*=[ \t]*function[^\*][^\*]/\2/F,Function,Functions/--regex-javascript=/^[ \t]*(var|let|const)[ \t]+([a-z][A-Za-z0-9_$]+)[ \t]*=[ \t]*\([^\*]/\2/F,Function,Functions/--regex-javascript=/^[ \t]*function[ \t]*\*[ \t]*([A-Za-z0-9_$]+)/\1/G,Generator,Generators/--regex-javascript=/^[ \t]*(var|let|const)[ \t]+([a-z][A-Za-z0-9_$]+)[ \t]*=[ \t]*function([ \t]*\*)/\2/G,Generator,Genrators/--regex-javascript=/^[ \t]*(\*[ \t])([A-Za-z0-9_$]+)[ \t]*\(.*\)[ \t]*{/\2/G,Generator,Generators/--regex-javascript=/^[ \t]*import[ \t]?({[ \t]*)*([A-Za-z0-9_\*]*[ \t]as[ \t])([A-Za-z0-9_]+)/\3/I,Import,Imports/--regex-javascript=/^[ \t]*import[ \t]?({[ \t]*)*([A-Za-z0-9_\*]*[ \t]as[ \t])*([A-Za-z0-9_]+),[ \t]*([A-Za-z0-9_\*]*[ \t]as[ \t])([A-Za-z0-9_]+)/\5/I,Import,Imports/--regex-javascript=/^[ \t]*import[ \t]?({[ \t]*)*([A-Za-z0-9_\*]*[ \t]as[ \t])*([A-Za-z0-9_]+),[ \t]*([A-Za-z0-9_\*]*[ \t]as[ \t])*([A-Za-z0-9_]+),[ \t]*([A-Za-z0-9_\*]*[ \t]as[ \t])([A-Za-z0-9_]+)/\7/I,Import,Imports/--regex-javascript=/^[ \t]*this\.([A-Za-z0-9_$]+)[ \t]*=.*{$/\1/M,Method,Methods/--regex-javascript=/^[ \t]*([A-Za-z0-9_$]+)[ \t]*[:=][ \t]*[\(]*function[ \t]*\(/\1/M,Method,Methods/--regex-javascript=/^[ \t]*static[ \t]+([A-Za-z0-9_$]+)[ \t]*\(/\1/M,Method,Methods/--regex-javascript=/^[ \t]*([A-Za-z0-9_$]+)\(.*\)[ \t]*{/\1/M,Method,Methods/--regex-javascript=/^[ \t]*(this\.)*([A-Za-z0-9_$]+)[ \t]*[:=].*[,;]*[^{]$/\2/P,Property,Properties/--regex-javascript=/^[ \t]*(var|let|const)[ \t]+([A-Za-z0-9_$]+)[ \t]*=[ \t]*{/\2/O,Object,Objects/--regex-javascript=/\/\/[ \t]*(FIXME|TODO|BUG|NOBUG|\?\?\?|\!\!\!|HACK|XXX)[ \t]*\:*(.*)/\1/T,Tag,Tags/--regex-javascript=/^[ \t]*(var|let|const)[ \t]+([A-Za-z0-9_$]+)[ \t]*=[ \t]*[^\[{]*;$/\2/V,Variable,Variables/--exclude=min--exclude=vendor--exclude=\*.min.\*--exclude=\*.map--exclude=\*.swp--exclude=\*.bak--exclude=tags--exclude=node_modules--exclude=bower_components--exclude=test--exclude=__test__--exclude=build--exclude=dist--exclude=*.bundle.*

Here is how it looks like going to function definition:

這是去函數定義的樣子:

Also you can use Ctrlp to search for tags instead of files. To do this, first you need to map a shortcut in your .vimrc:

您也可以使用Ctrlp搜索標簽而不是文件。 為此,首先需要在.vimrc映射一個快捷方式:

nnoremap <leader>. :CtrlPTag<cr>

Here is how it works:

下面是它的工作原理:

Hope it helps :)

希望能幫助到你 :)

I write code for audio and web, and play guitar on YouTube. If you want to see more stuff from me or know more about me, you can always find me in:

我編寫音頻和網絡代碼,并在YouTube上彈吉他。 如果您想從我這里了解更多信息或對我有更多了解,可以隨時在以下位置找到我:

Website:https://haochuan.io/

網址: https : //haochuan.io/

GitHub:https://github.com/haochuan

GitHub: https : //github.com/haochuan

Medium:https://medium.com/@haochuan

媒介: https : //medium.com/@haochuan

YouTube: https://www.youtube.com/channel/UCNESazgvF_NtDAOJrJMNw0g

YouTube: https : //www.youtube.com/channel/UCNESazgvF_NtDAOJrJMNw0g

翻譯自: https://www.freecodecamp.org/news/make-your-vim-smarter-using-ctrlp-and-ctags-846fc12178a4/

vim ctrlp

總結

以上是生活随笔為你收集整理的vim ctrlp_使用Ctrlp和Ctag使Vim更智能的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 精品一区二区视频在线观看 | 黄瓜视频在线免费观看 | 99福利视频导航 | 中文日韩在线观看 | 国产午夜精品久久 | 艳妇乳肉亭妇荡乳av | 天天看毛片 | 亚洲va在线| 高清免费毛片 | 桥本有菜aⅴ一区二区三区 在线午夜电影 | 黄色免费大片 | 大地资源影视在线播放观看高清视频 | 国产精品五月天 | 伊人精品一区二区三区 | 亚洲一区二区黄 | 天天射日日射 | 中国免费观看的视频 | 爱看av| 国产精品无码白浆高潮 | 国产人人看 | 国精产品一二三区精华液 | 婷婷久久亚洲 | 少妇99 | 一级视频在线 | 亚洲成年人网站在线观看 | 亚洲黄色影视 | 午夜精品久久99蜜桃的功能介绍 | 久久噜噜噜精品国产亚洲综合 | 美女搞黄在线观看 | 日韩一区在线看 | 国产av电影一区二区三区 | 一级黄毛片 | 国产成人一区二区三区免费看 | 韩国三级hd中文字幕叫床浴室 | 波多野结衣中文字幕在线播放 | 一级片中文 | 久久久久www| 亚洲色精品三区二区一区 | 91网站免费看 | 91亚洲欧美激情 | a一级免费视频 | 成人午夜av | 日韩a级片在线观看 | 少妇av网| 青青草免费看 | 又污又黄又爽的网站 | 91入囗 | 日本一区二区三区四区五区 | 天堂网视频在线观看 | 日本黄色大片视频 | 天堂中文资源在线 | 人人干人人草 | 日本www高清视频 | 少妇日皮视频 | 五月激情婷婷网 | 隔壁人妻偷人bd中字 | 免费成人美女女 | 九九在线精品 | 欧美成人一二区 | 天天摸天天操 | 黄色骚视频 | 日本熟妇色xxxxx日本免费看 | 天天影视插插插 | 九九激情视频 | 久久94 | 国产精品久久久久久久久久久免费看 | 久热这里只有 | 超碰人人人人人 | 91精品国产高清91久久久久久 | 成人区人妻精品一区二区不卡视频 | 欧美在线日韩在线 | 亚洲国产高清国产精品 | 黄色1级视频 | 免费荫蒂添的好舒服视频 | 国产鲁鲁视频在线观看特色 | 美女极度色诱图片www视频 | 伦理片av| 欧美不卡在线视频 | 婷婷国产成人精品视频 | 在线一区二区三区四区五区 | 国产精品免费一区二区三区在线观看 | 美女被草视频在线观看 | 99热在线免费观看 | 男人天堂影院 | 亚洲视频你懂的 | 国产精品一区二区三区在线免费观看 | 婷婷成人综合 | 福利视频h| 精品国产区一区二 | 精品视频在线一区二区 | 日韩成人av网站 | 中国一级片在线观看 | a级无遮挡超级高清-在线观看 | 国产高清免费在线 | 亚洲欧洲色 | 一区二区在线免费看 | 日本黄色www| 91九色国产ts另类人妖 | 日韩欧美成人免费视频 |