put the following line in your ~/.bashrc
or ~/.zshrc
if you are using zsh
echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
What? your sudo command asks your password? then
sudo visudo
#add this line
your-user-name ALL=(ALL:ALL) NOPASSWD:ALL
Don't you want to set this NOPASSWD option for security reasons? then put the following line into /etc/rc.local
instead. It should work.
echo 2 > /sys/module/hid_apple/parameters/fnmode
Reference
/\cYourSearchKeywords
case insensitive
/\CYourSearchKeywords
case sensitive, which is the default behaviour
A few other ideas:
-
\c
can appear anywhere in the pattern, so if you type a pattern and then decide you wanted a case-insensitive search, just add a \c
at the end.
-
add set ignorecase
for case-insensitive searching in my vimrc, and I can use \C
to do a case-sensitive search
-
There's also set smartcase
which will automatically switch to a case-sensitive search if you use any capital letters
- Remember!
set smartcase
applies only when set ignorecase
is already active
Reference
This great article taught me how to use github actions to deploy my side project to my cheap VPS. Many thanks to the author!
Yesterday, I need to replace a string ClassName
with List<ClassName>
many times in a few files, and the ClassName varies. Manually doing it again and again is tedious and mistake prone, which is what I hate. Here's the solution
First, record a macro,
- move cursor on any letter of the target ClassName
- qa
- ysiw>
- Insert
- List
- Esc
- q
Second, replay the macro, move cursor to another occurrence of ClassName,
@a
Third, replay the same macro as many times as you want: move cursor to any other occurrences, simply type
@@
The feeling is so good to let a computer do what you want it to do!
and here's the Reference where I learnt how to use vim macro. TL;DR;
Instead of pressing backspace repeatedly, press ESC
then Backspace
.
Reference
Don't you want more? here's some
- how to delete to the end of the line?
Ctrl + k
- how to delete to the beginning of the line?
Ctrl + u
- Simply move the cursor to the line of the beginning?
Ctrl + a
Want a full list?
Here you are