Skip to content

Instantly share code, notes, and snippets.

@ripples-alive
Last active March 18, 2016 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ripples-alive/38853778be70fab2f682 to your computer and use it in GitHub Desktop.
Save ripples-alive/38853778be70fab2f682 to your computer and use it in GitHub Desktop.
config files
# enable mouse mode
#set -g mode-mouse on
#set -g mouse-resize-pane on
#set -g mouse-select-pane on
#set -g mouse-select-window on
# set prefix Ctrl+k
set -g prefix ^k
# unbind prefix Ctrl+b
unbind ^b
# bind r for config reload
bind r source-file ~/.tmux.conf \; display "Reloaded!"
set -g default-terminal "screen-256color"
set -g display-time 3000
set -g history-limit 10000
set -g base-index 1
set -g pane-base-index 1
set -s escape-time 0
# set vi mode
setw -g mode-keys vi
set -g status-keys vi
# navigate panes with hjkl
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize pane
bind -r ^k resizep -U 5 # upward (prefix Ctrl+k)
bind -r ^j resizep -D 5 # downward (prefix Ctrl+j)
bind -r ^h resizep -L 10 # to the left (prefix Ctrl+h)
bind -r ^l resizep -R 10 # to the right (prefix Ctrl+l)
# swap panes
bind ^u swapp -U
bind ^d swapp -D
# Copy and paste like in vim
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
# select the last pane (prefix e)
bind e lastp
# select the last window (prefix Ctrl+e)
bind ^e last
# kill pane (prefix q)
bind q killp
# kill window (prefix Ctrl+q)
bind ^q killw
# htop (prefix !)
bind ! splitw -h htop
# man (prefix m)
bind m command-prompt "splitw -h 'exec man %%'"
#-- statusbar --#
set -g status-justify centre
set -g status-left "#[fg=green]s#S:w#I.p#P#[default]"
set -g status-left-attr bright
set -g status-left-length 20
set -g status-utf8 on
set -g status-interval 1
set -g visual-activity on
setw -g monitor-activity on
setw -g automatic-rename off
# default statusbar colors
set -g status-bg colour235 #base02
set -g status-fg colour136 #yellow
set -g status-attr default
# default window title colors
setw -g window-status-fg colour244
setw -g window-status-bg default
#setw -g window-status-attr dim
# active window title colors
setw -g window-status-current-fg colour166 #orange
setw -g window-status-current-bg default
#setw -g window-status-current-attr bright
# pane border
set -g pane-active-border-fg '#55ff55'
set -g pane-border-fg '#555555'
# message text
set -g message-bg colour235 #base02
set -g message-fg colour166 #orange
# pane number display
set -g display-panes-active-colour colour33 #blue
set -g display-panes-colour colour166 #orange
# clock
setw -g clock-mode-colour colour64 #green
set fileencodings=ucs-bom,utf-8,cp936,gbk18030,big5,euc-jp,euc-kr,latin1
syntax on
set autoindent
set cindent
set smartindent
set expandtab
set softtabstop=4
set tabstop=4
set shiftwidth=4
set backspace=2
set nobackup
set noswapfile
"set ignorecase
set hlsearch
set incsearch
set number
set nocompatible
set showmatch
set cursorline
set ruler
set history=50
map <F2> :w<CR>
map <F3> :%s/\s\+$//<CR>
"map <F7> :set filetype=masm<CR>
map <F8> :!./%< > %<.out; cat %<.out<CR>
map <F9> :!g++ -Wall -ggdb3 % -o %<<CR>
map <F12> :!./%< < %<.in > %<.out; cat %<.out<CR>
"map <C-a> ggVG
"map <C-c> "+y
"map <C-c> <ESC>:'<,'>w !xsel -i -b<CR>
"map <C-p> "+p
"map <C-y> <ESC>:'[,']w !xsel -i -b<CR>
"map <C-y> :r !xsel -o -b<CR>
":inoremap ( ()<ESC>i
":inoremap ) <c-r>=ClosePair(')')<CR>
":inoremap { {<CR>}<ESC>O
":inoremap } <c-r>=ClosePair('}')<CR>
":inoremap [ []<ESC>i
":inoremap ] <c-r>=ClosePair(']')<CR>
":inoremap " ""<ESC>i
":inoremap ' ''<ESC>i
"function ClosePair(char)
" if getline('.')[col('.') - 1] == a:char
" return "\<Right>"
" else
" return a:char
" endif
"endfunction
"set fdm=expr
"set foldexpr=MyFold(v:lnum)
"function MyFold(lnum)
" if strlen(getline(a:lnum)) == 0
" return '='
" elseif indent(a:lnum) == 0
" return 0
" else
" return 1
" endif
"endfunction
colorscheme evening
filetype indent on
autocmd filetype make setlocal noexpandtab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment