-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/prontera/ideavimrc
# Conflicts: # local.vimrc
- Loading branch information
Showing
6 changed files
with
313 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
# 该脚本的作用是自定义idea的配置文件和插件的位置 | ||
# author: prontera@github | ||
|
||
#set -x | ||
set -eo pipefail | ||
shopt -s nullglob | ||
|
||
idea_pros_path=$HOME/idea.properties | ||
|
||
if [[ -e $HOME/.zshrc ]]; then | ||
if ! grep -q IDEA_PROPERTIES "$HOME/.zshrc"; then | ||
echo write it to zshrc | ||
echo "export IDEA_PROPERTIES=${idea_pros_path}" >> $HOME/.zshrc | ||
touch ${idea_pros_path} | ||
echo 'idea.config.path=${user.home}/Public/Nutstore/config/mac/IntelliJIdea2016.3/config' > ${idea_pros_path} | ||
echo 'idea.system.path=${user.home}/Public/Nutstore/config/mac/IntelliJIdea2016.3/system' >> ${idea_pros_path} | ||
echo 'idea.plugins.path=${user.home}/Public/Nutstore/config/mac/IntelliJIdea2016.3/plugins' >> ${idea_pros_path} | ||
fi | ||
fi | ||
if [[ -e $HOME/.bashrc ]];then | ||
if ! grep -q IDEA_PROPERTIES "$HOME/.bashrc"; then | ||
echo write it to bashrc | ||
echo "export IDEA_PROPERTIES=${idea_pros_path}" >> $HOME/.bashrc | ||
touch ${idea_pros_path} | ||
echo 'idea.config.path=${user.home}/Public/Nutstore/config/mac/IntelliJIdea2016.3/config' > ${idea_pros_path} | ||
echo 'idea.system.path=${user.home}/Public/Nutstore/config/mac/IntelliJIdea2016.3/system' >> ${idea_pros_path} | ||
echo 'idea.plugins.path=${user.home}/Public/Nutstore/config/mac/IntelliJIdea2016.3/plugins' >> ${idea_pros_path} | ||
fi | ||
fi | ||
|
||
echo "$(tput setaf 2)>>> "Done!" $(tput sgr0)" | ||
exit 0 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
# usage: 将spacevim配置硬链接到用户下的.SpaceVim.d,如果spacevim文件已经存在,则自动重命名该文件。 | ||
# author: prontera@github | ||
|
||
#set -x | ||
set -eo pipefail | ||
shopt -s nullglob | ||
|
||
spacevim_d=$HOME/.SpaceVim.d | ||
|
||
# 无参函数 | ||
# 检测spacevim文件是否存在,如果存在则重命名该文件 | ||
rename_if_file_exists(){ | ||
local random="$RANDOM" | ||
if [[ -e "${spacevim_d}/init.vim" ]]; then | ||
echo "$(tput setaf 1)>>> "file \"init.vim\" has already exists which had been renamed to init-$random.vim" $(tput sgr0)" | ||
mv "${spacevim_d}/init.vim" "${spacevim_d}/init-$random.vim" | ||
fi | ||
} | ||
|
||
rename_if_file_exists | ||
ln spacevim.vimrc "$HOME/.SpaceVim.d/init.vim" | ||
echo "$(tput setaf 2)>>> "Done!" $(tput sgr0)" | ||
exit 0 |
Oops, something went wrong.