You are here

Software profiles

Shells and editors configuration

This is part of my shell configuration

FreeBSD

This configuration allow, when using tmux:

  • Ctrl+arrow to move around words in tcsh and zsh
  • Ctrl+arrow to move around words in vim
  • Shift+arrow to selects characters in vim
  • Ctrl+Shift+arrow to selects words in vim
  • Many other things

~/.vimrc

set nocompatible
set tabstop=4
set shiftwidth=2
set showmatch
set guioptions-=T
set vb t_vb=
set ruler
set nohls
set incsearch
set virtualedit=all
set bs=2

syntax on
colorscheme zenburn
if !empty($TMUX)
    if &term =~ 'xterm-256color'
      " Disable Background Color Erase (BCE) so that color schemes
      " work properly when Vim is used inside tmux and GNU screen.
      " See also http://snk.tuxfamily.org/log/vim-256color-bce.html
      set term=cons25
      set t_ut=
      set t_Co=256

      "Ctrl + Arrows => Move fast
      map ^[[1;5C w
      map ^[[1;5D b
      imap ^[[1;5C w
      imap ^[[1;5D b
      "Del => Delete
      map ^[[3~ x
      imap ^[[3~ x

      "Shift + Arrow => Select
      map      ^[[1;2A vk
      map      ^[[1;2B vj
      map      ^[[1;2D vh
      map      ^[[1;2C vl
      inoremap ^[[1;2A vk
      vnoremap ^[[1;2A k
      inoremap ^[[1;2B vj
      vnoremap ^[[1;2B j
      inoremap ^[[1;2C vl
      vnoremap ^[[1;2C l
      inoremap ^[[1;2D vh
      vnoremap ^[[1;2D h

      "Simple arrows in visual mode gets back to normal mode
      vnoremap ^[[C vl
      vnoremap ^[[D vh
      vnoremap ^[[A vk
      vnoremap ^[[B vj

      "Shift + Select + Arrow => Select fast
      map      ^[[1;6C vw
      map      ^[[1;6D vb
      map      ^[[1;6A vk
      map      ^[[1;6B vj
      inoremap ^[[1;6C vw
      inoremap ^[[1;6D vb
      inoremap ^[[1;6A vk
      inoremap ^[[1;6B vj
      vnoremap ^[[1;6C w
      vnoremap ^[[1;6D b
      vnoremap ^[[1;6A k
      vnoremap ^[[1;6B j

      "End, Home
      map      ^[[F $
      map      ^[[H 0
      inoremap ^[[F $
      inoremap ^[[H 0
      vnoremap ^[[F $
      vnoremap ^[[H 0
      "Ctrl + End, Home => Document Start, End
      map      ^[[1;5F G
      map      ^[[1;5H gg
      inoremap ^[[1;5F G
      inoremap ^[[1;5H gg
      vnoremap ^[[1;5F G
      vnoremap ^[[1;5H gg
      map      ^[[1;2F v$
      map      ^[[1;2H v0
      inoremap ^[[1;2F v$
      inoremap ^[[1;2H v0
      vnoremap ^[[1;2F $
      vnoremap ^[[1;2H 0

      "PgUp, PgDown
      map      ^[[5~ 
      map      ^[[6~ 

      " backspace in Visual mode deletes selection
      vnoremap ^? d

    endif
else
    if &term =~ 'xterm-256color'
        set t_Co=256
        map ^[[C w
        map ^[[D b
        imap ^[[C w
        imap ^[[D b
    endif
endif

ZenBurn Color scheme

.cshrc, relevant parts

if ( $?tcsh ) then
        bindkey "^W" backward-delete-word
        bindkey -k up history-search-backward
        bindkey -k down history-search-forward
        bindkey "^[[1;5D" backward-word
        bindkey "^[[1;5C" forward-word
endif

.zshrc, relevant parts

bindkey "^[OD" backward-word
bindkey "^[OC" forward-word
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
bindkey "^[[3~" delete-char

.tmux.conf, relevant parts

set -g default-terminal "xterm-256color-tmuxed-zwm"
set -g terminal-overrides "xterm*:colors=256:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC"
set-option -gw xterm-keys on

To get the full, experience, you need to SSH to your box using Futty.

Be sure to use a version with Ctrl+Shift+Keys enabled.

See: http://code.google.com/p/futty/issues/detail?id=23

Software profile : tmux

Here is my tmux profile files. I use them mainly on FreeBSD.

Simple configuration

Tmux configuration: simple

.tmux.conf

#~/.tmux.conf
#revision 100829
set-window-option -g mode-keys vi

#set -g default-terminal "screen-256color"
set -g history-limit 1000

set -g status-left '#H:'
set-window-option -g window-status-current-fg red
#set -g status-bg black
#set -g status-fg white

unbind C-b
set -g prefix C-a

unbind C-t
bind C-t new-window

bind C-a last-window

unbind NPage
bind NPage next-window
unbind PPage
bind PPage previous-window

unbind C-[
bind-key = copy-mode

unbind C-]
bind-key ) paste-buffer

#set-option -g mouse-select-pane on
#setw -g mode-mouse on

Advanced configuration: user

Image

.tmux.conf

#~/.tmux.conf
#revision 121001
set-window-option -g mode-keys vi

#set -g default-terminal "screen-256color"
set -g history-limit 1000

# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg colour166 #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01
# message text
set-option -g message-bg colour235 #base02
set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour64 #green

set-option -g status on
set-option -g status-utf8 on
set-option -g status-interval 2
set-option -g status-left-length 60
set-option -g status-right-length 90
set-option -g status-right "#(~/.tmux.status_right.sh)"
set-option -g status-left  "#(~/.tmux.status_left.sh)"
#set-window-option -g window-status-current-fg red
#set -g status-bg black
#set -g status-fg white

unbind C-b
set -g prefix C-a

unbind C-t
bind C-t new-window

bind C-a last-window

unbind NPage
bind NPage next-window
unbind PPage
bind PPage previous-window

unbind C-[
bind-key = copy-mode

unbind C-]
bind-key ) paste-buffer

.tmux.status_left.sh

#!/bin/sh
HOSTNAME=`hostname`
WHOAMI=`whoami`

echo -n "#[fg=colour234, bg=colour27]$HOSTNAME \
#[fg=colour27, bg=colour33]⮀#[fg=colour0,bg=colour33] $WHOAMI \
#[fg=colour33, bg=colour235]⮀ \
"

.tmux.status_right.sh

#!/bin/sh
IP4ETH0=`ifconfig em0 | grep -E 'inet.[0-9]' | grep -v '127.0.0.1' | awk '{ print $2}'`
DATE1=`date +'%a'`
DATE2=`date +'%Y-%m-%d'`
DATE3=`date +'%H:%M'`

echo -n "#[fg=colour237, bg=colour235]⮂\
#[fg=colour97, bg=colour237] $IP4ETH0 ⮃ 91.217.154.93 \
#[fg=colour235, bg=colour237]⮂#[fg=colour136, bg=colour235] $DATE1 ⮃ $DATE2 ⮃ $DATE3 \
"

Advanced configuration: root

Image

.tmux.conf

#~/.tmux.conf
#revision 121001
set-window-option -g mode-keys vi

#set -g default-terminal "screen-256color"
set -g history-limit 1000

# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg colour166 #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01
# message text
set-option -g message-bg colour235 #base02
set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour64 #green

set-option -g status on
set-option -g status-utf8 on
set-option -g status-interval 2
set-option -g status-left-length 60
set-option -g status-right-length 90
set-option -g status-right "#(~/.tmux.status_right.sh)"
set-option -g status-left  "#(~/.tmux.status_left.sh)"
#set-window-option -g window-status-current-fg red
#set -g status-bg black
#set -g status-fg white

unbind C-b
set -g prefix C-a

unbind C-t
bind C-t new-window

bind C-a last-window

unbind NPage
bind NPage next-window
unbind PPage
bind PPage previous-window

unbind C-[
bind-key = copy-mode

unbind C-]
bind-key ) paste-buffer

.tmux.status_left.sh

#!/bin/sh
HOSTNAME=`hostname`
WHOAMI=`whoami`

echo -n "#[fg=colour234, bg=colour124]$HOSTNAME \
#[fg=colour124, bg=colour196]⮀#[fg=colour0,bg=colour196] $WHOAMI \
#[fg=colour196, bg=colour235]⮀ \
"

.tmux.status_right.sh

#!/bin/sh
IP4ETH0=`ifconfig em0 | grep -E 'inet.[0-9]' | grep -v '127.0.0.1' | awk '{ print $2}'`
DATE1=`date +'%a'`
DATE2=`date +'%Y-%m-%d'`
DATE3=`date +'%H:%M'`

echo -n "#[fg=colour237, bg=colour235]⮂\
#[fg=colour97, bg=colour237] $IP4ETH0 ⮃ 91.217.154.93 \
#[fg=colour235, bg=colour237]⮂#[fg=colour136, bg=colour235] $DATE1 ⮃ $DATE2 ⮃ $DATE3 \
"
Subscribe to Software profiles