ITPub博客

首页 > Linux操作系统 > Linux操作系统 > [20150310]vim persistent undo.txt

[20150310]vim persistent undo.txt

原创 Linux操作系统 作者:lfree 时间:2015-03-10 08:10:37 0 删除 编辑

[20150310]vim persistent undo.txt

--寻找一个vim插件,上了网站,看到如下一段:

Did you know about persistent undo?

[2014-10-31] A feature I enjoy using myself is not known to many users, as I found out last weekend. Besides undo with
as many levels as you like, Vim also offers storing the undo information in a file. So you can exit Vim, reboot your
computer and still undo changes you made. See the help for 'undofile'. (Bram Moolenaar)

--才发现vim目前支持persistent undo,仔细看了一些文档,设置如下:
--在vimrc文件中加入如下内容,我的测试是windows,linux下也很容易修改.

"重启后撤销历史可用 persistent undo"
set undofile
set undodir=d:\\tmp\\undodir
"maximum number of changes that can be undone"
set undolevels=10000

--手工建立目录d:\tmp\undodir就ok了.
--这样就可以实现即使退出vim,甚至重启机器后,依旧使用undo功能,如果觉得产生的文件多,可以定期删除.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-1454224/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    4006
  • 访问量
    7971601