From 59692a59763be5a5698ba0243c9bc06692b544b9 Mon Sep 17 00:00:00 2001 From: shaoying Date: Wed, 19 Sep 2018 00:47:16 +0800 Subject: [PATCH] tce add .vimrc --- Makefile | 7 +++- etc/dotsfile/.tmux.conf | 90 +++++++++++++++++++++++++++++++++++++++++ etc/dotsfile/.vimrc | 9 ++++- etc/dotsfile/.zsh_local | 16 ++++++++ 4 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 etc/dotsfile/.tmux.conf create mode 100644 etc/dotsfile/.zsh_local diff --git a/Makefile b/Makefile index 6cb5cb70..f7880995 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,6 @@ install: @go get github.com/nsf/termbox-go @go get github.com/skip2/go-qrcode @go get github.com/gomarkdown/markdown - @cp etc/go.snippets ~/.vim/snippets/ @cp etc/shy.vim ~/.vim/syntax/ @touch etc/local.shy @touch etc/local_exit.shy @@ -37,3 +36,9 @@ linux32: linux_arm: GOARCH=arm GOOS=linux go build $(BENCH) mv bench bench_1.0_linux_arm + +back_dotsfile: + cp ~/.zsh_local etc/dotsfile + cp ~/.tmux.conf etc/dotsfile + cp ~/.vimrc etc/dotsfile + diff --git a/etc/dotsfile/.tmux.conf b/etc/dotsfile/.tmux.conf new file mode 100644 index 00000000..ac7e0b53 --- /dev/null +++ b/etc/dotsfile/.tmux.conf @@ -0,0 +1,90 @@ +# 配置管理 +set -g prefix C-s + +set -g base-index 1 +set -g display-panes-time 5000 +set -g display-time 5000 +setw -g pane-base-index 1 + +set -g mode-keys vi +set -g history-limit 50000 + +bind Space command-prompt + +# 窗口管理 +bind w choose-window +bind q confirm-before kill-window + +bind c new-window + +bind o last-window +bind n next-window +bind p previous-window + +bind m command-prompt -p "move window from:,to:" "swap-window -s %% -t %%" + +bind 1 select-window -t :1 +bind 2 select-window -t :2 +bind 3 select-window -t :3 +bind 4 select-window -t :4 +bind 5 select-window -t :5 +bind 6 select-window -t :6 + +# 面板管理 +bind i display-panes +bind x confirm-before -p "kill-pane #P? (y/n)" kill-pane + +bind u split-window +bind v split-window -h + +bind C-o last-pane +bind h select-pane -L +bind l select-pane -R +bind j select-pane -D +bind k select-pane -U + +bind C-h command-prompt -p "size:" "resize-pane -L %%" +bind C-l command-prompt -p "size:" "resize-pane -R %%" +bind C-j command-prompt -p "size:" "resize-pane -D %%" +bind C-k command-prompt -p "size:" "resize-pane -U %%" +bind C-m command-prompt -p "move pane from:,to:" "swap-pane -s %% -t %%" + +# 缓存管理 +bind C-s copy-mode +bind C-d clear-history + +bind a choose-buffer +bind z paste-buffer + + +# tmux 1.x +if-shell "[ `tmux -V |cut -d' ' -f2|cut -d'.' -f1` -lt '2' ]" "\ + bind -t vi-copy e scroll-down; \ + bind -t vi-copy y scroll-up; \ + bind -t vi-copy d halfpage-down; \ + bind -t vi-copy u halfpage-up; \ + bind -t vi-copy f page-down; \ + bind -t vi-copy b page-up; \ + bind -t vi-copy v begin-selection; \ + bind -t vi-copy c copy-selection; \ + bind -t vi-edit C-n history-down; \ + bind -t vi-edit C-p history-up; \ + bind -t vi-copy Space page-down; \ + set -g mouse-select-window on; \ + set -g mouse-select-pane on; \ + set -g mouse-resize-pane on; \ + " + +# tmux 2.x +if-shell "[ `tmux -V |cut -d' ' -f2|cut -d'.' -f1` -gt '1' ]" "\ + bind -T copy-mode-vi y send-keys -X scroll-down; \ + bind -T copy-mode-vi e send-keys -X scroll-up; \ + bind -T copy-mode-vi d send-keys -X halfpage-down; \ + bind -T copy-mode-vi u send-keys -X halfpage-up; \ + bind -T copy-mode-vi f send-keys -X page-down; \ + bind -T copy-mode-vi b send-keys -X page-up; \ + bind -T copy-mode-vi v send-keys -X begin-selection; \ + bind -T copy-mode-vi c send-keys -X copy-selection; \ + set -g mouse on; \ + " + diff --git a/etc/dotsfile/.vimrc b/etc/dotsfile/.vimrc index db6da2eb..1559d589 100644 --- a/etc/dotsfile/.vimrc +++ b/etc/dotsfile/.vimrc @@ -1,12 +1,17 @@ "加载插件"{{{ call plug#begin() Plug 'vim-scripts/tComment' -Plug 'airblade/vim-gitgutter' +Plug 'tpope/vim-fugitive' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'ntpeters/vim-better-whitespace' +Plug 'easymotion/vim-easymotion' +nmap f ;;f +nmap F ;;F Plug 'vim-scripts/taglist.vim' +let g:Tlist_WinWidth=45 +let g:Tlist_Exit_OnlyWindow=1 let g:Tlist_Enable_Fold_Column=0 nnoremap :TlistToggle @@ -71,6 +76,7 @@ set hlsearch set incsearch set nowrapscan set smartcase +set ignorecase set hidden set autowrite @@ -96,6 +102,7 @@ cnoremap jk "}}} " 编程配置{{{ set keywordprg=man\ -a +command! RR wa | source ~/.vimrc |e autocmd BufNewFile,BufReadPost *.shy set filetype=shy autocmd BufNewFile,BufReadPost *.shy set commentstring=#%s diff --git a/etc/dotsfile/.zsh_local b/etc/dotsfile/.zsh_local new file mode 100644 index 00000000..1f346427 --- /dev/null +++ b/etc/dotsfile/.zsh_local @@ -0,0 +1,16 @@ +export PROMPT=$LOCAL_PROMPT'%![%*]%c$ ' +export EDITOR=vim + +alias t='tmux' +alias v='vim' +alias g='git' + +bindkey -e +bindkey jk accept-line +bindkey "^N" down-line-or-beginning-search +bindkey "^P" up-line-or-beginning-search + +bindkey -M vicmd j down-line-or-beginning-search +bindkey -M vicmd k up-line-or-beginning-search + +