- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有vim:
foo barba[r]bar
foo
最佳答案
参见:help text-object
。这比这里的任何人都可以更好地说明了一切。
这是整个部分:
6. Text object selection *object-select* *text-objects*
*v_a* *v_i*
This is a series of commands that can only be used while in Visual mode or
after an operator. The commands that start with "a" select "a"n object
including white space, the commands starting with "i" select an "inner" object
without white space, or just the white space. Thus the "inner" commands
always select less text than the "a" commands.
These commands are {not in Vi}.
These commands are not available when the |+textobjects| feature has been
disabled at compile time.
*v_aw* *aw*
aw "a word", select [count] words (see |word|).
Leading or trailing white space is included, but not
counted.
When used in Visual linewise mode "aw" switches to
Visual characterwise mode.
*v_iw* *iw*
iw "inner word", select [count] words (see |word|).
White space between words is counted too.
When used in Visual linewise mode "iw" switches to
Visual characterwise mode.
*v_aW* *aW*
aW "a WORD", select [count] WORDs (see |WORD|).
Leading or trailing white space is included, but not
counted.
When used in Visual linewise mode "aW" switches to
Visual characterwise mode.
*v_iW* *iW*
iW "inner WORD", select [count] WORDs (see |WORD|).
White space between words is counted too.
When used in Visual linewise mode "iW" switches to
Visual characterwise mode.
*v_as* *as*
as "a sentence", select [count] sentences (see
|sentence|).
When used in Visual mode it is made characterwise.
*v_is* *is*
is "inner sentence", select [count] sentences (see
|sentence|).
When used in Visual mode it is made characterwise.
*v_ap* *ap*
ap "a paragraph", select [count] paragraphs (see
|paragraph|).
Exception: a blank line (only containing white space)
is also a paragraph boundary.
When used in Visual mode it is made linewise.
*v_ip* *ip*
ip "inner paragraph", select [count] paragraphs (see
|paragraph|).
Exception: a blank line (only containing white space)
is also a paragraph boundary.
When used in Visual mode it is made linewise.
a] *v_a]* *v_a[* *a]* *a[*
a[ "a [] block", select [count] '[' ']' blocks. This
goes backwards to the [count] unclosed '[', and finds
the matching ']'. The enclosed text is selected,
including the '[' and ']'.
When used in Visual mode it is made characterwise.
i] *v_i]* *v_i[* *i]* *i[*
i[ "inner [] block", select [count] '[' ']' blocks. This
goes backwards to the [count] unclosed '[', and finds
the matching ']'. The enclosed text is selected,
excluding the '[' and ']'.
When used in Visual mode it is made characterwise.
a) *v_a)* *a)* *a(*
a( *v_ab* *v_a(* *ab*
ab "a block", select [count] blocks, from "[count] [(" to
the matching ')', including the '(' and ')' (see
|[(|). Does not include white space outside of the
parenthesis.
When used in Visual mode it is made characterwise.
i) *v_i)* *i)* *i(*
i( *v_ib* *v_i(* *ib*
ib "inner block", select [count] blocks, from "[count] [("
to the matching ')', excluding the '(' and ')' (see
|[(|).
When used in Visual mode it is made characterwise.
a> *v_a>* *v_a<* *a>* *a<*
a< "a <> block", select [count] <> blocks, from the
[count]'th unmatched '<' backwards to the matching
'>', including the '<' and '>'.
When used in Visual mode it is made characterwise.
i> *v_i>* *v_i<* *i>* *i<*
i< "inner <> block", select [count] <> blocks, from
the [count]'th unmatched '<' backwards to the matching
'>', excluding the '<' and '>'.
When used in Visual mode it is made characterwise.
*v_at* *at*
at "a tag block", select [count] tag blocks, from the
[count]'th unmatched "<aaa>" backwards to the matching
"</aaa>", including the "<aaa>" and "</aaa>".
See |tag-blocks| about the details.
When used in Visual mode it is made characterwise.
*v_it* *it*
it "inner tag block", select [count] tag blocks, from the
[count]'th unmatched "<aaa>" backwards to the matching
"</aaa>", excluding the "<aaa>" and "</aaa>".
See |tag-blocks| about the details.
When used in Visual mode it is made characterwise.
a} *v_a}* *a}* *a{*
a{ *v_aB* *v_a{* *aB*
aB "a Block", select [count] Blocks, from "[count] [{" to
the matching '}', including the '{' and '}' (see
|[{|).
When used in Visual mode it is made characterwise.
i} *v_i}* *i}* *i{*
i{ *v_iB* *v_i{* *iB*
iB "inner Block", select [count] Blocks, from "[count] [{"
to the matching '}', excluding the '{' and '}' (see
|[{|).
When used in Visual mode it is made characterwise.
a" *v_aquote* *aquote*
a' *v_a'* *a'*
a` *v_a`* *a`*
"a quoted string". Selects the text from the previous
quote until the next quote. The 'quoteescape' option
is used to skip escaped quotes.
Only works within one line.
When the cursor starts on a quote, Vim will figure out
which quote pairs form a string by searching from the
start of the line.
Any trailing white space is included, unless there is
none, then leading white space is included.
When used in Visual mode it is made characterwise.
Repeating this object in Visual mode another string is
included. A count is currently not used.
i" *v_iquote* *iquote*
i' *v_i'* *i'*
i` *v_i`* *i`*
Like a", a' and a`, but exclude the quotes and
repeating won't extend the Visual selection.
Special case: With a count of 2 the quotes are
included, but no extra white space as with a"/a'/a`.
When used after an operator:
For non-block objects:
For the "a" commands: The operator applies to the object and the white
space after the object. If there is no white space after the object
or when the cursor was in the white space before the object, the white
space before the object is included.
For the "inner" commands: If the cursor was on the object, the
operator applies to the object. If the cursor was on white space, the
operator applies to the white space.
For a block object:
The operator applies to the block where the cursor is in, or the block
on which the cursor is on one of the braces. For the "inner" commands
the surrounding braces are excluded. For the "a" commands, the braces
are included.
When used in Visual mode:
When start and end of the Visual area are the same (just after typing "v"):
One object is selected, the same as for using an operator.
When start and end of the Visual area are not the same:
For non-block objects the area is extended by one object or the white
space up to the next object, or both for the "a" objects. The
direction in which this happens depends on which side of the Visual
area the cursor is. For the block objects the block is extended one
level outwards.
For illustration, here is a list of delete commands, grouped from small to big
objects. Note that for a single character and a whole line the existing vi
movement commands are used.
"dl" delete character (alias: "x") |dl|
"diw" delete inner word *diw*
"daw" delete a word *daw*
"diW" delete inner WORD (see |WORD|) *diW*
"daW" delete a WORD (see |WORD|) *daW*
"dd" delete one line |dd|
"dis" delete inner sentence *dis*
"das" delete a sentence *das*
"dib" delete inner '(' ')' block *dib*
"dab" delete a '(' ')' block *dab*
"dip" delete inner paragraph *dip*
"dap" delete a paragraph *dap*
"diB" delete inner '{' '}' block *diB*
"daB" delete a '{' '}' block *daB*
Note the difference between using a movement command and an object. The
movement command operates from here (cursor position) to where the movement
takes us. When using an object the whole object is operated upon, no matter
where on the object the cursor is. For example, compare "dw" and "daw": "dw"
deletes from the cursor position to the start of the next word, "daw" deletes
the word under the cursor and the space after or before it.
"operator-pending mapping
onoremap K :normal! hv2l<return>
"visual mapping (xmap preferred over vmap because vmap also works in select mode)
"note that in visual mode o goes to the other end. Therefore this will expand selection if you were at the end and restrict it otherwise.
xnoremap K ohol
关于vim - 正常模式下 “vaw”在vim中意味着什么(还有 “caw”和 “daw”)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7267375/
我有 虚拟机 在 马克 & CentOS .所以,我看到人们在写 -xterm_clipboard , -lua , ... 有没有一种简单的方法来安装它?或者我们必须一个一个地启用选项并编译/重新编
默认情况下,Vim 在 ~/.vim 中寻找插件和其他东西。 有没有办法告诉 Vim 在 ~/.other_folder 中搜索插件等,并强制它完全忽略 ~/.vim? 最佳答案 Vim 使用来自 '
我正在尝试处理一系列文件。我注意到从命令行(即 ex 模式)运行特定命令时存在差异。例如。 $cat poo.txt big red dog small black cat $vim -c "2,$g
我正在尝试将所有与 vim 相关的文件/插件整合到 ~/.vim 中文件夹,以便我可以将其转储到 github 并开始使用病原体。但是,现在我所有的 vim 插件都散落在各处。 例如,语法插件在 /u
所以我的 ~/.vimrc 文件中的设置正确设置 set mouse=a set ttymouse=xterm2 但是,当我使用 vim 并尝试使用鼠标滚轮滚动时,命令提示符上的滚动条会移动,而不是
我试图尝试 vim 在启动时加载的自动加载文件。我将 example.vim 文件保存在: ~/.vim/autoload/ 目录并编写了一个非常简单的函数: echom "Autoloading..
这个问题已经有答案了: How can you check which options vim was compiled with? (3 个回答) 已关闭 7 年前。 我在多台计算机上使用相同的 V
我需要将一些设置和变量写入一些文本文件以供以后检索。检索文件可以是一个简单的源命令。那么从 vimscript 写入文件的最简单方法是什么? 我只想存储一些全局变量。全局的,因为它们将被多个缓冲区使用
如何使 vim 列(:set 光标列)具有不同的颜色?这是我现在看到的: 请注意,列颜色与 vim 用于标记我的身份等的颜色相同(我认为是背景颜色)。我想选择不同的颜色。 干杯:) 最佳答案 使用这个
我试图尝试 vim 在启动时加载的自动加载文件。我将 example.vim 文件保存在: ~/.vim/autoload/ 目录并编写了一个非常简单的函数: echom "Autoloading..
我正在修改已安装的 VIM 插件,并在另一个终端选项卡中测试结果。每次我想测试更改时,我都必须重新启动 VIM。 有没有更快的方法来完成这个过程?如何在 VIM 启动后重新加载 VIM 插件? 插件是
一个简单的例子: function! Foo() echom 'Starting Foo' let x = Bar(123) " Function does not exist so
有没有办法让 Vim 像带有 explorer 插件的 notepad++ 或 pspad、ultraedit 和 editplus 等其他文本编辑器一样工作? 也就是 保持文件浏览器始终在左侧(左侧
经过多次谷歌搜索后,我无法使 Vim 的代码隐藏功能与 Javascript 和 Typescript 一起使用(无需插件)。 我一直在尝试在我的 .vimrc 中使用如下行来隐藏我的代码,但没有任何
我有以下问题:在 Pycharm 中试验 vim 宏时(我使用的是 Idea Vim 插件)- 我输入了一个简单的宏并让编辑器运行它 100 次。执行速度非常慢,我无法使用 these 中的任何一个来
如何在 vim 中将字符串(4000 到 4200)替换为(5000 到 5200).. 最佳答案 另一种可能性: :%s/\v/5\1/g 这个也能做 200 次,而且由于使用了 \v switch
示例:我有一些文本,比如这个 php 代码 if(empty($condition)) { // work here... } 我的默认寄存器包含字符串“$NewCondition”。 我想将
有时我想在当前缓冲区上应用一些自定义的额外语法突出显示。 如何使用内置的 vim 语法/高亮系统来完成(我不想使用 Highlight 插件) 例如,我想突出显示当前缓冲区中的所有断言语句。 最佳答案
我有一个ora文件,它的长度为200,000行,但最后60,000行的某些行都是空白回车/空格。 我知道G会跳到文件末尾,但是我是否将vim配置为跳到非空格和非回车符的最后一行或字符? 最佳答案 G?
我想在退出vim后看到屏幕原来的内容就像打开文件之前一样,我的文件不是退出而是原始显示不存在 谢谢 最佳答案 在运行全屏应用程序后返回屏幕内容与将内容保留在那里的功能并不特定于 vi,而是特定于您的终
我是一名优秀的程序员,十分优秀!