Skip to content

Commit

Permalink
update vimplus
Browse files Browse the repository at this point in the history
  • Loading branch information
chxuan committed Nov 21, 2019
1 parent 5019116 commit 22b3f1c
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 37 deletions.
8 changes: 4 additions & 4 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ Plug 'vim-scripts/indentpython.vim'
Plug 'docunext/closetag.vim'

" 自定义插件
if filereadable(expand($HOME . '/.vimrc.plugins'))
source $HOME/.vimrc.plugins
if filereadable(expand($HOME . '/.vimrc.custom.plugins'))
source $HOME/.vimrc.custom.plugins
endif

call plug#end()
Expand Down Expand Up @@ -352,6 +352,6 @@ nnoremap <leader>G :GV!<cr>
nnoremap <leader>gg :GV?<cr>
" 自定义设置
if filereadable(expand($HOME . '/.vimrc.config'))
source $HOME/.vimrc.config
if filereadable(expand($HOME . '/.vimrc.custom.config'))
source $HOME/.vimrc.custom.config
endif
2 changes: 1 addition & 1 deletion .vimrc.config → .vimrc.custom.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 自定义设置(该文件放一般性配置,若要增加插件,请放入~/.vimrc.plugins)
" 自定义设置(该文件放一般性配置,若要增加插件,请放入~/.vimrc.custom.plugins)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" 开启相对行号
Expand Down
2 changes: 1 addition & 1 deletion .vimrc.plugins → .vimrc.custom.plugins
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 自定义插件列表(该文件只放插件,若要增加其他配置,请放入~/.vimrc.config)
" 自定义插件列表(该文件只放插件,若要增加其他配置,请放入~/.vimrc.custom.config)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" 增加~/.vimrc里没有的插件
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ An automatic configuration program for vim

## 自定义

`~/.vimrc`为vimplus的默认配置,一般不做修改,若要增加插件,请修改 `~/.vimrc.plugins`,其他配置请放入`~/.vimrc.config`
`~/.vimrc`为vimplus的默认配置,一般不做修改,若要增加、卸载插件,请修改 `~/.vimrc.custom.plugins`,其他配置请放入`~/.vimrc.custom.config`


## 插件列表
Expand Down
24 changes: 12 additions & 12 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ function backup_vimrc_file()
fi
}

#备份原有的.vimrc.plugins文件
function backup_vimrc_plugins_file()
#备份原有的.vimrc.custom.plugins文件
function backup_vimrc_custom_plugins_file()
{
old_vimrc_plugins=$HOME"/.vimrc.plugins"
old_vimrc_plugins=$HOME"/.vimrc.custom.plugins"
is_exist=$(is_exist_file $old_vimrc_plugins)
if [ $is_exist == 1 ]; then
time=$(get_datetime)
Expand All @@ -95,10 +95,10 @@ function backup_vimrc_plugins_file()
fi
}

#备份原有的.vimrc.config文件
function backup_vimrc_config_file()
#备份原有的.vimrc.custom.config文件
function backup_vimrc_custom_config_file()
{
old_vimrc_config=$HOME"/.vimrc.config"
old_vimrc_config=$HOME"/.vimrc.custom.config"
is_exist=$(is_exist_file $old_vimrc_config)
if [ $is_exist == 1 ]; then
time=$(get_datetime)
Expand Down Expand Up @@ -129,8 +129,8 @@ function backup_vim_dir()
function backup_vimrc_and_vim()
{
backup_vimrc_file
backup_vimrc_plugins_file
backup_vimrc_config_file
backup_vimrc_custom_plugins_file
backup_vimrc_custom_config_file
backup_vim_dir
}

Expand Down Expand Up @@ -347,11 +347,11 @@ function copy_files()
rm -rf ~/.vimrc
ln -s ${PWD}/.vimrc ~

rm -rf ~/.vimrc.plugins
cp ${PWD}/.vimrc.plugins ~
rm -rf ~/.vimrc.custom.plugins
cp ${PWD}/.vimrc.custom.plugins ~

rm -rf ~/.vimrc.config
cp ${PWD}/.vimrc.config ~
rm -rf ~/.vimrc.custom.config
cp ${PWD}/.vimrc.custom.config ~

rm -rf ~/.ycm_extra_conf.py
ln -s ${PWD}/.ycm_extra_conf.py ~
Expand Down
28 changes: 14 additions & 14 deletions install_to_user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ function backup_vimrc_file()
fi
}

#备份原有的.vimrc.plugins文件
function backup_vimrc_plugins_file()
#备份原有的.vimrc.custom.plugins文件
function backup_vimrc_custom_plugins_file()
{
user=$1
home_path=$2
old_vimrc_plugins=$home_path".vimrc.plugins"
old_vimrc_plugins=$home_path".vimrc.custom.plugins"
is_exist=$(is_exist_file $old_vimrc_plugins)
if [ $is_exist == 1 ]; then
time=$(get_datetime)
Expand All @@ -107,12 +107,12 @@ function backup_vimrc_plugins_file()
fi
}

#备份原有的.vimrc.config文件
function backup_vimrc_config_file()
#备份原有的.vimrc.custom.config文件
function backup_vimrc_custom_config_file()
{
user=$1
home_path=$2
old_vimrc_config=$home_path".vimrc.config"
old_vimrc_config=$home_path".vimrc.custom.config"
is_exist=$(is_exist_file $old_vimrc_config)
if [ $is_exist == 1 ]; then
time=$(get_datetime)
Expand Down Expand Up @@ -147,8 +147,8 @@ function backup_vim_dir()
function backup_vimrc_and_vim()
{
backup_vimrc_file $1 $2
backup_vimrc_plugins_file $1 $2
backup_vimrc_config_file $1 $2
backup_vimrc_custom_plugins_file $1 $2
backup_vimrc_custom_config_file $1 $2
backup_vim_dir $1 $2
}

Expand Down Expand Up @@ -230,13 +230,13 @@ function install_to_user_on_linux()
cp -R $src_vimplus_path $desc_home_path
chown -R $desc_username":"$desc_username $desc_vimplus_path

rm -rf $desc_home_path".vimrc.plugins"
cp $desc_vimplus_path".vimrc.plugins" $desc_home_path
chown $desc_username":"$desc_username $desc_home_path".vimrc.plugins"
rm -rf $desc_home_path".vimrc.custom.plugins"
cp $desc_vimplus_path".vimrc.custom.plugins" $desc_home_path
chown $desc_username":"$desc_username $desc_home_path".vimrc.custom.plugins"

rm -rf $desc_home_path".vimrc.config"
cp $desc_vimplus_path".vimrc.config" $desc_home_path
chown $desc_username":"$desc_username $desc_home_path".vimrc.config"
rm -rf $desc_home_path".vimrc.custom.config"
cp $desc_vimplus_path".vimrc.custom.config" $desc_home_path
chown $desc_username":"$desc_username $desc_home_path".vimrc.custom.config"

# 创建软链接
rm -rf $desc_home_path".vimrc"
Expand Down
8 changes: 4 additions & 4 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ function update_vim_plugin()
# 拷贝文件
function copy_files()
{
vimrc_plugins=$HOME"/.vimrc.plugins"
vimrc_plugins=$HOME"/.vimrc.custom.plugins"
is_exist=$(is_exist_file $vimrc_plugins)
if [ $is_exist != 1 ]; then
cp ${PWD}/.vimrc.plugins ~
cp ${PWD}/.vimrc.custom.plugins ~
fi

vimrc_config=$HOME"/.vimrc.config"
vimrc_config=$HOME"/.vimrc.custom.config"
is_exist=$(is_exist_file $vimrc_config)
if [ $is_exist != 1 ]; then
cp ${PWD}/.vimrc.config ~
cp ${PWD}/.vimrc.custom.config ~
fi
}

Expand Down

0 comments on commit 22b3f1c

Please sign in to comment.