public
Created — forked from paulrouget/.tmux.conf

Paul's configurations files

  • Download Gist
.tmux.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
set -g default-terminal "screen-256color"
set -g status-utf8 on
 
bind M source-file ~/.tmux/mac.session
bind L source-file ~/.tmux/linux.session
 
# set -g terminal-overrides 'xterm*:smcup@:rmcup@'
 
# THEME
set -g status-bg black
set -g status-fg white
set -g status-left-length 30
set -g status-right-length 60
set -g status-left ' #[default]'
set -g status-right '#[fg=colour235]Inbox: #[fg=yellow]#(ls ~/Mails/INBOX/new | wc -l | tr -d " ")#[fg=colour235]/#(ls ~/Mails/INBOX/cur ~/Mails/INBOX/new | wc -l | tr -d " ") | Bugzilla: #[fg=yellow]#(ls ~/Mails/bugzilla/new | wc -l | tr -d " ")#[fg=colour235]/#(ls ~/Mails/bugzilla/cur ~/Mails/bugzilla/new| wc -l | tr -d " ") | ml: #[fg=yellow]#(ls ~/Mails/lists/new | wc -l | tr -d " ")#[fg=colour235]/#(ls ~/Mails/lists/cur ~/Mails/lists/new | wc -l | tr -d " ")#[default] #[fg=colour198]%H:%M#[default]'
 
setw -g window-status-format '#[fg=colour235]#I #[fg=white]#W#[default] '
#FIXME: I want to be able to use: ⮁
setw -g window-status-current-format '#[bg=white,fg=black]⮀ #W #[bg=black,fg=white]⮀'
 
######################### SCREEN BINDINGS ######################
 
# $Id: screen-keys.conf,v 1.7 2010/07/31 11:39:13 nicm Exp $
#
# By Nicholas Marriott. Public domain.
#
# This configuration file binds many of the common GNU screen key bindings to
# appropriate tmux key bindings. Note that for some key bindings there is no
# tmux analogue and also that this set omits binding some commands available in
# tmux but not in screen.
#
# Note this is only a selection of key bindings and they are in addition to the
# normal tmux key bindings. This is intended as an example not as to be used
# as-is.
 
# Set the prefix to ^A.
unbind C-b
set -g prefix ^A
bind a send-prefix
 
# Bind appropriate commands similar to screen.
# lockscreen ^X x
unbind ^X
bind ^X lock-server
unbind x
bind x lock-server
 
# screen ^C c
unbind ^C
bind ^C new-window
bind c new-window
 
# detach ^D d
unbind ^D
bind ^D detach
 
# displays *
unbind *
bind * list-clients
 
# next ^@ ^N sp n
unbind ^@
bind ^@ next-window
unbind ^N
bind ^N next-window
unbind " "
bind " " next-window
unbind n
bind n next-window
 
# title A
unbind A
bind A command-prompt "rename-window %%"
 
# other ^A
unbind ^A
bind ^A last-window
 
# prev ^H ^P p ^?
unbind ^H
bind ^H previous-window
unbind ^P
bind ^P previous-window
unbind p
bind p previous-window
unbind BSpace
bind BSpace previous-window
 
# windows ^W w
unbind ^W
bind ^W list-windows
unbind w
bind w list-windows
 
# quit \
unbind \
bind \ confirm-before "kill-server"
 
# kill K k
unbind K
bind K confirm-before "kill-window"
unbind k
bind k confirm-before "kill-window"
 
# redisplay ^L l
unbind ^L
bind ^L refresh-client
unbind l
bind l refresh-client
 
# split -v |
unbind |
bind | split-window
 
# :kB: focus up
unbind Tab
bind Tab select-pane -t:.+
unbind BTab
bind BTab select-pane -t:.-
 
# " windowlist -b
unbind '"'
bind '"' choose-window
.vimrc
VimL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
"""""""""""""""""""" PLUGINS
filetype off
 
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
 
Bundle 'gmarik/vundle'
Bundle 'matchit.zip'
Bundle 'The-NERD-Commenter'
Bundle 'vim-powerline'
Bundle 'Command-T'
 
"""""""""""""""""""" GLOBAL
let mapleader=","
colorscheme molokai
set gfn=terminus
set go=
 
syntax on
filetype plugin indent on
set encoding=utf-8
set hidden
set showcmd
set nowrap
set backspace=indent,eol,start
set autoindent
set copyindent
set number
set shiftround
set ignorecase
set smartcase
set hlsearch
set incsearch
set history=1000
set undolevels=1000
set wildignore=*.swp,*.bak
set title
set visualbell
set noerrorbells
set list
set listchars=tab:>.,trail:.,extends:#,nbsp:.
set ttyfast
set mouse=
set nocompatible
set backup
set backupdir=~/.vim_backup
set noswapfile
set fileformats=unix,dos,mac
set laststatus=2
set expandtab
set softtabstop=2 tabstop=2 shiftwidth=2
set ruler
 
"""""""""""""""""""" KEYBINDINGS
 
map cc <leader>c<space>
map # {v}! par 72<CR>
map & {v}! par 72j<CR>
map <F6> :setlocal spell! spelllang=en<CR>
map <F12> :set invhls<CR>
cmap <C-g> <C-u><ESC>
command! -bang W w<bang>
 
"""""""""""""""""""" PLUGINS
 
let g:Powerline_symbols = 'fancy'
let g:CommandTMaxFiles=5000
let g:CommandTMaxHeight=12
map <C-o> :CommandT<CR>
let g:CommandTAcceptSelectionMap = '<CR>'
let g:CommandTCancelMap = '<C-g>'
 
"""""""""""""""""""" FILES SPECIFIC
 
au BufRead mutt-* set ft=mail
au BufRead mutt-* set invhls
au bufNewFile *.html 0r ~/.vim/templates/html.txt
au BufRead,BufNewFile *.jsm setfiletype javascript
au BufRead,BufNewFile *.xul setfiletype xml
 
autocmd filetype html,xml set listchars-=tab:>.
qqq.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
#!/usr/bin/node
 
var exec = require('child_process').exec;
var fs = require('fs');
 
exec('hg root', function(err, stdout, stderr) {
if (err) throw err;
var root = stdout;
root = root.substr(0, root.length - 1);
exec('hg qqueue', function (err, stdout, stderr) {
if (err) throw err;
var queues = stdout.split("\n");
for (var i = 0; i < queues.length - 1; i++) {
var queue = queues[i];
var idx = queue.indexOf(" (active)");
if (idx > -1) {
queues[i] = {name: queue.substr(0, idx), active: true};
} else {
queues[i] = {name: queue, active: false};
}
}
delete queues[queues.length - 1];
 
var count = queues.length - 1;
queues.forEach(function(queue) {
fs.readFile(root + "/.hg/patches-" + queue.name + "/series", function (err, data) {
if (err) throw err;
queue.patches = data.toString().split("\n");
queue.patches.pop();
if (queue.active) {
fs.readFile(root + "/.hg/patches-" + queue.name + "/status", function (err, data) {
if (err) throw err;
data = data.toString().split(":");
var current = data[data.length - 1];
current = current.substr(0, current.length - 1);
queue.current = current;
count--;
if (count == 0) dump(queues);
});
} else {
count--;
if (count == 0) dump(queues);
}
});
});
});
});
 
 
 
function fg(val) { return "\033[38;5;" + val + "m"; }
function bg(val) { return "\033[48;5;" + val + "m"; }
 
function dump(queues) {
queues.forEach(function(q) {
str = q.active ? fg(15) : fg(238);
str += fixedSize(q.name, 20);
str += " - ";
if (!q.current) str += fg(238);
for (var i = 0; i < q.patches.length; i++) {
var p = q.patches[i];
str += " " + p + " ";
if (i != q.patches.length - 1) str += "⮁";
if (p == q.current) str += fg(238);
};
console.log(str);
});
}
 
function fixedSize(msg, count) {
if (msg.length > count) {
msg = msg.substr(0, count - 1);
msg += "…";
} else {
while (msg.length != count) {
msg += " ";
}
}
return msg;
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.