我正在通过SSH连接使用vim。我已经设置了数字,所以每当我尝试用鼠标复制我的代码部分时...它也会抓取数字。有没有一种好的方法可以复制文本而不带数字呢?(我知道在vim中可以使用Y,但我需要一种将其复制到其他实例和程序的方法)。
这是我所说的一个例子。
1 function foo ( home, ip, hash, regex )
2 {
3 return false;
4 }
非常感谢大家给予的建议。
我正在通过SSH连接使用vim。我已经设置了数字,所以每当我尝试用鼠标复制我的代码部分时...它也会抓取数字。有没有一种好的方法可以复制文本而不带数字呢?(我知道在vim中可以使用Y,但我需要一种将其复制到其他实例和程序的方法)。
这是我所说的一个例子。
1 function foo ( home, ip, hash, regex )
2 {
3 return false;
4 }
使用 !
切换 'number'
设置
:set nu!
运行一次可以关闭'number',再次运行该命令可以重新打开该设置。
我在我的~/.vimrc
文件中使用以下映射:
nnoremap <leader>tn :set nu! nu?<cr>
这将切换该设置,然后输出'number'
的当前值。
更多帮助请参见:
:h 'nu'
:h :set-!
If you copy and paste within Vim, there is no valid reason to not use the proper commands: y
to "yank" (copy, see :help y
) and p
to "put" (paste, see :help p
).
If you copy in remote Vim to paste in another local app, you'll have to:
:set nonumber
do your thing
:set number
You might want to verify if you are able to use "X11 Forwarding" as it enables two-way clipboard sharing.
If you copy in a local app to paste in remote Vim, you'll have to:
copy in local app
go to Vim
:set paste
Ctrl+v or Cmd+v
:set nopaste
See :help pastetoggle
for a handy mapping.
mouse
设置好了吗?:set mouse?
返回什么? - none