I found other articles online which mention editing ~/.bash.rc and ~./bash_profile but these are more work than necessary.
Simply use:
open -e [filename]
However, I noticed this functionality has some limitations concerning the files edited.
After trying the following commands on a secure file, it still would not save after making changes.
sudo open -e [filename] sudo chmod 777 [filename] sudo open -e [filename] sudo chown -R [currentusershortname]:staff [filename] sudo open -e [filename] su open -e [filename]
If you run into this issue where you cannot save after opening the file or any others with TextEdit, an awesome alternative and what I ultimately used is the tried and true vi.
See my “vi keyboard shortcuts quick reference” article for more info.
References
vi keyboard shortcuts quick reference, https://ronniediaz.com/2011/04/14/vi-keyboard-shortcuts-quick-reference
Leave a comment