From f6a20e02198c737aceddae97ce951d2a830c7397 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Tue, 17 Jun 2014 08:19:40 -0400 Subject: [PATCH] Submodules have been updated. FKey toggles were tweaked a bit along with general improvements to keyboard mappings. Fixed some issues with the update script, including incorrect log placement as well as allowing it to fail after a timeout when vim hangs (happens when vim displays an error on startup, for example), added better and more consistant error output/logging and fixed some errors along with dozens of tweaks. --- README.md | 15 +-- update | 213 +++++++++++++++++++++++---------------- vim/bundle/lightline.vim | 2 +- vim/bundle/syntastic | 2 +- vim/bundle/unite.vim | 2 +- vim/bundle/vimfiler.vim | 2 +- vim/config/keyboard.vim | 71 +++++++------ 7 files changed, 172 insertions(+), 135 deletions(-) diff --git a/README.md b/README.md index 9c011ba..8f3b972 100644 --- a/README.md +++ b/README.md @@ -8,16 +8,16 @@ A theme, config and collection of plugins for Vim. * **Bash**: Required by the _update_ and _gentags_ scripts. * **Git**: Required by the _update_ script and git-related plugins. * **Grep and Find**: Required by the _grep_ plugin. -* **CTags**: Required by the _tagbar_ and _neocomplcache_ plugins as well as the _gentags_ script ([ctags website](http://ctags.sourceforge.net)). ## Optional Requirements ## -* **Powerline Fonts**: Required to enable the fancier looking status line ([powerline-fonts repo](https://github.com/Lokaltog/powerline-fonts)). * **Artistic Style**: Required by the _autoformat_ plugin to format C, C++, C++/CLI, C#, and Java source ([astyle website](http://astyle.sourceforge.net)). * **autopep8**: Required by the _autoformat_ plugin to format Python using the PEP 8 style guide ([autopep8 repo](https://github.com/hhatto/autopep8)). -* **JS Beautifier**: Required by the _autoformat_ plugin to format Javascript source and HTML ([js-beautify repo](https://github.com/Chiel92/vim-autoformat)). -* **Tidy**: Required by the _autoformat_ plugin to format XHTML and XML ([tidy website](http://tidy.sourceforge.net)). * **Compilers and Runtimes**: The syntastic plugin can use the compiler or runtime for most languages to provide real-time syntax checking. +* **CTags**: Required by the _tagbar_ and _neocomplcache_ plugins as well as the _gentags_ script ([ctags website](http://ctags.sourceforge.net)). +* **JS Beautifier**: Required by the _autoformat_ plugin to format Javascript source and HTML ([js-beautify repo](https://github.com/Chiel92/vim-autoformat)). +* **Powerline Fonts**: Required to enable the fancier looking status line ([powerline-fonts repo](https://github.com/Lokaltog/powerline-fonts)). +* **Tidy**: Required by the _autoformat_ plugin to format XHTML and XML ([tidy website](http://tidy.sourceforge.net)). ## Distribution Features ## @@ -94,13 +94,14 @@ A theme, config and collection of plugins for Vim. | \` | NORM | Toggle the gutter (line #s, folds, git diffs) | | | | | | \ | ALL | Toggle the **gundo** undo history sidebar | -| \ | ALL | Toggle the **spellcheck** bottom bar of mistakes | -| \ | ALL | Toggle the **tagbar** source code tag sidebar | -| \ | ALL | Toggle the **extradite** git history window | +| \ | ALL | Toggle the **tagbar** source code tag sidebar | +| \ | ALL | Toggle the **spellcheck** bottom bar of mistakes | +| \ | ALL | Toggle the **extradite** git history window | | | | | | \ | ALL | Toggle line wrapping | | \ | ALL | Toggle highlighting of spelling mistakes | | \ | ALL | Toggle source code syntax checking | +| \ | ALL | Toggle external-paste mode | ##### GVim ##### diff --git a/update b/update index 197205f..583a3bf 100755 --- a/update +++ b/update @@ -11,16 +11,19 @@ # # ############################################################## -# change to the the directory containing this script -cd "${0%/*}" +### BEGIN: VARIABLES ### +# user variables (these can be edited) +ERRORLOG="update-errors.log" # set the error log filename -# set the name of this script without including the path -SCRIPT_NAME=`echo "$0" | grep -o -e "[^\/]*$"` - -# set the version based on the number and date of the current commit +# script variables (these should not be touched) VERSION=$(printf "%s.r%s" "$(git show -s --format=%ci master | sed 's/\ .*//g;s/-//g')" "$(git rev-list --count HEAD)") +SCRIPT_NAME=`echo "$0" | grep -o -e "[^\/]*$"` +SCRIPT_HOME="${0%/*}" +### END: VARIABLES ### -# this function configures the env using arguments its passed + +### BEGIN: FUNCTIONS ### +# command_parse "$@": configures environment using arguments function command_parse { for param in $@; do case "$param" in @@ -40,47 +43,47 @@ function command_parse { done } -# this function both outputs error messages as well as writing them to a log when they occur +# error "file/command" "error output" "note": output and log error function error() { echo -e "${HEADINGCOLOUR} ${RESETCOLOUR}${ERRORCOLOUR} ! ERROR: ${RESETCOLOUR}${FAILCOLOUR} ${2} " - echo -e "${HEADINGCOLOUR} ${RESETCOLOUR}${ERRORCOLOUR} ! ${RESETCOLOUR} ${NOACTIONCOLOUR}=> ${1}${RESETCOLOUR}" - [[ -n "$3" ]] && echo -e "${HEADINGCOLOUR} ${RESETCOLOUR}${ERRORCOLOUR} ! ${RESETCOLOUR}${NOACTIONCOLOUR} ${3}" + echo -e "${HEADINGCOLOUR} ${RESETCOLOUR}${ERRORCOLOUR} ! COMMAND: ${RESETCOLOUR} ${NOACTIONCOLOUR}=> ${1}${RESETCOLOUR}" + [[ -n "$3" ]] && echo -e "${HEADINGCOLOUR} ${RESETCOLOUR}${ERRORCOLOUR} ! OUTPUT: ${RESETCOLOUR}${NOACTIONCOLOUR} ${3}" - echo "${1} @ $(date)" >> "$ERRORLOG" - echo " ! Error: ${2}" >> "$ERRORLOG" - [[ -n "$3" ]] && echo " ! ${3}" >> "$ERRORLOG" - echo >> "$ERRORLOG" + echo "DATE: @ $(date)" >> "${SCRIPT_HOME}/${ERRORLOG}" + echo "ERROR: ${2}" >> "${SCRIPT_HOME}/${ERRORLOG}" + echo "COMMAND: ${1}" >> "${SCRIPT_HOME}/${ERRORLOG}" + [[ -n "$3" ]] && echo "OUTPUT: ${3}" >> "${SCRIPT_HOME}/${ERRORLOG}" + echo >> "${SCRIPT_HOME}/${ERRORLOG}" } -# this function displays version information +# show_version: displays version information function show_version() { echo -e "Update tool for darkcloud-vimconfig (${SCRIPT_NAME}) v${VERSION}\n" } -# this function displays help output +# show_help: this function displays help output function show_help() { echo -e "Usage: ${SCRIPT_NAME} [OPTION]\n" echo " Options:" - - echo -e "\t-n, --no-colour (or --no-color)" - echo -e "\t\tdisable colour output\n" - - echo -e "\t-v, --version" - echo -e "\t\toutput version information and exit\n" - - echo -e "\t-h, --help" - echo -e "\t\tdisplay this help and exit\n" - + echo -e "\t-n, --no-colour (or --no-color)\n\t\tdisable colour output\n" + echo -e "\t-v, --version\n\t\toutput version information and exit\n" + echo -e "\t-h, --help\n\t\tdisplay this help and exit\n" echo -e "\tRun with no arguments to update darkcloud-vimconfig\n" } +### END: FUNCTIONS ### -# initialize the error log -ERRORLOG="update-errors.log" -[[ -f "$ERRORLOG" ]] && rm "$ERRORLOG" -# parse for commandline arguments and respond accordingly +### BEGIN: SETUP ### +# change to the base darkcloud-vimconfig folder +cd "$SCRIPT_HOME" + +# delete old error log if it exists +[[ -f "$ERRORLOG" ]] && rm "${SCRIPT_HOME}/${ERRORLOG}" + +# parse for arguments (then handle them below) [[ ! -z "$@" ]] && command_parse "$@" -# set colours unless user specifies otherwise + +# set colour for output unless an argument was given to disable it if [ ! "$NO_COLOUR" = "true" ]; then TITLECOLOUR="\e[40m" HEADINGCOLOUR="\e[44m" @@ -93,19 +96,33 @@ if [ ! "$NO_COLOUR" = "true" ]; then else HEADINGCOLOUR="#" fi -# display an error for an invalid argument, then the help and exit + +# display an error, help then exit when invalid argument(s) are given [[ -n "$ERROR" ]] && error "$ERROR" "Invalid option supplied at runtime" && echo && show_help && exit 1 -# show the help and exit + +# show the help and exit when an argument has been given to do so [[ "$SHOW_HELP" = "true" ]] && show_version && show_help && exit 0 -# show version information and exit + +# show version information and exit when an argument has been given to do so [[ "$SHOW_VERSION" = "true" ]] && show_version && exit 0 -# create vim/vimrc.user and vim/bundle.user if they don't already exist -[[ ! -d vim/bundle.user ]] && install -d vim/bundle.user +echo -e "\n${TITLECOLOUR} ~~~ DarkCloud Vimconfig Update Tool ~~~ ${RESETCOLOUR}" + +# create vim/bundle.user and vim/vimrc.user if either don't exist +if [ ! -d vim/bundle.user ]; then + echo -n -e "\n${HEADINGCOLOUR} >> Creating User Plugin Directory:${RESETCOLOUR}" + PROCESS_STATUS=$(install -d vim/bundle.user 2>&1) + if [ $? = 0 ]; then + echo -e "${SUCCESSCOLOUR} SUCCESS! ${RESETCOLOUR}" + else + echo -e "${FAILCOLOUR} FAIL! ${RESETCOLOUR}" + error "install -d vim/bundle.user" "User plugin directory couldn't be created" "$PROCESS_STATUS" + fi +fi if [ ! -e vim/vimrc.user ]; then - echo -e "\n${TITLECOLOUR} ~~~ DarkCloud Vimconfig Setup ~~~ ${RESETCOLOUR}" - echo -n -e "\n${HEADINGCOLOUR} >> Creating User Config 'vim/vimrc.user': ${RESETCOLOUR}" - if [ -w vim ]; then + echo -n -e "\n${HEADINGCOLOUR} >> Creating User Config File:${RESETCOLOUR}" + PROCESS_STATUS=$(touch vim/vimrc.user 2>&1) + if [ $? = 0 ]; 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 @@ -115,61 +132,66 @@ if [ ! -e vim/vimrc.user ]; then echo -e "${SUCCESSCOLOUR} SUCCESS! ${RESETCOLOUR}" else echo -e "${FAILCOLOUR} FAIL! ${RESETCOLOUR}" - error "vim/vimrc.user" "User config couldn't be created" "The 'vim' folder is read-only and must be set read/write" + error "touch vim/vimrc.user" "User config couldn't be created" "$PROCESS_STATUS" fi -else - echo -e "\n${TITLECOLOUR} ~~~ DarkCloud Vimconfig Update Tool ~~~ ${RESETCOLOUR}" fi +### END: SETUP ### -# update darkcloud-vimconfig -echo -n -e "\n${HEADINGCOLOUR} >> Updating Repository: ${RESETCOLOUR}" -GIT_STATUS=$(git pull origin master 2>&1) + +### BEGIN: REPO UPDATE ### +echo -n -e "\n${HEADINGCOLOUR} >> Updating Repository:${RESETCOLOUR}" +PROCESS_STATUS=$(git pull origin master 2>&1) if [ $? = 0 ]; then echo -e "${SUCCESSCOLOUR} SUCCESS! ${RESETCOLOUR}" else echo -e "${FAILCOLOUR} FAIL! ${RESETCOLOUR}" - error "git pull origin master" "Git failed to sync the repo" "Git output: ${GIT_STATUS}" + error "git pull origin master" "Git failed to sync the repo" "$PROCESS_STATUS" exit 1 fi +### END: REPO UPDATE ### -# setup and sync the submodules + +### BEGIN: SUBMODULE UPDATE ### +# synchronize the repo urls for each submodule using the ones in .gitmodules echo -e "\n${HEADINGCOLOUR} >> Updating Plugin Submodules >> ${RESETCOLOUR}" -echo -n -e "${HEADINGCOLOUR} ${RESETCOLOUR}${SUBHEADINGCOLOUR} + Updating Plugin URLs: ${RESETCOLOUR}" -GIT_STATUS=$(git submodule sync 2>&1) +echo -n -e "${HEADINGCOLOUR} ${RESETCOLOUR}${SUBHEADINGCOLOUR} + Updating Plugin URLs:${RESETCOLOUR}" +PROCESS_STATUS=$(git submodule sync 2>&1) if [ $? = 0 ]; then echo -e "${SUCCESSCOLOUR} SUCCESS! ${RESETCOLOUR}" else echo -e "${FAILCOLOUR} FAIL! ${RESETCOLOUR}" - error "git submodule sync" "Git failed to sync the submodules" "Git output: ${GIT_STATUS}" + error "git submodule sync" "Git failed to sync the submodules" "$PROCESS_STATUS" fi -echo -n -e "${HEADINGCOLOUR} ${RESETCOLOUR}${SUBHEADINGCOLOUR} + Fetching Updates: ${RESETCOLOUR}" -GIT_STATUS=$(git submodule foreach git fetch --all 2>&1) +# update each submodule to the new head and run 'git fetch --all' +echo -n -e "${HEADINGCOLOUR} ${RESETCOLOUR}${SUBHEADINGCOLOUR} + Fetching Updates:${RESETCOLOUR}" +PROCESS_STATUS=$(git submodule foreach git fetch --all 2>&1) if [ $? = 0 ]; then - GIT_STATUS=$(git submodule update --init --recursive 2>&1) + PROCESS_STATUS=$(git submodule update --init --recursive 2>&1) if [ $? = 0 ]; then echo -e "${SUCCESSCOLOUR} SUCCESS! ${RESETCOLOUR}" else echo -e "${FAILCOLOUR} FAIL! ${RESETCOLOUR}" - error "git submodule update --init --recursive" "Git failed to update the submodules" "Git output: ${GIT_STATUS}" + error "git submodule update --init --recursive" "Git failed to update the submodules" "$PROCESS_STATUS" fi else echo -e "${FAILCOLOUR} FAIL! ${RESETCOLOUR}" - error "git submodule foreach git fetch --all" "Git failed to fetch the submodules from their respective remotes" "Git output: ${GIT_STATUS}" + error "git submodule foreach git fetch --all" "Git failed to fetch the submodules from their respective remotes" "$PROCESS_STATUS" fi -echo -n -e "${HEADINGCOLOUR} ${RESETCOLOUR}${SUBHEADINGCOLOUR} + Checkout Origin/Master: ${RESETCOLOUR}" -GIT_STATUS=$(git submodule foreach git checkout -f origin/master 2>&1) +# run 'git checkout origin/master' on each submodule +echo -n -e "${HEADINGCOLOUR} ${RESETCOLOUR}${SUBHEADINGCOLOUR} + Checking Out Updates:${RESETCOLOUR}" +PROCESS_STATUS=$(git submodule foreach git checkout -f origin/master 2>&1) if [ $? = 0 ]; then echo -e "${SUCCESSCOLOUR} SUCCESS! ${RESETCOLOUR}" else echo -e "${FAILCOLOUR} FAIL! ${RESETCOLOUR}" - error "git submodule foreach git checkout -f origin/master" "Git failed to checkout the submodules into origin/master" "Git output: ${GIT_STATUS}" + error "git submodule foreach git checkout -f origin/master" "Git failed to checkout the submodules into origin/master" "$PROCESS_STATUS" fi # clean plugin directories and remove plugins no longer in the repo echo -e "\n${HEADINGCOLOUR} >> Cleaning Plugin Directories >> ${RESETCOLOUR}" -echo -n -e "${HEADINGCOLOUR} ${RESETCOLOUR}${SUBHEADINGCOLOUR} + Removing Untracked Files: ${RESETCOLOUR}" +echo -n -e "${HEADINGCOLOUR} ${RESETCOLOUR}${SUBHEADINGCOLOUR} + Removing Untracked Files:${RESETCOLOUR}" git submodule foreach git clean -dxf > /dev/null 2>&1 && echo -e "${SUCCESSCOLOUR} SUCCESS! ${RESETCOLOUR}" || echo -e "${FAILCOLOUR} FAIL! ${RESETCOLOUR}" [[ -f .gitmodules ]] && for each in vim/bundle/*; do if [ -d "$each" ]; then @@ -177,49 +199,64 @@ git submodule foreach git clean -dxf > /dev/null 2>&1 && echo -e "${SUCCESSCOLOU FILE=$(echo $each | grep -o -e "[^\/]*$") if [ $(cat .gitmodules | grep "path = " | grep -o -e "[^\/]*$" | grep -c -e "${FILE}$") = 0 ]; then [[ -z "$FIRST_OLD" ]] && export FIRST_OLD=1 && echo -n -e "${HEADINGCOLOUR} ${RESETCOLOUR}${SUBHEADINGCOLOUR} + Removing Old Plugins: ${RESETCOLOUR}\n" - rm -rf "$each" + PROCESS_STATUS=$(rm -rf "$each") if [ $? = 0 ]; then echo -e "${HEADINGCOLOUR} ${RESETCOLOUR}${SUBHEADINGCOLOUR} = ${RESETCOLOUR}$(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" + error "rm -rf ${each}" "Folder couldn't be deleted" "$PROCESS_STATUS" exit 1 fi fi fi fi -done && unset FIRST_OLD && echo +done && echo +### END: SUBMODULE UPDATE ### -# update git-based plugins in vim/bundle.user if any exist -if [ ! $(find vim/bundle.user | grep ".git/config" | wc -l) = 0 ]; then - echo -e "${HEADINGCOLOUR} >> Updating User Plugins >> ${RESETCOLOUR}" - 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 - echo -n -e "${HEADINGCOLOUR} ${RESETCOLOUR}${SUBHEADINGCOLOUR} + Updating 'vim/bundle.user/${each}' ${RESETCOLOUR}" - 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 "${SUCCESSCOLOUR} SUCCESS! ${RESETCOLOUR}" + +### BEGIN: USER PLUGIN UPDATE ### +if [ -d vim/bundle.user ]; then + if [ ! $(find vim/bundle.user | grep ".git/config" | wc -l) = 0 ]; then + echo -e "${HEADINGCOLOUR} >> Updating User Plugins >> ${RESETCOLOUR}" + 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 + echo -n -e "${HEADINGCOLOUR} ${RESETCOLOUR}${SUBHEADINGCOLOUR} + Updating 'vim/bundle.user/${each}':${RESETCOLOUR}" + PROCESS_STATUS=$(git pull origin master 2>&1) + if [ $? = 0 ]; then + if [ $(echo $PROCESS_STATUS | grep -c "Already up-to-date") = 0 ]; then + echo -e "${SUCCESSCOLOUR} SUCCESS! ${RESETCOLOUR}" + else + echo -e "${NOACTIONCOLOUR} UP TO DATE ${RESETCOLOUR}" + fi else - echo -e "${NOACTIONCOLOUR} UP TO DATE ${RESETCOLOUR}" + error "git pull origin master" "Failed pulling changes for ${each}" "$PROCESS_STATUS" fi - else - error "vim/bundle.user/${each}" "Git failed to pull the latest changes" "Git output: ${GIT_STATUS}" fi - fi - popd > /dev/null 2>&1 - fi - done - popd > /dev/null 2>&1 - echo + popd > /dev/null 2>&1 + fi + done + popd > /dev/null 2>&1 + echo + fi fi +### END: USER PLUGIN UPDATE ### -echo -n -e "${HEADINGCOLOUR} >> Generating Plugin Helpdocs: ${RESETCOLOUR}" -[[ $(type -P vim) ]] && vim -c "Helptags|qa!" &> /dev/null 2>&1 \ - && echo -e "${SUCCESSCOLOUR} SUCCESS! ${RESETCOLOUR}" \ - || (echo -e "${FAILCOLOUR} FAIL! ${RESETCOLOUR}"; error "$vim -c \"Helptags|qa!\"" "Generating helpdocs for the submodules failed") + +### BEGIN: GENERATE PLUGIN HELPTAGS ### +if [ $(type -P vim) ]; then + echo -n -e "${HEADINGCOLOUR} >> Generating Plugin Help:${RESETCOLOUR}" + timeout --foreground 2m vim -c "Helptags|qa!" &> /dev/null + if [ $? = 0 ]; then + echo -e "${SUCCESSCOLOUR} SUCCESS! ${RESETCOLOUR}" + else + reset -I + echo -e "${FAILCOLOUR} FAIL! ${RESETCOLOUR}" + error "vim -c \"Helptags|qa!\"" "Generating helpdocs for the submodules failed" + fi +fi +### END: GENERATE PLUGIN HELPTAGS ### echo -e "\n${TITLECOLOUR} ~~~ Update Complete ~~~ ${RESETCOLOUR}\n" exit 0 diff --git a/vim/bundle/lightline.vim b/vim/bundle/lightline.vim index 97ac8be..7afa72e 160000 --- a/vim/bundle/lightline.vim +++ b/vim/bundle/lightline.vim @@ -1 +1 @@ -Subproject commit 97ac8be9c313092f25e15e10d932403f6eab0ed4 +Subproject commit 7afa72e7fb048fa0b0d938cac7a509c4f20023c8 diff --git a/vim/bundle/syntastic b/vim/bundle/syntastic index bd7e347..3ebdeab 160000 --- a/vim/bundle/syntastic +++ b/vim/bundle/syntastic @@ -1 +1 @@ -Subproject commit bd7e34757d73f6ed95f41f178fd9e2b4a5e49eeb +Subproject commit 3ebdeabf63eb2f093ccd79c1c9f4d8e198488d5b diff --git a/vim/bundle/unite.vim b/vim/bundle/unite.vim index ec749dd..201f4b7 160000 --- a/vim/bundle/unite.vim +++ b/vim/bundle/unite.vim @@ -1 +1 @@ -Subproject commit ec749ddeb6a6ebbf2a5f56eadcc48abe5bfc4f81 +Subproject commit 201f4b779a48a7296c93e5b359fcd992eb22a031 diff --git a/vim/bundle/vimfiler.vim b/vim/bundle/vimfiler.vim index cf348a4..cd59caa 160000 --- a/vim/bundle/vimfiler.vim +++ b/vim/bundle/vimfiler.vim @@ -1 +1 @@ -Subproject commit cf348a47ecb326e33e676326836df3dd74ad4c07 +Subproject commit cd59caa85efa4be1688588383d7126ab3d44a1a8 diff --git a/vim/config/keyboard.vim b/vim/config/keyboard.vim index af0f0cc..849bed9 100644 --- a/vim/config/keyboard.vim +++ b/vim/config/keyboard.vim @@ -83,13 +83,14 @@ " 0 | (N) -> reset all folds using default fold level " " | (N) -> toggle the gundo sidebar -" | (A) -> toggle spellcheck error list -" | (A) -> toggle the tagbar sidebar -" <12> | (A) -> toggle extradite git commit history +" | (A) -> toggle the tagbar sidebar +" | (A) -> toggle spellcheck error list +" | (A) -> toggle extradite git commit history " " | (A) -> toggle line wrapping " | (A) -> toggle spell check " | (A) -> toggle syntax checking +" | (A) -> toggle external-paste mode " " (gvim toggles) " | (A) -> toggle the menubar @@ -165,7 +166,6 @@ " | (V) -> select a few lines left " " (copy/paste and undo/redo) -" | (N) -> toggle paste mode " p | (N) -> view the paste buffers and register contents " y | (N) -> copies the character at the cursor " P | (V) -> save selection to the buffer and paste over @@ -183,7 +183,7 @@ " dd | (N) -> delete lines under and after the one below " d | (V) -> delete the currently selected text " -" (typical copy and paste shortcuts) +" (improved copy and paste shortcuts) " | (N) -> paste from buffer " | (V) -> paste buffer in place of selection " | (I) -> paste from buffer then return to input @@ -207,7 +207,7 @@ " | (N) -> move to the parent tag " " (extradite) -" | (A) -> close the dialog +" | (A) -> close the dialog " | (A) -> same as down " l | (A) -> same as j " | (A) -> same as Up @@ -390,38 +390,41 @@ "bindings to trigger the gundo undo history nnoremap ':GundoToggle:echo "undo history sidebar toggled"' - xnoremap ':GundoTogglev' - inoremap ':GundoToggle' - - "bindings to trigger spellcheck - nnoremap ':UpdateAndSpellCheck:call ToggleQuickfixList():wincmd j' - xnoremap ':UpdateAndSpellCheck:call ToggleQuickfixList():wincmd j' - inoremap ':UpdateAndSpellCheck:call ToggleQuickfixList():wincmd j' + xnoremap ':GundoToggle' + inoremap ':GundoToggle' "bindings to trigger the tagbar list of tags - nnoremap ':TagbarToggle:echo "tagbar toggled"' - xnoremap ':TagbarTogglegv' - inoremap ':TagbarToggle' + nnoremap ':TagbarToggle:echo "tagbar toggled"' + xnoremap ':TagbarTogglegv' + inoremap ':TagbarToggle' + + "bindings to trigger spellcheck + nnoremap ':UpdateAndSpellCheck:call ToggleQuickfixList():wincmd j' + xnoremap ':UpdateAndSpellCheck:call ToggleQuickfixList():wincmd j' + inoremap ':UpdateAndSpellCheck:call ToggleQuickfixList():wincmd j' "view commit history and diffs - nnoremap ':Extradite:wincmd x:wincmd j:resize 10' - xnoremap ':Extradite:wincmd x:wincmd j:resize 10v' - inoremap ':Extradite:wincmd x:wincmd j:resize 10' + nnoremap ':Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' + xnoremap ':Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' + inoremap ':Extradite!:resize 10:wincmd x:wincmd b:wincmd H:wincmd b' "toggle line wrapping (and bottom bar if using the gui) nnoremap ':set wrap!:echo "line wrapping toggled"' xnoremap ':set wrap!gv' inoremap ':set wrap!' - "toggle spellcheck - nnoremap ':set spell!:echo "spell checking toggled"' - xnoremap ':set spell!gv' - inoremap ':set spell!' - "toggle syntax checking - nnoremap ':SyntasticToggleMode' - xnoremap ':SyntasticToggleModegv' - inoremap ':SyntasticToggleMode' + nnoremap ':SyntasticToggleMode' + xnoremap ':SyntasticToggleModegv' + inoremap ':SyntasticToggleMode' + + "toggle spellcheck + nnoremap ':set spell!:echo "spell checking toggled"' + xnoremap ':set spell!gv' + inoremap ':set spell!' + + "toggle external-paste mode + set pastetoggle= "} "GVIM TOGGLES:{ @@ -539,9 +542,6 @@ "} "COPY PASTE AND UNDO REDO:{ - "toggle paste mode - nnoremap ':set paste!' - "display contents of paste buffers nnoremap p ':reg' @@ -593,7 +593,7 @@ autocmd FileType extradite map l j autocmd FileType extradite map autocmd FileType extradite map h k - autocmd FileType diff,extradite map ':Extradite' + autocmd FileType diff,extradite map ':Extradite' "gundo autocmd FileType gundo map 0l @@ -611,7 +611,7 @@ endif "markdown: launch table of contents instead of the tagbar - autocmd FileType mkd map ':Toch' + autocmd FileType mkd map ':Toch' "markdown table of contents autocmd FileType qf map 0 @@ -624,14 +624,13 @@ autocmd FileType qf map h j autocmd FileType qf map l k autocmd FileType qf map q ':hide' - autocmd FileType qf map ':hide' + autocmd FileType qf map ':hide' "vimdiff autocmd FilterWritePre * if &diff|nnoremap <> ':diffu'|endif autocmd FilterWritePre * if &diff|nnoremap >< ':diffu'|endif autocmd FilterWritePre * if &diff|nnoremap > dp|endif autocmd FilterWritePre * if &diff|nnoremap < do|endif - autocmd FilterWritePre * if &diff|cabbrev q qall|endif autocmd FilterWritePre * if &diff|cabbrev q! qall!|endif "vimfiler @@ -648,8 +647,8 @@ "DISABLED MAPPINGS FOR FILETYPES: {{{ "remove incompatible toggles from specific file types autocmd Filetype qf,vimfiler,extradite,help noremap - autocmd Filetype ggundo,vimfiler,extradite,tagbar,help noremap - autocmd Filetype qf,ggundo,vimfiler,extradite,help noremap + autocmd Filetype qf,ggundo,vimfiler,extradite,help noremap + autocmd Filetype ggundo,vimfiler,extradite,tagbar,help noremap autocmd Filetype qf,ggundo,vimfiler,tagbar,help noremap <12> "disable modifier keys with directions that would interfere with logic