Re:Just Use Sublime Text
by bcoates on Thursday March 21, 2013 @02:12AM
(#5413267)
Just out of curiosity, what made you decide to change? I've never felt a strong motivation to not just keep using pico/nano, actually putting effort into learning a text editor strikes me as the weirdest hobby ever.
[ Parent
| on HN ]
I used to use nano, and for me it was the fact that every one else seemed to love vim, so I felt like I should at least try it out. Honestly, it takes about 20 minutes, max, to get to the level of being able to do what nano can do in vim. And if you want something more, it's not very hard to learn after you get the vim basics. I'm not going to say it's for everyone (especially if you're already used to a full IDE) but I would encourage anyone who's at least a little interested in trying it out for a day.
It just happened to be a good time to switch, to be honest. I've migrated from Openbox to Awesome WM in the past few days, and I needed a good editor with features like syntax highlighting, line numbers and great community themes as I learned my way around rc.lua. Also, as mentioned previously, Vim has a "reputation" for being difficult to master. It interested me, and all of the Linux gurus I know seem to use it, so I figured I would give it a shot.
It isn't a hobby, it's a one-off investment. Surely anyone who programs learns a new thing every now and then?
One time I started editing an nginx.conf file in nano while setting up a remote server on Linode. I forgot to sudo when I opened the file and couldn't save my changes. I might be an idiot here but (could I have resolved this in nano?)... but I'm fairly certain this would have been a non-issue in Vim.
One simple solution that people often forget - at least I know I did in this situation is to save the file in home directory and then move it using su(do).
" Use w!! to sudo save after file is already opened
cmap w!! w !sudo tee % >/dev/null
See Nathan Long's awesome answer for an explanation:
http://stackoverflow.com/questions/2600783/how-does-the-vim-...