From 65dcd4b57419ee0abe69c36fd576ece13ea912d3 Mon Sep 17 00:00:00 2001 From: Ma Weiwei Date: Sun, 25 Oct 2015 22:04:12 +0800 Subject: [PATCH 1/9] Delete .zshrc --- .zshrc | 359 --------------------------------------------------------- 1 file changed, 359 deletions(-) delete mode 100755 .zshrc diff --git a/.zshrc b/.zshrc deleted file mode 100755 index 629a813c..00000000 --- a/.zshrc +++ /dev/null @@ -1,359 +0,0 @@ -#color{{{ -autoload colors -colors - -for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do -eval _$color='%{$terminfo[bold]$fg[${(L)color}]%}' -eval $color='%{$fg[${(L)color}]%}' -(( count = $count + 1 )) -done -FINISH="%{$terminfo[sgr0]%}" -#}}} - -#命令提示符 -RPROMPT=$(echo "$RED%D %T$FINISH") -PROMPT=$(echo "@$GREEN%/$_YELLOW\$ $FINISH") - -#RPROMPT=$(echo "$RED%D %T$FINISH") -#PROMPT=$(echo "$CYAN%n@$YELLOW%M:$GREEN%/$_YELLOW>$FINISH ") - -#PROMPT=$(echo "$BLUE%M$GREEN%/ -#$CYAN%n@$BLUE%M:$GREEN%/$_YELLOW>>>$FINISH ") -#标题栏、任务栏样式{{{ -case $TERM in (*xterm*|*rxvt*|(dt|k|E)term) -precmd () { print -Pn "\e]0;%n@%M//%/\a" } -preexec () { print -Pn "\e]0;%n@%M//%/\ $1\a" } -;; -esac -#}}} - -#python startup -export PYTHONSTARTUP="/home/ma6174/.pythonstartup" - -#current path-directories -#编辑器 -export EDITOR=vim -#输入法 -export XMODIFIERS="@im=ibus" -export QT_MODULE=ibus -export GTK_MODULE=ibus -#关于历史纪录的配置 {{{ -#历史纪录条目数量 -export HISTSIZE=10000 -#注销后保存的历史纪录条目数量 -export SAVEHIST=10000 -#历史纪录文件 -export HISTFILE=~/.zhistory -#以附加的方式写入历史纪录 -setopt INC_APPEND_HISTORY -#如果连续输入的命令相同,历史纪录中只保留一个 -setopt HIST_IGNORE_DUPS -#为历史纪录中的命令添加时间戳 -setopt EXTENDED_HISTORY - -#启用 cd 命令的历史纪录,cd -[TAB]进入历史路径 -setopt AUTO_PUSHD -#相同的历史路径只保留一个 -setopt PUSHD_IGNORE_DUPS - -#在命令前添加空格,不将此命令添加到纪录文件中 -#setopt HIST_IGNORE_SPACE -#}}} - -#每个目录使用独立的历史纪录{{{ -# cd() { -# builtin cd "$@" # do actual cd -# fc -W # write current history file -# local HISTDIR="$HOME/.zsh_history$PWD" # use nested folders for history -# if [ ! -d "$HISTDIR" ] ; then # create folder if needed -# mkdir -p "$HISTDIR" -# fi -# export HISTFILE="$HISTDIR/zhistory" # set new history file -# touch $HISTFILE -# local ohistsize=$HISTSIZE -# HISTSIZE=0 # Discard previous dir's history -# HISTSIZE=$ohistsize # Prepare for new dir's history -# fc -R #read from current histfile -# } -# mkdir -p $HOME/.zsh_history$PWD -# export HISTFILE="/home/ma6174/.zhistory" - -function allhistory { cat $(find $HOME/.zsh_history -name zhistory) } -function convhistory { -sort $1 | uniq | -sed 's/^:\([ 0-9]*\):[0-9]*;\(.*\)/\1::::::\2/' | -awk -F"::::::" '{ $1=strftime("%Y-%m-%d %T",$1) "|"; print }' -} -#使用 histall 命令查看全部历史纪录 -function histall { convhistory =(allhistory) | -sed '/^.\{20\} *cd/i\\' } -#使用 hist 查看当前目录历史纪录 -function hist { convhistory $HISTFILE } - -#全部历史纪录 top50 -function top50 { allhistory | awk -F':[ 0-9]*:[0-9]*;' '{ $1="" ; print }' | sed 's/ /\n/g' | sed '/^$/d' | sort | uniq -c | sort -nr | head -n 50 } - -#}}} - -#杂项 {{{ -#允许在交互模式中使用注释 例如: -#cmd #这是注释 -setopt INTERACTIVE_COMMENTS - -#启用自动 cd,输入目录名回车进入目录 -#稍微有点混乱,不如 cd 补全实用 -setopt AUTO_CD - -#扩展路径 -#/v/c/p/p => /var/cache/pacman/pkg -setopt complete_in_word - -#禁用 core dumps -limit coredumpsize 0 - -#Emacs风格 键绑定 -bindkey -e -#bindkey -v -#设置 [DEL]键 为向后删除 -#bindkey "\e[3~" delete-char - -#以下字符视为单词的一部分 -WORDCHARS='*?_-[]~=&;!#$%^(){}<>' -#}}} - -#自动补全功能 {{{ -setopt AUTO_LIST -setopt AUTO_MENU -#开启此选项,补全时会直接选中菜单项 -#setopt MENU_COMPLETE - -autoload -U compinit -compinit - -#自动补全缓存 -#zstyle ':completion::complete:*' use-cache on -#zstyle ':completion::complete:*' cache-path .zcache -#zstyle ':completion:*:cd:*' ignore-parents parent pwd - -#自动补全选项 -zstyle ':completion:*' verbose yes -zstyle ':completion:*' menu select -zstyle ':completion:*:*:default' force-list always -zstyle ':completion:*' select-prompt '%SSelect: lines: %L matches: %M [%p]' - -zstyle ':completion:*:match:*' original only -zstyle ':completion::prefix-1:*' completer _complete -zstyle ':completion:predict:*' completer _complete -zstyle ':completion:incremental:*' completer _complete _correct -zstyle ':completion:*' completer _complete _prefix _correct _prefix _match _approximate - -#路径补全 -zstyle ':completion:*' expand 'yes' -zstyle ':completion:*' squeeze-shlashes 'yes' -zstyle ':completion::complete:*' '\\' - -#彩色补全菜单 -eval $(dircolors -b) -export ZLSCOLORS="${LS_COLORS}" -zmodload zsh/complist -zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} -zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' - -#修正大小写 -zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' -#错误校正 -#zstyle ':completion:*' completer _complete _match _approximate -#zstyle ':completion:*:match:*' original only -#zstyle ':completion:*:approximate:*' max-errors 1 numeric - -#kill 命令补全 -compdef pkill=kill -compdef pkill=killall -zstyle ':completion:*:*:kill:*' menu yes select -zstyle ':completion:*:*:*:*:processes' force-list always -zstyle ':completion:*:processes' command 'ps -au$USER' - -#补全类型提示分组 -zstyle ':completion:*:matches' group 'yes' -zstyle ':completion:*' group-name '' -zstyle ':completion:*:options' description 'yes' -zstyle ':completion:*:options' auto-description '%d' -zstyle ':completion:*:descriptions' format $'\e[01;33m -- %d --\e[0m' -zstyle ':completion:*:messages' format $'\e[01;35m -- %d --\e[0m' -zstyle ':completion:*:warnings' format $'\e[01;31m -- No Matches Found --\e[0m' -zstyle ':completion:*:corrections' format $'\e[01;32m -- %d (errors: %e) --\e[0m' - -# cd ~ 补全顺序 -zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'users' 'expand' -#}}} - -##行编辑高亮模式 {{{ -# Ctrl+@ 设置标记,标记和光标点之间为 region -zle_highlight=(region:bg=magenta #选中区域 -special:bold #特殊字符 -isearch:underline)#搜索时使用的关键字 -#}}} - -##空行(光标在行首)补全 "cd " {{{ -user-complete(){ -case $BUFFER in -"" ) # 空行填入 "cd " -BUFFER="cd " -zle end-of-line -zle expand-or-complete -;; -"cd --" ) # "cd --" 替换为 "cd +" -BUFFER="cd +" -zle end-of-line -zle expand-or-complete -;; -"cd +-" ) # "cd +-" 替换为 "cd -" -BUFFER="cd -" -zle end-of-line -zle expand-or-complete -;; -* ) -zle expand-or-complete -;; -esac -} -zle -N user-complete -bindkey "\t" user-complete -#}}} - -##在命令前插入 sudo {{{ -#定义功能 -sudo-command-line() { -[[ -z $BUFFER ]] && zle up-history -[[ $BUFFER != sudo\ * ]] && BUFFER="sudo $BUFFER" -zle end-of-line #光标移动到行末 -} -zle -N sudo-command-line -#定义快捷键为: [Esc] [Esc] -bindkey "\e\e" sudo-command-line -#}}} - -#命令别名 {{{ -alias cp='cp -i' -alias mv='mv -i' -alias rm='rm -i -f' -alias ls='ls -F --color=auto' -alias ll='ls -al' -alias grep='grep --color=auto' -alias la='ls -a' -alias pacman='sudo pacman-color' -alias p='python' -alias p3='python3' -alias y='yaourt' -alias h='htop' -alias vim='sudo vim' -alias sshacm='ssh acmxs@210.44.176.195' -alias sshdb='ssh db@210.44.176.195 -p 23' -alias sshsys='ssh ma6174@211.64.20.43 -X' -alias fqr="ssh -TfnN -D 7071 512c1f5d500446d56a00009c@py-ma6174.rhcloud.com" -alias fq='ssh -TfnN -D 7070 -p 3843 winston@27.120.120.5' -alias l='ls' -alias b='bpython' -alias pi='ssh pi@192.168.1.106' -alias sl='sl -e' -alias fileftp='python -m SimpleHTTPServer' -alias r='ranger' -alias i='sudo apt-get install -y' -alias gita='git add . && git commit -a' -alias t='tmux' -alias ta='tmux a -t 0' -alias news="newsbeuter" - -#[Esc][h] man 当前命令时,显示简短说明 -alias run-help >&/dev/null && unalias run-help -autoload run-help - -#历史命令 top10 -alias top10='print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10' -#}}} - -#路径别名 {{{ -#进入相应的路径时只要 cd ~xxx -hash -d E="/etc/" -hash -d y='/home/yunio/' -hash -d p='/home/ma6174/yunio/program' -#}}} - -##for Emacs {{{ -#在 Emacs终端 中使用 Zsh 的一些设置 不推荐在 Emacs 中使用它 -#if [[ "$TERM" == "dumb" ]]; then -#setopt No_zle -#PROMPT='%n@%M %/ -#>>' -#alias ls='ls -F' -#fi -#}}} - -#{{{自定义补全 -#补全 ping -zstyle ':completion:*:ping:*' hosts 192.168.1.{1,50,51,100,101} www.google.com - -#补全 ssh scp sftp 等 -#zstyle -e ':completion::*:*:*:hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })' -#}}} - -#{{{ F1 计算器 -arith-eval-echo() { -LBUFFER="${LBUFFER}echo \$(( " -RBUFFER=" ))$RBUFFER" -} -zle -N arith-eval-echo -bindkey "^[[11~" arith-eval-echo -#}}} - -####{{{ -function timeconv { date -d @$1 +"%Y-%m-%d %T" } - -# }}} - -zmodload zsh/mathfunc -autoload -U zsh-mime-setup -zsh-mime-setup -setopt EXTENDED_GLOB -#autoload -U promptinit -#promptinit -#prompt redhat - -setopt correctall -autoload compinstall - -#漂亮又实用的命令高亮界面 -setopt extended_glob - TOKENS_FOLLOWED_BY_COMMANDS=('|' '||' ';' '&' '&&' 'sudo' 'do' 'time' 'strace') - - recolor-cmd() { - region_highlight=() - colorize=true - start_pos=0 - for arg in ${(z)BUFFER}; do - ((start_pos+=${#BUFFER[$start_pos+1,-1]}-${#${BUFFER[$start_pos+1,-1]## #}})) - ((end_pos=$start_pos+${#arg})) - if $colorize; then - colorize=false - res=$(LC_ALL=C builtin type $arg 2>/dev/null) - case $res in - *'reserved word'*) style="fg=magenta,bold";; - *'alias for'*) style="fg=cyan,bold";; - *'shell builtin'*) style="fg=yellow,bold";; - *'shell function'*) style='fg=green,bold';; - *"$arg is"*) - [[ $arg = 'sudo' ]] && style="fg=red,bold" || style="fg=blue,bold";; - *) style='none,bold';; - esac - region_highlight+=("$start_pos $end_pos $style") - fi - [[ ${${TOKENS_FOLLOWED_BY_COMMANDS[(r)${arg//|/\|}]}:+yes} = 'yes' ]] && colorize=true - start_pos=$end_pos - done - } -check-cmd-self-insert() { zle .self-insert && recolor-cmd } - check-cmd-backward-delete-char() { zle .backward-delete-char && recolor-cmd } - - zle -N self-insert check-cmd-self-insert - zle -N backward-delete-char check-cmd-backward-delete-char -export PATH=$HOME/.cabal/bin:$PATH From 421485747a42d8bb0ea7f8c5a4088c1512e6aa17 Mon Sep 17 00:00:00 2001 From: Ma Weiwei Date: Sun, 25 Oct 2015 22:07:32 +0800 Subject: [PATCH 2/9] Update .vimrc --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 90db372b..6ca03495 100644 --- a/.vimrc +++ b/.vimrc @@ -427,7 +427,7 @@ let g:indentLine_char = '┊' Bundle 'L9' Bundle 'FuzzyFinder' " non github repos -Bundle 'git://github.com/wincent/command-t.git' +Bundle 'https://github.com/wincent/command-t.git' Bundle 'Auto-Pairs' Bundle 'python-imports.vim' Bundle 'CaptureClipboard' From 3878162e531633d23fa760762cb1ac33c4632c54 Mon Sep 17 00:00:00 2001 From: zhangxiang Date: Mon, 30 Nov 2015 23:05:21 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9tags=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BD=BF=E5=85=B6=E6=94=AF=E6=8C=81=E8=87=AA=E5=8A=A8=E9=80=92?= =?UTF-8?q?=E5=BD=92=E6=9F=A5=E6=89=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index 6ca03495..7a99b752 100644 --- a/.vimrc +++ b/.vimrc @@ -364,8 +364,8 @@ let Tlist_Exist_OnlyWindow = 1 " 如果只有一个buffer,kill窗口也kill ""let Tlist_Enable_Fold_Column = 0 " 不要显示折叠树 "let Tlist_Show_One_File=1 "不同时显示多个文件的tag,只显示当前文件的 "设置tags -"set tags=tags -"set autochdir +set tags=tags; +set autochdir """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" From e9c008a80d54b90e2c3a87ab1a44ab9b6d495efd Mon Sep 17 00:00:00 2001 From: Ma Weiwei Date: Mon, 30 Nov 2015 23:19:05 +0800 Subject: [PATCH 4/9] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 52b8872b..82c75db0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ os: language: python python: - - 2.7 + - 2.7.5 script: - date From d9ec72ae842142d1b9caf7b22585653c28ebcc49 Mon Sep 17 00:00:00 2001 From: "jam.chenjun" Date: Wed, 23 Dec 2015 10:18:18 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 7a99b752..af679324 100644 --- a/.vimrc +++ b/.vimrc @@ -64,7 +64,7 @@ set tabstop=4 " 统一缩进为4 set softtabstop=4 set shiftwidth=4 -" 不要用空格代替制表符 +" 使用空格代替制表符 set expandtab " 在行和段开始处使用制表符 set smarttab From 6826f43b0061c2636f34b95c2f0a8f9cb0543851 Mon Sep 17 00:00:00 2001 From: Zhang Xiang Date: Thu, 28 Jan 2016 16:08:11 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E7=9A=84=E5=BF=AB=E6=8D=B7=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.vimrc b/.vimrc index af679324..e216cf49 100644 --- a/.vimrc +++ b/.vimrc @@ -172,6 +172,7 @@ map :tabn map! zzi map! , map ggVG$"+y +map :w map gg=G map w imap , From 16a6eaa64cefa0896f06b55bc2dfadbe2d8c8742 Mon Sep 17 00:00:00 2001 From: acelove Date: Sat, 10 Dec 2016 17:19:20 +0800 Subject: [PATCH 7/9] Update .vimrc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 支持c++11新特性 --- .vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index af679324..e47e41d6 100644 --- a/.vimrc +++ b/.vimrc @@ -205,7 +205,7 @@ func! CompileRunGcc() exec "!g++ % -o %<" exec "!time ./%<" elseif &filetype == 'cpp' - exec "!g++ % -o %<" + exec "!g++ % -std=c++11 -o %<" exec "!time ./%<" elseif &filetype == 'java' exec "!javac %" @@ -228,7 +228,7 @@ endfunc map :call Rungdb() func! Rungdb() exec "w" - exec "!g++ % -g -o %<" + exec "!g++ % -std=c++11 -g -o %<" exec "!gdb ./%<" endfunc From 681553ab66aac07596ed1bdc09e6fdac6cf572e6 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 27 Feb 2017 15:48:37 +0800 Subject: [PATCH 8/9] fix obsolete link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前的链接失效了 --- update_log.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update_log.md b/update_log.md index 888738e5..f75f4b7e 100644 --- a/update_log.md +++ b/update_log.md @@ -9,7 +9,7 @@ ### 2013年5月31日更新 - 增加400多种主题,可以在[colors](colors)目录中找到 -- 可以在[这里](http://vimcolorschemetest.googlecode.com/svn/html/index-c.html)预览 +- 可以在[这里](http://vimcolors.com/)预览 - 将`color ron`中的`ron`换成你喜欢的主题名字即可 - 重新打开vim生效 From cc26a20fe41d7dbea9c86d652b549c496598ade8 Mon Sep 17 00:00:00 2001 From: msn27149m Date: Tue, 20 Jun 2017 20:25:31 +0800 Subject: [PATCH 9/9] Update pyflakes.vim --- ftplugin/python/pyflakes.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftplugin/python/pyflakes.vim b/ftplugin/python/pyflakes.vim index 5a0b44ce..5cb1107e 100755 --- a/ftplugin/python/pyflakes.vim +++ b/ftplugin/python/pyflakes.vim @@ -267,7 +267,7 @@ EOF call setqflist(b:qf_list, 'r') else " one pyflakes quickfix window for all buffer - call setqflist(b:qf_list, '') + call setqflist(b:qf_list, ' ') let s:pyflakes_qf = s:GetQuickFixStackCount() endif endif