Skip to content

Instantly share code, notes, and snippets.

View kasparsbergs's full-sized avatar
🍉
x2

Kaspars Bergs kasparsbergs

🍉
x2
View GitHub Profile
@nifl
nifl / grok_vi.mdown
Created August 29, 2011 17:23
Your problem with Vim is that you don't grok vi.

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

@maxlevesque
maxlevesque / build_gcc.sh
Last active May 3, 2024 23:53
how to build gcc from sources
sudo apt install libgmp-dev libmpc-dev libisl-dev libmpfr-dev
# change 6.3 to anything you'd like
wget http://mirrors-usa.go-parts.com/gcc/releases/gcc-6.3.0/gcc-6.3.0.tar.bz2
tar jxvf gcc-6.3.0.tar.bz2
mkdir objdir
cd objdir
# change /tmp/mygcc6.3 to any output folder you'd like
../gcc-6.3.0/configure --prefix=/tmp/mygcc6.3 --disable-multilib --disable-werror
make -j
make install