'sudo' after opening the file
You open the file and find that you need the superuser privileges for writing the file. You can easily give superuser privileges after opening a file using the famous trick
:w !sudo tee % > /dev/null
Instead a better way is to declare this in your .vimrc file
cmap w!! w !sudo tee % >/dev/null
Basically the next time you just have to use 'w!!' to give the superuser privileges for the app and write it.
Happy Hacking....
Written by Rajeev N Bharshetty
Related protips
1 Response
Awesome tip, thanks for that. I'd remove the "rails" tag tho, since this tip is useful to any file type.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#