% for Matching ({[...
Use % to jump between matching (, {, [, ...
No title available
Alisa U Zemlji Chuda

#extradirty
No title available
Three Goblin Art
h
KIROKAZE
No title available
Mike Driver

★

pixel skylines
Lint Roller? I Barely Know Her

Origami Around
Stranger Things

titsay
Game of Thrones Daily

No title available

Discoholic 🪩
PUT YOUR BEARD IN MY MOUTH
🪼
seen from United States
seen from United States

seen from Malaysia

seen from Malaysia

seen from Belarus
seen from United States

seen from Malaysia

seen from Japan

seen from Singapore
seen from United States
seen from Malaysia

seen from Norway
seen from United States

seen from United States

seen from Poland
seen from United States
seen from United States
seen from United States

seen from United States

seen from United Kingdom
@viiimtips-blog
% for Matching ({[...
Use % to jump between matching (, {, [, ...
w, e, b
Starting to see the usefulness of being able to move around in text with w/e/b (going forward a word, go to end of word, go back a word - respectively). It is just too much trouble to hold down the standard jkl; keys.
Pasting from OS Clipboard
" + g p
or
" + g P
Explanation: press those keys in succession. four keys (addition sign included)
Changing Font in Vim
Good link for explaining the differences in setting up your vimrc for Linux/Mac/Windows.
http://vim.runpaint.org/gui/changing-the-font/
Vim Search and Replace
I keep forgetting how to search and replace in vim so I decided to just create quick "sticky note" post.
:%s/search/replace/g -- replaces the word "search" for "replace", and the g stands for global.
:%s/search/replace/gc -- same as above but it asks for confirmation at each search/replace.
More here: http://vim.wikia.com/wiki/Search_and_replace
Copy & Paste Trick
Often you have hash keys in strings that you may need to copy many times. This can be cumbersome but thanks to vim, it's actually a fairly....efficient (correct diction?) process. Put your cursor anywhere on the string that represents the hash key and press ci' (notice the single quote at the end).
This stands for change inside some character like ' or < or { or [ etc. Now that deleted it so just go back to command mode, put your cursor wherever you want to paste and press either p or P.
Mapping for :noh
I think it's just my personal .vimrc settings but whenever I search for something in Vim, every occurrence o that word gets highlighted.
This is useful when I'm looking for something but after I've found it, I don't want the highlighting anymore. I then use the command ":noh" for no highlighting.
Too much of a hassle to type those four characters everytime so I first checked out what ctrl+n does (which seems to be just going to the next line) and then modified my .vimrc by adding the line:
map <C-n> :noh<CR>
This will run the command whereas leaving out the <CR> part would just type :noh for you and then you'd have to manually press enter.
Period to Repeat
Erm very ambiguous title haha. **Press the "period" on keyboard to repeat last command in Vim.** @@ for "colon-commands".
Delete from line number to line number.
:1,10d Deletes lines 1-10
Vim Tabs
I never knew you could vim tabs in the command line! It is in the terminal so it's basically just ascii art and shading but you can interact with it using your mouse! (if you have "set mouse=a" in your vimrc)
vim -p firstfile secondfile
Switch with the mouse or the command gt
A better overview: http://mohtasham.info/article/how-work-tabs-vim/
Commenting the beginning of Multiple Lines
To comment out a block of Perl code using the single-comment character "#":
Select block of code using Ctrl-V
Press I (capital i)
Type #
Press ESC
Deleting and Jumping
Pretty basic stuff but I didn't know all of these little "tricks" so I'm just posting them in the hopes that they'll be useful to someone.
d is for delete. 0 moves to the beginning of the line (including all whitespace). ^ moves to the first character (whitespace doesn't count as a character) of the line. $ moves to the end of the line. / searches something.
No matter where you are in a line, if you key d$ vim will delete everything from your cursor to the end of the line. Similarly, d^ deletes everything from your cursor position to the first character of the line. Lastly, d/eddie deletes everything from your cursor to the first occurrence of the string "eddie" (but not including "eddie").
ci" and cw are worth learning vim for
Two commands that totally saved my ass at work yesterday was change inside and change word.
The first command, you append either a single quote ('), double quote ("), html bracket (<), etc in order to change the text inside the character surrounding block. For example, with the text "random<hello>text" if you place your cursor at the "<" and then type "ci<", vim will automagically delete the text between the "<" and ">" and then put you in insert mode.
Change word, like its name implies, is used for changing the word your cursor is over. Like ci it'll delete the current word and put you in insert mode. You could even use cw over ci by putting your cursor over the "h" in "hello" rather than the surrounding characters (in the previous example).
Kinda hard to explain vim stuff, don't know if that was clear enough haha.
If you check out the slides of the slideshow for the new iMac at the link, if you look carefully, you'll see this isn't your typical slideshow. When you switch to the last slide with the three iMacs, each iMac actually slides into view at a different speed/time than the others, giving a cool (but very subtle) effect. Check it out.
Quick Translating in Unix bash Shell
(maketrans for you pythonistas :)) And yes, not matching the parentheses would have bothered me - blame it on Scheme.
Running the following command will replace every occurrence of 0 with u for everything you type then press Enter (key in Ctrl-D to exit):
tr '0' 'u'
Thus, using some unix command knowledge I learned from a DeCal class at UC Berkeley a simple piping addition can form a one-liner for translating text:
echo 'some random 1337 text' | tr '137' 'let'
Will output:
some random leet text
I Love Vim.
I'm always finding another reason to love vim (over emacs - haha jk).
Supposing I have the following lines of code:
title1 = line[i].split(" ")[1] title2 = line[i].split(" ")[2] title3 = line[i].split(" ")[3] title4 = line[i].split(" ")[4]
(Yes this code is inefficient, it's just an example, not even real) But then I realize that this code should actually start with the index 0. In vim, the change is as easy as...
Placing the cursor over "1"
Pressing "r0" in command mode (to replace the current character with "0" instead)
"j" to go down a line
"r1" to replace "2" with "1"
"j" to go down a line
etc.