Ubuntu 用vim编辑文件发现交换文件的错误

用类似vim ~/.config/user-dirs 编辑文件时,发现以下这些错误提示:

Found a swap file by the name “.install.log.swp”
owned by: root dated: Sat May 1 10:52:16 2010
file name: ~root/install.log
modified: no
user name: root host name: localhost.localdomain
process ID: 14389 (still running)
While opening file “install.log”
dated: Sat Jan 30 21:31:27 2010

(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.

(2) An edit session for this file crashed.
If this is the case, use “:recover” or “vim -r install.log”
to recover the changes (see “:help recovery”).
If you did this already, delete the swap file “.install.log.swp”
to avoid this message.
“install.log” 892L, 33018C
Press ENTER or type command to continue
原因是上次修改的文件不正常退出,导致在编辑这个文件时,出现同时打开的情况。我是直接删除了里面结尾为.swp的文件,然后没有出现提示,删除命令用rm+文件名。
参考 vim错误提示解决方法

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Ubuntu中,可以使用vim编辑器来编辑文件。首先,需要将配置文件复制到当前用户的环境下,可以使用以下命令: ``` sudo cp /etc/vim/vimrc /home/your_username/.vimrc ``` 然后,创建一个.vim文件夹并在其中创建一个bundle子文件夹: ``` sudo mkdir /home/your_username/.vim sudo mkdir /home/your_username/.vim/bundle ``` 接下来,打开终端并输入以下命令以使用vim编辑文件: ``` vim filename ``` 其中,filename是您想要编辑文件的名称。这将打开一个vim编辑器窗口,您可以在其中进行编辑操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [UbuntuVIM配置成C++开发编辑器](https://download.csdn.net/download/weixin_38720461/14091572)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [ubuntu下如何正确使用vim编辑器](https://blog.csdn.net/weixin_38208741/article/details/78862368)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值