当前位置:网站首页>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 (一个单词)
边栏推荐
- MySQL Practice Summary -
- 「以云为核,无感极速」顶象第五代验证码
- 56:第五章:开发admin管理服务:9:开发【文件上传到,MongoDB的GridFS中,接口】;(把文件上传到GridFS的SOP)
- 数组问题之《两数之和》以及《三数之和 》
- typescript22-接口继承
- 剑指 Offer 68 - II. 二叉树的最近公共祖先
- y83. Chapter 4 Prometheus Factory Monitoring System and Actual Combat -- Advanced Prometheus Alarm Mechanism (14)
- Selenium:元素定位
- typescript25-类型断言
- (2022牛客多校四)D-Jobs (Easy Version)(三维前缀或)
猜你喜欢
零序电流继电器器JL-8C-12-2-2
PAT乙级 1002 写出这个数
2022/07/29 入职健海JustFE团队,我学到了高效开发(年中总结)
(Codeforce 757) E. Bash Plays with Functions
MySQL-Data Definition Language-DDLdatebase define language
干货!如何使用仪表构造SRv6-TE性能测试环境
Robot_Framework:常用内置关键字
typescript23-tuple
数组问题之《下一个排列》、《旋转图像》以及二分查找之《搜索二维矩阵》
力扣(LeetCode)212. 单词搜索 II(2022.07.31)
随机推荐
SL-12/2过流继电器
Power button (LeetCode) 212. The word search II (2022.07.31)
scheduleWithFixedDelay和scheduleAtFixedRate的区别
在沈自所的半年总结
WPF项目-初步了解数据绑定 binding
Error: AttributeError: module 'matplotlib' has no attribute 'figure'
In the shake database, I want to synchronize the data of the source db0 to the destination db5, how to set the parameters?
请求/响应拦截器写法
56:第五章:开发admin管理服务:9:开发【文件上传到,MongoDB的GridFS中,接口】;(把文件上传到GridFS的SOP)
(2022 Nioke Duo School IV) D-Jobs (Easy Version) (3D prefix or)
罗技鼠标体验记录
typescript26-字面量类型
y83. Chapter 4 Prometheus Factory Monitoring System and Actual Combat -- Advanced Prometheus Alarm Mechanism (14)
typescript23-tuple
typescript26 - literal types
[MySQL] 多表查询
typescript22-接口继承
LeetCode 27. 移除元素
备战金九银十,如何顺利通过互联网大厂Android的笔面试?
[target detection] YOLOv7 theoretical introduction + practical test