vim tips

SBP依赖计算中的蝴蝶效应:一个Prefab修改如何触发全量重建? 本文深入探讨了Unity中SBP(Scriptable Build Pipeline)依赖计算的蝴蝶效应,解析了Prefab修改如何触发全量重建的机制。通过分析Asset与Object的层级关系、依赖计算的三种维度及CacheEntry系统,揭示了全量重建的根本原因,并提供了依赖可视化工具开发、优化策略与最佳实践,帮助开发者提升构建效率。 阅读详情
Keyword Lookup
The K command is designed to look up the selected text using the “man” command. It
works just like the normal-mode K command except that it uses the highlighted text
as the keyword.


Inserting Text
The command Istring<Esc> inserts the text on each line starting at the left side of
the visual block, as seen in Figure 6.9.
You start by pressing CTRL-V to enter visual block mode. Now you define your
block. Next you type I to enter insert mode followed by the text to insert. As you
type, the text appears on the first line. After you press <Esc> to end the insert, the text
will magically be inserted in the rest of the lines contained in the visual selection.
Figure 6.9 shows how this process works.
If the block spans short lines that do not extend into the block, the text is not
inserted in that line. Figure 6.10 illustrates what happens to short lines.
If the string contains a newline, the I acts just like a normal-mode insert (i) com-
mand and affects only the first line of the block.

The Vim editor has lots of commands that help the programmer indent his program
correctly.The first ones discussed here merely shift the text to the left (<<) or the
right (>>).
The left shift command (<<) shifts the current line one shift width to the left.The
right shift command (>>) does the same in the other direction. But what is a shift
width? By default, it is 8. However, studies have shown that an indentation of 4 spaces
for each level of logic is the most readable. So a shift width of 4 would be much nicer.
To change the size of the shift width, use the following command:

block = indent


The = Command
The =motion command indents the selected text using Vim’s internal formatting pro-
gram. If you want to indent a block of text, for example, you can use the = command
to do it.The motion in this case is the % (go to matching {}) command. Figure 7.5
shows the results.


Shifting a Block of Text Enclosed in {}
Suppose that you want to indent the text encoded in {} one level. Position the cursor
on the first (or last) {.
Execute the command >%.This shifts the text right to where the motion takes you.
In this case, % takes you to the matching {}.
Figure 7.14 shows how these commands work.

Unfortunately this shifts the {} in addition to the text. Suppose you just want to shift
what is in the {}.Then you need to do the following:
1. Position the cursor on the first {.
2. Execute the command >i{.

The K command gets the subject from the word under the cursor. But what if you need
to select the section number? It is simple; the K command takes a count argument. If
specified, this is used as the section number.Therefore, if you position the K over the
word mkdir and execute the 2K, you will get the mkdir(2) page.
You can customize the K command. It runs the program specified by the
'keywordprg' option. By default, on UNIX this is man.


The command :cprevious or :cNext goes to the previous error. Similarly, the com-
mand :clast goes to the last error and :crewind goes to the first.The :cnfile goes to
first error message for the next file (see Figure 7.28).
If you forget what the current error is, you can display it using the following
command:
:cc
To see a list of errors, execute this command:
:clist
Figure 7.29 shows the output of a :clist command.
If you want to list only a subset of the errors, you can give :clist a range of errors
to list. For example:
:clist 3,5
:clist ,5
:clist 5,
(List errors 3 through 5)
(List errors 1-5)
(List errors 5 to the end)
The Vim editor suppresses all informational messages. If you want everything, use the
following command:
:clist!
The override option (!) tells Vim to not suppress anything.

Saving Your Setting
After performing all your :map, :abbreviate, and :set commands, it would be nice if
you could save them and use them again.
The command :mkvimrc writes all your settings to a file.The format of this com-
mand is as follows:
:mkvimrc file
file is the name of the file to which you want to write the settings.
You can read this file by using the following command:
:source file
During startup, the Vim editor looks for an initialization file. If it is found, it is auto-
matically executed. (Only the first file found is read.)


Automatic Completion Details
For the most part, the Vim editor does the right thing when it comes to automatic
completion. At times, however, you might want to fine-tune your completions.
The ‘complete’ option controls where Vim searches for words.The form of this
option is as follows:
:set complete=key,key,key
key is a key letter (and possible argument).The possible key values are as follows:
. Current file
b Files in loaded buffers, not in a window
d Definitions in the current file and in files included by a #include directive
i Files included by the current file through the use of a #include directive
k The file defined by the ‘dictionary’ option (discussed later in this chapter)
kfile The file named {file}
t The “tags” file. (The ] character can be used as well.)
u Unloaded buffers
w Files in other windows



The S Command
The S command deletes the current line and puts the editor in insert mode. If a count
is specified, it deletes count lines.This differs from the C command in that the C com-
mand deletes from the current location to the end of the line, whereas the S command
always works on the entire line. Figure 18.18 illustrates the use of the S command.

Instant Word Searches
The * command searches for the word under the cursor. For example, position the
cursor on the first const. Pressing * moves the cursor to the next occurrence of the
word, specifically line 26. Figure 19.5 shows the results.


Special Registers
Vim has a number of special registers.The first is the unnamed register, whose name is
double quote (“).
Others include the registers 1 through 9. Register 1 contains the last text you
deleted; register 2 the next to last, and so on.
(Back in the bad old days of Vi, these registers were a lifesaver.You see, Vi had only
one level of undo. So if you deleted three lines by executing dd three times, you were
out of luck if you wanted to undo the delete using the u command. Fortunately, the
three lines were stored in registers 1, 2, and 3, so you could put them back with
“1P”2P”3P.You can also use the command “”P.. (“”P and two dots).
Other special registers include the following:
Register Description Writeable
0 The last yanked text Yes
- The last small delete No
. The last inserted text No
% The name of the current file No
# The name of the alternate file No
/ The last search string No
: The last “:” command No
_ The black hole (more on this later) Yes
= An expression (see next page) No
* The text selected with the mouse Yes

Spaces and Tabs
If you are using a combination of tabs and spaces, you just edit normally.The Vim
defaults do a fine job of handling things.
But you can make life a little easier by setting the ‘softtabstop’ option.This
option tells Vim to make the Tab key look and feel as if tabs were set at the value of
‘softtabstop’, but use a combination of tabs and spaces to fake things (see Figure 23.3).
After you execute the following command, every time you press the Tab key the
cursor moves to the next 4-column boundary:
:set softtabstop=4
The first time you press it, however, you get 4 spaces inserted in your text.The second
time, Vim takes out the 4 spaces and puts in a tab (thus taking you to column 8).


Smart Tabs
Another related option is the ‘smarttab’ option.With this option on (:set smarttab),
tabs inserted at the beginning of a line are treated like soft tabs.The tab size used in
this case is defined the ‘shiftwidth’ option.
But tabs inserted elsewhere in the text act just like normal tabs. Note that you must
have soft tabs off (:set softtabstop=0) for this option to work. Figure 23.4 shows
sample results.
Smart indenting is a combination of soft tabs and normal tabs.When you execute
the following command, Vim treats tabs at the beginning of a line differently:
:set smarttab
Suppose, for example, that you have the following settings:
:set shiftwidth=4
:set tabstop=8
:set smarttabs
Tab stops are every eight spaces and the indentation size is four spaces.When you type
<Tab> at the beginning of a line, the cursor will move over the indentation size (four
spaces). Doing a double <Tab> moves over two indention sizes (eight spaces [4*2]).


机器人关节电机发热难题:从工程化角度拆解热管理解决方案(下) 摘要:本文系统分析了机器人关节电机与驱动系统的热管理方案,重点解决局部热点问题。针对不同功率场景提出了热管/均热板散热(适用于中小功率)和液冷散热(适用于高功率)的具体实施方案,详细比较了结构参数、材料选择、安装工艺和散热效果。特别强调了电机-驱动协同热管理的重要性,提出"工况联动+热路径共享"的核心理念,包括一体化散热结构设计和动态控制策略。最后介绍了热仿真与测试验证方法,确保方案的有效落地。通过系统级热管理,可显著降低温升(热点区域降温30-60℃),同时优化体积和能耗。 阅读详情

相关推荐

Zephyr 开发必备技能:一文搞懂 west manifest

本文深入解析Zephyr项目的westmanifest工具与Manifest文件管理,从基础概念到高级应用。文章首先介绍westmanifest作为Zephyr模块化架构的核心工具,负责管理west.yml文件中的模块信息、Git地址及版本控制。随后详细讲解Manifest文件的基本结构、字段含义,以及westmanifest子命令的使用方法,包括查看内容、冻结版本、验证文件等操作。文章还探讨了Manifest的导入继承机制和在团队协作中的版本管理策略,并给出常见问题排查技巧。最后强调Manifest文件作

hemoparrot的专栏 1255

Best of VIM Tips(译注) - 连载1 序

前段时间在网上看到有人说“网上的VIM技巧很多,但都只是告诉你怎么样,不告诉你为什么”,深以为然。刚好最近又在重新看Best of VIM Tips这篇文章,于是就产生一个想法,把这篇文章翻译一遍,另外还加一些讲解,给出一些帮助入口,便于VIM的初学者掌握。Best of VIM Tips可以在http://www.vim.org/tips/tip.php?tip_id=305找到,不过这是比

Easwy的专栏 4036

按照autoware.universe官方从零搭建自己的自动导航小车(三)(续)

本文介绍了在Autoware框架下完善自定义传感器套件描述包的详细过程。主要内容包括:1)创建传感器描述包tinyplc_sensor_kit_description,包含YAML标定文件和URDF模型;2)配置传感器与车辆基座的相对位姿,实现sensor_kit.xacro和sensors.xacro宏文件;3)更新sensor_kit.launch.xml文件以集成激光雷达和GNSS/IMU驱动。通过xacro验证URDF模型正确性后,下一步计划接入Helios16激光雷达数据并在Rviz2中验证点云显

qq_45335326的博客 1272

Vim Tips

Vim Tips

走南闯北的专栏 1005

5分钟搞定:用Pyannote和Whisper实现带说话人分离的语音转文字(附完整代码)

本文详细介绍了如何快速构建一个集成了说话人分离功能的语音转文字系统。通过结合OpenAI的Whisper模型进行高精度语音识别和Pyannote模型实现说话人分离,并提供了完整的代码实现、环境搭建指南以及核心的对齐与合并逻辑,帮助开发者高效处理会议录音、访谈等多说话人音频,实现自动化转录。

threejs5artist的博客 635

PC微信逆向:破解聊天记录文件!_读取别人pc微信msg文件

本文详细介绍了PC版微信数据库的解密方法,总结了前人经验并补充了关键细节。通过OllyDbg调试工具从微信内存中获取32字节加密密钥,使用C++结合OpenSSL库实现解密程序。重点解决了开发环境配置问题,包括Visual Studio项目设置和OpenSSL库的版本适配,将原本固定的数据库路径改为参数化输入,提高了工具的通用性。该方案为电子取证中的微信数据提取提供了完整的技术路径,避免了研究者重复探索已解决的问题。

zz96405784848的博客 9748

VIM Tips

全局查找替换:%s/stext/rtext/g比如::%s/text/txt/g 就是把所有的text替换成txt。VIM中怎样整体缩进一段代码或者相反?很简单,按v进入可视化模式,选中要缩进的代码,按下>缩进代码,一个>就插入一个tab,当然,要插入3个tab就输入3>,按下tab的宽度在_vimrc中可以设置set tabstop=4 set s

xian_qiang的专栏 1240

Claude Code 100个真实案例 - 用AI搭建LangChain多工具Agent(自主搜索+查询)

本案例展示如何使用 Claude Code 搭建一个 LangChain 多工具 Agent 系统。Agent 能够自主决定调用搜索引擎、数据库查询、天气查询、计算器等工具,像人类助手一样拆解问题并逐步解决。

yueyeguzhuo的专栏 557

vim.wikia.com-featured-tips.zip

半个月从vim.wikia.com上取下来的每月推荐Tips。该网站居然也被GFW墙了(但昨天发现已经解封了)http://vim.wikia.com/wiki/Vim_Tips_Wiki:Featured_Tip该网站每月会推选一个Tip,称为该月的Featured Tip,这里取下来的包含所有Featured Tip (2008年2月到今年7月).采用Firefox的Scrapbook p...

martinbooch的博客 167

UniRx之基本语法格式

想要更好的去学习UniRx,我们最好是先理解UniRx 的语法格式。就像我们去学习英语或者汉语一样,理解了基本的语法规则后,再学其他的就信手拈来了。

TxNet 924

【智能车Code review】——小S与中S道路判断

基本思想: 找到中线的左拐点和右拐点,并且计算出两点之间的空间距离。通过限制空间距离,分为中S和小S。 注意这种情况:当20行以下的中线斜率比较陡,此时可以通过人为限制设定,将第0行的中线设置为拐点。 if (flag_centre_right_point == 0 && flag_centre_left_point == 1 && parameterB >= 0.5 && centre_left_point[0] >= 33) { .

hanhan的博客 6102

Vim tips

虽然经常使用vim,但是早已经不记得自己的vimrc是如何配置成现在这个样子,google当然能够让你找到很多关于如何配置出强大的vim的各种文章,但我还是很愿意在这里mark一些自己常用的一些link。 目前我使用的vimrc配置的基础来自:http://phuzz.org/

Mac Track 678

CesiumForUnreal实现鹰眼地图(MiniMap)效果

CesiumForUnreal实现鹰眼地图(MiniMap)效果

专注GIS开发 3951

Vim Tricks And Tips

1.文件间切换 Ctrl+6—下一个文件 :bn—下一个文件 :bp—上一个文件 在vim下可以使用常用的箭头键 但是 还有其它键可以让你更快的达到目标 hjkl 这是代替箭头键功能的 H M L 跳到屏幕的顶上 中间 下方 w 跳到下一个单词的开始 e 跳到单词的结束 b 向后跳 gg 跳到文件的开始 G 跳到文件的结束 10gg 或10G 跳到第10行 ta 跳到下一个a 前面 fa 跳到下一...

WOW 403

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

vim的各种tips

centos系统,修改vim的配置文件 /etc/vimrc 添加如下内容: 1) 打开 vimrc ,添加以下语句来使得语法高亮显示: syntax on 2) 如果此时语法还是没有高亮显示,那么在 /etc 目录下的 profile 文件中添加以下语句: export TERM=xterm-color 3)解决方向键和退格键失效的问题(采用非兼容模式) set nocom...

weixin_33910460的博客 145

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

vim 使用tips

可以对标点内的内容进行操作: ci’、ci"、ci(、ci[、ci{、ci< - 分别更改这些配对标点符号中的文本内容 di’、di"、di(或dib、di[、di{或diB、di< - 分别删除这些配对标点符号中的文本内容 yi’、yi"、yi(、yi[、yi{、yi< - 分别复制这些配对标点符号中的文本内容 vi’、vi"、vi(、vi[、vi{、vi< - 分别选中...

Stay fool & simple 214

vim Tips

1、改变文档编码 :set fileencoding=utf-8 2、缩进尽量使用四个空格,vim设置方法: 修改.vimrc文件,增加: :set ts=4 :set expandtab :%retab!

oucXrsh的博客 308

Vim 正则表达式 and some tips

搜索vim正则表达式, 发现了下面这篇文章。 http://blog.chinaunix.net/u/553/showart.php?id=512851 进而链接到了下面这个网站:Vim中文维基 http://www.idv2.com/vimwiki/index.php http://www.idv2.com/vimwiki/index.php?%E6%AD%A3%E5%88%99%E8%A1%...

SAP => Simplify Anything Possible 118

我的VIM tips

***普通设置*** :set incsearch 增量搜索 :set hlsearch 高亮搜索 :set nu 显示行号 tabnew 新建一个tab verbose imap  查看imap下的C-v映射的命令 set winaltkeys=no 设置gVIM中不使用Alt键激活菜单 ***光标移动*** ============== 普通光标移动 -------------- ^ 移动到...

Simple is better 184

some vim tips

1) 为什么别人的方法在我这里行不通?(2) 如何找到上次编辑的文件?(3) 如何复制粘贴?(4) 如何在多个文件中进行替换?(5) 如何把fold一次全部打开?(6) 如何选择或者复制光标所在的单词?(7) 如何计数搜索的字符串?(8) 如何去掉高亮搜索?(9) 如何解决linux下gvim中文菜单乱码的问题?(10) 如何对所编辑的文件语法高亮显示?(11) 如何快速插入多行数字0-99?==

2311

Best of Vim Tips

Best of VIM Tips, gVIM's Key Features zzapperBest of Vim Tipszzapper (zzapper) 15 Years of Vi + 7+ years of Vim and still learning 05Nov12 : Last Update (Now in VIM Help Format :h helptags) ### These ...

weixin_34389926的博客 81

vim tips小结

使用vim过程当中,经常会不经意间就碰到了一个特别有用的tip, 但是过后好久不用就给忘了。下次遇到还是想不起来应该怎么处理,所以就写篇文章来总结一下,下次遇到的时候直接来查。 正则表达式 1. 正则表达式匹配开始、匹配结束 \zs    匹配任何位置(零宽,不占用字符),并将匹配起始处置于该处: 下一个字符将是整个匹配的第一个字     符。     例如: >         "^

ziven tech 724
上一篇: bash 颜色控制
下一篇: 编译gcc时关于工具链的调整
learnboy007
博客等级 码龄19年 5粉丝 18原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值