Skip to content

Instantly share code, notes, and snippets.

View cabrinha's full-sized avatar

cabrinha

  • California
View GitHub Profile

#Vim beginner's customization guide

This article is for those who've been using Vim for a little while and have started to grasp modal editing and the powers of Vim, and now want to start customizing it. If you're completely new to Vim, there are many resources on the internet for learning it, so I'm not going to bother with that here, I'm just gonna point you here and here.

If you already have someone else's vimrc or are using a distribution like Janus or spf13 then I suggest you delete it. You likely have no idea what it does and it means nothing to you. I'm not going to explain how to use someone else's config, I'm going to attempt to walk you through the process of creating your own, which is much more rewarding, although do keep in my mind I'm really only going to give you my own opinions on the process and attempt to save you from some of the boring legwork of testing things out (which admit

@cabrinha
cabrinha / grep_awk.sh
Created June 27, 2015 23:12
I'd rather awk than grep awk...
#!/bin/bash
# You could grep root | awk {print $1}
ps aux | grep root | awk '{print $1]'
# Or you could do away with the grep entirely
ps aux | awk '/root/ {print $1}'

Typography

Headings

Headings from h1 through h6 are constructed with a # for each level:

# h1 Heading
## h2 Heading
### h3 Heading
<script>
var text = document;
var observer = new MutationObserver(function(mutations) {
mutations.every(function(mutation) {
var entry = {
mutation: mutation,
el: mutation.target,
value: mutation.target.textContent,
oldValue: mutation.oldValue
};
@cabrinha
cabrinha / xonsh.rb
Last active August 29, 2015 14:20
IT'S ALIVE!
class Xonsh < Formula
homepage "http://xonsh.org"
url "https://github.com/scopatz/xonsh/archive/0.1.5.tar.gz"
sha256 "ed04665d4396837191594f2dd9107403eabecb14add5dfbb8f4fb31e13fc03c2"
depends_on :python3
resource "ply" do
url "https://pypi.python.org/packages/source/p/ply/ply-3.6.tar.gz"
sha256 "61367b9eb2f4b819f69ea116750305270f1df8859992c9e356d6a851f25a4b47"
@cabrinha
cabrinha / tree.txt
Created May 2, 2015 00:09
tree of the xonsh hier
[ realeyes@psyche ~/devel/brew/xonsh ]$ tree
.
├── xonsh-0.1.0.tar.gz
└── xonsh-master
├── CONTRIBUTING -> docs/devguide.rst
├── README.rst
├── docs
│   ├── Makefile
│   ├── _static
│   │   ├── ascii_conch.png
@cabrinha
cabrinha / .vimrc
Created April 16, 2015 15:14
vim config
"set nu " Enable line numbers
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=indent,eol,start " make backspace a more flexible
set backup " Make vim write a backup file
" Don't write backup file if vim is being called by "crontab -e"
au BufWrite /private/tmp/crontab.* set nowritebackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup
@cabrinha
cabrinha / install_these_things.sh
Last active August 29, 2015 14:19
Install script for FreeBSD 10.1
#!/bin/sh
export BATCH=yes # Dont prompt me bro
freebsd-update fetch # fetch the update
freebsd-update install # install the update
portsnap fetch extract update # extract and update the ports
cd /usr/ports/editors/vim-lite && make all install clean
cd /usr/ports/shells/bash && make all install clean
cd /usr/ports/dns/bind-tools && make all install clean
cd /usr/ports/net/rsync && make all install clean
cd /usr/ports/editors/joe && make all install clean # who uses joe? lol
@cabrinha
cabrinha / to-do-list.txt
Created April 13, 2015 20:34
To-DO List
1. install vagrant
2. install virtualbox
3. create new vagrant env (create new dir, maybe /Users/scott/vagrant/centos for a centos virtual machine)
4. initialize a vagrant instance in that directory
5. modify the new Vagrantfile to use virtualbox as your virtual machine type
6. create a bootstrap.sh script in this new directory
7. configure the Vagrantfile to use the bootstrap.sh on full boot
8. add commands to the bootstrap.sh to help build your environment
@cabrinha
cabrinha / ud.pl
Created April 3, 2015 18:33
sub => ud
use Mojo::URL;
use Mojo::UserAgent;
my $term = 'wtf';
my $url = Mojo::URL->new('http://api.urbandictionary.com/v0/define')->query(term => $term);
my $tx = Mojo::UserAgent->new->get($url);
if ($tx->success) {
my $results = $tx->res->json;
my $definitions = $results->{list};