Skip to content

Instantly share code, notes, and snippets.

@reecer
Forked from paulrouget/.tmux.conf
Last active August 29, 2015 14:14

Revisions

  1. Paul Rouget revised this gist Feb 15, 2012. 1 changed file with 45 additions and 5 deletions.
    50 changes: 45 additions & 5 deletions .vimrc
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,7 @@ call vundle#rc()
    Bundle 'gmarik/vundle'
    Bundle 'matchit.zip'
    Bundle 'The-NERD-Commenter'
    Bundle 'The-NERD-tree'
    Bundle 'vim-powerline'
    Bundle 'Command-T'

    @@ -33,7 +34,6 @@ set hlsearch
    set incsearch
    set history=1000
    set undolevels=1000
    set wildignore=*.swp,*.bak
    set title
    set visualbell
    set noerrorbells
    @@ -50,6 +50,8 @@ set laststatus=2
    set expandtab
    set softtabstop=2 tabstop=2 shiftwidth=2
    set ruler
    set wildignore=*.swp,*.bak
    set wildmode=longest,list

    """""""""""""""""""" KEYBINDINGS

    @@ -63,19 +65,57 @@ command! -bang W w<bang>

    """""""""""""""""""" PLUGINS

    let g:Powerline_symbols = 'fancy'
    "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
    let NERDChristmasTree = 1
    let NERDTreeSortOrder = ['\/$', '\.js*', '\.cpp$', '\.h$', '*']
    nmap <c-b> :NERDTreeToggle<cr>
    nmap <C-n> <c-w><left><down><c-w><c-w>
    nmap <C-p> <c-w><left><up><c-w><c-w>
    nmap <C-o> <c-w><left><CR>
    """""""""""""""""""" FILES SPECIFIC
    au BufRead mutt-* set ft=mail
    au BufRead mutt-* set invhls
    au bufNewFile *.html 0r ~/.vim/templates/html.txt
    au BufNewFile *.html 0r ~/.vim/templates/html.txt
    au BufRead,BufNewFile *.jsm setfiletype javascript
    au BufRead,BufNewFile *.xul setfiletype xml
    au filetype html,xml set listchars-=tab:>.

    """""""""""""""""""" CUSTOM FUNCTIONS

    """ Toggle relative/absolute numbering
    function! NumberToggle()
    if(&relativenumber == 1)
    set number
    else
    set relativenumber
    endif
    endfunc

    nnoremap <F10> :call NumberToggle()<cr>
    autocmd filetype html,xml set listchars-=tab:>.
    """ FocusMode
    function! ToggleFocusMode()
    if (&foldcolumn != 12)
    set laststatus=0
    set numberwidth=10
    set foldcolumn=12
    set noruler
    hi FoldColumn ctermbg=none
    hi LineNr ctermfg=0 ctermbg=none
    hi NonText ctermfg=0
    else
    set laststatus=2
    set numberwidth=4
    set foldcolumn=0
    set ruler
    execute 'colorscheme ' . g:colors_name
    endif
    endfunc
    nnoremap <F1> :call ToggleFocusMode()<cr>
  2. Paul Rouget revised this gist Jan 27, 2012. 1 changed file with 0 additions and 120 deletions.
    120 changes: 0 additions & 120 deletions .ls_colors
    Original file line number Diff line number Diff line change
    @@ -1,120 +0,0 @@
    ##################-*-sh-*-#
    # LS_COLORS configuration #
    ###########################

    export LS_COLORS=""

    add() {
    C="$2"
    if [[ $# -gt 2 && "$TERM" != xterm-256color ]]; then
    C="$3"
    fi
    if [[ $C = 9* && "$TERM" = linux ]]; then
    C="1;3${C#9}"
    fi
    LS_COLORS="$LS_COLORS$1=$C:"
    }

    add no 0 # Normal (non-filename) text
    add fi 0 # Regular file
    #add hl 37\;44 # Regular file with more than one link (hardlink)
    add ln 96 # Symbolic link
    add or 91\;40 # Orphaned symbolic link (defaults to ln)
    # add mi # Missing file (visible when you type ls -l) (defaults to fi)
    add pi 33 # Named pipe (FIFO)
    add so 95 # Socket
    add do 95 # Door ??
    add bd 93 # Block device
    add cd 93 # Character device
    add di 94 # Directory (-t,o-w)
    add tw 30\;42 # Directory that is sticky and other-writable (+t,o+w)
    add ow 34\;42 # Directory that is other-writable and not sticky (-t,o+w)
    add st 37\;44 # Directory with the sticky bit set and not other-writable (+t,o-w)
    add ex 92 # Executable file
    add su 37\;41 # File that is setuid (u+s)
    add sg 30\;43 # File that is setgid (g+s)
    add ca 30\;41 # File with capability ??
    # lc ^[[ # Left code
    # rc m # Right code
    # ec # End code (replaces lc+no+rc)
    # rs 0 # Reset code

    # Archives
    for i in zip rar ace tar z Z gz bz2 xz taz tgz tbz txz; do
    add "*.$i" 31
    done
    # Packages
    for i in deb rpm jar; do
    add "*.$i" 91
    done

    ## Medias
    # Pictures
    for i in jpg JPG jpeg gif bmp pbm pgm ppm png tga xbm xpm tif tiff xcf xwd; do
    add "*.$i" 37
    done
    # Video
    for i in avi mpg mpeg mov fli; do
    add "*.$i" 95
    done
    # Sound
    for i in ogg mp3 wav; do
    add "*.$i" 95
    done

    ## Documents
    # Textual documents
    for i in dvi ps pdf html htm rtf txt log tex; do
    add "*.$i" 37
    done
    add \*README 36
    add \*TODO 36
    # Office Documents (50, 44, 38, 32)
    #for i in odt doc docx odp ppt pptx ods xls xlsx; do
    # add "*.$i" 36
    #done

    for i in odt doc docx; do
    add "*.$i" "38;5;50" 36
    done
    for i in odp ppt pptx; do
    add "*.$i" "38;5;44" 36
    done
    for i in ods xls xlsx; do
    add "*.$i" "38;5;38" 36
    done


    ## Developement
    # Sources
    #for i in cpp cxx cc c C h hxx sh awk pl rb py; do
    # add "*.$i" 33
    #done
    for i in js cpp cxx cc c C; do
    add "*.$i" "38;5;202" 37
    done
    for i in h hxx; do
    add "*.$i" "38;5;208" 33
    done
    for i in sh awk pl rb py; do
    add "*.$i" "38;5;214" 33
    done

    add \*.in "38;5;228" 93
    add \*.am "38;5;228" 93
    add \*.ac "38;5;228" 93
    add \*.mk "38;5;227" 93
    add \*Makefile "38;5;226" 93
    add \*Kconfig "38;5;227" 93
    add \*Kbuild "38;5;227" 93
    # TODO: *.patch *.diff

    # Objects
    for i in so o a pyc; do
    add "*.$i" 32
    done

    # Dirty
    add \*~ 90
    add \*# 90
    add \*.orig 90
  3. Paul Rouget revised this gist Jan 27, 2012. 1 changed file with 80 additions and 0 deletions.
    80 changes: 80 additions & 0 deletions qqq.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,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;
    }
  4. Paul Rouget created this gist Jan 27, 2012.
    120 changes: 120 additions & 0 deletions .ls_colors
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,120 @@
    ##################-*-sh-*-#
    # LS_COLORS configuration #
    ###########################

    export LS_COLORS=""

    add() {
    C="$2"
    if [[ $# -gt 2 && "$TERM" != xterm-256color ]]; then
    C="$3"
    fi
    if [[ $C = 9* && "$TERM" = linux ]]; then
    C="1;3${C#9}"
    fi
    LS_COLORS="$LS_COLORS$1=$C:"
    }

    add no 0 # Normal (non-filename) text
    add fi 0 # Regular file
    #add hl 37\;44 # Regular file with more than one link (hardlink)
    add ln 96 # Symbolic link
    add or 91\;40 # Orphaned symbolic link (defaults to ln)
    # add mi # Missing file (visible when you type ls -l) (defaults to fi)
    add pi 33 # Named pipe (FIFO)
    add so 95 # Socket
    add do 95 # Door ??
    add bd 93 # Block device
    add cd 93 # Character device
    add di 94 # Directory (-t,o-w)
    add tw 30\;42 # Directory that is sticky and other-writable (+t,o+w)
    add ow 34\;42 # Directory that is other-writable and not sticky (-t,o+w)
    add st 37\;44 # Directory with the sticky bit set and not other-writable (+t,o-w)
    add ex 92 # Executable file
    add su 37\;41 # File that is setuid (u+s)
    add sg 30\;43 # File that is setgid (g+s)
    add ca 30\;41 # File with capability ??
    # lc ^[[ # Left code
    # rc m # Right code
    # ec # End code (replaces lc+no+rc)
    # rs 0 # Reset code

    # Archives
    for i in zip rar ace tar z Z gz bz2 xz taz tgz tbz txz; do
    add "*.$i" 31
    done
    # Packages
    for i in deb rpm jar; do
    add "*.$i" 91
    done

    ## Medias
    # Pictures
    for i in jpg JPG jpeg gif bmp pbm pgm ppm png tga xbm xpm tif tiff xcf xwd; do
    add "*.$i" 37
    done
    # Video
    for i in avi mpg mpeg mov fli; do
    add "*.$i" 95
    done
    # Sound
    for i in ogg mp3 wav; do
    add "*.$i" 95
    done

    ## Documents
    # Textual documents
    for i in dvi ps pdf html htm rtf txt log tex; do
    add "*.$i" 37
    done
    add \*README 36
    add \*TODO 36
    # Office Documents (50, 44, 38, 32)
    #for i in odt doc docx odp ppt pptx ods xls xlsx; do
    # add "*.$i" 36
    #done

    for i in odt doc docx; do
    add "*.$i" "38;5;50" 36
    done
    for i in odp ppt pptx; do
    add "*.$i" "38;5;44" 36
    done
    for i in ods xls xlsx; do
    add "*.$i" "38;5;38" 36
    done


    ## Developement
    # Sources
    #for i in cpp cxx cc c C h hxx sh awk pl rb py; do
    # add "*.$i" 33
    #done
    for i in js cpp cxx cc c C; do
    add "*.$i" "38;5;202" 37
    done
    for i in h hxx; do
    add "*.$i" "38;5;208" 33
    done
    for i in sh awk pl rb py; do
    add "*.$i" "38;5;214" 33
    done

    add \*.in "38;5;228" 93
    add \*.am "38;5;228" 93
    add \*.ac "38;5;228" 93
    add \*.mk "38;5;227" 93
    add \*Makefile "38;5;226" 93
    add \*Kconfig "38;5;227" 93
    add \*Kbuild "38;5;227" 93
    # TODO: *.patch *.diff

    # Objects
    for i in so o a pyc; do
    add "*.$i" 32
    done

    # Dirty
    add \*~ 90
    add \*# 90
    add \*.orig 90
    123 changes: 123 additions & 0 deletions .tmux.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,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
    81 changes: 81 additions & 0 deletions .vimrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,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:>.