在vim中,一旦用 set mouse=a 后,会和xshell中右键粘贴命令冲突。
因此,使用快捷键 F11来进行 “set mouse=a” 和 "set mouse="的切换。
为了区分什么时候可粘贴,还设置了“set numbe”。一旦没有行号的时候,代表可粘贴
if has('mouse') | 5 set nu
set mouse=a | 6 autocmd BufWritePre *.c :%s/\s\+$//e
endif | 7 autocmd BufNewFile *.cpp,*.[ch],*.sh exec ":
| call SetTitle()"
map <F11> :call Mouse()<CR> | 8 func SetTitle()
let g:mousemode=0 | 9 if &filetype == 'sh'
function Mouse() | 10 call setline(1, "##########
if g:mousemode | ############################################
:set number | ##########################")
:set nopaste | 11 call append(line("."), " # @file
:set mouse=a | ".expand("%"))
else | 12 call append(line(".")+1, " # @veris
:set number& | on v1.0.0")
:set mouse= | 13 call append(line(".")+2, " # @copyr
:set paste | ight copYRIGHT © 2020 CSG")
endif | 14 call append(line(".")+3, " # @autho
let g:mousemode=!g:mousemode | r Shenwenjuan ")
endfunction
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。