![]() ![]() Bonus!įor the fastest approach yet, use vim-mkdir to just automatically make the directory when it doesn't exist, with no manual intervention necessary. How many times have you seen that You how over to /etc/ to edit a config file and forget to sudo vim. For some reason the file you are writing to cannot be created or overwritten. So, when editing app/views/application/, the command expands to mkdir -p app/views/application. Running :h E212 inside Vim prints the following. ![]() %:h is the directory in which the current file is located. Once you have the file, you can then open it with a simple right click. You first need to find the file in question. What Sean does in Hands-On Backbone.js on Rails is create the directory right from Vim: :!mkdir -p %:h When you open a file, you don’t just take it to a folder and click open. ![]() Then, bring Vim back to the foreground: fg Making the directory in Vim Then, create the directory from the shell: mkdir app/views/application The error means is it can't save the file because app/views/application doesn't exist. The errorĮdit a new file in a directory that does not exist yet, such as app/views/application: :e app/views/application/Īn error will display: "app/views/application/" E212: Can't open file for writing I learned this tip watching Sean Griffin in Hands-On Backbone.js on Rails. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |