Skip to content

Commit

Permalink
fix astyle bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ma6174 committed May 27, 2013
1 parent b987401 commit 13648b5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func SetTitle()
call append(line(".")+6, "")
elseif &filetype == 'python'
call setline(1,"#!/usr/bin/env python")
call append(line("."),"#coding=utf-8")
call append(line("."),"# coding=utf-8")
call append(line(".")+1, "")
" elseif &filetype == 'mkd'
" call setline(1,"<head><meta charset=\"UTF-8\"></head>")
Expand Down Expand Up @@ -157,7 +157,7 @@ nnoremap <F2> :g/^\s*$/d<CR>
"比较文件
nnoremap <C-F2> :vert diffsplit
"列出当前目录文件
map <F3> :NERDTree .<CR>
map <F3> :NERDTree<CR>
"打开树状文件目录
map <C-F3> \be
:autocmd BufRead,BufNewFile *.dot map <F5> :w<CR>:!dot -Tjpg -o %<.jpg % && eog %<.jpg <CR><CR> && exec "redr!"
Expand Down Expand Up @@ -202,13 +202,13 @@ endfunc

"代码格式优化化

map <F6> :call FormartSrc()<CR>
map <F6> :call FormartSrc()<CR><CR>
"定义FormartSrc()
func FormartSrc()
exec "w"
if &filetype == 'c'
exec "!astyle --style=ansi --one-line=keep-statements -a --suffix=none %"
exec "!astyle --style=ansi -a --suffix=none %"
elseif &filetype == 'cpp' || &filetype == 'hpp'
exec "r !astyle --style=ansi --one-line=keep-statements -a --suffix=none %> /dev/null 2>&1"
elseif &filetype == 'perl'
Expand Down
32 changes: 16 additions & 16 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ setopt PUSHD_IGNORE_DUPS
#}}}

#每个目录使用独立的历史纪录{{{
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/.zsh_history$PWD/zhistory"
# 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 {
Expand Down

0 comments on commit 13648b5

Please sign in to comment.