当前位置:网站首页>vim configuration + ctag is as easy to read code as source insight
vim configuration + ctag is as easy to read code as source insight
2022-08-01 05:09:00 【Cicadas on mountain】
1,配置amix/vimrc
在 https://github.com/amix/vimrc 下载 amix/vimrc
并安装:
$ git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime
// 执行该命令后 ~/.vimrc The file will become the required configuration
$ sh ~/.vim_runtime/install_awesome_vimrc.sh
2,下载taglist(相当于sourceinsightThe left window of the display shows functions and variables)
http://www.vim.org/scripts/script.php?script_id=273
解压把 taglist.vim 放到 ~/.vim_runtime/my_plugins 目录中
并在 ~/.vimrc 文件中添加如下行:
source ~/.vim_runtime/my_plugins/taglist.vim
3,在~/.vim_runtime/vimrcs/basic.vim添加如下配置
" my start
set mouse=a
set number
set cursorline
let Tlist_Use_Right_Window=0 "taglist 显示在左侧
let Tlist_Exit_OnlyWindow=1 "taglist When there is only one window left,自动关闭
let Tlist_File_Fold_Auto_Close=1
map tl :TlistToggle
nnoremap ev :vsplit $MYVIMRC
nnoremap sv :source $MYVIMRC
" my end
4,使用配置好的vim
比如:进入源代码目录,以Android源代码为例:
比如:阅读frameworks/base目录的代码
首先:在frameworks/base目录执行:
$ ctags -R
然后: Open the file at will:如打开PowerManagerService.java
frameworks/base$ vim ./services/core/java/com/android/server/power/PowerManagerService.java
在打开的文件中:常用操作
执行:Shift + * // Search for the variable at the cursor
执行:ctrl + o // ctrl + * 反向操作,back later
执行: tl <Enter> // The Functions and Variables window for the current file will open
执行:,nn // A file directory browsing will open
执行:ctrl + ] // Jump to the definitions of functions and variables
执行:ctrl + t // call back to execute ctrl + ] 处
执行: ts <函数名或变量名> // Show which files call the function
执行: ! 用于执行命令
执行: tabnew 文件名 // Open the file in a new tab
执行: gt // tabnewJump through multiple open tabs
执行: vw // vimVisual mode to copy the word,Then go to the command line mode to search for the word
执行: Enter command line mode to execute: Shift+insert // Paste the word copied in Visual mode
执行:vim /<函数名或变量名>/ % | copen
执行:vim /test1/ ** | copen // The following recursively finds all inclusions in the current directorytest1 字符串的文件,And click on the line you want to view to jump directly to the file containstest1的位置中去.
1. 只搜索当前文件 vim /main/ % | copen
2. 只搜索当前目录 vim /main/ * | copen
3. Search the parent directory,并递归 vim /main/ ../** | copen 4. Can search in multiple paths vim /main path1/** path2/** | copen 执行:ctrl + d // 向下翻半页 执行:ctrl + u // 向上翻半页 执行:f + 字符 // at the cursor line,Find that character ~/.vim_runtimeThe shortcut commands of the plugins configured in the directory can be accessed:~/.vim_runtime中 grep 查找到 如到 ~/.vim_runtime/vimrcs/plugins_config.vim中能找到Nerd TreeConfigured shortcut keys. 自动补全:Ctrl + N :reg VimMethods for interacting with the system clipboard 选中一行 :"+Y //复制一行 :"+yy //复制一行 选中多行后 :"+y 选中单词后 :"+y (Shift) :"+yw (一个单词)
边栏推荐
- Typescript20 - interface
- MySQL-Data Definition Language-DDLdatebase define language
- LeetCode 1189. “气球” 的最大数量
- Selenium:元素等待
- 关于给Qt做一个软件初始化的进度条
- 小心你的字典和样板代码
- Error: AttributeError: module 'matplotlib' has no attribute 'figure'
- 数组问题之《下一个排列》、《旋转图像》以及二分查找之《搜索二维矩阵》
- II. Binary tree to Offer 68 - recent common ancestor
- (2022牛客多校四)D-Jobs (Easy Version)(三维前缀或)
猜你喜欢
(2022 Nioke Duo School IV) D-Jobs (Easy Version) (3D prefix or)
safari浏览器怎么导入书签
Excel record of integer programming optimization model to solve the problem
风险策略调优中重要的三步分析法
【目标检测】YOLOv7理论简介+实践测试
y83.第四章 Prometheus大厂监控体系及实战 -- prometheus告警机制进阶(十四)
初识shell脚本
56:第五章:开发admin管理服务:9:开发【文件上传到,MongoDB的GridFS中,接口】;(把文件上传到GridFS的SOP)
typescript26-字面量类型
Lawyer Interpretation | Guns or Roses?Talking about Metaverse Interoperability from the Battle of Big Manufacturers
随机推荐
备战金九银十,如何顺利通过互联网大厂Android的笔面试?
Power button (LeetCode) 212. The word search II (2022.07.31)
LeetCode 1189. “气球” 的最大数量
mysql中解决存储过程表名通过变量传递的方法
state compressed dp
typescript28 - value of enumeration type and data enumeration
7 行代码搞崩溃 B 站,原因令人唏嘘!
4D line-by-line analysis and implementation of Transformer, and German translation into English (3)
华为Android开发面试后得出的面试秘诀
Immutable
中国的机器人增长
pytroch、tensorflow对比学习—专栏介绍
高数 | 【重积分】线面积分880例题
罗技鼠标体验记录
MySQL-数据定义语言-DDLdatebase define language
挑战52天背完小猪佩奇(第01天)
y83.第四章 Prometheus大厂监控体系及实战 -- prometheus告警机制进阶(十四)
MySQL-DML语言-数据库操作语言-insert-update-delete-truncate
LeetCode 387. 字符串中的第一个唯一字符
小心你的字典和样板代码