English 中文(简体)
六、无视觉/标志的现段
原标题:vim set ex range to current paragraph without visual/mark etc
  • 时间:2012-01-13 15:56:27
  •  标签:
  • vim

I m wanting to apply a command to the currect paragraph but I d like to automate it so I don t need to visually select/mark the paragraph before-hand.

我想像这样的东西。

:{,}s/this isn t/important/g  

(在这种情况下)

最后,我想要利用广域接受圈子进行一段改革。

是否有任何人知道如何这样做? 是否有更好的办法解决我所失踪的问题?

最佳回答
: {, }s/this isn t/important/g

见:

:h  {
问题回答

http://vimdoc.sourceforge.net/htmldoc/motion.html#object-select”rel=“nofollow” 文本物体选择载于Vim,p

To select a paragraph in visual mode, for example, to apply other commands to it, use vip or vap

If you want to exclude the first and last empty lines around the paragraph — just like the text-object "v_ip" — you can use this:

: {+1, }-1

简言之,这不会给上下一条线。 我利用这一图表对目前段落进行详细分类:

nn <leader>s mx: {+1, }-1!awk  {print length(), $0|"sort -n"} |cut -d    -f2-<cr>`x




相关问题
Autoupdate VIM Plugins?

Is it possible to update vim plugins automatically?

how to unindent in vim without leaving edit mode?

I m writing a lot of python code recently, and i used the tab-to-space mode in vim. I was just wondering how would i unindent in vim without leaving edit mode for example after i finished if...: block....

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

Vim - Deleting XML Comments

How do I delete comments in XML? If the opening and the closing comment tags are on the same line, I use :g/^<!--.*-->$/d to delete the comment. How to delete the comments that are spread ...

Limiting a match in vim to certain filetypes?

I have the following in my .vimrc to highlight lines longer than 80 chars: highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%81v.*/ This works quite well. However, the ...

Profiling Vim startup time

I’ve got a lot of plugins enabled when using Vim – I have collected plugins over the years. I’m a bit fed up with how long Vim takes to start now, so I’d like to profile its startup and see which of ...

热门标签