简体   繁体   English

为什么 :w 文件名不能在 vim 中写入文件

[英]why :w filename is not working to write file in vim

I was watching a tutorial in which instructor using vim for ruby on rials development.我正在观看一个教程,其中讲师使用 vim 进行 ruby​​ 开发。 He writes code on blank screen and then uses command :w hello.rb the whole code behaves like ruby code... when i try to use this command it gives an error message.他在空白屏幕上编写代码,然后使用命令:w hello.rb整个代码的行为就像 ruby​​ 代码......当我尝试使用此命令时,它给出了一条错误消息。 I searched a lot on stackoverflow.com There are some similar questions but no one works... http://vim.wikia.com/wiki/Saving_a_file and Vim Can't Save File (E212) and one solutions is :w!!我在 stackoverflow.com 上搜索了很多有一些类似的问题,但没有一个有效... http://vim.wikia.com/wiki/Saving_a_fileVim 无法保存文件(E212) ,一种解决方案是:w! ! but i want to save file as :w filename eg :w hello.rb但我想将文件另存为:w 文件名,例如:w hello.rb

Try using the following (after pressing escape) :wq!尝试使用以下命令(按 Esc 键后):wq! Should work.应该管用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 带oa缓冲区的vim插件命令 - vim plugin command w/o a buffer 为什么file.original_filename在Ruby on Rails中不起作用? - Why does file.original_filename doesn't work in Ruby on Rails? 加入文件名时为什么会出现“ Errno :: ENOENT:没有这样的文件或目录”的信息? - Why do I get “Errno::ENOENT: No such file or directory” when joining a filename? Carrierwave:保存原始文件名不起作用 - Carrierwave: Saving Original Filename not working 在rails.vim中为什么我得到“E345无法在路径中找到文件”错误? - In rails.vim why do I get “E345 can't find file in path” errors? 我该如何修复带有Rails-vim插件的vim中的'/ bin / bash /:命令未找到'? - How do I fix '/bin/bash/: command not found' in vim w/ rails-vim plugin? 从载波获取文件和文件名 - Get file and filename from carrierwave 为什么这个Ruby代码无法写入日志文件? - Why does this Ruby code fail to write to the log file? 使用rspec定义带有文件附件和测试文件上载的制造商 - Defining fabricator w/ file attachment & testing file upload w/ rspec 使用 rails.vim,当活动缓冲区为空或不是 rails 项目的文件时,为什么命令不起作用? - With rails.vim, why don't commands work when the active buffer is empty or not a file that's part of a rails project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM