Skip to content

Instantly share code, notes, and snippets.

@Genki-S
Genki-S / gist:5667706
Created May 29, 2013 03:08
Tmuxinator template for rails
project_name: <`1`>
project_root: <`2`>
rvm: <`3`>
pre: <`4`>
tabs:
- editor: v
- console: rails c genki
- database: rails db genki
- server: rails s -e genki
- log: tail -f log/development.log
@Genki-S
Genki-S / ins_vim.sh
Last active December 29, 2015 05:39
yum install mercurial -y
hg clone https://vim.googlecode.com/hg/ vim
cd vim
hg pull
hg update
yum install ncurses-devel -y
./configure \
--enable-gui=no \
--without-x \
# Add repositories: http://www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x
# Add EPEL repo
wget http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6*.rpm
# Add remi repo
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm
" By using NeoBundleLazy command
NeoBundleLazy "user/repo"
" By passing options to NeoBundle command
NeoBundle "user/repo", {
\ 'lazy' : 1,
\}
NeoBundle "user/repo", {
\ 'lazy' : 1,
\ 'autoload' : {
\ 'filetypes' : ['vim', 'elisp']
\ 'commands' : ['Command']
\ 'mappings' : ['<Plug>(pluign_mapping)']
\ }
\}
# Emacs like
percol.import_keymap({
"C-a" : lambda percol: percol.command.beginning_of_line(),
"C-e" : lambda percol: percol.command.end_of_line(),
"C-b" : lambda percol: percol.command.backward_char(),
"C-f" : lambda percol: percol.command.forward_char(),
"C-d" : lambda percol: percol.command.delete_forward_char(),
"C-h" : lambda percol: percol.command.delete_backward_char(),
"C-k" : lambda percol: percol.command.kill_end_of_line(),
"C-y" : lambda percol: percol.command.yank(),
function exists { which $1 &> /dev/null }
if exists percol; then
function percol_select_history() {
local tac
exists gtac && tac="gtac" || { exists tac && tac="tac" || { tac="tail -r" } }
BUFFER=$(fc -l -n 1 | eval $tac | percol --query "$LBUFFER")
CURSOR=$#BUFFER # move cursor
zle -R -c # refresh
}
#!/bin/sh
# See file status life cycle: http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository
untracked=$(git status --porcelain 2>/dev/null | grep "^??")
modified=$(git status --porcelain 2>/dev/null | grep "^ M")
staged=$(git status --porcelain 2>/dev/null | grep "^M")
if [ -n "$untracked" -o -n "$modified" -o -n "$staged" ]; then
echo "Working tree not clean." 1>&2
exit 1
#!/bin/sh
for f in $@; do
echo $f >> $(git rev-parse --show-toplevel)/.git/info/exclude
done
NeoBundleFetch 'Shougo/neobundle.vim'
NeoBundle 'Shougo/vimproc.vim', {
\ 'build' : {
\ 'windows' : 'make -f make_mingw32.mak',
\ 'cygwin' : 'make -f make_cygwin.mak',
\ 'mac' : 'make -f make_mac.mak',
\ 'unix' : 'make -f make_unix.mak',
\ },
\ }
NeoBundleLazy 'Shougo/vimfiler', {