Ever copy something to your clipboard to NOT have it appear as you would expect in Vim? Pasting from another application to Vim yields wonky results because Vim doesn’t know how to handle the clipboard’s content. Vim has a paste mode you can toggle on or off using :set paste and :set nopaste. Vim has a one liner you can add to vimrc to transform into a Vim paste toggle: set pastetoggle=<F2>.
I like to code recklessly. Spelling errors aren’t uncommon when this happens. Defining variables and calling them in different places where I expect them to work and they DON’T work is a problem. There’s a command with Vim that’s handy for this situation. Hover your Vim cursor over the variable you instantiate and SHIFT * over it. This will highlight each variable with the same variable name, one by one. It allows you to visually see each variable and if it’s defined with accurate spelling or if you fucked up!
Your SaaS project is taking off and you’re making $$. Customers want to sell your product. Let’s utilize Rails to create affiliate links so customer accounts will sell for you. We’ll want to generate an affiliate link akin to: https://<your_hostname>/r/<affiliate_token> This is made up of a protocol, your hostname and affiliate token - in that order. Rails url helpers will pick up current request protocol and hostname for us. This will make life easier.
If your workflow consists of using Vim and commiting code with Github, you’ll often see THIS screen: AND you’ll use :wq to save and quit Vim. Awesome! Apparently :x does the EXACT.. SAME.. THING! Ugh. Save some keystrokes, folks.