3 ms·
truncate -s 0 ~/.vimrc Shorter way: > ~/.vimrc
by shmerl 10y ago
truncate -s 0 ~/.vimrc
Shorter way:
> ~/.vimrc
- bigbugbag 10y agoNot really shorter as I have to Ctrl+C to get back to shell afterwards. Anyways my zsh has noclobber set so your command fails with error: zsh: file exists: ~/.vimrc
- stplsd 10y ago> ~/.vimrc works on bash, but it hangs on zsh because it treats it like cat > ~/.vimrc (> without any command in front of it is not well defined in POSIX) So portable way to do this is like this: :> ~/.vimrc
- stplsd 10y agoOr to be completely portable :> ~/.vimrc
- dotancohen 10y agoSmarter way: $ mv ~/.vimrc ~/vimrc-reference
- shmerl 10y agoI'm trying to avoid cluttering $HOME. In my case it's ~/.config/nvim/init.vim