当前位置:网站首页>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 (一个单词) 边栏推荐
- typescript24 - type inference
- Swastika line-by-line parsing and realization of the Transformer, and German translation practice (2)
- II. Binary tree to Offer 68 - recent common ancestor
- y83.第四章 Prometheus大厂监控体系及实战 -- prometheus告警机制进阶(十四)
- 力扣(LeetCode)212. 单词搜索 II(2022.07.31)
- pytroch、tensorflow对比学习—搭建模型范式(构建模型方法、训练模型范式)
- Selenium:下拉框操作
- typescript22-接口继承
- Selenium: Manipulating Cookies
- MySQL Practice Summary -
猜你喜欢

Risk strategy important steps of tuning method

关于给Qt做一个软件初始化的进度条

safari浏览器怎么导入书签

pytorch、tensorflow对比学习—张量

DL-31/6电流继电器

pytroch、tensorflow对比学习—专栏介绍

y83.第四章 Prometheus大厂监控体系及实战 -- prometheus告警机制进阶(十四)

I met a shell script

Swastika line-by-line parsing and realization of the Transformer, and German translation practice (a)

typescript25 - type assertion
随机推荐
typescript22-接口继承
Pyspark机器学习:向量及其常用操作
UE4 从鼠标位置射出射线检测
这里有110+公开的专业数据集
ModuleNotFoundError: No module named ‘tensorflow.keras‘报错信息的解决方法
JWL-11/2-99.9A电流继电器
API设计笔记:pimpl技巧
Robot_Framework:常用内置关键字
I met a shell script
II. Binary tree to Offer 68 - recent common ancestor
typescript25-类型断言
MySQL-Data Definition Language-DDLdatebase define language
High Numbers | 【Re-integration】Line Area Score 880 Examples
Swastika line-by-line parsing and realization of the Transformer, and German translation practice (a)
7月编程排行榜来啦!这次有何新变化?
程序员代码面试指南 CD15 生成窗口最大值数组
MySQL-数据操作-分组查询-连接查询-子查询-分页查询-联合查询
Selenium:操作JS
typescript19-对象可选参数
剑指 Offer 68 - II. 二叉树的最近公共祖先