我想在复制时匹配上面的缩进。我可以根据顶部的缩进粘贴复制的内容吗?
源文件
call plug#begin('~/.config/nvim/plugged')
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.0' }
call plug#end()复制内容
Plug '.../...'
Plug '.../...'我想做什么
call plug#begin('~/.config/nvim/plugged')
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.0' }
| <- cursor
Plug '.../...'
Plug '.../...'
call plug#end()实际
call plug#begin('~/.config/nvim/plugged')
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.0' }
| <- cursor
Plug '.../...'
Plug '.../...' <- need to match the indentation of copying top.
call plug#end()*设置粘贴
call plug#begin('~/.config/nvim/plugged')
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.0' }
| <- cursor
Plug '.../...'
Plug '.../...'
call plug#end()发布于 2022-11-26 17:31:16
我认为您想要的是自动地重新缩进粘贴的文本,您可以使用这些映射来完成:
nnoremap p p=']^
nnoremap P P='[^p=']^所做的事情:
p -粘贴为expected='] -增强到粘贴text^的末尾-转到一行中的第一个非空白字符(与普通粘贴一样)对于P,这是相同的操作,但是向后的-因为它粘贴在光标之前。
https://stackoverflow.com/questions/74583510
复制相似问题