I always thought the fact that Vim had automatic buffer copying and forced me to use "0p instead of p was really annoying. Looks like there is an actual reason for it after all :)
(Apologies if I’m misunderstanding and you already know this.)
Not specifying a register (e.g. "0) just means the commands, including x and p, will use the " register, aka the unnamed register. By itself, p is equivalent to ""p. :reg shows you all the registers and their current contents. This seems like a good description: https://www.brianstorti.com/vim-registers/ Edit: Oh I guess you are saying it was unexpected that delete or change commands clobber yanked contents of the unnamed register.
This is if you have emacs-based keybindings (which is the default). M-f/M-b (Meta, often the alt key or option key) will move forward/backward a full word. C-f/C-b moves forward/backward a character. C-w kills the previous word (if you're in the middle of a word it leaves everything from the cursor to the end intact).
C-r will search backward in your history allowing you to type partial matches (like, "I know I compiled foo.c, but what options did I use?" type `C-r foo.c` and repeatedly type C-r until I find the compiler command I used). https://www.gnu.org/software/bash/manual/html_node/Bindable-... - for a lot more options You can switch to vi keybindings with `set -o vi`.
Here's mine, the Pareto principle or the 80/20 rule. You will find that it applies in MANY ascpects of life and knowing it may give you an `edge'.
https://en.wikipedia.org/wiki/Pareto_principle
Here is my favorite mental-model for problem solving (and my favorite analogy) So I have this problem: I love eating scramble eggs, I hate cleaning up the pan and have been trying over the years many different techniques to make sure the egg's doesn't stick to the pan. (No I don't want teflon thanks). So I tried different oils, temperatures and techniques, all with the goal of getting those delicious eggs not to stick in my pot/pan afterwards. Then one day it hit me, I'm solving the wrong problem. The problem to be solved is not "EGGS NOT STICKING TO PAN", it's "FINDING A BETTER WAY TO CLEAN" the pan ! And I have found it, it's using a different type of plastic-scrubber. It looks like steel-wool, but it's all plastic. So whenever I'm stuck on a problem for too long, I try and model the problem as an "eggs-in-pan" problem statement.
First I put oil in the pan and let it heat up.
Once it is hot, I pour the scrambled egg on it.
Use my spoon, fork, whatever to distribute and turn.
then I tip over the pan get the eggs onto my plate. My pan has a nice feature to make pouring it out easier. Usually nothing has stuck to the pan. It is key to heat the pan and the oil first. If something sticks, whilst still hot, pour some water on it.
It will result in a satifsying bubbling that usually will get
any residue out. Dry with a (paper) towel or whatever else you use. I usually drip a little oil in the pan before I put it away. If that sounds complicated it realy is not.
Once you do it a few times it takes up little time
and is fairly reliable. Another good tip is make sure you use the right oil.
Use oil that is mean for high heat.
I had a girlfriend in Amsterdam who taught me to make scrambled eggs in a double boiler. This keeps the eggs at the temperature of boiling water. The result is so much better (light and fluffy) that you will never use your skillet again. I have heard that there are special large double boilers that are used to prepare scrambled eggs for restaurants, but I have never seen one.
Comments (762) 128 threads
Earlier commentsCtrl-T does the same in emacs, and also in readline based programs like bash, as well as everywhere on macOS.
I always thought the fact that Vim had automatic buffer copying and forced me to use "0p instead of p was really annoying. Looks like there is an actual reason for it after all :)
Not specifying a register (e.g. "0) just means the commands, including x and p, will use the " register, aka the unnamed register. By itself, p is equivalent to ""p.
:reg shows you all the registers and their current contents.
This seems like a good description: https://www.brianstorti.com/vim-registers/
Edit: Oh I guess you are saying it was unexpected that delete or change commands clobber yanked contents of the unnamed register.
C-r will search backward in your history allowing you to type partial matches (like, "I know I compiled foo.c, but what options did I use?" type `C-r foo.c` and repeatedly type C-r until I find the compiler command I used).
https://www.gnu.org/software/bash/manual/html_node/Bindable-... - for a lot more options
You can switch to vi keybindings with `set -o vi`.
(Never used macOS. Welp. Guess I have a lot of relearning to do.)
In theory, there's no difference between the theory and the practice.
In practice, there is.
Here is my favorite mental-model for problem solving (and my favorite analogy)
So I have this problem:
I love eating scramble eggs, I hate cleaning up the pan and have been trying over the years many different techniques to make sure the egg's doesn't stick to the pan. (No I don't want teflon thanks).
So I tried different oils, temperatures and techniques, all with the goal of getting those delicious eggs not to stick in my pot/pan afterwards.
Then one day it hit me, I'm solving the wrong problem. The problem to be solved is not "EGGS NOT STICKING TO PAN", it's "FINDING A BETTER WAY TO CLEAN" the pan !
And I have found it, it's using a different type of plastic-scrubber. It looks like steel-wool, but it's all plastic.
So whenever I'm stuck on a problem for too long, I try and model the problem as an "eggs-in-pan" problem statement.
First I put oil in the pan and let it heat up. Once it is hot, I pour the scrambled egg on it. Use my spoon, fork, whatever to distribute and turn. then I tip over the pan get the eggs onto my plate.
My pan has a nice feature to make pouring it out easier.
Usually nothing has stuck to the pan.
It is key to heat the pan and the oil first.
If something sticks, whilst still hot, pour some water on it. It will result in a satifsying bubbling that usually will get any residue out.
Dry with a (paper) towel or whatever else you use.
I usually drip a little oil in the pan before I put it away.
If that sounds complicated it realy is not. Once you do it a few times it takes up little time and is fairly reliable.
Another good tip is make sure you use the right oil. Use oil that is mean for high heat.
.
All comments shown.
Couldn't load more comments. Check your connection and try again.