Hacker News new | past | comments | ask | show | jobs | submit login

Why I do 'touch' first: I'm in vim creating the file, then I try to save and discover I don't have write permissions [1].

With a touch first, saving the file always works.

1: https://www.cyberciti.biz/faq/vim-vi-text-editor-save-file-w...




That's a good tip!

Sadly it does not save me from going and editing a system file as non-root and then trying to save... :(


You could have a function that writes contents of buffer to current path as root in your editor of choice.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: