diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2012-02-01 17:32:27 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2012-02-01 17:32:27 +0100 |
commit | c7d66805e30493054e460a8f4f698bec98efab18 (patch) | |
tree | 9192033f2a3a40bb1af52a85ea1fc59d700ac582 | |
parent | 4ab3dd986fe6868e5827aeb82fc899993cbf9991 (diff) | |
download | vim4projects-c7d66805e30493054e460a8f4f698bec98efab18.tar.gz vim4projects-c7d66805e30493054e460a8f4f698bec98efab18.tar.xz vim4projects-c7d66805e30493054e460a8f4f698bec98efab18.zip |
replace TagList-plus with Tagbar + other changes
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r-- | .gitmodules | 19 | ||||
-rw-r--r-- | README.txt | 37 | ||||
m--------- | git-tagbar | 0 | ||||
m--------- | git-taglist-plus | 0 | ||||
-rwxr-xr-x | init.sh | 143 | ||||
-rwxr-xr-x | vim-init.sh | 23 |
6 files changed, 187 insertions, 35 deletions
diff --git a/.gitmodules b/.gitmodules index def4476..1eeec99 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,13 +1,18 @@ -# integrate pylint, rope, pydoc, pyflakes -# + extra highlighting, whitespace removal ... +# +# python +# + [submodule "git-python-mode"] path = git-python-mode url = git://github.com/klen/python-mode.git -# taglist plugin incl. support for JavaScript -[submodule "git-taglist-plus"] - path = git-taglist-plus - url = git://github.com/klen/vim-taglist-plus.git -# to be integrated with tests + +# +# optional +# + [submodule "git-makegreen"] path = git-makegreen url = git://github.com/reinh/vim-makegreen.git +[submodule "git-tagbar"] + path = git-tagbar + url = git://github.com/majutsushi/tagbar.git @@ -1,6 +1,12 @@ -Script ./vim-init.sh provides a way to get preferred vim plugins -for development. All will be prepared in ./vim-bundle dir. -In order to use them conveniently from here, install pathogen [1] +Shared collection of vim plugins useful for development +======================================================= + +Script ./init.sh provides a way to get selected vim plugins +useful for development. Plugins are categorized, for list of +them, see "./init.sh help" ("all" will select them all). +The plugins are prepared in this directory, in own subdirs. + +To use plugins conveniently from here, install pathogen [1] as per instructions, but add this to your ~/.vimrc: filetype off @@ -17,7 +23,8 @@ additions of new plugins upon pulling. Call pathogen without the parameter then. -After restarting vim, everything should work. To check this, +After restarting vim, everything should work. To check this +(if ./init.sh python or ./init.sh all was used only), ":PymodeVersion'" should output something like: Current python-mode version: 0.5.5" @@ -25,10 +32,14 @@ After restarting vim, everything should work. To check this, It is important that this test is passing! +To remove particular category completely, just run +"./init.sh del <category>". + + Please note that some of the plugins have dependencies; non-exhaustive enumeration (refer to per-plugin README files): -- taglist-plus +- Tagbar - exuberant ctags (?), Fedora: ctags-etags - jsctags + node.js: see respective README @@ -38,5 +49,21 @@ following sources (mostly the main pages at github.com): - python-mode: https://github.com/klen/python-mode +The settings that should be shared can be set in _local_vimrc +files within particular project repo. + + +If you think some plugin is missing, please drop me a line [2]. +Note that this collection is meant to provide only plugins +that support collaboration (as local_vimrc) and/or are a clear +choice for selected kind of development (Python, TG2, web, ...). + +Plugins of deliberate personal choice and possibly conflicting +what another one uses privately (e.g., buffer management) does +not belong here. If there is a conflict of included plugin, +please let me know. (Tagbar is an exception, alternative is +TagList, but it seems unmaintained). + [1] https://github.com/tpope/vim-pathogen +[2] mailto:jpokorny@redhat.com diff --git a/git-tagbar b/git-tagbar new file mode 160000 +Subproject 392de7da25ac2778324407e7d148dfefed2f4d2 diff --git a/git-taglist-plus b/git-taglist-plus deleted file mode 160000 -Subproject d1ac211f70efbba4e7cfa7049855b4c924ac56b @@ -0,0 +1,143 @@ +#!/bin/sh +# Read README.txt first. +# jpokorny@redhat.com + +# +# helpers +# + +announce () { + # use colours if available + echo + if test -t 1; then + echo -en "\\033[32m" + echo -n "$1" + echo -e "\\033[0m" + else + echo "[[ $1 ]]" + + fi +} + +do_del () { + #echo "delete $1?" + [ -d "$1" ] && rm -rfI -- "$1" || echo "$1 not present" +} + +do_wget () { + # usage: $1 = action, $2 = target dir, $2..n = actual arguments to wget + if [ $# -le 2 ]; then + echo "do_wget: not enough arguments" + exit 2 + fi + if [ "$(dirname $2)" == "." ]; then + toplevel="$2" + else + toplevel="$(dirname $2)" + fi + announce "$1 $toplevel (wget)" + + if [ "$1" == "get" ]; then + wget -nv -P "$2" "${@:3}" 2>&1 + else + do_del "$toplevel" + fi + ret=$? + [ $ret -ne 0 ] && announce "action failed with exit status $?" + return $ret +} + +git_init_submodule () { + # usage: $1 = action, $2..n submodules + ret=0 + for submodule in "${@:2}"; do + announce "$1 $submodule (git submodule)" + if [ "$1" == "get" ]; then + git submodule update --init "$submodule" 2>&1 + else + do_del "$submodule" + fi + ret=$? + [ $ret -ne 0 ] && break + done + [ $ret -ne 0 ] && announce "action failed with exit status $?" + return $ret +} + +# +# categories of plugins + recipes to get them +# + +common () { + announce "--- common ---" + # local_vimrc: + # directory-local settings applied to contained files + LOCAL_VIMRC_DIR="local-vimrc" + LOCAL_VIMRC_URL="http://lh-vim.googlecode.com/svn/misc/trunk/plugin/local_vimrc.vim" + # "plugin" directory has to be added (downloading recursively + # the whole original "plugin" path for one file is impractical) + do_wget $1 "$LOCAL_VIMRC_DIR/plugin" -nc "$LOCAL_VIMRC_URL" +} + +python () { + announce "--- python ---" + # Python-mode: + # integrates pylint, rope, pydoc, pyflakes + # + extra highlighting, whitespace removal ... + git_init_submodule $1 "git-python-mode" +} + +tg2 () { + announce "--- tg2 ---" + # genshi-contrib: + # from genshi svn, contrib/vim + # TODO: is there a less complicated way to get these files? + GENSHI_CONTRIB_DIR="genshi-contrib" + GENSHI_CONTRIB_URL="http://svn.edgewall.org/repos/genshi/contrib/vim/" + do_wget $1 "$GENSHI_CONTRIB_DIR" -nc -e robots=off -r -l3 -np -nH --cut-dirs=4 -R index.html "$GENSHI_CONTRIB_URL" +} + +web () { + announce "--- web ---" + # empty for now +} + +optional () { + announce "--- optional ---" + # makegreen: + # test results integration + # Tagbar (possible alternative TagList): + # "code navigator" incl. JS support if jsctags installed + git_init_submodule $1 "git-makegreen" "git-tagbar" +} + +# +# go +# + +main () { + action="get" + if [ "$1" == "get" -o "$1" == "del" ]; then + action="$1" + shift + fi + while [ -n "$1" ]; do + case "$1" in + common|python|tg2|web|optional) + $1 $action || exit $? + shift;; + all) + main $action common python tg2 web optional + break;; + help|*) + echo "usage: ./init.sh [del] (common|python|tg2|web|optional|all)+" + break;; + esac + done +} + +if [ $# -eq 0 ]; then + main help +else + main "$@" +fi diff --git a/vim-init.sh b/vim-init.sh deleted file mode 100755 index 92cd11e..0000000 --- a/vim-init.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Read vim.txt first. - -WGET="wget -nv" - -echo -echo "[initializing/updating local git submodules]" -git submodule update --init - -LOCAL_VIMRC_DIR="local-vimrc" -LOCAL_VIMRC_URL="http://lh-vim.googlecode.com/svn/misc/trunk/plugin/local_vimrc.vim" -echo -echo "[getting $LOCAL_VIMRC_DIR]" -# "plugin" directory has to be added (downloading recursively -# the whole original "plugin" path for one file is impractical) -$WGET -P "$LOCAL_VIMRC_DIR/plugin" -nc "$LOCAL_VIMRC_URL" - -# TODO: is there a less complicated way to get these files? -GENSHI_CONTRIB_DIR="genshi-contrib" -GENSHI_CONTRIB_URL="http://svn.edgewall.org/repos/genshi/contrib/vim/" -echo -echo "[getting $GENSHI_CONTRIB_DIR]" -$WGET -P "$GENSHI_CONTRIB_DIR" -nc -e robots=off -r -l3 -np -nH --cut-dirs=4 -R index.html "$GENSHI_CONTRIB_URL" |