Added a new script that can be used to update the repo if bash is
available. Updated the README. Improved the theme by adding a bunch
of syntax highlighting definitions (mostly rooted in html, though
a bunch of other languages base their colours on it), as well as
tweaking visual selection to longer invert on the block with the cursor,
and parenthesis matching to look the same at both ends. Added a plugin
that improves the theme and adds some keyboard shortcuts to markdown,
which is what the README.md files in Github are written in. I realized
that the h,j,k,l shortcuts equivalent to the ones with arrow keys I'd
added were overwriting other shortcuts with the shift combinations, so
I removed those and the ctrl-ones for consistency. The diff shortcuts
weren't intuitive or easy on the hands, so I tried something else and
I think it works much better now (check vim/keyboard.vim). An update
script has also been added to simplify updating submodules; I'm not
completely clear as to whether following this method will properly
update the submodules in certain conditions like when one is removed,
but this should add new ones and update the existing ones after pulling
from the repo.
2014-04-01 00:03:52 -04:00
#!/usr/bin/env bash
2014-06-16 05:37:52 -04:00
# change to the base directory
Tons of changes all in one commit because I'd broken a commit a while
back and opted to simply reverse them all- Lots of colour changes, the
update script now removes decommissioned bundles, gentags script can now
have additional paths added to it when generating a tags file, README is
much improved, fixed a few issues that required remapping some toggles,
fixed a bunch of issues with the colourscheme between the terminal and
gvim. You can now setup a custom config file to have loaded after the
darkcloud-vimconfig ones, and there's a custom location for pathogen
modules too, to make things tidier without necessarily needing to use
an additional runtimepath. You can also create a file in your home
directory to assign filetypes to programs, for use with the file
manager. A file can be placed in ~/.vim/ with file associations and
prorams to launch them with. The file manager will also open a file with
vim by hitting shift+enter, since e isn't all that comfortablly placed.
The vimrc can now also point to the darkcloud-vimconfig folder, rather
than relying on the vim folder being in a specific location, and the
after folder is now configured to work in the project too.
2014-04-04 19:49:02 -04:00
cd "${0%/*}"
2014-06-16 05:37:52 -04:00
# define an error function to both output and record errors
ERRORLOG="update-errors.log"
function error() {
echo -e "\e[44m \e[0m\e[01;41m ! ERROR: \e[0m\e[1;31m ${2} "
echo -e "\e[44m \e[0m\e[01;41m ! \e[0m \e[1;37m=> ${1}\e[0m"
[[ -n "$3" ]] && echo -e "\e[44m \e[0m\e[01;41m ! \e[0m\e[1;37m ${3}"
echo "${1} @ $(date)" >> "$ERRORLOG"
echo " ! Error: ${2}" >> "$ERRORLOG"
[[ -n "$3" ]] && echo " ! ${3}" >> "$ERRORLOG"
echo >> "$ERRORLOG"
}
# initialize the errorlog file for this session
echo > "$ERRORLOG"
# create vim/vimrc.user and vim/bundle.user if they don't already exist
[[ ! -d vim/bundle.user ]] && install -d vim/bundle.user
2014-04-08 03:39:10 -04:00
if [ ! -e vim/vimrc.user ]; then
2014-06-16 05:37:52 -04:00
echo -e "\n\e[40m ~~~ DarkCloud Vimconfig Setup ~~~ \e[0m"
echo -e "\n\e[44m >> Create User Config: 'vim/vimrc.user' \e[0m"
2014-06-04 03:18:29 -04:00
if [ -w vim ]; then
echo -e '"Disable Linebreaks: (*1:force disabled globally | 0: disabled by default)\n"let g:disablelinebreaks=0\n' >> vim/vimrc.user
echo -e '"Autostart Filer: (*1:filer loads in new empty buffers | 0: filer must be triggered)\n"let g:autostartfiler=0\n' >> vim/vimrc.user
echo -e '"Syntax Autostart: (1:start toggled on | *0: start toggled off)\n"let g:autostartchecker=1\n' >> vim/vimrc.user
echo -e '"Tagbar Autostart: (1:start open | *0:start closed)\n"let g:autostarttagbar=1\n' >> vim/vimrc.user
echo -e '"Powerline Fonts: (1:enabled | *0:disabled)\n"let g:powerlinefonts=1 "(set powerline font for gvim and terminal when enabled)\n' >> vim/vimrc.user
echo -e '"GVim Font Selection: (Escaping spaces and use powerline if appropriate)\nset guifont=Monospace\ 12' >> vim/vimrc.user
2014-04-08 03:39:10 -04:00
fi
2014-06-16 05:37:52 -04:00
else
echo -e "\n\e[40m ~~~ DarkCloud Vimconfig Update Tool ~~~ \e[0m"
fi
echo
# update darkcloud-vimconfig
echo -n -e "\e[44m >> Updating Repository: \e[0m"
GIT_STATUS=$(git pull origin master 2>&1)
if [ $? = 0 ]; then
echo -e "\e[0;32m SUCCESS! \e[0m"
else
echo -e "\e[1;31m FAIL! \e[0m"
error "git pull origin master" "Git failed to sync the repo" "Git output: ${GIT_STATUS}"
exit 1
2014-04-08 03:39:10 -04:00
fi
2014-04-05 00:55:40 -04:00
2014-06-16 05:37:52 -04:00
# setup and sync the submodules
echo -e "\n\e[44m >> Updating Plugin Submodules >> \e[0m"
echo -n -e "\e[44m \e[0m\e[43m + Updating Plugin URLs: \e[0m"
GIT_STATUS=$(git submodule sync 2>&1)
if [ $? = 0 ]; then
echo -e "\e[0;32m SUCCESS! \e[0m"
else
echo -e "\e[1;31m FAIL! \e[0m"
error "git submodule sync" "Git failed to sync the submodules" "Git output: ${GIT_STATUS}"
fi
echo -n -e "\e[44m \e[0m\e[43m + Fetching Updates: \e[0m"
GIT_STATUS=$(git submodule foreach git fetch --all 2>&1)
if [ $? = 0 ]; then
GIT_STATUS=$(git submodule update --init --recursive 2>&1)
if [ $? = 0 ]; then
echo -e "\e[0;32m SUCCESS! \e[0m"
else
echo -e "\e[1;31m FAIL! \e[0m"
error "git submodule update --init --recursive" "Git failed to update the submodules" "Git output: ${GIT_STATUS}"
fi
else
echo -e "\e[1;31m FAIL! \e[0m"
error "git submodule foreach git fetch --all" "Git failed to fetch the submodules from their respective remotes" "Git output: ${GIT_STATUS}"
fi
2014-05-05 08:57:38 -04:00
2014-06-16 05:37:52 -04:00
echo -n -e "\e[44m \e[0m\e[43m + Checkout Origin/Master: \e[0m"
GIT_STATUS=$(git submodule foreach git checkout -f origin/master 2>&1)
if [ $? = 0 ]; then
echo -e "\e[0;32m SUCCESS! \e[0m"
else
echo -e "\e[1;31m FAIL! \e[0m"
error "git submodule foreach git checkout -f origin/master" "Git failed to checkout the submodules into origin/master" "Git output: ${GIT_STATUS}"
fi
Tons of changes all in one commit because I'd broken a commit a while
back and opted to simply reverse them all- Lots of colour changes, the
update script now removes decommissioned bundles, gentags script can now
have additional paths added to it when generating a tags file, README is
much improved, fixed a few issues that required remapping some toggles,
fixed a bunch of issues with the colourscheme between the terminal and
gvim. You can now setup a custom config file to have loaded after the
darkcloud-vimconfig ones, and there's a custom location for pathogen
modules too, to make things tidier without necessarily needing to use
an additional runtimepath. You can also create a file in your home
directory to assign filetypes to programs, for use with the file
manager. A file can be placed in ~/.vim/ with file associations and
prorams to launch them with. The file manager will also open a file with
vim by hitting shift+enter, since e isn't all that comfortablly placed.
The vimrc can now also point to the darkcloud-vimconfig folder, rather
than relying on the vim folder being in a specific location, and the
after folder is now configured to work in the project too.
2014-04-04 19:49:02 -04:00
2014-06-16 05:37:52 -04:00
# clean plugin directories and remove plugins no longer in the repo
echo -e "\n\e[44m >> Cleaning Plugin Directories >> \e[0m"
echo -n -e "\e[44m \e[0m\e[43m + Removing Untracked Files: \e[0m"
git submodule foreach git clean -dxf > /dev/null 2>&1 && echo -e "\e[0;32m SUCCESS! \e[0m" || echo -e "\e[1;31m FAIL! \e[0m"
Tons of changes all in one commit because I'd broken a commit a while
back and opted to simply reverse them all- Lots of colour changes, the
update script now removes decommissioned bundles, gentags script can now
have additional paths added to it when generating a tags file, README is
much improved, fixed a few issues that required remapping some toggles,
fixed a bunch of issues with the colourscheme between the terminal and
gvim. You can now setup a custom config file to have loaded after the
darkcloud-vimconfig ones, and there's a custom location for pathogen
modules too, to make things tidier without necessarily needing to use
an additional runtimepath. You can also create a file in your home
directory to assign filetypes to programs, for use with the file
manager. A file can be placed in ~/.vim/ with file associations and
prorams to launch them with. The file manager will also open a file with
vim by hitting shift+enter, since e isn't all that comfortablly placed.
The vimrc can now also point to the darkcloud-vimconfig folder, rather
than relying on the vim folder being in a specific location, and the
after folder is now configured to work in the project too.
2014-04-04 19:49:02 -04:00
[[ -f .gitmodules ]] && for each in vim/bundle/*; do
if [ -d "$each" ]; then
if [ -f "${each}/.git" ]; then
FILE=$(echo $each | grep -o -e "[^\/]*$")
2014-06-16 05:37:52 -04:00
if [ $(cat .gitmodules | grep "path = " | grep -o -e "[^\/]*$" | grep -c -e "${FILE}$") = 0 ]; then
[[ -z "$FIRST_OLD" ]] && export FIRST_OLD=1 && echo -n -e "\e[44m \e[0m\e[43m + Removing Old Plugins: \e[0m\n"
rm -rf "$each"
if [ $? = 0 ]; then
echo -e "\e[44m \e[0m\e[43m = \e[0m$(echo ${each}\ | sed -re 's|^(.*)/([^/]*)$|\\e\[1;37m\1/\\e\[1;31m\2\\e\[0m|')"
else
error "$each" "The folder could not be deleted" "Try deleting manually to resolve"
exit 1
fi
fi
Tons of changes all in one commit because I'd broken a commit a while
back and opted to simply reverse them all- Lots of colour changes, the
update script now removes decommissioned bundles, gentags script can now
have additional paths added to it when generating a tags file, README is
much improved, fixed a few issues that required remapping some toggles,
fixed a bunch of issues with the colourscheme between the terminal and
gvim. You can now setup a custom config file to have loaded after the
darkcloud-vimconfig ones, and there's a custom location for pathogen
modules too, to make things tidier without necessarily needing to use
an additional runtimepath. You can also create a file in your home
directory to assign filetypes to programs, for use with the file
manager. A file can be placed in ~/.vim/ with file associations and
prorams to launch them with. The file manager will also open a file with
vim by hitting shift+enter, since e isn't all that comfortablly placed.
The vimrc can now also point to the darkcloud-vimconfig folder, rather
than relying on the vim folder being in a specific location, and the
after folder is now configured to work in the project too.
2014-04-04 19:49:02 -04:00
fi
fi
2014-06-16 05:37:52 -04:00
done && unset FIRST_OLD && echo
2014-05-05 08:57:38 -04:00
# update git-based plugins in vim/bundle.user if any exist
if [ ! $(find vim/bundle.user | grep ".git/config" | wc -l) = 0 ]; then
2014-06-16 05:37:52 -04:00
echo -e "\e[44m >> Updating User Plugins >> \e[0m"
2014-05-05 08:57:38 -04:00
pushd vim/bundle.user > /dev/null 2>&1
for each in *; do
if [ -d "$each" ]; then
pushd "$each" > /dev/null 2>&1
if [ -d .git ]; then
2014-06-16 05:37:52 -04:00
echo -n -e "\e[44m \e[0m\e[43m + Updating 'vim/bundle.user/${each}' \e[0m"
GIT_STATUS=$(git pull origin master 2>&1)
if [ $? = 0 ]; then
if [ $(echo $GIT_STATUS | grep -c "Already up-to-date") = 0 ]; then
echo -e "\e[0;32m SUCCESS! \e[0m"
else
echo -e "\e[1;37m UP TO DATE \e[0m"
fi
else
error "vim/bundle.user/${each}" "Git failed to pull the latest changes" "Git output: ${GIT_STATUS}"
fi
2014-05-05 08:57:38 -04:00
fi
popd > /dev/null 2>&1
fi
done
popd > /dev/null 2>&1
echo
fi
2014-04-07 19:16:58 -04:00
2014-06-16 05:37:52 -04:00
echo -n -e "\e[44m >> Generating Plugin Helpdocs: \e[0m"
[[ $(type -P vim) ]] && vim -c "Helptags|qa!" &> /dev/null 2>&1 \
&& echo -e "\e[0;32m SUCCESS! \e[0m" \
|| (echo -e "\e[1;31m FAIL! \e[0m"; error "$vim -c \"Helptags|qa!\"" "Generating helpdocs for the submodules failed")
2014-04-07 19:16:58 -04:00
2014-06-16 05:37:52 -04:00
echo -e "\n\e[40m ~~~ Update Complete ~~~ \e[0m\n"
Tons of changes all in one commit because I'd broken a commit a while
back and opted to simply reverse them all- Lots of colour changes, the
update script now removes decommissioned bundles, gentags script can now
have additional paths added to it when generating a tags file, README is
much improved, fixed a few issues that required remapping some toggles,
fixed a bunch of issues with the colourscheme between the terminal and
gvim. You can now setup a custom config file to have loaded after the
darkcloud-vimconfig ones, and there's a custom location for pathogen
modules too, to make things tidier without necessarily needing to use
an additional runtimepath. You can also create a file in your home
directory to assign filetypes to programs, for use with the file
manager. A file can be placed in ~/.vim/ with file associations and
prorams to launch them with. The file manager will also open a file with
vim by hitting shift+enter, since e isn't all that comfortablly placed.
The vimrc can now also point to the darkcloud-vimconfig folder, rather
than relying on the vim folder being in a specific location, and the
after folder is now configured to work in the project too.
2014-04-04 19:49:02 -04:00
exit 0