Misc Tips

Misc TIPs

Git repo credential helper

To push code to your GitHub repositories, we’re going to use the recommended HTTPS method (versus SSH). So you don’t have to type your username and password everytime, let’s enable Git password caching as described here:

$ git config --global credential.helper osxkeychain

Note: On a Mac, it is important to remember to add .DS_Store (a hidden OS X system file that’s put in folders) to your .gitignore files. You can take a look at this repository’s .gitignore file for inspiration. Also check out GitHub’s collection of .gitignore templates.

Passwordless SSH

  • creat key w/ $ ssh-keygen
  • Copy key to remote host $ ssh-copy-id root@linuxconfig.org
  • Verify key with checking remote host .ssh/authorized_keys

VIM with setting mouse=a

Press shift while selecting with the mouse. This will make mouse selection behave as if mouse=a was not enabled.

Note: this trick also applies to “middle button paste”: if you want to paste in vim text that was selected outside, press shift while clicking the middle button. Just make sure that insert mode is activated when you do that (you may also want to :set paste to avoid unexpected effects).

OS X (mac): hold alt/option while selecting (source)

Written on January 24, 2018