網頁

2014年6月8日 星期日

[WorkingEnv]

~/.vimrc
set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" Plugin 'jedi-vim'
Bundle 'Valloric/YouCompleteMe'
"Bundle 'git://git.wincent.com/command-t.git'
"Plugin 'wincent/command-t'
Bundle 'git://github.com/scrooloose/syntastic.git'
Bundle 'scrooloose/nerdtree'
Bundle 'taglist.vim'


" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList          - list configured plugins
" :PluginInstall(!)    - install (update) plugins
" :PluginSearch(!) foo - search (or refresh cache first) for foo
" :PluginClean(!)      - confirm (or auto-approve) removal of unused plugins
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"
"kPlus
"
"
:imap <F5> <ESC>:w!<CR>i
:nmap <F5> <ESC>:w!<CR>

:nmap <F6> :SyntasticToggleMode<CR>


:vmap <F9> "+yy:let @+ = "<pre class='codeblock'>". @+ ."<\\pre>"<CR>  
:vmap <F8> "8yy
:vmap <F7> "7yy
:vmap <F6> "6yy
:vmap <F5> "5yy
:vmap <F4> "4yy
:vmap <F3> "3yy
:vmap <F2> "+yy:let @* = @+<CR> 

"{{{ Paste Toggle
let paste_mode = 0 " 0 = normal, 1 = paste

func! Paste_on_off()
   if g:paste_mode == 0
      set paste
      let g:paste_mode = 1
   else
      set nopaste
      let g:paste_mode = 0
   endif
   return
endfunc
"}}}

"{{{ Mouse Toggle
let mouse_mode = 0 " 0 = c, 1 = a

func! Mouse_on_off()
   if g:mouse_mode == 0
      let g:mouse_mode = 1
      set mouse=""
   else
      let g:mouse_mode = 0
      set mouse=a
   endif
   return
endfunc
"}}}

:nnoremap <silent> <C-m> :call Mouse_on_off()<CR>
:nnoremap <Esc><Esc> <Esc>:w<CR>
:inoremap <Esc><Esc> <Esc>:w<CR>

:set fdm=syntax
:set tabstop=4

:nnoremap <C-Left> :tabprevious<CR>
:nnoremap <C-Right> :tabnext<CR>
:nnoremap <silent> <A-Left> :execute 'silent! tabmove ' . (tabpagenr()-2)<CR>
:nnoremap <silent> <A-Right> :execute 'silent! tabmove ' . tabpagenr()<CR>

set cindent


inoremap {<CR>  {<CR>}<Esc>O

:highlight ExtraWhitespace ctermbg=red guibg=red
:match ExtraWhitespace /\s\+$/           




~/.tmux.conf

#tmux start \; source-file ~/.tmux.conf



set -g mode-mouse on

set -g mouse-resize-pane on

set -g mouse-select-pane on

set -g mouse-select-window on



# Toggle mouse on

bind m \

    set -g mode-mouse on \;\

    set -g mouse-resize-pane on \;\

    set -g mouse-select-pane on \;\

    set -g mouse-select-window on \;\

    display 'Mouse: ON'



# Toggle mouse off

bind M \

    set -g mode-mouse off \;\

    set -g mouse-resize-pane off \;\

    set -g mouse-select-pane off \;\

    set -g mouse-select-window off \;\

    display 'Mouse: OFF'





#bind -n C-v run-shell "tmux set-buffer \"$(xsel -o -p)\"; tmux paste-buffer" \; display-message "Pasted"

bind -n F12 run-shell "tmux set-buffer \"$(xsel -o -b)\"; tmux paste-buffer \;"
bind -n F10 run-shell "tmux save-buffer -| ~/.escape.py | xsel -i -b \;"
bind -n -r C-y run-shell "tmux save-buffer -| xsel -i -b \;"
#bind -n F12 run-shell "tmux set-buffer \"$(xsel -o -p)\" \; tmux save-buffer - | ~/.escape.py | xsel -i -b" \; display-message "Copied and traslated"



# Use vim keybindings in copy mode

setw -g mode-keys vi



bind -r k run-shell "tmux resize-pane -U 1"

bind -r j run-shell "tmux resize-pane -D 1"

bind -r h run-shell "tmux resize-pane -L 1"

bind -r l run-shell "tmux resize-pane -R 1"

bind -n -r ` run-shell "tmux last-window" # 'switch to last window'


set -g prefix C-b

~/.escape.py
#!/usr/bin/python

import sys

import django.utils.html



blP = False

line = sys.stdin.readline()

if (line):

        blP = True

        print "<pre class=\"brush:python;\">"

        print  django.utils.html.escape(line)



while line:

        line = sys.stdin.readline()

        print django.utils.html.escape(line)



if (blP):

        print "</pre>"


沒有留言:

張貼留言