Skip to content

Instantly share code, notes, and snippets.

View nerd190's full-sized avatar
🤓
coding to music 🎵

Scott nerd190

🤓
coding to music 🎵
  • London
View GitHub Profile
@kneath
kneath / ._what.md
Created December 4, 2009 18:23
Badass git pull alias (up) to show commit log that just got pulled in addition to changes

Badass git pull alternative

Add this little snippet to your ~/.gitconfig and it amps up your git pull by means of git up

  1. Adds in a list of the commits you're pulling down
  2. Auto-prunes remote branches
  3. Defaults to pull --rebase - gets rid of unnecessary merge commits. If you don't know what rebase does, this is probably safe for you. If you know what rebase does, you should know where this will not be safe for you.

Scott Chacon and Ryan Tomayko basically figured out how to do this and I am stealing all of the credit.

@mislav
mislav / git-amend.sh
Created January 16, 2010 13:43 — forked from nachof/git-amend.sh
git amend command
#!/usr/bin/env bash
git status >/dev/null
if [ $? -ne 0 ]; then
echo "Nothing to commit. Use git add first"
exit 1
fi
TARGET=$1
BRANCH=$(git name-rev HEAD | cut -d' ' -f2)
" Sticky shift in English keyboard."{{{
" Sticky key.
inoremap <expr> ; <SID>sticky_func()
cnoremap <expr> ; <SID>sticky_func()
snoremap <expr> ; <SID>sticky_func()
function! s:sticky_func()
let l:sticky_table = {
\',' : '<', '.' : '>', '/' : '?',
\'1' : '!', '2' : '@', '3' : '#', '4' : '$', '5' : '%',
@gf3
gf3 / gist:306785
Created February 17, 2010 16:38
Sexy bash prompt
Moved to: http://github.com/gf3/dotfiles/blob/master/bash_prompt
#autoload +X
__git_files () {
local expl files ls_opts opts gitdir gitcdup
zparseopts -D -E -a opts -- -cached -deleted -modified -others -ignored -unmerged -killed
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
__git_command_successful || return
#autoload +X
__git_files () {
local expl
_wanted files expl 'file' _files
}
#autoload +X
__git_files () {
local expl files ls_opts opts gitdir gitcdup
zparseopts -D -E -a opts -- -cached -deleted -modified -others -ignored -unmerged -killed
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
__git_command_successful || return
#!zsh
# 直前のコマンドを再度実行して、その出力を補完候補するようなスクリプトです
_complete_previous_output () {
local command xs
command=${(Q)$(fc -l -n -1)}
xs=(${(f)"$(${=command})"})
_message "($command)"
#!zsh
# 直前のコマンドラインの要素を補完候補にするようなスクリプトです。
_complete_previous_commandline () {
local cl xs
cl="$(fc -l -n -1)"
xs=${(@z)cl}
compadd \
#!zsh
# コマンドライン上の今のカーソルの左の要素の展開具合を補完候補にするようなス
# クリプトです。
_expand_word_fu () {
compstate[insert]=
local origprefix=$PREFIX
case $origprefix[1] in