diff --git a/bash_ps1 b/bash/.bash_ps1 similarity index 100% rename from bash_ps1 rename to bash/.bash_ps1 diff --git a/bashrc b/bash/.bashrc similarity index 100% rename from bashrc rename to bash/.bashrc diff --git a/lynxrc b/crap/.lynxrc similarity index 100% rename from lynxrc rename to crap/.lynxrc diff --git a/octaverc b/crap/.octaverc similarity index 100% rename from octaverc rename to crap/.octaverc diff --git a/procmailrc b/crap/.procmailrc similarity index 100% rename from procmailrc rename to crap/.procmailrc diff --git a/signature b/crap/.signature similarity index 100% rename from signature rename to crap/.signature diff --git a/gitconfig b/git/.gitconfig similarity index 100% rename from gitconfig rename to git/.gitconfig diff --git a/gitignore b/git/.gitignore similarity index 100% rename from gitignore rename to git/.gitignore diff --git a/git_auto_pull.sh b/git/git_auto_pull.sh similarity index 100% rename from git_auto_pull.sh rename to git/git_auto_pull.sh diff --git a/Xmodmap b/graphical/.Xmodmap similarity index 100% rename from Xmodmap rename to graphical/.Xmodmap diff --git a/inputrc b/graphical/.inputrc similarity index 100% rename from inputrc rename to graphical/.inputrc diff --git a/xinitrc b/graphical/.xinitrc similarity index 100% rename from xinitrc rename to graphical/.xinitrc diff --git a/install.sh b/install.sh deleted file mode 100755 index 754cc7f..0000000 --- a/install.sh +++ /dev/null @@ -1,144 +0,0 @@ -#!/bin/bash -set -x -function deploy_directory() -{ # {{{ -# @arg1: dst directory -# @arg2: src directory - - if [ ! -d $1 ]; then mkdir $1; fi; - cd $1; - - for i in `ls $2`; do ln -s $2/$i ./$i; done - cd .. -} # }}} - -function deploy_encryption() -{ - cd ~ - mkdir $SECURE_DIR/.mozilla - ln -s $SECURE_DIR/.mozilla ~./.mozilla -} - -function deploy_for_desktop() -{ # {{{ - cd ~ - ln -s $WAI/xinitrc ./.xinitrc - ln -s $WAI/xbindkeysrc ./.xbindkeysrc - ln -s $WAI/inputrc ./.inputrc - ln -s $WAI/Xmodmap ./.Xmodmap - ln -s $WAI/octaverc ./.octaverc - ln -s $WAI/lynxrc ./.lynxrc - - cd ~ - deploy_directory ~/texmf $WAI/texmf - - cd ~ - if [ ! -d "~/.my_utils" ]; then mkdir ~/.my_utils; fi; - cd ~/.my_utils - ln -s $WAI/Utils/track.sh ./track.sh - ln -s $WAI/Utils/blink.sh ./blink.sh - ln -s $WAI/Utils/octopus.sh ./octopus.sh - - - ln -s $WAI/chooseWP.sh ~/Pictures/wallpapers/chooseWP.sh -} # }}} - -function deploy_vim() -{ # {{{ - - cd ~ - ln -s $WAI/vim/vimrc ./.vimrc - ln -s $WAI/vim ./.vim - -} # }}} - -function deploy_ssh() -{ # {{{ - cd ~ - if [ -d ~/.ssh && ! -h ~/.ssh ]; then - mv ~/.ssh ~/.sshBAK - fi; - - if [ ! -d "$SECURE_DIR/.ssh/" ]; then - mkdir "$SECURE_DIR/.ssh" - if [ -d ~/.sshBAK ]; then #could've reversed 2 ifs, i know - mv ~/.sshBAK/* $SECURE_DIR/.ssh/ - rm -f ~/.sshBAK - fi; - fi; - - ln -s $SECURE_DIR/.ssh/ ~/.ssh - - cd ~/.ssh - ln -s $WAI/ssh/config ./ -} # }}} - -function deploy_mutt() -{ # {{{ - cd ~ - ln -s $WAI/mailcap ./.mailcap - - if [ -d ~/.mutt && ! -h ~/.mutt ]; then - mv ~/.mutt ~/.muttBAK - fi; - - if [ ! -d $SECURE_DIR/.mutt ]; then - mkdir $SECURE_DIR/.mutt; - if [ -d ~/.muttBAK ]; then - mv ~/.muttBAK/* $SECURE_DIR/.mutt/ - fi; - fi; - - if [ ! -h ~/.mutt ]; then - ln -s $SECURE_DIR/.mutt/ ~/.mutt/ - fi - - cd ~/.mutt - ln -s $WAI/mutt/muttrc ./ - ln -s $WAI/mutt/killsig ./ - ln -s $WAI/mutt/passwords.gpg ./ - ln -s $WAI/mutt/crypto ./ - ln -s $WAI/mutt/colors.test1 ./ - ln -s $WAI/mutt/colors.test2 ./ - ln -s $WAI/mutt/unlock-pass.sh ./ - ln -s $WAI/mutt/account.frank ./ - ln -s $WAI/mutt/account.aei ./ - - mkdir ~/.mutt/certificates - mkdir ~/.mutt/cache - mkdir ~/.mutt/cache/bodies - mkdir ~/.mutt/cache/headers -} # }}} - - -WAI=`pwd` - -if [ $(hostname) = "intersect" ]; then - SECURE_DIR=~/Private -else - SECURE_DIR=~ - echo "FIXME" -fi; - -#simple files -cd ~ -ln -s $WAI/Utils/ .my_utils -ln -s $WAI/bashrc ./.bashrc -ln -s $WAI/bash_ps1 ./.bash_ps1 -ln -s $WAI/signature ./.signature -ln -s $WAI/gitconfig ./.gitconfig -ln -s $WAI/vacation.msg ./.vacation.msg - -deploy_for_desktop -#deploy_encryption -deploy_vim -deploy_ssh -deploy_mutt - - -cd ~ -if [ -d "Programmation" ]; then mkdir Programmation; fi; -cd ~/Programmation -ln -s $WAI/git_auto_pull.sh ./git_auto_pull.sh - - diff --git a/texmf/tex/latex/frank_tex/blindtext.sty b/latex/texmf/tex/latex/frank_tex/blindtext.sty similarity index 100% rename from texmf/tex/latex/frank_tex/blindtext.sty rename to latex/texmf/tex/latex/frank_tex/blindtext.sty diff --git a/texmf/tex/latex/frank_tex/boiboites.sty b/latex/texmf/tex/latex/frank_tex/boiboites.sty similarity index 100% rename from texmf/tex/latex/frank_tex/boiboites.sty rename to latex/texmf/tex/latex/frank_tex/boiboites.sty diff --git a/texmf/tex/latex/frank_tex/chngcntr.sty b/latex/texmf/tex/latex/frank_tex/chngcntr.sty similarity index 100% rename from texmf/tex/latex/frank_tex/chngcntr.sty rename to latex/texmf/tex/latex/frank_tex/chngcntr.sty diff --git a/texmf/tex/latex/frank_tex/csvsimple.sty b/latex/texmf/tex/latex/frank_tex/csvsimple.sty similarity index 100% rename from texmf/tex/latex/frank_tex/csvsimple.sty rename to latex/texmf/tex/latex/frank_tex/csvsimple.sty diff --git a/texmf/tex/latex/frank_tex/framed.sty b/latex/texmf/tex/latex/frank_tex/framed.sty similarity index 100% rename from texmf/tex/latex/frank_tex/framed.sty rename to latex/texmf/tex/latex/frank_tex/framed.sty diff --git a/texmf/tex/latex/frank_tex/frank_tex.sty b/latex/texmf/tex/latex/frank_tex/frank_tex.sty similarity index 100% rename from texmf/tex/latex/frank_tex/frank_tex.sty rename to latex/texmf/tex/latex/frank_tex/frank_tex.sty diff --git a/texmf/tex/latex/frank_tex/french.sty b/latex/texmf/tex/latex/frank_tex/french.sty similarity index 100% rename from texmf/tex/latex/frank_tex/french.sty rename to latex/texmf/tex/latex/frank_tex/french.sty diff --git a/texmf/tex/latex/frank_tex/fullpage.sty b/latex/texmf/tex/latex/frank_tex/fullpage.sty similarity index 100% rename from texmf/tex/latex/frank_tex/fullpage.sty rename to latex/texmf/tex/latex/frank_tex/fullpage.sty diff --git a/texmf/tex/latex/frank_tex/lipsum.sty b/latex/texmf/tex/latex/frank_tex/lipsum.sty similarity index 100% rename from texmf/tex/latex/frank_tex/lipsum.sty rename to latex/texmf/tex/latex/frank_tex/lipsum.sty diff --git a/texmf/tex/latex/frank_tex/mcode.sty b/latex/texmf/tex/latex/frank_tex/mcode.sty similarity index 100% rename from texmf/tex/latex/frank_tex/mcode.sty rename to latex/texmf/tex/latex/frank_tex/mcode.sty diff --git a/texmf/tex/latex/frank_tex/minipage.sty b/latex/texmf/tex/latex/frank_tex/minipage.sty similarity index 100% rename from texmf/tex/latex/frank_tex/minipage.sty rename to latex/texmf/tex/latex/frank_tex/minipage.sty diff --git a/texmf/tex/latex/frank_tex/moreverb.sty b/latex/texmf/tex/latex/frank_tex/moreverb.sty similarity index 100% rename from texmf/tex/latex/frank_tex/moreverb.sty rename to latex/texmf/tex/latex/frank_tex/moreverb.sty diff --git a/texmf/tex/latex/frank_tex/qtree.sty b/latex/texmf/tex/latex/frank_tex/qtree.sty similarity index 100% rename from texmf/tex/latex/frank_tex/qtree.sty rename to latex/texmf/tex/latex/frank_tex/qtree.sty diff --git a/texmf/tex/latex/frank_tex/sistyle.sty b/latex/texmf/tex/latex/frank_tex/sistyle.sty similarity index 100% rename from texmf/tex/latex/frank_tex/sistyle.sty rename to latex/texmf/tex/latex/frank_tex/sistyle.sty diff --git a/texmf/tex/latex/frank_tex/stdclsdv.sty b/latex/texmf/tex/latex/frank_tex/stdclsdv.sty similarity index 100% rename from texmf/tex/latex/frank_tex/stdclsdv.sty rename to latex/texmf/tex/latex/frank_tex/stdclsdv.sty diff --git a/texmf/tex/latex/frank_tex/titlesec.sty b/latex/texmf/tex/latex/frank_tex/titlesec.sty similarity index 100% rename from texmf/tex/latex/frank_tex/titlesec.sty rename to latex/texmf/tex/latex/frank_tex/titlesec.sty diff --git a/texmf/tex/latex/frank_tex/tocloft.sty b/latex/texmf/tex/latex/frank_tex/tocloft.sty similarity index 100% rename from texmf/tex/latex/frank_tex/tocloft.sty rename to latex/texmf/tex/latex/frank_tex/tocloft.sty diff --git a/texmf/tex/latex/frank_tex/tracklang.sty b/latex/texmf/tex/latex/frank_tex/tracklang.sty similarity index 100% rename from texmf/tex/latex/frank_tex/tracklang.sty rename to latex/texmf/tex/latex/frank_tex/tracklang.sty diff --git a/texmf/tex/latex/frank_tex/tracklang.tex b/latex/texmf/tex/latex/frank_tex/tracklang.tex similarity index 100% rename from texmf/tex/latex/frank_tex/tracklang.tex rename to latex/texmf/tex/latex/frank_tex/tracklang.tex diff --git a/texmf/tex/latex/pgfplots/INSTALL b/latex/texmf/tex/latex/pgfplots/INSTALL similarity index 100% rename from texmf/tex/latex/pgfplots/INSTALL rename to latex/texmf/tex/latex/pgfplots/INSTALL diff --git a/texmf/tex/latex/pgfplots/README b/latex/texmf/tex/latex/pgfplots/README similarity index 100% rename from texmf/tex/latex/pgfplots/README rename to latex/texmf/tex/latex/pgfplots/README diff --git a/texmf/tex/latex/pgfplots/bugtracker.sty b/latex/texmf/tex/latex/pgfplots/bugtracker.sty similarity index 100% rename from texmf/tex/latex/pgfplots/bugtracker.sty rename to latex/texmf/tex/latex/pgfplots/bugtracker.sty diff --git a/texmf/tex/latex/pgfplots/doc/TeX-programming-notes.pdf b/latex/texmf/tex/latex/pgfplots/doc/TeX-programming-notes.pdf similarity index 100% rename from texmf/tex/latex/pgfplots/doc/TeX-programming-notes.pdf rename to latex/texmf/tex/latex/pgfplots/doc/TeX-programming-notes.pdf diff --git a/texmf/tex/latex/pgfplots/doc/pgfplots.doc.src.tar.bz2 b/latex/texmf/tex/latex/pgfplots/doc/pgfplots.doc.src.tar.bz2 similarity index 100% rename from texmf/tex/latex/pgfplots/doc/pgfplots.doc.src.tar.bz2 rename to latex/texmf/tex/latex/pgfplots/doc/pgfplots.doc.src.tar.bz2 diff --git a/texmf/tex/latex/pgfplots/doc/pgfplots.pdf b/latex/texmf/tex/latex/pgfplots/doc/pgfplots.pdf similarity index 100% rename from texmf/tex/latex/pgfplots/doc/pgfplots.pdf rename to latex/texmf/tex/latex/pgfplots/doc/pgfplots.pdf diff --git a/texmf/tex/latex/pgfplots/doc/pgfplotsexample-context.pdf b/latex/texmf/tex/latex/pgfplots/doc/pgfplotsexample-context.pdf similarity index 100% rename from texmf/tex/latex/pgfplots/doc/pgfplotsexample-context.pdf rename to latex/texmf/tex/latex/pgfplots/doc/pgfplotsexample-context.pdf diff --git a/texmf/tex/latex/pgfplots/doc/pgfplotsexample-context.tex b/latex/texmf/tex/latex/pgfplots/doc/pgfplotsexample-context.tex similarity index 100% rename from texmf/tex/latex/pgfplots/doc/pgfplotsexample-context.tex rename to latex/texmf/tex/latex/pgfplots/doc/pgfplotsexample-context.tex diff --git a/texmf/tex/latex/pgfplots/doc/pgfplotsexample-plain.pdf b/latex/texmf/tex/latex/pgfplots/doc/pgfplotsexample-plain.pdf similarity index 100% rename from texmf/tex/latex/pgfplots/doc/pgfplotsexample-plain.pdf rename to latex/texmf/tex/latex/pgfplots/doc/pgfplotsexample-plain.pdf diff --git a/texmf/tex/latex/pgfplots/doc/pgfplotsexample-plain.tex b/latex/texmf/tex/latex/pgfplots/doc/pgfplotsexample-plain.tex similarity index 100% rename from texmf/tex/latex/pgfplots/doc/pgfplotsexample-plain.tex rename to latex/texmf/tex/latex/pgfplots/doc/pgfplotsexample-plain.tex diff --git a/texmf/tex/latex/pgfplots/doc/pgfplotsexample.pdf b/latex/texmf/tex/latex/pgfplots/doc/pgfplotsexample.pdf similarity index 100% rename from texmf/tex/latex/pgfplots/doc/pgfplotsexample.pdf rename to latex/texmf/tex/latex/pgfplots/doc/pgfplotsexample.pdf diff --git a/texmf/tex/latex/pgfplots/doc/pgfplotsexample.tex b/latex/texmf/tex/latex/pgfplots/doc/pgfplotsexample.tex similarity index 100% rename from texmf/tex/latex/pgfplots/doc/pgfplotsexample.tex rename to latex/texmf/tex/latex/pgfplots/doc/pgfplotsexample.tex diff --git a/texmf/tex/latex/pgfplots/doc/pgfplotstable.pdf b/latex/texmf/tex/latex/pgfplots/doc/pgfplotstable.pdf similarity index 100% rename from texmf/tex/latex/pgfplots/doc/pgfplotstable.pdf rename to latex/texmf/tex/latex/pgfplots/doc/pgfplotstable.pdf diff --git a/texmf/tex/latex/pgfplots/doc/pgfplotstodo.pdf b/latex/texmf/tex/latex/pgfplots/doc/pgfplotstodo.pdf similarity index 100% rename from texmf/tex/latex/pgfplots/doc/pgfplotstodo.pdf rename to latex/texmf/tex/latex/pgfplots/doc/pgfplotstodo.pdf diff --git a/texmf/tex/latex/pgfplots/libs/tikzlibrarypgfplots.clickable.code.tex b/latex/texmf/tex/latex/pgfplots/libs/tikzlibrarypgfplots.clickable.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/libs/tikzlibrarypgfplots.clickable.code.tex rename to latex/texmf/tex/latex/pgfplots/libs/tikzlibrarypgfplots.clickable.code.tex diff --git a/texmf/tex/latex/pgfplots/libs/tikzlibrarypgfplotsclickable.code.tex b/latex/texmf/tex/latex/pgfplots/libs/tikzlibrarypgfplotsclickable.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/libs/tikzlibrarypgfplotsclickable.code.tex rename to latex/texmf/tex/latex/pgfplots/libs/tikzlibrarypgfplotsclickable.code.tex diff --git a/texmf/tex/latex/pgfplots/pgfplots.code.tex b/latex/texmf/tex/latex/pgfplots/pgfplots.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/pgfplots.code.tex rename to latex/texmf/tex/latex/pgfplots/pgfplots.code.tex diff --git a/texmf/tex/latex/pgfplots/pgfplots.sty b/latex/texmf/tex/latex/pgfplots/pgfplots.sty similarity index 100% rename from texmf/tex/latex/pgfplots/pgfplots.sty rename to latex/texmf/tex/latex/pgfplots/pgfplots.sty diff --git a/texmf/tex/latex/pgfplots/pgfplotscore.code.tex b/latex/texmf/tex/latex/pgfplots/pgfplotscore.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/pgfplotscore.code.tex rename to latex/texmf/tex/latex/pgfplots/pgfplotscore.code.tex diff --git a/texmf/tex/latex/pgfplots/pgfplotstable.sty b/latex/texmf/tex/latex/pgfplots/pgfplotstable.sty similarity index 100% rename from texmf/tex/latex/pgfplots/pgfplotstable.sty rename to latex/texmf/tex/latex/pgfplots/pgfplotstable.sty diff --git a/texmf/tex/latex/pgfplots/pgfregressiontest.sty b/latex/texmf/tex/latex/pgfplots/pgfregressiontest.sty similarity index 100% rename from texmf/tex/latex/pgfplots/pgfregressiontest.sty rename to latex/texmf/tex/latex/pgfplots/pgfregressiontest.sty diff --git a/texmf/tex/latex/pgfplots/scripts/matlab2pgfplots.m b/latex/texmf/tex/latex/pgfplots/scripts/matlab2pgfplots.m similarity index 100% rename from texmf/tex/latex/pgfplots/scripts/matlab2pgfplots.m rename to latex/texmf/tex/latex/pgfplots/scripts/matlab2pgfplots.m diff --git a/texmf/tex/latex/pgfplots/scripts/matlab2pgfplots.sh b/latex/texmf/tex/latex/pgfplots/scripts/matlab2pgfplots.sh similarity index 100% rename from texmf/tex/latex/pgfplots/scripts/matlab2pgfplots.sh rename to latex/texmf/tex/latex/pgfplots/scripts/matlab2pgfplots.sh diff --git a/texmf/tex/latex/pgfplots/scripts/pgf2pdf.sh b/latex/texmf/tex/latex/pgfplots/scripts/pgf2pdf.sh similarity index 100% rename from texmf/tex/latex/pgfplots/scripts/pgf2pdf.sh rename to latex/texmf/tex/latex/pgfplots/scripts/pgf2pdf.sh diff --git a/texmf/tex/latex/pgfplots/scripts/pgfplots.py b/latex/texmf/tex/latex/pgfplots/scripts/pgfplots.py similarity index 100% rename from texmf/tex/latex/pgfplots/scripts/pgfplots.py rename to latex/texmf/tex/latex/pgfplots/scripts/pgfplots.py diff --git a/texmf/tex/latex/pgfplots/source/pgfplotstests.context.tar.bz2 b/latex/texmf/tex/latex/pgfplots/source/pgfplotstests.context.tar.bz2 similarity index 100% rename from texmf/tex/latex/pgfplots/source/pgfplotstests.context.tar.bz2 rename to latex/texmf/tex/latex/pgfplots/source/pgfplotstests.context.tar.bz2 diff --git a/texmf/tex/latex/pgfplots/source/pgfplotstests.tar.bz2 b/latex/texmf/tex/latex/pgfplots/source/pgfplotstests.tar.bz2 similarity index 100% rename from texmf/tex/latex/pgfplots/source/pgfplotstests.tar.bz2 rename to latex/texmf/tex/latex/pgfplots/source/pgfplotstests.tar.bz2 diff --git a/texmf/tex/latex/pgfplots/tex/bugtracker.sty b/latex/texmf/tex/latex/pgfplots/tex/bugtracker.sty similarity index 100% rename from texmf/tex/latex/pgfplots/tex/bugtracker.sty rename to latex/texmf/tex/latex/pgfplots/tex/bugtracker.sty diff --git a/texmf/tex/latex/pgfplots/tex/pgflibraryfillbetween.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgflibraryfillbetween.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgflibraryfillbetween.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgflibraryfillbetween.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-dvipdfmx.def b/latex/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-dvipdfmx.def similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-dvipdfmx.def rename to latex/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-dvipdfmx.def diff --git a/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-dvips.def b/latex/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-dvips.def similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-dvips.def rename to latex/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-dvips.def diff --git a/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-pdftex.def b/latex/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-pdftex.def similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-pdftex.def rename to latex/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-pdftex.def diff --git a/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-xetex.def b/latex/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-xetex.def similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-xetex.def rename to latex/texmf/tex/latex/pgfplots/tex/pgflibrarypgfplots.surfshading.pgfsys-xetex.def diff --git a/texmf/tex/latex/pgfplots/tex/pgfplots.assert.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplots.assert.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplots.assert.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplots.assert.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplots.assert.sty b/latex/texmf/tex/latex/pgfplots/tex/pgfplots.assert.sty similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplots.assert.sty rename to latex/texmf/tex/latex/pgfplots/tex/pgfplots.assert.sty diff --git a/texmf/tex/latex/pgfplots/tex/pgfplots.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplots.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplots.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplots.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplots.errorbars.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplots.errorbars.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplots.errorbars.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplots.errorbars.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplots.lua b/latex/texmf/tex/latex/pgfplots/tex/pgfplots.lua similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplots.lua rename to latex/texmf/tex/latex/pgfplots/tex/pgfplots.lua diff --git a/texmf/tex/latex/pgfplots/tex/pgfplots.markers.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplots.markers.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplots.markers.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplots.markers.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplots.paths.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplots.paths.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplots.paths.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplots.paths.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplots.revision.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplots.revision.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplots.revision.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplots.revision.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplots.scaling.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplots.scaling.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplots.scaling.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplots.scaling.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplots.sty b/latex/texmf/tex/latex/pgfplots/tex/pgfplots.sty similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplots.sty rename to latex/texmf/tex/latex/pgfplots/tex/pgfplots.sty diff --git a/texmf/tex/latex/pgfplots/tex/pgfplots.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplots.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplots.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplots.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsarray.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsarray.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsarray.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsarray.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsbinary.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsbinary.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsbinary.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsbinary.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsbinary.data.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsbinary.data.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsbinary.data.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsbinary.data.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotscolor.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotscolor.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotscolor.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotscolor.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotscolormap.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotscolormap.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotscolormap.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotscolormap.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotscoordprocessing.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotscoordprocessing.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotscoordprocessing.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotscoordprocessing.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotscore.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotscore.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotscore.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotscore.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsdeque.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsdeque.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsdeque.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsdeque.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotslibrary.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotslibrary.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotslibrary.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotslibrary.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsliststructure.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsliststructure.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsliststructure.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsliststructure.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsliststructureext.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsliststructureext.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsliststructureext.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsliststructureext.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsmatrix.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsmatrix.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsmatrix.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsmatrix.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsmeshplothandler.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsmeshplothandler.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsmeshplothandler.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsmeshplothandler.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_loader.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_loader.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_loader.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_loader.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_misc.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_misc.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_misc.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_misc.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_patches.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_patches.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_patches.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_patches.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcoreexternal.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcoreimage.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcoreimage.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcoreimage.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcoreimage.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcorelayers.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcorelayers.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcorelayers.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcorelayers.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcorescopes.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcorescopes.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcorescopes.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfcorescopes.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfkeys.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfkeys.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfkeys.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfkeys.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfkeysfiltered.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryfpu.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryintersections.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryintersections.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryintersections.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryintersections.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmanual.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmanual.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmanual.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmanual.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmanual.pdflinks.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmanual.prettyprinter.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmathfloat.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmathfloat.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmathfloat.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfmathfloat.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfutil-common-lists.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfutil-common-lists.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfutil-common-lists.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_pgfutil-common-lists.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_tikzexternal.sty b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_tikzexternal.sty similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_tikzexternal.sty rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_tikzexternal.sty diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_tikzexternalshared.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_tikzexternalshared.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_tikzexternalshared.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_tikzexternalshared.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_tikzlibraryexternal.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_trig_format.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_trig_format.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_trig_format.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsoldpgfsupp_trig_format.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsplothandlers.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsplothandlers.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsplothandlers.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsplothandlers.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsstackedplots.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsstackedplots.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsstackedplots.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsstackedplots.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotssysgeneric.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotssysgeneric.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotssysgeneric.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotssysgeneric.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotstable.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotstable.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotstable.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotstable.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotstable.coltype.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotstable.coltype.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotstable.coltype.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotstable.coltype.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotstable.sty b/latex/texmf/tex/latex/pgfplots/tex/pgfplotstable.sty similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotstable.sty rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotstable.sty diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotstable.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotstable.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotstable.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotstable.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotstableshared.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotstableshared.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotstableshared.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotstableshared.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsticks.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsticks.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsticks.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsticks.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsutil.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsutil.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsutil.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsutil.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfplotsutil.verb.code.tex b/latex/texmf/tex/latex/pgfplots/tex/pgfplotsutil.verb.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfplotsutil.verb.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/pgfplotsutil.verb.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/pgfregressiontest.sty b/latex/texmf/tex/latex/pgfplots/tex/pgfregressiontest.sty similarity index 100% rename from texmf/tex/latex/pgfplots/tex/pgfregressiontest.sty rename to latex/texmf/tex/latex/pgfplots/tex/pgfregressiontest.sty diff --git a/texmf/tex/latex/pgfplots/tex/t-pgfplots.tex b/latex/texmf/tex/latex/pgfplots/tex/t-pgfplots.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/t-pgfplots.tex rename to latex/texmf/tex/latex/pgfplots/tex/t-pgfplots.tex diff --git a/texmf/tex/latex/pgfplots/tex/t-pgfplotstable.tex b/latex/texmf/tex/latex/pgfplots/tex/t-pgfplotstable.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/t-pgfplotstable.tex rename to latex/texmf/tex/latex/pgfplots/tex/t-pgfplotstable.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarydateplot.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarydateplot.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarydateplot.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarydateplot.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarydecorations.softclip.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarydecorations.softclip.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarydecorations.softclip.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarydecorations.softclip.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibraryfillbetween.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibraryfillbetween.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibraryfillbetween.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibraryfillbetween.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.clickable.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.clickable.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.clickable.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.clickable.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.colormaps.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.colormaps.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.colormaps.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.colormaps.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.dateplot.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.dateplot.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.dateplot.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.dateplot.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.decorations.softclip.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.decorations.softclip.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.decorations.softclip.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.decorations.softclip.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.external.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.external.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.external.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.external.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.fillbetween.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.fillbetween.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.fillbetween.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.fillbetween.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.groupplots.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.groupplots.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.groupplots.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.groupplots.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.patchplots.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.patchplots.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.patchplots.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.patchplots.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.polar.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.polar.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.polar.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.polar.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.smithchart.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.smithchart.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.smithchart.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.smithchart.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.statistics.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.statistics.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.statistics.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.statistics.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.ternary.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.ternary.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.ternary.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.ternary.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.units.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.units.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.units.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplots.units.code.tex diff --git a/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplotsclickable.code.tex b/latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplotsclickable.code.tex similarity index 100% rename from texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplotsclickable.code.tex rename to latex/texmf/tex/latex/pgfplots/tex/tikzlibrarypgfplotsclickable.code.tex diff --git a/texmf/tex/latex/siunitx/LICENSE b/latex/texmf/tex/latex/siunitx/LICENSE similarity index 100% rename from texmf/tex/latex/siunitx/LICENSE rename to latex/texmf/tex/latex/siunitx/LICENSE diff --git a/texmf/tex/latex/siunitx/README b/latex/texmf/tex/latex/siunitx/README similarity index 100% rename from texmf/tex/latex/siunitx/README rename to latex/texmf/tex/latex/siunitx/README diff --git a/texmf/tex/latex/siunitx/README.txt b/latex/texmf/tex/latex/siunitx/README.txt similarity index 100% rename from texmf/tex/latex/siunitx/README.txt rename to latex/texmf/tex/latex/siunitx/README.txt diff --git a/texmf/tex/latex/siunitx/siunitx-abbreviations.cfg b/latex/texmf/tex/latex/siunitx/siunitx-abbreviations.cfg similarity index 100% rename from texmf/tex/latex/siunitx/siunitx-abbreviations.cfg rename to latex/texmf/tex/latex/siunitx/siunitx-abbreviations.cfg diff --git a/texmf/tex/latex/siunitx/siunitx-binary.cfg b/latex/texmf/tex/latex/siunitx/siunitx-binary.cfg similarity index 100% rename from texmf/tex/latex/siunitx/siunitx-binary.cfg rename to latex/texmf/tex/latex/siunitx/siunitx-binary.cfg diff --git a/texmf/tex/latex/siunitx/siunitx-version-1.cfg b/latex/texmf/tex/latex/siunitx/siunitx-version-1.cfg similarity index 100% rename from texmf/tex/latex/siunitx/siunitx-version-1.cfg rename to latex/texmf/tex/latex/siunitx/siunitx-version-1.cfg diff --git a/texmf/tex/latex/siunitx/siunitx.aux b/latex/texmf/tex/latex/siunitx/siunitx.aux similarity index 100% rename from texmf/tex/latex/siunitx/siunitx.aux rename to latex/texmf/tex/latex/siunitx/siunitx.aux diff --git a/texmf/tex/latex/siunitx/siunitx.dtx b/latex/texmf/tex/latex/siunitx/siunitx.dtx similarity index 100% rename from texmf/tex/latex/siunitx/siunitx.dtx rename to latex/texmf/tex/latex/siunitx/siunitx.dtx diff --git a/texmf/tex/latex/siunitx/siunitx.dvi b/latex/texmf/tex/latex/siunitx/siunitx.dvi similarity index 100% rename from texmf/tex/latex/siunitx/siunitx.dvi rename to latex/texmf/tex/latex/siunitx/siunitx.dvi diff --git a/texmf/tex/latex/siunitx/siunitx.glo b/latex/texmf/tex/latex/siunitx/siunitx.glo similarity index 100% rename from texmf/tex/latex/siunitx/siunitx.glo rename to latex/texmf/tex/latex/siunitx/siunitx.glo diff --git a/texmf/tex/latex/siunitx/siunitx.hd b/latex/texmf/tex/latex/siunitx/siunitx.hd similarity index 100% rename from texmf/tex/latex/siunitx/siunitx.hd rename to latex/texmf/tex/latex/siunitx/siunitx.hd diff --git a/texmf/tex/latex/siunitx/siunitx.idx b/latex/texmf/tex/latex/siunitx/siunitx.idx similarity index 100% rename from texmf/tex/latex/siunitx/siunitx.idx rename to latex/texmf/tex/latex/siunitx/siunitx.idx diff --git a/texmf/tex/latex/siunitx/siunitx.ins b/latex/texmf/tex/latex/siunitx/siunitx.ins similarity index 100% rename from texmf/tex/latex/siunitx/siunitx.ins rename to latex/texmf/tex/latex/siunitx/siunitx.ins diff --git a/texmf/tex/latex/siunitx/siunitx.log b/latex/texmf/tex/latex/siunitx/siunitx.log similarity index 100% rename from texmf/tex/latex/siunitx/siunitx.log rename to latex/texmf/tex/latex/siunitx/siunitx.log diff --git a/texmf/tex/latex/siunitx/siunitx.out b/latex/texmf/tex/latex/siunitx/siunitx.out similarity index 100% rename from texmf/tex/latex/siunitx/siunitx.out rename to latex/texmf/tex/latex/siunitx/siunitx.out diff --git a/texmf/tex/latex/siunitx/siunitx.pdf b/latex/texmf/tex/latex/siunitx/siunitx.pdf similarity index 100% rename from texmf/tex/latex/siunitx/siunitx.pdf rename to latex/texmf/tex/latex/siunitx/siunitx.pdf diff --git a/texmf/tex/latex/siunitx/siunitx.sty b/latex/texmf/tex/latex/siunitx/siunitx.sty similarity index 100% rename from texmf/tex/latex/siunitx/siunitx.sty rename to latex/texmf/tex/latex/siunitx/siunitx.sty diff --git a/texmf/tex/latex/siunitx/siunitx.tmp b/latex/texmf/tex/latex/siunitx/siunitx.tmp similarity index 100% rename from texmf/tex/latex/siunitx/siunitx.tmp rename to latex/texmf/tex/latex/siunitx/siunitx.tmp diff --git a/texmf/tex/latex/siunitx/siunitx.toc b/latex/texmf/tex/latex/siunitx/siunitx.toc similarity index 100% rename from texmf/tex/latex/siunitx/siunitx.toc rename to latex/texmf/tex/latex/siunitx/siunitx.toc diff --git a/mailcap b/mutt/.mailcap similarity index 100% rename from mailcap rename to mutt/.mailcap diff --git a/mutt/account.frank b/mutt/.mutt/account.frank similarity index 100% rename from mutt/account.frank rename to mutt/.mutt/account.frank diff --git a/mutt/colors.test1 b/mutt/.mutt/colors.test1 similarity index 100% rename from mutt/colors.test1 rename to mutt/.mutt/colors.test1 diff --git a/mutt/colors.test2 b/mutt/.mutt/colors.test2 similarity index 100% rename from mutt/colors.test2 rename to mutt/.mutt/colors.test2 diff --git a/mutt/crypto b/mutt/.mutt/crypto similarity index 100% rename from mutt/crypto rename to mutt/.mutt/crypto diff --git a/mutt/killsig b/mutt/.mutt/killsig similarity index 100% rename from mutt/killsig rename to mutt/.mutt/killsig diff --git a/mutt/muttrc b/mutt/.mutt/muttrc similarity index 100% rename from mutt/muttrc rename to mutt/.mutt/muttrc diff --git a/mutt/passwords.gpg b/mutt/.mutt/passwords.gpg similarity index 100% rename from mutt/passwords.gpg rename to mutt/.mutt/passwords.gpg diff --git a/mutt/unlock-pass.sh b/mutt/.mutt/unlock-pass.sh similarity index 100% rename from mutt/unlock-pass.sh rename to mutt/.mutt/unlock-pass.sh diff --git a/screenrc b/screenrc deleted file mode 100644 index 3337674..0000000 --- a/screenrc +++ /dev/null @@ -1 +0,0 @@ -startup_message off diff --git a/ssh/config b/ssh/.ssh/config similarity index 100% rename from ssh/config rename to ssh/.ssh/config diff --git a/vim/.VimballRecord b/vim/.VimballRecord new file mode 100644 index 0000000..dfda54d --- /dev/null +++ b/vim/.VimballRecord @@ -0,0 +1,2 @@ +supertab.vmb: call delete('/home/frank/.vim/doc/supertab.txt')|call delete('/home/frank/.vim/plugin/supertab.vim') +clang_complete.vmb: call delete('/home/frank/.vim/bin/cc_args.py')|call delete('/home/frank/.vim/doc/clang_complete.txt')|call delete('/home/frank/.vim/plugin/clang/__init__.py')|call delete('/home/frank/.vim/plugin/clang/cindex.py')|call delete('/home/frank/.vim/plugin/clang/enumerations.py')|call delete('/home/frank/.vim/plugin/clang_complete.vim')|call delete('/home/frank/.vim/plugin/libclang.py')|call delete('/home/frank/.vim/plugin/snippets/__init__.py')|call delete('/home/frank/.vim/plugin/snippets/clang_complete.py')|call delete('/home/frank/.vim/plugin/snippets/dummy.py')|call delete('/home/frank/.vim/plugin/snippets/ultisnips.py') diff --git a/vim/.netrwhist b/vim/.netrwhist new file mode 100644 index 0000000..eacc804 --- /dev/null +++ b/vim/.netrwhist @@ -0,0 +1,5 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhist_cnt =3 +let g:netrw_dirhist_1='/home/frank/Studies/MUSE1/Master/src/tests' +let g:netrw_dirhist_2='/home/frank/Programmation/altitude_API/config' +let g:netrw_dirhist_3='/dev/shm/docker-flask/config' diff --git a/vim/autoload/signature.vim b/vim/autoload/signature.vim new file mode 100644 index 0000000..81288cb --- /dev/null +++ b/vim/autoload/signature.vim @@ -0,0 +1,509 @@ +" vim: fdm=marker:et:ts=4:sw=2:sts=2 +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +" +" Helper Functions {{{1 +" +function! s:NumericSort(x, y) " {{{2 + return a:x - a:y +endfunction + + +function! s:MarksList(...) " {{{2 + " Description: Takes two optional arguments - mode and line no. + " If no arguments are specified, returns a list of [mark, line no.] pairs that are in use in the buffer + " or are free to be placed in which case, line no. is 0 + " + " Arguments: a:1 (mode) = 'used' : Returns list of [ [used marks, line no.] ] + " 'free' : Returns list of [ free marks ] + " a:2 (line no.) : Returns list of used marks on current line. Note that mode = 'free' is meaningless + " here and thus, is ignored + + let l:SignatureIncludeMarks = ( exists('b:SignatureIncludeMarks') ? b:SignatureIncludeMarks : g:SignatureIncludeMarks ) + let l:marks_list = [] + + " Add local marks first + for i in filter( split( l:SignatureIncludeMarks, '\zs' ), 'v:val =~# "[a-z]"' ) + let l:marks_list = add(l:marks_list, [i, line("'" . i)]) + endfor + + " Add global (uppercase) marks to list only if it is in use in this buffer or hasn't been used at all. + for i in filter( split( l:SignatureIncludeMarks, '\zs' ), 'v:val =~# "[A-Z]"' ) + let [ l:buf, l:line, l:col, l:off ] = getpos( "'" . i ) + if l:buf == bufnr('%') || l:buf == 0 + let l:marks_list = add(l:marks_list, [i, l:line]) + endif + endfor + + if ( a:0 == 0 ) + return l:marks_list + elseif (( a:0 == 1 ) && ( a:1 ==? "used" )) + return filter( l:marks_list, 'v:val[1] > 0' ) + elseif (( a:0 == 1 ) && ( a:1 ==? "free" )) + return map( filter( l:marks_list, 'v:val[1] == 0' ), 'v:val[0]' ) + elseif (( a:0 == 2 ) && ( a:2 > 0 )) + return map( filter( l:marks_list, 'v:val[1] == ' . a:2 ), 'v:val[0]' ) + endif +endfunction +" }}}2 + + +" +" Toggle Marks/Signs {{{1 +" +function! signature#Input() " {{{2 + " Description: Grab input char + + let l:SignatureIncludeMarkers = ( exists('b:SignatureIncludeMarkers') ? b:SignatureIncludeMarkers : g:SignatureIncludeMarkers ) + let l:SignatureIncludeMarks = ( exists('b:SignatureIncludeMarks') ? b:SignatureIncludeMarks : g:SignatureIncludeMarks ) + + " ... if not, obtain input from user ... + let l:ascii = getchar() + let l:char = nr2char( l:ascii ) + + " Check if 'PlaceNextMark', 'PurgeMarks' or 'PurgeMarkers' was called + if g:SignatureMap['PlaceNextMark'] == "" && l:ascii == 13 | return s:ToggleMark('next') | endif + if g:SignatureMap['PlaceNextMark'] == "" && l:ascii == 32 | return s:ToggleMark('next') | endif + if l:ascii == eval( '"\' . g:SignatureMap['PlaceNextMark'] . '"' ) | return s:ToggleMark('next') | endif + + if g:SignatureMap['PurgeMarks'] == "" && l:ascii == 13 | return signature#PurgeMarks() | endif + if g:SignatureMap['PurgeMarks'] == "" && l:ascii == 32 | return signature#PurgeMarks() | endif + if l:ascii == eval( '"\' . g:SignatureMap['PurgeMarks'] . '"' ) | return signature#PurgeMarks() | endif + + if g:SignatureMap['PurgeMarkers'] == "" && l:ascii == 13 | return signature#PurgeMarkers() | endif + if g:SignatureMap['PurgeMarkers'] == "" && l:ascii == 32 | return signature#PurgeMarkers() | endif + if l:ascii == eval( '"\' . g:SignatureMap['PurgeMarkers'] . '"' ) | return signature#PurgeMarkers() | endif + + " ... if the input is not a number eg. '!' ==> Delete all '!' markers + if stridx( l:SignatureIncludeMarkers, l:char ) >= 0 + return signature#PurgeMarkers( l:char ) + endif + + " ... but if input is a number, convert it to corresponding marker before proceeding + if match( l:char, '\d' ) >= 0 + let l:char = split( ")!@#$%^&*(", '\zs' )[l:char] + endif + + if stridx( l:SignatureIncludeMarkers, l:char ) >= 0 + return s:ToggleMarker( l:char ) + elseif stridx( l:SignatureIncludeMarks, l:char ) >= 0 + return s:ToggleMark( l:char ) + endif + +endfunction + + +function! s:ToggleMark( mark ) " {{{2 + " Description: mark = 'next' : Place new mark on current line else toggle specified mark on current line + " Arguments: mark [,a-z,A-Z] + + let l:lnum = line('.') + + if a:mark == "next" + " Place new mark + let l:mark = s:MarksList( "free" )[0] + if l:mark == "" + echoe "Signature: No free marks left." + return + endif + + execute 'normal! m' . l:mark + call s:ToggleSign( l:mark, "place", l:lnum ) + + else + " Toggle Mark + let l:mark = a:mark + let l:mark_pos = filter( s:MarksList(), 'v:val[0] ==# l:mark' )[0][1] + + if l:mark_pos == l:lnum + " Mark is present on the current line. Remove it and return + execute 'delmarks ' . l:mark + call s:ToggleSign( l:mark, "remove", l:lnum ) + return + + else + " Mark is not present on current line but it may be present somewhere else. We will first place and remove the + " sign to avoid the shifting of the Foldcolumn when there is only 1 mark placed and we re-place it somewhere else + " Place new sign + execute 'normal! m' . l:mark + call s:ToggleSign( l:mark, "place", l:lnum ) + + " l:mark_pos == 0 indicates that the mark was free. If not, we have to remove the sign for the original mark + if l:mark_pos != 0 + call s:ToggleSign( l:mark, "remove", l:mark_pos ) + endif + endif + endif +endfunction + + +function! signature#PurgeMarks() " {{{2 + " Description: Remove all marks + + let l:used_marks = s:MarksList( "used" ) + if empty( l:used_marks ) | return | endif + + if g:SignaturePurgeConfirmation + let choice = confirm("Are you sure you want to delete all marks? This cannot be undone.", "&Yes\n&No", 1) + if choice == 2 | return | endif + endif + + for i in l:used_marks + silent execute 'delmarks ' . i[0] + silent call s:ToggleSign( i[0], "remove", i[1] ) + endfor +endfunction + + +function! s:ToggleMarker( marker ) " {{{2 + " Description: Toggle marker on current line + " Arguments: marker [!@#$%^&*()] + + let l:lnum = line('.') + " If marker is found in on current line, remove it, else place it + let l:mode = ( get( b:sig_markers, l:lnum, "" ) =~# escape( a:marker, '$^' ) ? "remove" : "place" ) + call s:ToggleSign( a:marker, l:mode, l:lnum ) +endfunction + + +function! signature#PurgeMarkers(...) " {{{2 + " Description: If argument is given, removes marker only of the specified type else all markers are removed + + if empty( b:sig_markers ) | return | endif + + if g:SignaturePurgeConfirmation + let choice = confirm("Are you sure you want to delete all markers? This cannot be undone.", "&Yes\n&No", 1) + if choice == 2 | return | endif + endif + + if a:0 > 0 + let l:markers = [ a:1 ] + else + let l:SignatureIncludeMarkers = ( exists('b:SignatureIncludeMarkers') ? b:SignatureIncludeMarkers : g:SignatureIncludeMarkers ) + let l:markers = split( l:SignatureIncludeMarkers, '\zs' ) + endif + + for l:marker in l:markers + for l:lnum in keys( filter( copy(b:sig_markers), 'v:val =~# l:marker' )) + call s:ToggleSign( l:marker, "remove", l:lnum ) + endfor + endfor +endfunction + + +function! s:ToggleSign( sign, mode, lnum ) " {{{2 + " Description: Enable/Disable/Toggle signs for marks/markers on the specified line number, depending on value of mode + " Arguments: + " sign : The mark/marker whose sign is to be placed/removed/toggled + " mode : 'remove' + " : 'place' + " lnum : Line number on/from which the sign is to be placed/removed + " If mode = "remove" and line number is 0, the 'sign' is removed from all lines + + "echom "DEBUG: sign = " . a:sign . ", mode = " . a:mode . ", lnum = " . a:lnum + + let l:SignatureIncludeMarkers = ( exists('b:SignatureIncludeMarkers') ? b:SignatureIncludeMarkers : g:SignatureIncludeMarkers ) + let l:SignatureMarkOrder = ( exists('b:SignatureMarkOrder') ? b:SignatureMarkOrder : g:SignatureMarkOrder ) + let l:SignaturePrioritizeMarks = ( exists('b:SignaturePrioritizeMarks') ? b:SignaturePrioritizeMarks : g:SignaturePrioritizeMarks ) + + " If Signature is not enabled, return + if !b:sig_enabled | return | endif + + let l:lnum = a:lnum + let l:id = ( winbufnr(0) + 1 ) * l:lnum + + " Toggle sign for markers {{{3 + if stridx( l:SignatureIncludeMarkers, a:sign ) >= 0 + + if a:mode ==? "place" + let b:sig_markers[l:lnum] = a:sign . get( b:sig_markers, l:lnum, "" ) + else + let b:sig_markers[l:lnum] = substitute( b:sig_markers[l:lnum], "\\C" . escape( a:sign, '$^' ), "", "" ) + + " If there are no markers on the line, delete signs on that line + if b:sig_markers[l:lnum] == "" + call remove( b:sig_markers, l:lnum ) + endif + endif + + " Toggle sign for marks {{{3 + else + if a:mode ==? "place" + let b:sig_marks[l:lnum] = a:sign . get( b:sig_marks, l:lnum, "" ) + else + " If l:lnum == 0, remove from all lines + if l:lnum == 0 + let l:arr = keys( filter( copy(b:sig_marks), 'v:val =~# a:sign' )) + if empty(l:arr) | return | endif + else + let l:arr = [l:lnum] + endif + + for l:lnum in l:arr + let l:id = ( winbufnr(0) + 1 ) * l:lnum + let b:sig_marks[l:lnum] = substitute( b:sig_marks[l:lnum], "\\C" . a:sign, "", "" ) + + " If there are no marks on the line, delete signs on that line + if b:sig_marks[l:lnum] == "" + call remove( b:sig_marks, l:lnum ) + endif + endfor + endif + endif + "}}}3 + + " TODO: Place sign only if there are no signs from other plugins (eg. syntastic) + if ( has_key( b:sig_marks, l:lnum ) && ( l:SignaturePrioritizeMarks || !has_key( b:sig_markers, l:lnum ))) + let l:str = substitute( l:SignatureMarkOrder, "\m", strpart( b:sig_marks[l:lnum], 0, 1 ), "" ) + let l:str = substitute( l:str, "\p", strpart( b:sig_marks[l:lnum], 1, 1 ), "" ) + execute 'sign define sig_Sign_' . l:id . ' text=' . l:str . ' texthl=' . g:SignatureMarkTextHL + elseif has_key( b:sig_markers, l:lnum ) + let l:str = strpart( b:sig_markers[l:lnum], 0, 1 ) + execute 'sign define sig_Sign_' . l:id . ' text=' . l:str . ' texthl=' . g:SignatureMarkerTextHL + else + execute 'sign unplace ' . l:id + return + endif + execute 'sign place ' . l:id . ' line=' . l:lnum . ' name=sig_Sign_' . l:id . ' buffer=' . winbufnr(0) +endfunction +"}}}2 + + +" +" Navigation {{{1 +" +function! signature#GotoMark( dir, loc, mode ) " {{{2 + " Arguments: + " dir = next : Jump forward + " prev : Jump backward + " loc = line : Jump to first column of line with mark + " spot : Jump to exact column of the mark + " mode = pos : Jump to next mark by position + " alpha : Jump to next mark by alphabetical order + + let l:mark = "" + let l:dir = a:dir + + if a:mode ==? "alpha" + let l:mark = s:GotoMarkByAlpha(a:dir) + elseif a:mode ==? "pos" + let l:mark = s:GotoMarkByPos(a:dir) + endif + + " Note: If l:mark is an empty string then no movement will be made + if l:mark == "" | return | endif + + if a:loc ==? "line" + execute "normal! '" . l:mark + elseif a:loc ==? "spot" + execute 'normal! `' . l:mark + endif +endfunction + + +function! s:GotoMarkByPos( dir ) " {{{2 + " Description: Jump to next/prev mark by location. + " Arguments: dir = next : Jump forward + " prev : Jump backward + + " We need at least one mark to be present. If not, then return an empty string so that no movement will be made + if empty( b:sig_marks ) | return "" | endif + + let l:SignatureWrapJumps = ( exists('b:SignatureWrapJumps') ? b:SignatureWrapJumps : g:SignatureWrapJumps ) + let l:lnum = line('.') + + " Get list of line numbers of lines with marks. + if a:dir ==? "next" + let l:targ = min( sort( keys( b:sig_marks ), "s:NumericSort" )) + let l:mark_lnums = sort( keys( filter( copy( b:sig_marks ), 'v:key > l:lnum')), "s:NumericSort" ) + elseif a:dir ==? "prev" + let l:targ = max( sort( keys( b:sig_marks ), "s:NumericSort" )) + let l:mark_lnums = reverse( sort( keys( filter( copy( b:sig_marks ), 'v:key < l:lnum')), "s:NumericSort" )) + endif + let l:targ = ( empty( l:mark_lnums ) && l:SignatureWrapJumps ? l:targ : l:mark_lnums[0] ) + let l:mark = strpart( b:sig_marks[l:targ], 0, 1 ) + + return l:mark +endfunction + + +function! s:GotoMarkByAlpha( dir ) " {{{2 + " Description: Jump to next/prev mark by alphabetical order. Direction specified as input argument + + let l:SignatureWrapJumps = ( exists('b:SignatureWrapJumps') ? b:SignatureWrapJumps : g:SignatureWrapJumps ) + + let l:used_marks = s:MarksList( "used" ) + let l:line_marks = s:MarksList( "used", line('.') ) + let l:mark = "" + let l:mark_first = "" + + " If there is only one mark in the current file, then return the same + if ( len(l:used_marks) == 1 ) + return l:used_marks[0] + endif + + " Since we can place multiple marks on a line, to jump by alphabetical order we need to know what the current mark is. + " This information is kept in the b:sig_GotoMarkByAlpha_CurrMark variable. For instance, if we have marks a, b, and c + " on the current line and b:sig_GotoMarkByAlpha_CurrMark has the value 'a' then we jump to 'b' and set the value of + " the variable to 'b'. Reinvoking this function will thus now jump to 'c' + + if empty(l:line_marks) + if exists('b:sig_GotoMarkByAlpha_CurrMark') + unlet b:sig_GotoMarkByAlpha_CurrMark + endif + " If there are no marks present on the current line then call GotoMarkByPos to jump to the next line with a mark + return s:GotoMarkByPos(a:dir) + endif + + if (( len(l:line_marks) == 1 ) || !exists('b:sig_GotoMarkByAlpha_CurrMark')) + let b:sig_GotoMarkByAlpha_CurrMark = l:line_marks[0] + endif + + for i in range( 0, len(l:used_marks) - 1 ) + if l:used_marks[i][0] ==# b:sig_GotoMarkByAlpha_CurrMark + if a:dir ==? "next" + if i != len(l:used_marks)-1 + let l:mark = l:used_marks[i+1][0] + let b:sig_GotoMarkByAlpha_CurrMark = l:mark + elseif l:SignatureWrapJumps + let l:mark = l:used_marks[0][0] + let b:sig_GotoMarkByAlpha_CurrMark = l:mark + endif + elseif a:dir ==? "prev" + if i != 0 + let l:mark = l:used_marks[i-1][0] + let b:sig_GotoMarkByAlpha_CurrMark = l:mark + elseif l:SignatureWrapJumps + let l:mark = l:used_marks[-1][0] + let b:sig_GotoMarkByAlpha_CurrMark = l:mark + endif + endif + return l:mark + endif + endfor +endfunction + + +function! signature#GotoMarker( dir, type ) " {{{2 + " Description: Jump to next/prev marker by location. + " Arguments: dir = next : Jump forward + " prev : Jump backward + " type = same : Jump to a marker of the same type + " any : Jump to a marker of any type + + "" We need at least one mark to be present + if empty( b:sig_markers ) | return | endif + + let l:SignatureWrapJumps = ( exists('b:SignatureWrapJumps') ? b:SignatureWrapJumps : g:SignatureWrapJumps ) + let l:lnum = line('.') + + " Get list of line numbers of lines with markers. + " If current line has a marker, filter out line numbers of other markers ... + if has_key( b:sig_markers, l:lnum ) && a:type ==? "same" + let l:marker_lnums = sort( keys( filter( copy(b:sig_markers), + \ 'strpart(v:val, 0, 1) == strpart(b:sig_markers[l:lnum], 0, 1)' )), "s:NumericSort" ) + else + let l:marker_lnums = sort( keys( b:sig_markers ), "s:NumericSort" ) + endif + + if a:dir ==? "prev" + call reverse( l:marker_lnums ) + endif + + if a:dir ==? "next" + let l:targ = ( l:SignatureWrapJumps ? min( l:marker_lnums ) : l:lnum ) + for i in l:marker_lnums + if i > l:lnum + let l:targ = i + break + endif + endfor + + elseif a:dir ==? "prev" + let l:targ = ( l:SignatureWrapJumps ? max( l:marker_lnums ) : l:lnum ) + for i in l:marker_lnums + if i < l:lnum + let l:targ = i + break + endif + endfor + + endif + + execute 'normal! ' . l:targ . 'G' +endfunction +" }}}2 + + +" +" Misc {{{1 +" +function! signature#SignRefresh(...) " {{{2 + " Description: Add signs for new marks/markers and remove signs for deleted marks/markers + " Arguments: '1' to force a sign refresh + + if !exists('b:sig_marks') | let b:sig_marks = {} | endif + " b:sig_marks = { lnum => signs_str } + if !exists('b:sig_markers') | let b:sig_markers = {} | endif + " b:sig_markers = { lnum => marker } + + " If Signature is not enabled, return + if !exists('b:sig_enabled') | let b:sig_enabled = g:SignatureEnabledAtStartup | endif + if !b:sig_enabled | return | endif + + let l:SignatureIncludeMarks = ( exists('b:SignatureIncludeMarks') ? b:SignatureIncludeMarks : g:SignatureIncludeMarks ) + let l:used_marks = map( copy(s:MarksList( "used" )), 'v:val[0]') + + for i in s:MarksList( "free" ) + " ... remove it + call s:ToggleSign( i, "remove", 0 ) + endfor + + " Add signs for marks ... + for j in s:MarksList( "used" ) + " ... if mark is not present in our b:sig_marks list or if it is present but at the wrong line, + " remove the old sign and add a new one + if !has_key( b:sig_marks, j[1] ) || b:sig_marks[j[1]] !~# j[0] || ( a:0 > 0 && a:1 ) + call s:ToggleSign( j[0], "remove", 0 ) + call s:ToggleSign( j[0], "place", j[1] ) + endif + endfor + + " We do not add signs for markers as SignRefresh is executed periodically and we don't have a way to determine if the + " marker already has a sign or not +endfunction + + +function! signature#Toggle() " {{{2 + " Description: Toggles and refreshes sign display in the buffer. + + if !exists('b:sig_marks') | let b:sig_marks = {} | endif + " b:sig_marks = { lnum => signs_str } + if !exists('b:sig_markers') | let b:sig_markers = {} | endif + " b:sig_markers = { lnum => marker } + + " If Signature is not enabled, return + let b:sig_enabled = ( exists('b:sig_enabled') ? !b:sig_enabled : g:SignatureEnabledAtStartup ) + + if b:sig_enabled + " Signature enabled ==> Refresh signs + call signature#SignRefresh() + + " Add signs for markers ... + for i in keys( b:sig_markers ) + call s:ToggleSign( b:sig_markers[i], "place", i ) + endfor + else + " Signature disabled ==> Remove signs + for i in keys( b:sig_markers ) + let l:id = ( winbufnr(0) + 1 ) * i + silent! execute 'sign unplace ' . l:id + endfor + for i in keys( b:sig_marks ) + let l:id = ( winbufnr(0) + 1 ) * i + silent! execute 'sign unplace ' . l:id + endfor + unlet b:sig_marks + endif + +endfunction diff --git a/vim/bin/cc_args.py b/vim/bin/cc_args.py new file mode 100644 index 0000000..5f6ac3d --- /dev/null +++ b/vim/bin/cc_args.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +#-*- coding: utf-8 -*- + +import sys + +CONFIG_NAME = ".clang_complete" + +def readConfiguration(): + try: + f = open(CONFIG_NAME, "r") + except IOError: + return [] + + result = [] + for line in f.readlines(): + strippedLine = line.strip() + if strippedLine: + result.append(strippedLine) + f.close() + return result + +def writeConfiguration(lines): + f = open(CONFIG_NAME, "w") + f.writelines(lines) + f.close() + +def parseArguments(arguments): + nextIsInclude = False + nextIsDefine = False + nextIsIncludeFile = False + + includes = [] + defines = [] + include_file = [] + options = [] + + for arg in arguments: + if nextIsInclude: + includes += [arg] + nextIsInclude = False + elif nextIsDefine: + defines += [arg] + nextIsDefine = False + elif nextIsIncludeFile: + include_file += [arg] + nextIsIncludeFile = False + elif arg == "-I": + nextIsInclude = True + elif arg == "-D": + nextIsDefine = True + elif arg[:2] == "-I": + includes += [arg[2:]] + elif arg[:2] == "-D": + defines += [arg[2:]] + elif arg == "-include": + nextIsIncludeFile = True + elif arg.startswith('-std='): + options.append(arg) + elif arg == '-ansi': + options.append(arg) + elif arg.startswith('-pedantic'): + options.append(arg) + elif arg.startswith('-W'): + options.append(arg) + + result = list(map(lambda x: "-I" + x, includes)) + result.extend(map(lambda x: "-D" + x, defines)) + result.extend(map(lambda x: "-include " + x, include_file)) + result.extend(options) + + return result + +def mergeLists(base, new): + result = list(base) + for newLine in new: + if newLine not in result: + result.append(newLine) + return result + +configuration = readConfiguration() +args = parseArguments(sys.argv) +result = mergeLists(configuration, args) +writeConfiguration(map(lambda x: x + "\n", result)) + + +import subprocess +proc = subprocess.Popen(sys.argv[1:]) +ret = proc.wait() + +if ret is None: + sys.exit(1) +sys.exit(ret) + +# vim: set ts=2 sts=2 sw=2 expandtab : diff --git a/vim/colors/blackboard.vim b/vim/colors/blackboard.vim new file mode 100644 index 0000000..a2506c9 --- /dev/null +++ b/vim/colors/blackboard.vim @@ -0,0 +1,46 @@ +" Vim color file + +set bg=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "blackboard" + +hi Normal guifg=#ffffff guibg=#0D1021 + +hi Comment guifg=#aeaeae gui=italic +hi Constant guifg=#d7fa41 gui=none +hi String guifg=#64ce3e gui=none +hi Statement guifg=#f8de33 gui=none +hi Entity guifg=#fa6513 gui=none +hi Support guifg=#8fa6cd gui=none +hi LineNr guifg=#aeaeae guibg=#000000 gui=none +hi Title guifg=#f6f3e8 guibg=NONE gui=bold +hi NonText guifg=#808080 guibg=#0D1021 gui=none + +hi Visual gui=reverse +hi VertSplit guifg=#444444 guibg=#444444 +hi StatusLine guifg=#f6f3e8 guibg=#444444 gui=italic +hi StatusLineNC guifg=#857b6f guibg=#444444 +hi SpecialKey guifg=#808080 guibg=#343434 gui=none + + +hi link Define Entity +hi link Function Entity + +hi link Structure Support +hi link Special Support +hi link Test Support + +hi link Character Constant +hi link Number Constant +hi link Boolean Constant + +hi link Float Number + +hi link Conditional Statement +hi link StorageClass Statement +hi link Operator Statement +hi link Statement Statement diff --git a/vim/doc/LanguageTool.txt b/vim/doc/LanguageTool.txt new file mode 100644 index 0000000..43b5a6d --- /dev/null +++ b/vim/doc/LanguageTool.txt @@ -0,0 +1,319 @@ +*LanguageTool.txt* A grammar checker in Vim for English, French, German, etc. +*LanguageTool* + +Author: Dominique Pellé +Last Change: 20 Feb 2014 + +For Vim version 7.0 and above + +============================================================================ + +1. Overview |languagetool-overview| +2. Screenshots & Demo |languagetool-screenshots| +3. Download |languagetool-download| +4. Installation |languagetool-installation| +5. Configuration |languagetool-configuration| +6. Features |languagetool-features| +7. Bugs |languagetool-bugs| +8. License |languagetool-license| + +============================================================================ + +1. Overview *languagetool-overview* + +This plugin integrates LanguageTool into Vim. LanguageTool is an Open Source +style and grammar checker for English, French, German, etc. See +http://www.languagetool.org/languages/ for a complete list of supported +languages. + +LanguageTool detects grammar mistakes that a spelling checker cannot detect +such as "it work" instead of "it works". Since version 1.8, LanguageTool +can also detect spelling mistakes using Hunspell dictionaries bundled with +LanguageTool for several languages or using morfologik for other languages. +Vim builtin spelling checker can also of course be used along with +LanguageTool. One advantage of the spelling checker of LanguageTool over +Vim spelling checker, is that it uses the native Hunspell dictionary directly, +so it works even with the latest Hunspell dictionaries containing features +not supported by Vim. For example, the latest French Hunspell dictionaries +from http://www.dicollect.org are not supported by Vim but they work well +with LanguageTool. On the other hand, the Vim native spelling checker is +faster and better integrated with Vim. + +See http://www.languagetool.org/ for more information about LanguageTool. + +============================================================================ + +2. Screenshots & Demo *languagetool-screenshots* + +If you don't have time to read help files, these screenshots will give you +an idea of what the LanguageTool plugin does: + + http://dominique.pelle.free.fr/pic/LanguageToolVimPlugin_en.png + http://dominique.pelle.free.fr/pic/LanguageToolVimPlugin_fr.png + +A screencast demo is also available at: + + http://shelr.tv/records/4fba8ef99660803e4f00001f + +============================================================================ + +3. Download *languagetool-download* + +You can download the latest version of this plugin from: + + http://www.vim.org/scripts/script.php?script_id=3223 + +LanguageTool can be downloaded from: + + http://www.languagetool.org/ + +============================================================================ + +4. Installation *languagetool-installation* + +4.1 Installing the plugin + +Unzip file LanguageTool.zip plugin from in your personal |vimfiles| directory +(~/.vim under Unix or %HOMEPATH%\vimfiles under Windows): > + + $ mkdir ~/.vim + $ cd ~/.vim + $ unzip /path-to/LanguageTool.zip + $ vim -c 'helptags ~/.vim/doc' + +The zip file contains the following files: > + + plugin/LanguageTool.vim + doc/LanguageTool.vim + +You have to enable plugins by adding these two lines in your |.vimrc| file: > + + set nocompatible + filetype plugin on + +4.2 Installing LanguageTool + +To use this plugin, you need to install the Java LanguageTool program. You +can choose to: + +* download stand-alone version of LanguageTool (LanguageTool-*.zip) from: + http://www.languagetool.org/ using the orange button labelled + "Download LanguageTool for stand-alone use". The standalone version of + Vim not only does grammar checking but also contains Hunspell dictionaries + for spell checking. +* or download a nightly build LanguageTool-.*-snapshot.zip from + http://www.languagetool.org/download/snapshots/. It contains a more + recent version than the stable version but it is not as well tested. +* or checkout and build the latest LanguageTool from sources in git. + +Recent versions of LanguageTool require Java-7. + +4.2.1 Download the stand-alone version of LanguageTool + +Download the stand-alone version of LanguageTool (LanguageTool-*.zip) +from http://www.languagetool.org/, click on "LanguageTool stand-alone +for your desktop" to download it. Unzip it: > + + $ unzip LanguageTool-2.4.1.zip + +This should extract the file LanguageTool-2.4.1/languagetool-commandline.jar +among several other files. + +4.2.2 Build LanguageTool from sources in git + +If you prefer to build LanguageTool yourself from sources, you first need +to install the pre-requisite packages. On Ubuntu, you need to install the +following packages: > + + $ sudo apt-get install openjdk-7-jdk mvn git + +LanguageTool can then be downloaded and built with Maven as follows: > + + $ git clone https://github.com/languagetool-org/languagetool.git + $ cd languagetool + $ mvn clean package + +After the build, the command line version of LanguageTool can be found in: > + + ./languagetool-standalone/target/LanguageTool-2.5-SNAPSHOT/LanguageTool-2.5-SNAPSHOT/languagetool-commandline.jar + +4.3 Configuring the location of the jar file + +After installing LanguageTool, you must specify the location of the file +languagetool-commandline.jar in your $HOME/.vimrc file. Example: > + + let g:languagetool_jar='$HOME/languagetool/languagetool-standalone/target/LanguageTool-2.5-SNAPSHOT/LanguageTool-2.5-SNAPSHOT/languagetool-commandline.jar' + +See section |languagetool-configuration| for more optional settings. + +============================================================================ + +5. Configuration *languagetool-configuration* + +LanguageTool plugin uses character encoding from the 'fenc' option or from +the 'enc' option if 'fenc' is empty. + +Several global variables can be set in your |vimrc| to configure the behavior +of the LanguageTool plugin. + +g:languagetool_jar *g:languagetool_jar* + + This variable specifies the location of the LanguageTool java grammar + checker program. Default is empty. + + Example: > + + :let g:languagetool_jar='$HOME/languagetool/languagetool-standalone/target/LanguageTool-2.5-SNAPSHOT/LanguageTool-2.5-SNAPSHOT/languagetool-commandline.jar' + +g:languagetool_lang *g:languagetool_lang* + + The language code to use for the language tool checker. If undefined, + plugin tries to guess the language of the Vim spelling checker + 'spelllang' or v:lang. If neither works, plugin defaults to + English US (en-US). Starting with LanguageTool-1.8, regional variants + of some languages can be specified. For languages with variants + (currently English and German), it is necessary to specify the + variant in order for LanguageTool to signal spelling errors. + In other words, with :set spelllang=en LanguageTool only + signals grammar mistakes whereas with :set spellllang=en_us + LanguageTool signals spelling mistakes and grammar mistakes. + The valid language codes are: > + + ast Asturian + be Belarusian + br Breton + ca Catalan + cs Czech + da Danish + de German + de-AT German (Austria) + de-CH German (Switzerland) + de-DE German (Germany) + el Greek + en English + en-AU English (Australia) + en-CA English (Canada) + en-GB English (Great Britain) + en-NZ English (New Zealand) + en-US English (US) + en-ZA English (South Africa) + eo Esperanto + es Spanish + fr French + gl Galician + is Icelandic + it Italian + km Khmer + lt Lithuanian + ml Malayalam + nl Dutch + pl Polish + pt Portuguese + ro Romanian + ru Russian + sk Slovak + sl Slovenian + sv Swedish + tl Tagalog + uk Ukrainian + zh Chinese + +g:languagetool_disable_rules *g:languagetool_disable_rules* + + This variable specifies checker rules which are disabled. Each disabled + rule must be comma separated. + Default value set by plugin is: WHITESPACE_RULE,EN_QUOTES + +g:languagetool_win_height *g:languagetool_win_height* + + This variable specifies the height of the scratch window which contains + all grammatical mistakes with some explanations. You can use a negative + value to disable opening the scratch window. You can also make it empty '' + to let Vim pick a default size. + Default is: 14 + +You can also customize the following syntax highlighting groups: > + + LanguageToolGrammarError + LanguageToolSpellingError + LanguageToolCmd + LanguageToolLabel + LanguageToolErrorCount + +============================================================================ + +6. Features *languagetool-features* + +The LanguageTool plugin defines 2 commands |:LanguageToolCheck| and +|:LanguageToolClean|. + +:LanguageToolCheck *:LanguageToolCheck* + +Use the |:LanguageToolCheck| command to check the grammar in the current +buffer. This will highlight errors in the buffer. It will also open a new +scratch window with the list of grammar mistakes with further explanations +for each error. It also populates the location-list for the window. + +The |:LanguageToolCheck| command accepts a range. You can for example check +grammar between lines 100 and 200 in buffer with :100,200LanguageToolCheck, +check grammar in the visual selection with :<',>'LanguageToolCheck, etc. +The default range is 1,$ (whole buffer). + +:LanguageToolClear *:LanguageToolClear* + +Use the |:LanguageToolClear| command to clear highlighting of grammar +mistakes, close the scratch window containing the list of errors, clear +and close the location-list. + +The two commands are also available from the menu in gvim: > + + Plugin -> LanguageTool -> Check + -> Clear + +Using the error scratch window~ + +Pressing on an error in the error scratch buffer will jump to that +error. + +Using the Location-list~ + +The |location-list| is populated when running |:LanguageToolCheck|. So you can +use location-list Vim commands such as |:lopen| to open the location-list +window, |:lne| to jump to the next error, etc. + +The error scratch window may seem redundant with the location-list, but the +scratch window is more flexible to present errors in a nice way. If you do +not wish to popup the error scratch window, but use the location-list only, +you can disable it by setting |g:languagetool_win_height| to a negative value. + +============================================================================ + +7. Bugs *languagetool-bugs* + +Column number reported by LanguageTool indicating the location of the error +is sometimes incorrect. There is already an opened ticket about this bug: + + http://sourceforge.net/tracker/?func=detail&aid=3054895&group_id=110216&atid=655717 + +The script currently works around it by doing pattern matching with +information context but it's not a perfect workaround: it can cause +spurious highlighting of errors in rare cases. This bug is fixed in +LanguageTool-1.8. + +Please report bugs or suggestions to . +Alternatively, you can also discuss improvements to this plugin in Wiki +by clicking on the "Vim wiki" link at the top of the script page: + + http://www.vim.org/scripts/script.php?script_id=3223 + +============================================================================ + +8. License *languagetool-license* + +The VIM LICENSE applies to the LanguageTool.vim plugin (see |copyright| +except use "LanguageTool.vim" instead of "Vim"). + +LanguageTool is freely available under LGPL. + +============================================================================ +vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl: diff --git a/vim/doc/clang_complete.txt b/vim/doc/clang_complete.txt new file mode 100644 index 0000000..b3a5002 --- /dev/null +++ b/vim/doc/clang_complete.txt @@ -0,0 +1,397 @@ +*clang_complete.txt* For Vim version 7.3. Last change: 2014 Apr 13 + + + clang_complete plugin documentation + + +clang_complete plugin *clang_complete* + +1. Description |clang_complete-description| +2. Key bindings |clang_complete-keybindings| +3. Completion kinds |clang_complete-compl_kinds| +4. Configuration |clang_complete-configuration| +5. Options |clang_complete-options| +6. Known issues |clang_complete-issues| +7. cc_args.py script |clang_complete-cc_args| +8. To do |clang_complete-todo| +9. FAQ |clang_complete-faq| +10. License |clang_complete-license| + +Author: Xavier Deguillard *clang_complete-author* + +============================================================================== +1. Description *clang_complete-description* + +This plugin use clang for accurately completing C and C++ code. + +Note: This plugin is incompatible with omnicppcomplete due to the +unconditionnaly set mapping done by omnicppcomplete. So don't forget to +suppress it before using this plugin. Also it's possible to keep +omnicppcomplete plugin enabled by setting |g:clang_omnicppcomplete_compliance|. +in this case it will be possible to use omnicppcomplete in parallel with +clang_complete, though functionality of the latter will be reduced to + only. + +============================================================================== +2. Key bindings *clang_complete-keybindings* + +Completion is started with CTRL-X CTRL-U |i_CTRL-X_CTRL-U|, or automatically +depending on the value of |clang_complete-auto|. + +You can also jump to the declaration of the symbol under the cursor with +. Jumping back is done with . Since clang_complete uses +|jumplist|, you can navigate through the jumps with and + +============================================================================== +3. Completion kinds *clang_complete-compl_kinds* + +Because libclang provides a lot of information about completion, there are +some additional kinds of completion along with standard ones (see +|complete-items| for details): + '+' - constructor + '~' - destructor + 'e' - enumerator constant + 'a' - parameter ('a' from "argument") of a function, method or template + 'u' - unknown or buildin type (int, float, ...) + 'n' - namespace or its alias + 'p' - template ('p' from "pattern") + +============================================================================== +4. Configuration *clang_complete-configuration* + +Each project can have a .clang_complete at its root, containing the compiler +options. This is useful if you're using some non-standard include paths or +need to specify particular architecture type, frameworks to use, path to +precompiled headers, precompiler definitions etc. + +Note that as with other option sources, .clang_complete file is loaded and +parsed by the plugin only on buffer loading (or reloading, for example with +:edit! command). Thus no changes made to .clang_complete file after loading +source file into Vim's buffer will take effect until buffer will be closed and +opened again, reloaded or Vim is restarted. + +Compiler options should go on individual lines (multiple options on one line +can work sometimes too, but since there are some not obvious conditions for +that, it's better to have one option per line). + +Linking isn't performed during completion, so one doesn't need to specify any +of linker arguments in .clang_complete file. They will lead to completion +failure when using clang executable and will be completely ignored by +libclang. + +Example .clang_complete file: > + -DDEBUG + -include ../config.h + -I../common + -I/usr/include/c++/4.5.3/ + -I/usr/include/c++/4.5.3/x86_64-slackware-linux/ +< +============================================================================== +5. Options *clang_complete-options* + + *clang_complete-loaded* + *g:clang_complete_loaded* +If set, clang_complete won't be loaded. +Default: unset. + + *clang_complete-auto_select* + *g:clang_auto_select* +If equal to 0, nothing is selected. +If equal to 1, automatically select the first entry in the popup menu, but +without inserting it into the code. +If equal to 2, automatically select the first entry in the popup menu, and +insert it into the code. +Default: 0 + + *clang_complete-complete_auto* + *g:clang_complete_auto* +If equal to 1, automatically complete after ->, ., :: +Default: 1 + + *clang_complete-copen* + *g:clang_complete_copen* +If equal to 1, open quickfix window on error. +Default: 0 + + *clang_complete-hl_errors* + *g:clang_hl_errors* +If equal to 1, it will highlight the warnings and errors the same way clang +does it. +Default: 1 + + *clang_complete-periodic_quickfix* + *g:clang_periodic_quickfix* +If equal to 1, it will periodically update the quickfix window. +Default: 0 +Note: You could use the g:ClangUpdateQuickFix() to do the same with a mapping. + + *clang_complete-snippets* + *g:clang_snippets* +If equal to 1, it will do some snippets magic on code placeholders like +function argument, template parameters, etc. +Default: 0 + + *clang_complete-snippets_engine* + *g:clang_snippets_engine* +The snippets engine (clang_complete, ultisnips... see the snippets +subdirectory). +Default: "clang_complete" + + *clang_complete-conceal_snippets* + *g:clang_conceal_snippets* +Note: This option is specific to clang_complete snippets engine. +If equal to 1, clang_complete will use vim 7.3 conceal feature to hide the +snippet placeholders. + +Example of conceal configuration (see |'concealcursor'| and |'conceallevel'| +for details): > + " conceal in insert (i), normal (n) and visual (v) modes + set concealcursor=inv + " hide concealed text completely unless replacement character is defined + set conceallevel=2 + +Default: 1 (0 if conceal not available) + + *clang_complete-optional_args_in_snippets* + *g:clang_complete_optional_args_in_snippets* +If equal to 1, it will add optional arguments to the function call snippet. +Snippet replaceable object will not be only the argument, but the preceding +comma will be included as well, so you can press backspace to delete the +optional argument, while the replaceable is selected. +Example: foo($`T param1`, $`T param2`$`, T optional_param`) +Default: 0 + + *clang_complete-clang_trailing_placeholder* + *g:clang_trailing_placeholder* +Note: This option is specific to clang_complete snippets engine. +If equal to 1, clang_complete will add a trailing placeholder after functions +to let you add you continue writing code faster. +Default: 0 + + *clang_complete-clang_restore_cr_imap* + *g:clang_restore_cr_imap* +This option is used for versions of Vim without the Dictionary version of +|maparg()| introduced in 7.3.32. The variable is executed after completion to +restore the insert-mode map of . Occurrences of "" in the variable +are replaced with the appropriate "" code based on the original map. +Default: 'iunmap ' + + *clang_close-preview* + *g:clang_close_preview* +If equal to 1, the preview window will be close automatically after a +completion. +Default: 0 + + *clang_complete-user_options* + *g:clang_user_options* +Additionnal compilation argument passed to libclang. + +Example: > + " compile all sources as c++11 (just for example, use .clang_complete for + " setting version of the language per project) + let g:clang_user_options = '-std=c++11' +< +Default: "" + + *clang_complete-auto_user_options* + *g:clang_auto_user_options* +Set sources for user options passed to clang. Available sources are: +- path - use &path content as list of include directories (relative paths are + ignored); +- .clang_complete - use information from .clang_complete file Multiple options + are separated by comma; +- compile_commands.json - get the compilation arguments for the sources from a + compilation database. For example, recent versions of CMake (>=2.8.7) can + output this information. clang_complete will search upwards from where vi + was started for a database named 'compile_commands.json'. + Note : compilation databases can only be used when 'g:clang_use_library' + equals 1 and the clang libraries are recent enough (clang>=3.2). The + compilation database only contains information for the C/C++ sources files, + so when editing a header, clang_complete will reuse the compilation + arguments from the last file found in the database. +- {anything} else will be treaded as a custom option source in the following + manner: clang_complete will try to load the autoload-function named + getopts#{anything}#getopts, which then will be able to modify + b:clang_user_options variable. See help on |autoload| if you don't know + what it is. + +This option is processed and all sources are used on buffer loading, not each +time before doing completion. + +Default: ".clang_complete, path" + + *clang_complete-compilation_database* + *g:clang_compilation_database* +By default, clang_complete will search upwards from where it was started to +find a compilation database. In case this behaviour does not match your needs, +you can set |g:clang_compilation_database| to the directory where the database +can be loaded from. + + *clang_complete-use_library* + *g:clang_use_library* +Instead of calling the clang/clang++ tool use libclang directly. This gives +access to many more clang features. Furthermore it automatically caches all +includes in memory. Updates after changes in the same file will therefore be a +lot faster. +Note: This version doesn't support calling clang binary for completion. If you +cannot use libclang, you should download clang_complete from vim.org website. +Default: 1 + + *clang_complete-library_path* + *g:clang_library_path* +If libclang is not in your library search path, set this to the absolute path +where libclang is available. This should either be a directory containing a +file named libclang.[dll/so/dylib] or the clang shared library file itself. +Default: "" + + *clang_complete-sort_algo* + *g:clang_sort_algo* +How results are sorted (alpha, priority, none). Currently only works with +libclang. +Default: "priority" + + *clang_complete-complete_macros* + *g:clang_complete_macros* +If clang should complete preprocessor macros and constants. +Default: 0 + + *clang_complete-complete_patterns* + *g:clang_complete_patterns* +If clang should complete code patterns, i.e loop constructs etc. +Defaut: 0 + + *clang_complete-jumpto_declaration_key* + *g:clang_jumpto_declaration_key* +Set the key used to jump to declaration. +Defaut: "" +Note: You could use the g:ClangGotoDeclaration() to do the same with a mapping. + + *clang_complete-jumpto_declaration_in_preview_key* + *g:clang_jumpto_declaration_in_preview_key* +Set the key used to jump to declaration in a preview window. +Defaut: "]" +Note: You could use the g:ClangGotoDeclarationPreview() to do the same with a mapping. + + *clang_complete-jumpto_back_key* + *g:clang_jumpto_back_key* +Set the key used to jump back. +Note: Effectively this will be remapped to . The default value is chosen +to be coherent with ctags implementation. +Defaut: "" + + *clang_complete-make_default_keymappings* + *g:clang_make_default_keymappings* +If this option is set, the default keymappings will be set by clang_complete. +Otherwise none are set and the user will have to provide those keymappings. +Default: 1 + + *clang_complete-omnicppcomplete_compliance* + *g:clang_omnicppcomplete_compliance* +Omnicppcomplete compatibility mode. Keeps omni auto-completion in control of +omnicppcomplete, disables clang's auto-completion (|g:clang_complete_auto|) +and enables only as main clang completion function. +Defaut: 0 + +============================================================================== +6. Known issues *clang_complete-issues* + +If you get following error message while trying to complete anything: > + E121: Undefined variable: b:should_overload +it means that your version of Vim is too old (this is an old bug and it has +been fixed with one of patches for Vim 7.2) and you need to update it. + +Ubuntu users may need to install libclang-dev: > + apt-get install libclang-dev + +============================================================================== +7. cc_args.py script *clang_complete-cc_args* + +This script, installed at ~/.vim/bin/cc_args.py, could be used to generate or +update the .clang_complete file. It works similar to gccsence's gccrec and +simply stores -I and -D arguments passed to the compiler in the +.clang_complete file. Just add the cc_args.py script as the first argument of +the compile command. You should do that every time compile options have +changed. + +Example (we need -B flag to force compiling even if project is up to date): > + make CC='~/.vim/bin/cc_args.py gcc' CXX='~/.vim/bin/cc_args.py g++' -B +After running this command, .clang_complete will be created or updated with +new options. If you don't want to update an existing configuration file, +delete it before running make. + +============================================================================== +8. To do *clang_complete-todo* + +- Write some unit tests +- Explore "jump to declaration/definition" with libclang FGJ +- Think about supertab ( with supertab and clang_auto_select) + +============================================================================== +9. FAQ *clang_complete-faq* + +*) clang_complete doesn't work! I always get the message "pattern not found". + +This can have multiple reasons. You can try to open the quickfix window +(:copen) that displays the error messages from clang to get a better idea what +goes on. It might be that you need to update your .clang_complete file. If +this does not help, keep in mind that clang_complete can cause clang to search +for header files first in the system-wide paths and then in the ones specified +locally in .clang_complete. Therefore you might have to add "-nostdinc" and +the system include paths in the right order to .clang_complete. + +*) Only function names get completed but not the parentheses/parameters. + +Enable the snippets-support by adding the following lines to your .vimrc, +for example: + +let g:clang_snippets = 1 +let g:clang_snippets_engine = 'clang_complete' + +If you have ultisnips installed, you can use + +let g:clang_snippets = 1 +let g:clang_snippets_engine = 'ultisnips' + +instead. After a completetion you can use in normal mode to jump to the +next parameter. + +*) Can I configure clang_complete to insert the text automatically when there + is only one possibility? + +You can configure vim to complete automatically the longest common match by +adding the following line to your vimrc: + +set completeopt=menu,longest + +============================================================================== +10. License *clang_complete-license* + +Copyright (c) 2010, 2011, 2012, 2013 Xavier Deguillard, Tobias Grosser +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holders nor the names of their + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Note: This license does not cover the files that come from the LLVM project, +namely, cindex.py and __init__.py, which are covered by the LLVM license. + + vim:tw=78:ts=8:ft=help:norl: diff --git a/vim/doc/signature.txt b/vim/doc/signature.txt new file mode 100644 index 0000000..7a063e9 --- /dev/null +++ b/vim/doc/signature.txt @@ -0,0 +1,248 @@ +signature.txt A plugin to toggle, display and navigate marks + + _________.__ __ ~ + / _____/|__| ____ ____ _____ _/ |_ __ __ _______ ____ ~ + \_____ \ | | / ___\ / \ \__ \ \ __\| | \\_ __ \_/ __ \ ~ + / \| | / /_/ >| | \ / __ \_ | | | | / | | \/\ ___/ ~ + /_______ /|__| \___ / |___| /(____ / |__| |____/ |__| \___ > ~ + \/ /_____/ \/ \/ \/ ~ + + +============================================================================== +1. Contents *signature-contents* *signature* + + 1. Contents |signature-contents| + 2. Mappings |signature-mappings| + 3. Commands |signature-commands| + 4. Customization |signature-customization| + 5. Contributing |signature-contributing| + 6. Credits |signature-credits| + 7. License |signature-license| + + +============================================================================== +2. Mappings *signature-mappings* + +Out of the box, the followings mappings are defined by default + + m[a-zA-Z] Toggle mark and display it in the leftmost column + + m, Place the next available mark + m Delete all marks + ]` Jump to next mark + [` Jump to prev mark + ]' Jump to start of next line containing a mark + [' Jump to start of prev line containing a mark + `] Jump by alphabetical order to next mark + `[ Jump by alphabetical order to prev mark + '] Jump by alphabetical order to start of next line having a mark + '[ Jump by alphabetical order to start of prev line having a mark + + m[0-9] Toggle the corresponding marker !@#$%^&*() + m Remove all markers of the same type + ]- Jump to next line having a marker of the same type + [- Jump to prev line having a marker of the same type + ]= Jump to next line having a marker of any type + [= Jump to prev line having a marker of any type + m Remove all markers + +This will allow the use of default behavior of m to set marks and, if +the line already contains the mark, it'll be unset. The default behavior +of ]', [', ]` and [` is supported and enhanced by wrapping around when +beginning or end of file is reached. + + +============================================================================== +3. Commands *signature-commands* + +Signature provides just two commands + +'SignatureToggleSigns' + Toggle the display of signs. This won't affect the marks or the mappings. + +'SignatureRefresh' + Force the display of signs in the buffer to refresh. Use this to correct + the signs if things go awry + + +============================================================================== +4. Customization *signature-customization* + +Set up Signature the way you want using the following options + + *'g:SignatureMap'* + Type: Dictionary, Default: + To set up your own mappings copy the following dictionary and edit it + + let g:SignatureMap = { + \ 'Leader' : "m", + \ 'PlaceNextMark' : ",", + \ 'PurgeMarks' : "", + \ 'PurgeMarkers' : "", + \ 'GotoNextLineAlpha' : "']", + \ 'GotoPrevLineAlpha' : "'[", + \ 'GotoNextSpotAlpha' : "`]", + \ 'GotoPrevSpotAlpha' : "`[", + \ 'GotoNextLineByPos' : "]'", + \ 'GotoPrevLineByPos' : "['", + \ 'GotoNextSpotByPos' : "]`", + \ 'GotoPrevSpotByPos' : "[`", + \ 'GotoNextMarker' : "]-", + \ 'GotoPrevMarker' : "[-", + \ 'GotoNextMarkerAny' : "]=", + \ 'GotoPrevMarkerAny' : "[=", + \ } + + By default, it defines the mappings as shown in |signature-mappings| + To disable a map entirely, specify it as an empty string. + If a key is not specified, the default value will be picked up. + These same characters will be used to invoke the shortcuts. + + + *'g:SignatureIncludeMarks'* + String, Default : 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' + + Specify the marks that can be controlled by this plugin. + Only supports Alphabetical marks at the moment. + 'b:SignatureIncludeMarks' can be set separately for buffer-specific marks. + + + *'g:SignatureIncludeMarkers'* + String, Default : '!@#$%^&*()' + + Specify the markers that can be used by the plugin. + 'b:SignatureIncludeMarkers' can be specified separately for each buffer + + + *g:SignatureMap['Leader']* *'SignatureMapLeader'* + String, Default: 'm' + + Set the key used to toggle marks and markers. + For eg. If this key is set to `m`, + `ma` will toggle the mark 'a' on the current line + `m,` will place the next available mark + `m` will delete all marks + `m1` will toggle the marker '!' + `m!` will remove all the '!' markers + `m` will remove all markers + + Note: + Currently, either marks or markers can be displayed in front of a line. + Both can't be displayed simultaenously. + + To set this to mapleader or maplocalleader + let g:SignatureMap['Leader'] = '' + let g:SignatureMap['Leader'] = '' + + Assigning this to allows this to be buffer-specific + + + *'g:SignatureWrapJumps'* + Boolean, Default : 1 + + Specify if jumping to marks should wrap-around. + 'b:SignatureWrapJumps' can be set to specify buffer-specific settings. + + + *'g:SignatureMarkOrder'* + String, Default : "\p\m" + + Signature allows you to display upto marks in front of a line. This controls + the order in which marks are displayed. + '\m' indicates the current or latest mark placed on the line + '\p' indicates the previous mark placed on the line + + For eg. + g:SignatureMarkOrder = "\m." : Display last mark with '.' suffixed + g:SignatureMarkOrder = "_\m" : Display last mark with '_' prefixed + g:SignatureMarkOrder = ">" : Display only a ">" for a line with a mark. + The mark is not displayed + g:SignatureMarkOrder = "\m\p" : Display last two marks placed + + Note: + The signs feature allows only 2 characters to be displayed. This is not and + arbitratry limitation of the plugin. + + + *'g:SignatureMarkTextHL'* + String, Default : 'Exception' + + The highlight group used for mark signs. + + *'g:SignatureMarkerTextHL'* + String, Default : 'WarningMsg' + + The highlight group used for marker signs. + + + *'g:SignaturePurgeConfirmation'* + Boolean, Default: 0 + + An option for the more clumsy-fingered of us. Asks for confirmation before + deleting all marks/markers + + + *'g:SignatureMenu'* + String, Default: "P&lugins.&Signature" + + Set where the menu options are to be displayed. For more details refer, + `:h usr_42.txt` + To disable the menu, set to 0 + + + *'g:SignaturePeriodicRefresh'* + Boolean, Default: 1 + + Enable the display to refresh periodically. Generally a good thing to have. + This makes use of the CursorHold autocmd event to execute periodically. + The frequency of this event can be controlled by changing the value of the + updatetime variable in milliseconds + `set updatetime = 100` + + + *'g:SignaturePrioritizeMarks'* + Boolean, Default: 1 + + When a line has both marks and markers, display the sign for marks. If set + to 0, it will display the sign for markers instead + + *'g:SignatureEnabledAtStartup'* + Boolean, Default: 1 + + Control if the signs should be shown by default. If set to 0, the signs + won't be visible until `:SignatureToggleSigns` has been called + + +============================================================================== +5. Contributing *signature-contributing* + + Please post any issues and all your suggestions on Github + https://github.com/kshenoy/vim-signature + + Show some love by spreading the word and rating on + http://www.vim.org/scripts/script.php?script_id=4118 + + +============================================================================== +6. Credits *signature-credits* + +A great thanks to these guys for providing the idea and inspiration to develop +Signature + +* Sergey Khorev for mark-tools + http://www.vim.org/scripts/script.php?script_id=2929 + +* Zak Johnson for vim-showmarks + https://github.com/zakj/vim-showmarks + +I'd also like to thank Steve J. Losh for learningvimscriptthehardway.com +without whose detailed guide this plugin would not have seen the light of day. + + +============================================================================== +7. License *signature-license* + +Signature is MIT/X11 licensed + + +vim:tw=78:ts=2:et:sts=2:sw=2:ft=help diff --git a/vim/doc/supertab.txt b/vim/doc/supertab.txt new file mode 100644 index 0000000..72ab6ba --- /dev/null +++ b/vim/doc/supertab.txt @@ -0,0 +1,480 @@ +*supertab.txt* + +Author: Eric Van Dewoestine + Original concept and versions up to 0.32 written by + Gergely Kontra + +This plugin is licensed under the terms of the BSD License. Please see +supertab.vim for the license in its entirety. + +============================================================================== +Supertab *supertab* + +1. Introduction |supertab-intro| +2. Supertab Usage |supertab-usage| +3. Supertab Options |supertab-options| + Default completion type |supertab-defaultcompletion| + Secondary default completion type |supertab-contextdefault| + Completion contexts |supertab-completioncontexts| + Context text |supertab-contexttext| + Context Discover |supertab-contextdiscover| + Example |supertab-contextexample| + Completion Duration |supertab-duration| + Preventing Completion After/Before... |supertab-preventcomplete| + Changing default mapping |supertab-forwardbackward| + Inserting true tabs |supertab-mappingtabliteral| + Enhanced longest match support |supertab-longestenhanced| + Preselecting the first entry |supertab-longesthighlight| + Mapping to end completion |supertab-crmapping| + Auto close the preview window |supertab-closepreviewonpopupclose| + Keyword completion ignore/match case |supertab-completecase| + Completion Chaining |supertab-completionchaining| + +============================================================================== +1. Introduction *supertab-intro* + +Supertab is a plugin which allows you to perform all your insert completion +(|ins-completion|) using the tab key. + +Supertab requires Vim version 7.0 or above. + +============================================================================== +2. Supertab usage *supertab-usage* + +Using Supertab is as easy as hitting or (shift+tab) while in +insert mode, with at least one non whitespace character before the cursor, to +start the completion and then or again to cycle forwards or +backwards through the available completions. + +Example ('|' denotes the cursor location): + +bar +baz +b| Hitting here will start the completion, allowing you to + then cycle through the suggested words ('bar' and 'baz'). + +============================================================================== +3. Supertab Options *supertab-options* + +Supertab is configured via several global variables that you can set in your +|vimrc| file according to your needs. Below is a comprehensive list of +the variables available. + + +Default Completion Type *supertab-defaultcompletion* + *g:SuperTabDefaultCompletionType* + +g:SuperTabDefaultCompletionType (default value: "") + +Used to set the default completion type. There is no need to escape this +value as that will be done for you when the type is set. + + Example: setting the default completion to 'user' completion: + +> + let g:SuperTabDefaultCompletionType = "" +< + +Note: a special value of 'context' is supported which will result in +super tab attempting to use the text preceding the cursor to decide which +type of completion to attempt. Currently supertab can recognize method calls +or attribute references via '.', '::' or '->', and file path references +containing '/'. If the language you are using doesn't use any of the member +reference characters listed above, or you'd like to add additional patterns, +you can write a custom context function also described in the next section +(Completion context). + + Example: setting the default completion to supertab's 'context' completion: +> + let g:SuperTabDefaultCompletionType = "context" +< + + /usr/l # will use filename completion + myvar.t # will use user completion if completefunc set, + # or omni completion if omnifunc set. + myvar-> # same as above + +When using context completion, super tab will fall back to a secondary default +completion type set by |g:SuperTabContextDefaultCompletionType|. + +Note: once the buffer has been initialized, changing the value of this setting +will not change the default complete type used. If you want to change the +default completion type for the current buffer after it has been set, perhaps +in an ftplugin, you'll need to call *SuperTabSetDefaultCompletionType* like so, +supplying the completion type you wish to switch to: + +> + call SuperTabSetDefaultCompletionType("") +< + + +Secondary default completion type *supertab-contextdefault* + *g:SuperTabContextDefaultCompletionType* + +g:SuperTabContextDefaultCompletionType (default value: "") + +Sets the default completion type used when g:SuperTabDefaultCompletionType is +set to 'context' and no completion type is returned by any of the configured +contexts. + + +Completion contexts *supertab-completioncontexts* + *g:SuperTabCompletionContexts* + +g:SuperTabCompletionContexts (default value: ['s:ContextText']) + +Sets the list of contexts used for context completion. This value should +be a list of function names which provide the context implementation. + +When supertab starts context completion, each of these contexts will be +consulted, in the order they were supplied, to determine the completion type +to use. If a context returns a completion type, that type will be used, +otherwise the next context in the list will be consulted. If after executing +all the context functions, no completion type has been determined, then the +value of |g:SuperTabContextDefaultCompletionType| will be used. + + Note: supertab also supports the b:SuperTabCompletionContexts variable + allowing you to set the list of contexts separately for the current buffer, + like from an ftplugin for example. + +Built in completion contexts: + + s:ContextText *supertab-contexttext* + + The text context will examine the text near the cursor to decide which type + of completion to attempt. Currently the text context can recognize method + calls or attribute references via '.', '::' or '->', and file path + references containing '/'. + + /usr/l # will use filename completion + myvar.t # will use user completion if completefunc set, or + # omni completion if omnifunc set. + myvar-> # same as above + + Supported configuration attributes: + + *g:SuperTabContextTextFileTypeExclusions* + List of file types for which the text context will be skipped. + + *g:SuperTabContextTextOmniPrecedence* (default: ['&completefunc', '&omnifunc']) + *b:SuperTabContextTextOmniPrecedence* + List of omni completion option names in the order of precedence that they + should be used if available. By default, user completion will be given + precedence over omni completion, but you can use this variable to give + omni completion higher precedence by placing it first in the list. + + *g:SuperTabContextTextMemberPatterns* (default: ['\.', '>\?::', '->']) + *b:SuperTabContextTextMemberPatterns* + List of patterns used to determine when omni/user completion should be + used. The default list consists of the most common patterns used to access + module/class/object members. + + Note: For html and xml based files, the buffer local version of the above + two settings are set to trigger omni completion first when encountering a + potential end tag pattern of ' + let g:SuperTabCompletionContexts = ['s:ContextText', 's:ContextDiscover'] + let g:SuperTabContextTextOmniPrecedence = ['&omnifunc', '&completefunc'] + let g:SuperTabContextDiscoverDiscovery = + \ ["&completefunc:", "&omnifunc:"] +< + + In addition to the default completion contexts, you can plug in your own + implementation by creating a globally accessible function that returns + the completion type to use (eg. "\\"). + +> + function MyTagContext() + if filereadable(expand('%:p:h') . '/tags') + return "\\" + endif + " no return will result in the evaluation of the next + " configured context + endfunction + let g:SuperTabCompletionContexts = + \ ['MyTagContext', 's:ContextText', 's:ContextDiscover'] +< + + Here is another example that could be used to add context support for + clojure, and perhaps other lisp variants: + +> + let b:SuperTabCompletionContexts = + \ ['ClojureContext'] + g:SuperTabCompletionContexts + + function! ClojureContext() + let curline = getline('.') + let cnum = col('.') + let synname = synIDattr(synID(line('.'), cnum - 1, 1), 'name') + if curline =~ '(\S\+\%' . cnum . 'c' && synname !~ '\(String\|Comment\)' + return "\\" + endif + endfunction +< + + +Completion Duration *supertab-duration* + *g:SuperTabRetainCompletionDuration* + +g:SuperTabRetainCompletionDuration (default value: 'insert') + +Determines if, and for how long, the current completion type is retained. +The possible values include: +'completion' - The current completion type is only retained for the + current completion. Once you have chosen a completion + result or exited the completion mode, the default + completion type is restored. +'insert' - The current completion type is saved until you exit insert + mode (via ESC). Once you exit insert mode the default + completion type is restored. (supertab default) +'session' - The current completion type is saved for the duration of + your vim session or until you enter a different completion + mode. + + +Preventing completion after... *supertab-preventcomplete* + *g:SuperTabNoCompleteBefore* + *g:SuperTabNoCompleteAfter* + +g:SuperTabNoCompleteBefore (default value: []) +g:SuperTabNoCompleteAfter (default value: ['^', '\s']) + +These two variables are used to control when supertab will attempt completion +or instead fall back to inserting a literal . There are two possible ways +to define these variables: + + 1) by specifying a list of patterns which are tested against the text before + and after the current cursor position that when matched, prevent completion. + So if you don't want supertab to start completion at the start of a line, + after a comma, or after a space, you can set g:SuperTabNoCompleteAfter + to ['^', ',', '\s']. + + 2) by specifying a funcref to a global accessible function which expects + as parameter the text to be inspected (before or after) and, based on that (or + other factors), it returns 1 if completion must be prevented, 0 otherwise. + +Note: That a buffer local version of these variables +(b:SuperTabNoCompleteBefore, b:SuperTabNoCompleteAfter) are also supported +should you wish to have different values depending on the file type for +instance. + +Changing the default mapping *supertab-forwardbackward* + *g:SuperTabMappingForward* + *g:SuperTabMappingBackward* + +g:SuperTabMappingForward (default value: '') +g:SuperTabMappingBackward (default value: '') + +These two variables allow you to set the keys used to kick off the current +completion. By default this is and . To change to something +like and , you can add the following to your |vimrc|. + +> + let g:SuperTabMappingForward = '' + let g:SuperTabMappingBackward = '' +> + +Note: if the above does not have the desired effect (which may happen in +console version of vim), you can try the following mappings. Although the +backwards mapping still doesn't seem to work in the console for me, your +milage may vary. + +> + let g:SuperTabMappingForward = '' + let g:SuperTabMappingBackward = '' +< + + +Inserting true tabs *supertab-mappingtabliteral* + *g:SuperTabMappingTabLiteral* + +g:SuperTabMappingTabLiteral (default value: '') + +Sets the key mapping used to insert a literal tab where supertab would +otherwise attempt to kick off insert completion. The default is '' +(ctrl-tab) which unfortunately might not work at the console. So if you are +using a console vim and want this functionality, you may have to change it to +something that is supported. Alternatively, you can escape the with + (see |i_CTRL-V| for more infos). + +See also |supertab-preventcomplete|. + + +Enhanced longest match support *supertab-longestenhanced* + *g:SuperTabLongestEnhanced* + +g:SuperTabLongestEnhanced (default value: 0) + +When enabled and 'longest' is in your |completeopt| setting, supertab will +provide an enhanced longest match support where typing one or more letters and +hitting tab again while in a completion mode will complete the longest common +match using the new text in the buffer. + +For example, say you have a buffer with the following contents: + FooBarFoo + FooBar + Foo + FooBarBaz +And you then type F. Vim's builtin longest support will complete the +longest common text 'Foo' and offer 'FooBarFoo', 'FooBar', 'Foo', and +'FooBarBaz' as possible completions. With supertab's longest match +enhancement disabled, typing B while still in the completion mode will +end up completing 'FooBarBaz' or 'FooBarFoo' depending your settings, instead +of the next longest common match of 'FooBar'. With supertab's enhanced +longest match feature enabled, the typing of B will result in the next +longest text being completed. + + +Preselecting the first entry *supertab-longesthighlight* + *g:SuperTabLongestHighlight* + +g:SuperTabLongestHighlight (default value: 0) + +Sets whether or not to pre-highlight the first match when completeopt has the +popup menu enabled and the 'longest' option as well. When enabled, will +kick off completion and pre-select the first entry in the popup menu, allowing +you to simply hit to use it. + + +Mapping to end completion *supertab-crmapping* + *g:SuperTabCrMapping* + +g:SuperTabCrMapping (default value: 0) + +When enabled, will cancel completion mode preserving the current text. + +Compatibility with other plugins: + - endwise: compatible + - delimitMate: not compatible (disabled if the delimitMate mapping is + detected.) + +Note: if you have an insert expression mapping with a in it or an insert +abbreviation containing a , then supertab will not create a mapping +which could potentially cause problems with those. + + +Auto close the preview window *supertab-closepreviewonpopupclose* + *g:SuperTabClosePreviewOnPopupClose* + +g:SuperTabClosePreviewOnPopupClose (default value: 0) + +When enabled, supertab will attempt to close vim's completion preview window +when the completion popup closes (completion is finished or canceled). + + +Completion ignore/match case *supertab-completecase* + *g:SuperTabCompleteCase* + +g:SuperTabCompleteCase (default value: 'inherit') + +When issuing completions (keyword and potentially others), the value of your +|'ignorecase'| setting will determine what results are returned based on +whether or not you've chosen to ignore case or not. However, you may have +|'ignorecase'| set or unset for other reasons and don't want that value +considered when using insert completion. SuperTab allows you temporarily +override |'ignorecase'| by setting g:SuperTabCompleteCase to either 'ignore' +or 'match' depending on whether you want to always ignore or match case when +using insert completion. + +Note: third party omni/user completion plugins may or may not honor +|'ignorecase'|. If they do not, then you can probably contact them to add that +support. + +Completion Chaining *supertab-completionchaining* + +SuperTab provides the ability to chain one of the completion functions +(|completefunc| or |omnifunc|) together with one of the default vim +completion key sequences (|ins-completion|), giving you the ability to attempt +completion with the first, and upon no results, fall back to the second. + +To utilize this feature you need to call the *SuperTabChain* function where +the first argument is the name of a vim compatible |complete-function| and the +second is one of vim's insert completion (|ins-completion|) key bindings +(, , , etc). Calling this function will set the current +buffer's |completefunc| option to a supertab provided implementation which +utilizes the supplied arguments to perform the completion. Since the +|completefunc| option is being set, this feature must be used with +|g:SuperTabDefaultCompletionType| set to either "context" or "". + +Here is an example that can be added to your .vimrc which will setup the +supertab chaining for any filetype that has a provided |omnifunc| to first +try that, then fall back to supertab's default, , completion: + +> + autocmd FileType * + \ if &omnifunc != '' | + \ call SuperTabChain(&omnifunc, "") | + \ call SuperTabSetDefaultCompletionType("") | + \ endif +< + +Notice that this autocmd set's the supertab default completion type to user +completion. This is because the call to SuperTabChain will set your buffer's +|'completefunc'| to a supertab defined function which handles the completion +chaining. If that function is never called, by user completion being invoked +via supertab, then completion chaining will not execute. As noted above though, +instead of setting the default to user completion, you can alternatively set +it supertab's 'context' completion type, in which case supertab's 'context' +completion mechanism document above will execute first, and when that context +logic kicks off a user completion, based on the current context, then +supertab's completion chaining will then take over. + +Here is an example where 'context' is the global default and completion +chaining is enabled for file types that have omni completion support: + +> + let g:SuperTabDefaultCompletionType = 'context' + autocmd FileType * + \ if &omnifunc != '' | + \ call SuperTabChain(&omnifunc, "") | + \ endif +< + +That configuration will result in a completion flow like so: + + if text before the cursor looks like a file path: + use file completion + elif text before the cursor looks like an attempt to access a member + (method, field, etc): + use user completion + where user completion is currently set to supertab's + completion chaining, resulting in: + if omni completion has results: + use omni completion + else: + use keyword completion + else: + use keyword completion + +Note: Completion chaining only supports chaining 1 completion function (omni +or user) with 1 regular completion keybinding. All other combinations of +completions (2 or more completion functions, 2 or more key bindings, etc.) are +not supported due to limitations imposed by vim's code completion +implementation. + +Note: If the |completefunc| or |omnifunc| use vim's |complete_add()| instead +of returning completion results as a list, then Supertab's completion chaining +won't work properly with it since Supertab uses the function result to +determine if it should fallback to the next completion type. + +Note: If you are using the 'context' completion type, be sure to _not_ set the +|g:SuperTabContextTextOmniPrecedence| variable. The supertab default value for +that setting works with completion chaining, but if you change it, you may be +telling supertab to bypass its completion chaining logic. + +vim:tw=78:ts=8:ft=help:norl: diff --git a/vim/doc/tags b/vim/doc/tags new file mode 100644 index 0000000..abe2160 --- /dev/null +++ b/vim/doc/tags @@ -0,0 +1,145 @@ +'SignatureMapLeader' signature.txt /*'SignatureMapLeader'* +'g:SignatureEnabledAtStartup' signature.txt /*'g:SignatureEnabledAtStartup'* +'g:SignatureIncludeMarkers' signature.txt /*'g:SignatureIncludeMarkers'* +'g:SignatureIncludeMarks' signature.txt /*'g:SignatureIncludeMarks'* +'g:SignatureMap' signature.txt /*'g:SignatureMap'* +'g:SignatureMarkOrder' signature.txt /*'g:SignatureMarkOrder'* +'g:SignatureMarkTextHL' signature.txt /*'g:SignatureMarkTextHL'* +'g:SignatureMarkerTextHL' signature.txt /*'g:SignatureMarkerTextHL'* +'g:SignatureMenu' signature.txt /*'g:SignatureMenu'* +'g:SignaturePeriodicRefresh' signature.txt /*'g:SignaturePeriodicRefresh'* +'g:SignaturePrioritizeMarks' signature.txt /*'g:SignaturePrioritizeMarks'* +'g:SignaturePurgeConfirmation' signature.txt /*'g:SignaturePurgeConfirmation'* +'g:SignatureWrapJumps' signature.txt /*'g:SignatureWrapJumps'* +:LanguageToolCheck LanguageTool.txt /*:LanguageToolCheck* +:LanguageToolClear LanguageTool.txt /*:LanguageToolClear* +LanguageTool LanguageTool.txt /*LanguageTool* +LanguageTool.txt LanguageTool.txt /*LanguageTool.txt* +SuperTabChain supertab.txt /*SuperTabChain* +SuperTabSetDefaultCompletionType supertab.txt /*SuperTabSetDefaultCompletionType* +b:SuperTabContextTextMemberPatterns supertab.txt /*b:SuperTabContextTextMemberPatterns* +b:SuperTabContextTextOmniPrecedence supertab.txt /*b:SuperTabContextTextOmniPrecedence* +clang_close-preview clang_complete.txt /*clang_close-preview* +clang_complete clang_complete.txt /*clang_complete* +clang_complete-author clang_complete.txt /*clang_complete-author* +clang_complete-auto_select clang_complete.txt /*clang_complete-auto_select* +clang_complete-auto_user_options clang_complete.txt /*clang_complete-auto_user_options* +clang_complete-cc_args clang_complete.txt /*clang_complete-cc_args* +clang_complete-clang_restore_cr_imap clang_complete.txt /*clang_complete-clang_restore_cr_imap* +clang_complete-clang_trailing_placeholder clang_complete.txt /*clang_complete-clang_trailing_placeholder* +clang_complete-compilation_database clang_complete.txt /*clang_complete-compilation_database* +clang_complete-compl_kinds clang_complete.txt /*clang_complete-compl_kinds* +clang_complete-complete_auto clang_complete.txt /*clang_complete-complete_auto* +clang_complete-complete_macros clang_complete.txt /*clang_complete-complete_macros* +clang_complete-complete_patterns clang_complete.txt /*clang_complete-complete_patterns* +clang_complete-conceal_snippets clang_complete.txt /*clang_complete-conceal_snippets* +clang_complete-configuration clang_complete.txt /*clang_complete-configuration* +clang_complete-copen clang_complete.txt /*clang_complete-copen* +clang_complete-description clang_complete.txt /*clang_complete-description* +clang_complete-faq clang_complete.txt /*clang_complete-faq* +clang_complete-hl_errors clang_complete.txt /*clang_complete-hl_errors* +clang_complete-issues clang_complete.txt /*clang_complete-issues* +clang_complete-jumpto_back_key clang_complete.txt /*clang_complete-jumpto_back_key* +clang_complete-jumpto_declaration_in_preview_key clang_complete.txt /*clang_complete-jumpto_declaration_in_preview_key* +clang_complete-jumpto_declaration_key clang_complete.txt /*clang_complete-jumpto_declaration_key* +clang_complete-keybindings clang_complete.txt /*clang_complete-keybindings* +clang_complete-library_path clang_complete.txt /*clang_complete-library_path* +clang_complete-license clang_complete.txt /*clang_complete-license* +clang_complete-loaded clang_complete.txt /*clang_complete-loaded* +clang_complete-make_default_keymappings clang_complete.txt /*clang_complete-make_default_keymappings* +clang_complete-omnicppcomplete_compliance clang_complete.txt /*clang_complete-omnicppcomplete_compliance* +clang_complete-optional_args_in_snippets clang_complete.txt /*clang_complete-optional_args_in_snippets* +clang_complete-options clang_complete.txt /*clang_complete-options* +clang_complete-periodic_quickfix clang_complete.txt /*clang_complete-periodic_quickfix* +clang_complete-snippets clang_complete.txt /*clang_complete-snippets* +clang_complete-snippets_engine clang_complete.txt /*clang_complete-snippets_engine* +clang_complete-sort_algo clang_complete.txt /*clang_complete-sort_algo* +clang_complete-todo clang_complete.txt /*clang_complete-todo* +clang_complete-use_library clang_complete.txt /*clang_complete-use_library* +clang_complete-user_options clang_complete.txt /*clang_complete-user_options* +clang_complete.txt clang_complete.txt /*clang_complete.txt* +g:SignatureMap['Leader'] signature.txt /*g:SignatureMap['Leader']* +g:SuperTabClosePreviewOnPopupClose supertab.txt /*g:SuperTabClosePreviewOnPopupClose* +g:SuperTabCompleteCase supertab.txt /*g:SuperTabCompleteCase* +g:SuperTabCompletionContexts supertab.txt /*g:SuperTabCompletionContexts* +g:SuperTabContextDefaultCompletionType supertab.txt /*g:SuperTabContextDefaultCompletionType* +g:SuperTabContextTextFileTypeExclusions supertab.txt /*g:SuperTabContextTextFileTypeExclusions* +g:SuperTabContextTextMemberPatterns supertab.txt /*g:SuperTabContextTextMemberPatterns* +g:SuperTabContextTextOmniPrecedence supertab.txt /*g:SuperTabContextTextOmniPrecedence* +g:SuperTabCrMapping supertab.txt /*g:SuperTabCrMapping* +g:SuperTabDefaultCompletionType supertab.txt /*g:SuperTabDefaultCompletionType* +g:SuperTabLongestEnhanced supertab.txt /*g:SuperTabLongestEnhanced* +g:SuperTabLongestHighlight supertab.txt /*g:SuperTabLongestHighlight* +g:SuperTabMappingBackward supertab.txt /*g:SuperTabMappingBackward* +g:SuperTabMappingForward supertab.txt /*g:SuperTabMappingForward* +g:SuperTabMappingTabLiteral supertab.txt /*g:SuperTabMappingTabLiteral* +g:SuperTabNoCompleteAfter supertab.txt /*g:SuperTabNoCompleteAfter* +g:SuperTabNoCompleteBefore supertab.txt /*g:SuperTabNoCompleteBefore* +g:SuperTabRetainCompletionDuration supertab.txt /*g:SuperTabRetainCompletionDuration* +g:clang_auto_select clang_complete.txt /*g:clang_auto_select* +g:clang_auto_user_options clang_complete.txt /*g:clang_auto_user_options* +g:clang_close_preview clang_complete.txt /*g:clang_close_preview* +g:clang_compilation_database clang_complete.txt /*g:clang_compilation_database* +g:clang_complete_auto clang_complete.txt /*g:clang_complete_auto* +g:clang_complete_copen clang_complete.txt /*g:clang_complete_copen* +g:clang_complete_loaded clang_complete.txt /*g:clang_complete_loaded* +g:clang_complete_macros clang_complete.txt /*g:clang_complete_macros* +g:clang_complete_optional_args_in_snippets clang_complete.txt /*g:clang_complete_optional_args_in_snippets* +g:clang_complete_patterns clang_complete.txt /*g:clang_complete_patterns* +g:clang_conceal_snippets clang_complete.txt /*g:clang_conceal_snippets* +g:clang_hl_errors clang_complete.txt /*g:clang_hl_errors* +g:clang_jumpto_back_key clang_complete.txt /*g:clang_jumpto_back_key* +g:clang_jumpto_declaration_in_preview_key clang_complete.txt /*g:clang_jumpto_declaration_in_preview_key* +g:clang_jumpto_declaration_key clang_complete.txt /*g:clang_jumpto_declaration_key* +g:clang_library_path clang_complete.txt /*g:clang_library_path* +g:clang_make_default_keymappings clang_complete.txt /*g:clang_make_default_keymappings* +g:clang_omnicppcomplete_compliance clang_complete.txt /*g:clang_omnicppcomplete_compliance* +g:clang_periodic_quickfix clang_complete.txt /*g:clang_periodic_quickfix* +g:clang_restore_cr_imap clang_complete.txt /*g:clang_restore_cr_imap* +g:clang_snippets clang_complete.txt /*g:clang_snippets* +g:clang_snippets_engine clang_complete.txt /*g:clang_snippets_engine* +g:clang_sort_algo clang_complete.txt /*g:clang_sort_algo* +g:clang_trailing_placeholder clang_complete.txt /*g:clang_trailing_placeholder* +g:clang_use_library clang_complete.txt /*g:clang_use_library* +g:clang_user_options clang_complete.txt /*g:clang_user_options* +g:languagetool_disable_rules LanguageTool.txt /*g:languagetool_disable_rules* +g:languagetool_jar LanguageTool.txt /*g:languagetool_jar* +g:languagetool_lang LanguageTool.txt /*g:languagetool_lang* +g:languagetool_win_height LanguageTool.txt /*g:languagetool_win_height* +languagetool-bugs LanguageTool.txt /*languagetool-bugs* +languagetool-configuration LanguageTool.txt /*languagetool-configuration* +languagetool-download LanguageTool.txt /*languagetool-download* +languagetool-features LanguageTool.txt /*languagetool-features* +languagetool-installation LanguageTool.txt /*languagetool-installation* +languagetool-license LanguageTool.txt /*languagetool-license* +languagetool-overview LanguageTool.txt /*languagetool-overview* +languagetool-screenshots LanguageTool.txt /*languagetool-screenshots* +signature signature.txt /*signature* +signature-commands signature.txt /*signature-commands* +signature-contents signature.txt /*signature-contents* +signature-contributing signature.txt /*signature-contributing* +signature-credits signature.txt /*signature-credits* +signature-customization signature.txt /*signature-customization* +signature-license signature.txt /*signature-license* +signature-mappings signature.txt /*signature-mappings* +supertab supertab.txt /*supertab* +supertab-closepreviewonpopupclose supertab.txt /*supertab-closepreviewonpopupclose* +supertab-completecase supertab.txt /*supertab-completecase* +supertab-completionchaining supertab.txt /*supertab-completionchaining* +supertab-completioncontexts supertab.txt /*supertab-completioncontexts* +supertab-contextdefault supertab.txt /*supertab-contextdefault* +supertab-contextdiscover supertab.txt /*supertab-contextdiscover* +supertab-contextexample supertab.txt /*supertab-contextexample* +supertab-contexttext supertab.txt /*supertab-contexttext* +supertab-crmapping supertab.txt /*supertab-crmapping* +supertab-defaultcompletion supertab.txt /*supertab-defaultcompletion* +supertab-duration supertab.txt /*supertab-duration* +supertab-forwardbackward supertab.txt /*supertab-forwardbackward* +supertab-intro supertab.txt /*supertab-intro* +supertab-longestenhanced supertab.txt /*supertab-longestenhanced* +supertab-longesthighlight supertab.txt /*supertab-longesthighlight* +supertab-mappingtabliteral supertab.txt /*supertab-mappingtabliteral* +supertab-options supertab.txt /*supertab-options* +supertab-preventcomplete supertab.txt /*supertab-preventcomplete* +supertab-usage supertab.txt /*supertab-usage* +supertab.txt supertab.txt /*supertab.txt* diff --git a/vim/ftplugin/java_checkstyle b/vim/ftplugin/java_checkstyle new file mode 120000 index 0000000..dd107c1 --- /dev/null +++ b/vim/ftplugin/java_checkstyle @@ -0,0 +1 @@ +/home/frank/Programmation/dotfiles/vim/ftplugin/java_checkstyle \ No newline at end of file diff --git a/vim/plugin/libclang.py b/vim/plugin/libclang.py new file mode 100644 index 0000000..4cb7f12 --- /dev/null +++ b/vim/plugin/libclang.py @@ -0,0 +1,793 @@ +from clang.cindex import * +import vim +import time +import threading +import os +import shlex + +# Check if libclang is able to find the builtin include files. +# +# libclang sometimes fails to correctly locate its builtin include files. This +# happens especially if libclang is not installed at a standard location. This +# function checks if the builtin includes are available. +def canFindBuiltinHeaders(index, args = []): + flags = 0 + currentFile = ("test.c", '#include "stddef.h"') + try: + tu = index.parse("test.c", args, [currentFile], flags) + except TranslationUnitLoadError, e: + return 0 + return len(tu.diagnostics) == 0 + +# Derive path to clang builtin headers. +# +# This function tries to derive a path to clang's builtin header files. We are +# just guessing, but the guess is very educated. In fact, we should be right +# for all manual installations (the ones where the builtin header path problem +# is very common) as well as a set of very common distributions. +def getBuiltinHeaderPath(library_path): + if os.path.isfile(library_path): + library_path = os.path.dirname(library_path) + + knownPaths = [ + library_path + "/../lib/clang", # default value + library_path + "/../clang", # gentoo + library_path + "/clang", # opensuse + library_path + "/", # Google + "/usr/lib64/clang", # x86_64 (openSUSE, Fedora) + "/usr/lib/clang" + ] + + for path in knownPaths: + try: + files = os.listdir(path) + if len(files) >= 1: + files = sorted(files) + subDir = files[-1] + else: + subDir = '.' + path = path + "/" + subDir + "/include/" + arg = "-I" + path + if canFindBuiltinHeaders(index, [arg]): + return path + except: + pass + + return None + +def initClangComplete(clang_complete_flags, clang_compilation_database, \ + library_path): + global index + + debug = int(vim.eval("g:clang_debug")) == 1 + + if library_path: + if os.path.isdir(library_path): + Config.set_library_path(library_path) + else: + Config.set_library_file(library_path) + + Config.set_compatibility_check(False) + + try: + index = Index.create() + except Exception, e: + if library_path: + suggestion = "Are you sure '%s' contains libclang?" % library_path + else: + suggestion = "Consider setting g:clang_library_path." + + if debug: + exception_msg = str(e) + else: + exception_msg = '' + + print '''Loading libclang failed, completion won't be available. %s + %s + ''' % (suggestion, exception_msg) + return 0 + + global builtinHeaderPath + builtinHeaderPath = None + if not canFindBuiltinHeaders(index): + builtinHeaderPath = getBuiltinHeaderPath(library_path) + + if not builtinHeaderPath: + print "WARNING: libclang can not find the builtin includes." + print " This will cause slow code completion." + print " Please report the problem." + + global translationUnits + translationUnits = dict() + global complete_flags + complete_flags = int(clang_complete_flags) + global compilation_database + if clang_compilation_database != '': + compilation_database = CompilationDatabase.fromDirectory(clang_compilation_database) + else: + compilation_database = None + global libclangLock + libclangLock = threading.Lock() + return 1 + +# Get a tuple (fileName, fileContent) for the file opened in the current +# vim buffer. The fileContent contains the unsafed buffer content. +def getCurrentFile(): + file = "\n".join(vim.current.buffer[:] + ["\n"]) + return (vim.current.buffer.name, file) + +class CodeCompleteTimer: + def __init__(self, debug, file, line, column, params): + self._debug = debug + + if not debug: + return + + content = vim.current.line + print " " + print "libclang code completion" + print "========================" + print "Command: clang %s -fsyntax-only " % " ".join(params['args']), + print "-Xclang -code-completion-at=%s:%d:%d %s" % (file, line, column, file) + print "cwd: %s" % params['cwd'] + print "File: %s" % file + print "Line: %d, Column: %d" % (line, column) + print " " + print "%s" % content + + print " " + + current = time.time() + self._start = current + self._last = current + self._events = [] + + def registerEvent(self, event): + if not self._debug: + return + + current = time.time() + since_last = current - self._last + self._last = current + self._events.append((event, since_last)) + + def finish(self): + if not self._debug: + return + + overall = self._last - self._start + + for event in self._events: + name, since_last = event + percent = 1 / overall * since_last * 100 + print "libclang code completion - %25s: %.3fs (%5.1f%%)" % \ + (name, since_last, percent) + + print " " + print "Overall: %.3f s" % overall + print "========================" + print " " + +def getCurrentTranslationUnit(args, currentFile, fileName, timer, + update = False): + tu = translationUnits.get(fileName) + if tu != None: + if update: + tu.reparse([currentFile]) + timer.registerEvent("Reparsing") + return tu + + flags = TranslationUnit.PARSE_PRECOMPILED_PREAMBLE | \ + TranslationUnit.PARSE_DETAILED_PROCESSING_RECORD + try: + tu = index.parse(fileName, args, [currentFile], flags) + timer.registerEvent("First parse") + except TranslationUnitLoadError, e: + return None + + translationUnits[fileName] = tu + + # Reparse to initialize the PCH cache even for auto completion + # This should be done by index.parse(), however it is not. + # So we need to reparse ourselves. + tu.reparse([currentFile]) + timer.registerEvent("Generate PCH cache") + return tu + +def splitOptions(options): + # Use python's shell command lexer to correctly split the list of options in + # accordance with the POSIX standard + return shlex.split(options) + +def getQuickFix(diagnostic): + # Some diagnostics have no file, e.g. "too many errors emitted, stopping now" + if diagnostic.location.file: + filename = diagnostic.location.file.name + else: + filename = "" + + if diagnostic.severity == diagnostic.Ignored: + type = 'I' + elif diagnostic.severity == diagnostic.Note: + type = 'I' + elif diagnostic.severity == diagnostic.Warning: + if "argument unused during compilation" in diagnostic.spelling: + return None + type = 'W' + elif diagnostic.severity == diagnostic.Error: + type = 'E' + elif diagnostic.severity == diagnostic.Fatal: + type = 'E' + else: + return None + + return dict({ 'bufnr' : int(vim.eval("bufnr('" + filename + "', 1)")), + 'lnum' : diagnostic.location.line, + 'col' : diagnostic.location.column, + 'text' : diagnostic.spelling, + 'type' : type}) + +def getQuickFixList(tu): + return filter (None, map (getQuickFix, tu.diagnostics)) + +def highlightRange(range, hlGroup): + pattern = '/\%' + str(range.start.line) + 'l' + '\%' \ + + str(range.start.column) + 'c' + '.*' \ + + '\%' + str(range.end.column) + 'c/' + command = "exe 'syntax match' . ' " + hlGroup + ' ' + pattern + "'" + vim.command(command) + +def highlightDiagnostic(diagnostic): + if diagnostic.severity == diagnostic.Warning: + hlGroup = 'SpellLocal' + elif diagnostic.severity == diagnostic.Error: + hlGroup = 'SpellBad' + else: + return + + pattern = '/\%' + str(diagnostic.location.line) + 'l\%' \ + + str(diagnostic.location.column) + 'c./' + command = "exe 'syntax match' . ' " + hlGroup + ' ' + pattern + "'" + vim.command(command) + + for range in diagnostic.ranges: + highlightRange(range, hlGroup) + +def highlightDiagnostics(tu): + map (highlightDiagnostic, tu.diagnostics) + +def highlightCurrentDiagnostics(): + if vim.current.buffer.name in translationUnits: + highlightDiagnostics(translationUnits[vim.current.buffer.name]) + +def getCurrentQuickFixList(): + if vim.current.buffer.name in translationUnits: + return getQuickFixList(translationUnits[vim.current.buffer.name]) + return [] + +# Get the compilation parameters from the compilation database for source +# 'fileName'. The parameters are returned as map with the following keys : +# +# 'args' : compiler arguments. +# Compilation database returns the complete command line. We need +# to filter at least the compiler invocation, the '-o' + output +# file, the input file and the '-c' arguments. We alter -I paths +# to make them absolute, so that we can launch clang from wherever +# we are. +# Note : we behave differently from cc_args.py which only keeps +# '-I', '-D' and '-include' options. +# +# 'cwd' : the compiler working directory +# +# The last found args and cwd are remembered and reused whenever a file is +# not found in the compilation database. For example, this is the case for +# all headers. This achieve very good results in practice. +def getCompilationDBParams(fileName): + if compilation_database: + cmds = compilation_database.getCompileCommands(fileName) + if cmds != None: + cwd = cmds[0].directory + args = [] + skip_next = 1 # Skip compiler invocation + for arg in cmds[0].arguments: + if skip_next: + skip_next = 0; + continue + if arg == '-c': + continue + if arg == fileName or \ + os.path.realpath(os.path.join(cwd, arg)) == fileName: + continue + if arg == '-o': + skip_next = 1; + continue + if arg.startswith('-I'): + includePath = arg[2:] + if not os.path.isabs(includePath): + includePath = os.path.normpath(os.path.join(cwd, includePath)) + args.append('-I'+includePath) + continue + args.append(arg) + getCompilationDBParams.last_query = { 'args': args, 'cwd': cwd } + + # Do not directly return last_query, but make sure we return a deep copy. + # Otherwise users of that result may accidently change it and store invalid + # values in our cache. + query = getCompilationDBParams.last_query + return { 'args': list(query['args']), 'cwd': query['cwd']} + +getCompilationDBParams.last_query = { 'args': [], 'cwd': None } + +def getCompileParams(fileName): + global builtinHeaderPath + params = getCompilationDBParams(fileName) + args = params['args'] + args += splitOptions(vim.eval("g:clang_user_options")) + args += splitOptions(vim.eval("b:clang_user_options")) + args += splitOptions(vim.eval("b:clang_parameters")) + + if builtinHeaderPath: + args.append("-I" + builtinHeaderPath) + + return { 'args' : args, + 'cwd' : params['cwd'] } + +def updateCurrentDiagnostics(): + global debug + debug = int(vim.eval("g:clang_debug")) == 1 + params = getCompileParams(vim.current.buffer.name) + timer = CodeCompleteTimer(debug, vim.current.buffer.name, -1, -1, params) + + with libclangLock: + getCurrentTranslationUnit(params['args'], getCurrentFile(), + vim.current.buffer.name, timer, update = True) + timer.finish() + +def getCurrentCompletionResults(line, column, args, currentFile, fileName, + timer): + + tu = getCurrentTranslationUnit(args, currentFile, fileName, timer) + timer.registerEvent("Get TU") + + if tu == None: + return None + + cr = tu.codeComplete(fileName, line, column, [currentFile], + complete_flags) + timer.registerEvent("Code Complete") + return cr + +def formatResult(result): + completion = dict() + returnValue = None + abbr = "" + word = "" + info = "" + place_markers_for_optional_args = int(vim.eval("g:clang_complete_optional_args_in_snippets")) == 1 + + def roll_out_optional(chunks): + result = [] + word = "" + for chunk in chunks: + if chunk.isKindInformative() or chunk.isKindResultType() or chunk.isKindTypedText(): + continue + + word += chunk.spelling + if chunk.isKindOptional(): + result += roll_out_optional(chunk.string) + + return [word] + result + + for chunk in result.string: + + if chunk.isKindInformative(): + continue + + if chunk.isKindResultType(): + returnValue = chunk + continue + + chunk_spelling = chunk.spelling + + if chunk.isKindTypedText(): + abbr = chunk_spelling + + if chunk.isKindOptional(): + for optional_arg in roll_out_optional(chunk.string): + if place_markers_for_optional_args: + word += snippetsFormatPlaceHolder(optional_arg) + info += optional_arg + "=?" + + if chunk.isKindPlaceHolder(): + word += snippetsFormatPlaceHolder(chunk_spelling) + else: + word += chunk_spelling + + info += chunk_spelling + + menu = info + + if returnValue: + menu = returnValue.spelling + " " + menu + + completion['word'] = snippetsAddSnippet(info, word, abbr) + completion['abbr'] = abbr + completion['menu'] = menu + completion['info'] = info + completion['dup'] = 1 + + # Replace the number that represents a specific kind with a better + # textual representation. + completion['kind'] = kinds[result.cursorKind] + + return completion + + +class CompleteThread(threading.Thread): + def __init__(self, line, column, currentFile, fileName, params, timer): + threading.Thread.__init__(self) + # Complete threads are daemon threads. Python and consequently vim does not + # wait for daemon threads to finish execution when existing itself. As + # clang may compile for a while, we do not have to wait for the compilation + # to finish before vim can quit. Before adding this flags, vim was hanging + # for a couple of seconds before it exited. + self.daemon = True + self.line = line + self.column = column + self.currentFile = currentFile + self.fileName = fileName + self.result = None + self.args = params['args'] + self.cwd = params['cwd'] + self.timer = timer + + def run(self): + with libclangLock: + if self.line == -1: + # Warm up the caches. For this it is sufficient to get the + # current translation unit. No need to retrieve completion + # results. This short pause is necessary to allow vim to + # initialize itself. Otherwise we would get: E293: block was + # not locked The user does not see any delay, as we just pause + # a background thread. + time.sleep(0.1) + getCurrentTranslationUnit(self.args, self.currentFile, self.fileName, + self.timer) + else: + self.result = getCurrentCompletionResults(self.line, self.column, + self.args, self.currentFile, + self.fileName, self.timer) + +def WarmupCache(): + params = getCompileParams(vim.current.buffer.name) + timer = CodeCompleteTimer(0, "", -1, -1, params) + t = CompleteThread(-1, -1, getCurrentFile(), vim.current.buffer.name, + params, timer) + t.start() + +def getCurrentCompletions(base): + global debug + debug = int(vim.eval("g:clang_debug")) == 1 + sorting = vim.eval("g:clang_sort_algo") + line, _ = vim.current.window.cursor + column = int(vim.eval("b:col")) + params = getCompileParams(vim.current.buffer.name) + + timer = CodeCompleteTimer(debug, vim.current.buffer.name, line, column, + params) + + t = CompleteThread(line, column, getCurrentFile(), vim.current.buffer.name, + params, timer) + t.start() + while t.isAlive(): + t.join(0.01) + cancel = int(vim.eval('complete_check()')) + if cancel != 0: + return (str([]), timer) + + cr = t.result + if cr is None: + print "Cannot parse this source file. The following arguments " \ + + "are used for clang: " + " ".join(params['args']) + return (str([]), timer) + + results = cr.results + + timer.registerEvent("Count # Results (%s)" % str(len(results))) + + if base != "": + results = filter(lambda x: getAbbr(x.string).startswith(base), results) + + timer.registerEvent("Filter") + + if sorting == 'priority': + getPriority = lambda x: x.string.priority + results = sorted(results, None, getPriority) + if sorting == 'alpha': + getAbbrevation = lambda x: getAbbr(x.string).lower() + results = sorted(results, None, getAbbrevation) + + timer.registerEvent("Sort") + + result = map(formatResult, results) + + timer.registerEvent("Format") + return (str(result), timer) + +def getAbbr(strings): + for chunks in strings: + if chunks.isKindTypedText(): + return chunks.spelling + return "" + +def jumpToLocation(filename, line, column, preview): + filenameEscaped = filename.replace(" ", "\\ ") + if preview: + command = "pedit +%d %s" % (line, filenameEscaped) + elif filename != vim.current.buffer.name: + command = "edit %s" % filenameEscaped + else: + command = "normal m'" + try: + vim.command(command) + except: + # For some unknown reason, whenever an exception occurs in + # vim.command, vim goes crazy and output tons of useless python + # errors, catch those. + return + if not preview: + vim.current.window.cursor = (line, column - 1) + +def gotoDeclaration(preview=True): + global debug + debug = int(vim.eval("g:clang_debug")) == 1 + params = getCompileParams(vim.current.buffer.name) + line, col = vim.current.window.cursor + timer = CodeCompleteTimer(debug, vim.current.buffer.name, line, col, params) + + with libclangLock: + tu = getCurrentTranslationUnit(params['args'], getCurrentFile(), + vim.current.buffer.name, timer, + update = True) + if tu is None: + print "Couldn't get the TranslationUnit" + return + + f = File.from_name(tu, vim.current.buffer.name) + loc = SourceLocation.from_position(tu, f, line, col + 1) + cursor = Cursor.from_location(tu, loc) + defs = [cursor.get_definition(), cursor.referenced] + + for d in defs: + if d is not None and loc != d.location: + loc = d.location + if loc.file is not None: + jumpToLocation(loc.file.name, loc.line, loc.column, preview) + break + + timer.finish() + +# Manually extracted from Index.h +# Doing it by hand is long, error prone and horrible, we must find a way +# to do that automatically. +kinds = dict({ \ +# Declarations \ + 1 : 't', # CXCursor_UnexposedDecl (A declaration whose specific kind is not \ + # exposed via this interface) \ + 2 : 't', # CXCursor_StructDecl (A C or C++ struct) \ + 3 : 't', # CXCursor_UnionDecl (A C or C++ union) \ + 4 : 't', # CXCursor_ClassDecl (A C++ class) \ + 5 : 't', # CXCursor_EnumDecl (An enumeration) \ + 6 : 'm', # CXCursor_FieldDecl (A field (in C) or non-static data member \ + # (in C++) in a struct, union, or C++ class) \ + 7 : 'e', # CXCursor_EnumConstantDecl (An enumerator constant) \ + 8 : 'f', # CXCursor_FunctionDecl (A function) \ + 9 : 'v', # CXCursor_VarDecl (A variable) \ +10 : 'a', # CXCursor_ParmDecl (A function or method parameter) \ +11 : '11', # CXCursor_ObjCInterfaceDecl (An Objective-C @interface) \ +12 : '12', # CXCursor_ObjCCategoryDecl (An Objective-C @interface for a \ + # category) \ +13 : '13', # CXCursor_ObjCProtocolDecl (An Objective-C @protocol declaration) \ +14 : '14', # CXCursor_ObjCPropertyDecl (An Objective-C @property declaration) \ +15 : '15', # CXCursor_ObjCIvarDecl (An Objective-C instance variable) \ +16 : '16', # CXCursor_ObjCInstanceMethodDecl (An Objective-C instance method) \ +17 : '17', # CXCursor_ObjCClassMethodDecl (An Objective-C class method) \ +18 : '18', # CXCursor_ObjCImplementationDec (An Objective-C @implementation) \ +19 : '19', # CXCursor_ObjCCategoryImplDecll (An Objective-C @implementation \ + # for a category) \ +20 : 't', # CXCursor_TypedefDecl (A typedef) \ +21 : 'f', # CXCursor_CXXMethod (A C++ class method) \ +22 : 'n', # CXCursor_Namespace (A C++ namespace) \ +23 : '23', # CXCursor_LinkageSpec (A linkage specification, e.g. 'extern "C"') \ +24 : '+', # CXCursor_Constructor (A C++ constructor) \ +25 : '~', # CXCursor_Destructor (A C++ destructor) \ +26 : '26', # CXCursor_ConversionFunction (A C++ conversion function) \ +27 : 'a', # CXCursor_TemplateTypeParameter (A C++ template type parameter) \ +28 : 'a', # CXCursor_NonTypeTemplateParameter (A C++ non-type template \ + # parameter) \ +29 : 'a', # CXCursor_TemplateTemplateParameter (A C++ template template \ + # parameter) \ +30 : 'f', # CXCursor_FunctionTemplate (A C++ function template) \ +31 : 'p', # CXCursor_ClassTemplate (A C++ class template) \ +32 : '32', # CXCursor_ClassTemplatePartialSpecialization (A C++ class template \ + # partial specialization) \ +33 : 'n', # CXCursor_NamespaceAlias (A C++ namespace alias declaration) \ +34 : '34', # CXCursor_UsingDirective (A C++ using directive) \ +35 : '35', # CXCursor_UsingDeclaration (A C++ using declaration) \ +36 : 't', # CXCursor_TypeAliasDecl (A C++ alias declaration) \ +37 : '37', # CXCursor_ObjCSynthesizeDecl (An Objective-C synthesize definition)\ +38 : '38', # CXCursor_ObjCDynamicDecl (An Objective-C dynamic definition) \ +39 : '39', # CXCursor_CXXAccessSpecifier (An access specifier) \ + \ +# References \ +40 : '40', # CXCursor_ObjCSuperClassRef \ +41 : '41', # CXCursor_ObjCProtocolRef \ +42 : '42', # CXCursor_ObjCClassRef \ +43 : '43', # CXCursor_TypeRef \ +44 : '44', # CXCursor_CXXBaseSpecifier \ +45 : '45', # CXCursor_TemplateRef (A reference to a class template, function \ + # template, template template parameter, or class template partial \ + # specialization) \ +46 : '46', # CXCursor_NamespaceRef (A reference to a namespace or namespace \ + # alias) \ +47 : '47', # CXCursor_MemberRef (A reference to a member of a struct, union, \ + # or class that occurs in some non-expression context, e.g., a \ + # designated initializer) \ +48 : '48', # CXCursor_LabelRef (A reference to a labeled statement) \ +49 : '49', # CXCursor_OverloadedDeclRef (A reference to a set of overloaded \ + # functions or function templates that has not yet been resolved to \ + # a specific function or function template) \ +50 : '50', # CXCursor_VariableRef \ + \ +# Error conditions \ +#70 : '70', # CXCursor_FirstInvalid \ +70 : '70', # CXCursor_InvalidFile \ +71 : '71', # CXCursor_NoDeclFound \ +72 : 'u', # CXCursor_NotImplemented \ +73 : '73', # CXCursor_InvalidCode \ + \ +# Expressions \ +100 : '100', # CXCursor_UnexposedExpr (An expression whose specific kind is \ + # not exposed via this interface) \ +101 : '101', # CXCursor_DeclRefExpr (An expression that refers to some value \ + # declaration, such as a function, varible, or enumerator) \ +102 : '102', # CXCursor_MemberRefExpr (An expression that refers to a member \ + # of a struct, union, class, Objective-C class, etc) \ +103 : '103', # CXCursor_CallExpr (An expression that calls a function) \ +104 : '104', # CXCursor_ObjCMessageExpr (An expression that sends a message \ + # to an Objective-C object or class) \ +105 : '105', # CXCursor_BlockExpr (An expression that represents a block \ + # literal) \ +106 : '106', # CXCursor_IntegerLiteral (An integer literal) \ +107 : '107', # CXCursor_FloatingLiteral (A floating point number literal) \ +108 : '108', # CXCursor_ImaginaryLiteral (An imaginary number literal) \ +109 : '109', # CXCursor_StringLiteral (A string literal) \ +110 : '110', # CXCursor_CharacterLiteral (A character literal) \ +111 : '111', # CXCursor_ParenExpr (A parenthesized expression, e.g. "(1)") \ +112 : '112', # CXCursor_UnaryOperator (This represents the unary-expression's \ + # (except sizeof and alignof)) \ +113 : '113', # CXCursor_ArraySubscriptExpr ([C99 6.5.2.1] Array Subscripting) \ +114 : '114', # CXCursor_BinaryOperator (A builtin binary operation expression \ + # such as "x + y" or "x <= y") \ +115 : '115', # CXCursor_CompoundAssignOperator (Compound assignment such as \ + # "+=") \ +116 : '116', # CXCursor_ConditionalOperator (The ?: ternary operator) \ +117 : '117', # CXCursor_CStyleCastExpr (An explicit cast in C (C99 6.5.4) or a\ + # C-style cast in C++ (C++ [expr.cast]), which uses the syntax \ + # (Type)expr) \ +118 : '118', # CXCursor_CompoundLiteralExpr ([C99 6.5.2.5]) \ +119 : '119', # CXCursor_InitListExpr (Describes an C or C++ initializer list) \ +120 : '120', # CXCursor_AddrLabelExpr (The GNU address of label extension, \ + # representing &&label) \ +121 : '121', # CXCursor_StmtExpr (This is the GNU Statement Expression \ + # extension: ({int X=4; X;}) \ +122 : '122', # CXCursor_GenericSelectionExpr (brief Represents a C11 generic \ + # selection) \ +123 : '123', # CXCursor_GNUNullExpr (Implements the GNU __null extension) \ +124 : '124', # CXCursor_CXXStaticCastExpr (C++'s static_cast<> expression) \ +125 : '125', # CXCursor_CXXDynamicCastExpr (C++'s dynamic_cast<> expression) \ +126 : '126', # CXCursor_CXXReinterpretCastExpr (C++'s reinterpret_cast<> \ + # expression) \ +127 : '127', # CXCursor_CXXConstCastExpr (C++'s const_cast<> expression) \ +128 : '128', # CXCursor_CXXFunctionalCastExpr (Represents an explicit C++ type\ + # conversion that uses "functional" notion \ + # (C++ [expr.type.conv])) \ +129 : '129', # CXCursor_CXXTypeidExpr (A C++ typeid expression \ + # (C++ [expr.typeid])) \ +130 : '130', # CXCursor_CXXBoolLiteralExpr (brief [C++ 2.13.5] C++ Boolean \ + # Literal) \ +131 : '131', # CXCursor_CXXNullPtrLiteralExpr ([C++0x 2.14.7] C++ Pointer \ + # Literal) \ +132 : '132', # CXCursor_CXXThisExpr (Represents the "this" expression in C+) \ +133 : '133', # CXCursor_CXXThrowExpr ([C++ 15] C++ Throw Expression) \ +134 : '134', # CXCursor_CXXNewExpr (A new expression for memory allocation \ + # and constructor calls) \ +135 : '135', # CXCursor_CXXDeleteExpr (A delete expression for memory \ + # deallocation and destructor calls) \ +136 : '136', # CXCursor_UnaryExpr (A unary expression) \ +137 : '137', # CXCursor_ObjCStringLiteral (An Objective-C string literal \ + # i.e. @"foo") \ +138 : '138', # CXCursor_ObjCEncodeExpr (An Objective-C \@encode expression) \ +139 : '139', # CXCursor_ObjCSelectorExpr (An Objective-C \@selector expression)\ +140 : '140', # CXCursor_ObjCProtocolExpr (An Objective-C \@protocol expression)\ +141 : '141', # CXCursor_ObjCBridgedCastExpr (An Objective-C "bridged" cast \ + # expression, which casts between Objective-C pointers and C \ + # pointers, transferring ownership in the process) \ +142 : '142', # CXCursor_PackExpansionExpr (Represents a C++0x pack expansion \ + # that produces a sequence of expressions) \ +143 : '143', # CXCursor_SizeOfPackExpr (Represents an expression that computes\ + # the length of a parameter pack) \ +144 : '144', # CXCursor_LambdaExpr (Represents a C++ lambda expression that \ + # produces a local function object) \ +145 : '145', # CXCursor_ObjCBoolLiteralExpr (Objective-c Boolean Literal) \ + \ +# Statements \ +200 : '200', # CXCursor_UnexposedStmt (A statement whose specific kind is not \ + # exposed via this interface) \ +201 : '201', # CXCursor_LabelStmt (A labelled statement in a function) \ +202 : '202', # CXCursor_CompoundStmt (A group of statements like \ + # { stmt stmt }. \ +203 : '203', # CXCursor_CaseStmt (A case statment) \ +204 : '204', # CXCursor_DefaultStmt (A default statement) \ +205 : '205', # CXCursor_IfStmt (An if statemen) \ +206 : '206', # CXCursor_SwitchStmt (A switch statement) \ +207 : '207', # CXCursor_WhileStmt (A while statement) \ +208 : '208', # CXCursor_DoStmt (A do statement) \ +209 : '209', # CXCursor_ForStmt (A for statement) \ +210 : '210', # CXCursor_GotoStmt (A goto statement) \ +211 : '211', # CXCursor_IndirectGotoStmt (An indirect goto statement) \ +212 : '212', # CXCursor_ContinueStmt (A continue statement) \ +213 : '213', # CXCursor_BreakStmt (A break statement) \ +214 : '214', # CXCursor_ReturnStmt (A return statement) \ +215 : '215', # CXCursor_GCCAsmStmt (A GCC inline assembly statement extension)\ +216 : '216', # CXCursor_ObjCAtTryStmt (Objective-C's overall try-catch-finally\ + # statement. \ +217 : '217', # CXCursor_ObjCAtCatchStmt (Objective-C's catch statement) \ +218 : '218', # CXCursor_ObjCAtFinallyStmt (Objective-C's finally statement) \ +219 : '219', # CXCursor_ObjCAtThrowStmt (Objective-C's throw statement) \ +220 : '220', # CXCursor_ObjCAtSynchronizedStmt (Objective-C's synchronized \ + # statement) \ +221 : '221', # CXCursor_ObjCAutoreleasePoolStmt (Objective-C's autorelease \ + # pool statement) \ +222 : '222', # CXCursor_ObjCForCollectionStmt (Objective-C's collection \ + # statement) \ +223 : '223', # CXCursor_CXXCatchStmt (C++'s catch statement) \ +224 : '224', # CXCursor_CXXTryStmt (C++'s try statement) \ +225 : '225', # CXCursor_CXXForRangeStmt (C++'s for (* : *) statement) \ +226 : '226', # CXCursor_SEHTryStmt (Windows Structured Exception Handling's \ + # try statement) \ +227 : '227', # CXCursor_SEHExceptStmt (Windows Structured Exception Handling's\ + # except statement. \ +228 : '228', # CXCursor_SEHFinallyStmt (Windows Structured Exception \ + # Handling's finally statement) \ +229 : '229', # CXCursor_MSAsmStmt (A MS inline assembly statement extension) \ +230 : '230', # CXCursor_NullStmt (The null satement ";": C99 6.8.3p3) \ +231 : '231', # CXCursor_DeclStmt (Adaptor class for mixing declarations with \ + # statements and expressions) \ + \ +# Translation unit \ +300 : '300', # CXCursor_TranslationUnit (Cursor that represents the \ + # translation unit itself) \ + \ +# Attributes \ +400 : '400', # CXCursor_UnexposedAttr (An attribute whose specific kind is \ + # not exposed via this interface) \ +401 : '401', # CXCursor_IBActionAttr \ +402 : '402', # CXCursor_IBOutletAttr \ +403 : '403', # CXCursor_IBOutletCollectionAttr \ +404 : '404', # CXCursor_CXXFinalAttr \ +405 : '405', # CXCursor_CXXOverrideAttr \ +406 : '406', # CXCursor_AnnotateAttr \ +407 : '407', # CXCursor_AsmLabelAttr \ + \ +# Preprocessing \ +500 : '500', # CXCursor_PreprocessingDirective \ +501 : 'd', # CXCursor_MacroDefinition \ +502 : '502', # CXCursor_MacroInstantiation \ +503 : '503', # CXCursor_InclusionDirective \ + \ +# Modules \ +600 : '600', # CXCursor_ModuleImportDecl (A module import declaration) \ +}) + +# vim: set ts=2 sts=2 sw=2 expandtab : diff --git a/vim/plugin/snippets/__init__.py b/vim/plugin/snippets/__init__.py new file mode 100644 index 0000000..86365c3 --- /dev/null +++ b/vim/plugin/snippets/__init__.py @@ -0,0 +1 @@ +__all__ = ['clang_complete', 'ultisnips', 'dummy'] diff --git a/vim/plugin/snippets/__init__.pyc b/vim/plugin/snippets/__init__.pyc new file mode 100644 index 0000000..5d2b30b Binary files /dev/null and b/vim/plugin/snippets/__init__.pyc differ diff --git a/vim/plugin/snippets/clang_complete.py b/vim/plugin/snippets/clang_complete.py new file mode 100644 index 0000000..3c27e54 --- /dev/null +++ b/vim/plugin/snippets/clang_complete.py @@ -0,0 +1,47 @@ +import re +import vim + +def snippetsInit(): + vim.command("noremap :python updateSnips()") + vim.command("snoremap :python updateSnips()") + if int(vim.eval("g:clang_conceal_snippets")) == 1: + vim.command("syntax match placeHolder /\$`[^`]*`/ contains=placeHolderMark") + vim.command("syntax match placeHolderMark contained /\$`/ conceal") + vim.command("syntax match placeHolderMark contained /`/ conceal") + +# The two following function are performance sensitive, do _nothing_ +# more that the strict necessary. + +def snippetsFormatPlaceHolder(word): + return "$`%s`" % word + +def snippetsAddSnippet(fullname, word, abbr): + return word + +r = re.compile('\$`[^`]*`') + +def snippetsTrigger(): + if r.search(vim.current.line) is None: + return + vim.command('call feedkeys("\^\")') + +def snippetsReset(): + pass + +def updateSnips(): + line = vim.current.line + row, col = vim.current.window.cursor + + result = r.search(line, col) + if result is None: + result = r.search(line) + if result is None: + vim.command('call feedkeys("\", "n")') + return + + start, end = result.span() + vim.current.window.cursor = row, start + isInclusive = vim.eval("&selection") == "inclusive" + vim.command('call feedkeys("\v%dl\", "n")' % (end - start - isInclusive)) + +# vim: set ts=2 sts=2 sw=2 expandtab : diff --git a/vim/plugin/snippets/dummy.py b/vim/plugin/snippets/dummy.py new file mode 100644 index 0000000..ff4137f --- /dev/null +++ b/vim/plugin/snippets/dummy.py @@ -0,0 +1,16 @@ +def snippetsInit(): + pass + +def snippetsFormatPlaceHolder(word): + return '' + +def snippetsAddSnippet(fullname, word, abbr): + return abbr + +def snippetsTrigger(): + pass + +def snippetsReset(): + pass + +# vim: set ts=2 sts=2 sw=2 expandtab : diff --git a/vim/plugin/snippets/dummy.pyc b/vim/plugin/snippets/dummy.pyc new file mode 100644 index 0000000..8126559 Binary files /dev/null and b/vim/plugin/snippets/dummy.pyc differ diff --git a/vim/plugin/snippets/ultisnips.py b/vim/plugin/snippets/ultisnips.py new file mode 100644 index 0000000..5d1130e --- /dev/null +++ b/vim/plugin/snippets/ultisnips.py @@ -0,0 +1,39 @@ +import vim +import re + +try: + from UltiSnips import UltiSnips_Manager +except: + from UltiSnips import SnippetManager + + UltiSnips_Manager = SnippetManager( + vim.eval('g:UltiSnipsExpandTrigger'), + vim.eval('g:UltiSnipsJumpForwardTrigger'), + vim.eval('g:UltiSnipsJumpBackwardTrigger')) + +def snippetsInit(): + global ultisnips_idx + ultisnips_idx = 0 + UltiSnips_Manager.add_buffer_filetypes('%s.clang_complete' % vim.eval('&filetype')) + +def snippetsFormatPlaceHolder(word): + # Better way to do that? + global ultisnips_idx + ultisnips_idx += 1 + return '${%d:%s}' % (ultisnips_idx, word) + +def snippetsAddSnippet(fullname, word, abbr): + global ultisnips_idx + ultisnips_idx = 0 + UltiSnips_Manager.add_snippet(fullname, word, fullname, "i", "clang_complete") + return fullname + +def snippetsTrigger(): + print vim.current.line + UltiSnips_Manager.expand() + +def snippetsReset(): + if "clang_complete" in UltiSnips_Manager._added_snippets_source._snippets: + UltiSnips_Manager._added_snippets_source._snippets["clang_complete"]._snippets = [] + +# vim: set ts=2 sts=2 sw=2 expandtab : diff --git a/vim/plugin/supertab.vim b/vim/plugin/supertab.vim new file mode 100644 index 0000000..bbcc58f --- /dev/null +++ b/vim/plugin/supertab.vim @@ -0,0 +1,1099 @@ +" Author: Eric Van Dewoestine +" Original concept and versions up to 0.32 written by +" Gergely Kontra +" Version: 2.1 +" GetLatestVimScripts: 1643 1 :AutoInstall: supertab.vim +" +" Description: {{{ +" Use your tab key to do all your completion in insert mode! +" You can cycle forward and backward with the and keys +" Note: you must press once to be able to cycle back +" +" http://www.vim.org/scripts/script.php?script_id=1643 +" }}} +" +" License: {{{ +" Copyright (c) 2002 - 2014 +" All rights reserved. +" +" Redistribution and use of this software in source and binary forms, with +" or without modification, are permitted provided that the following +" conditions are met: +" +" * Redistributions of source code must retain the above +" copyright notice, this list of conditions and the +" following disclaimer. +" +" * Redistributions in binary form must reproduce the above +" copyright notice, this list of conditions and the +" following disclaimer in the documentation and/or other +" materials provided with the distribution. +" +" * Neither the name of Gergely Kontra or Eric Van Dewoestine nor the names +" of its contributors may be used to endorse or promote products derived +" from this software without specific prior written permission of Gergely +" Kontra or Eric Van Dewoestine. +" +" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +" }}} +" +" Testing Info: {{{ +" Running vim + supertab with the absolute bare minimum settings: +" $ vim -u NONE -U NONE -c "set nocp | runtime plugin/supertab.vim" +" }}} + +if v:version < 700 + finish +endif + +if exists('complType') " Integration with other completion functions. + finish +endif + +if exists("loaded_supertab") + finish +endif +let loaded_supertab = 1 + +let s:save_cpo=&cpo +set cpo&vim + +" Global Variables {{{ + + if !exists("g:SuperTabDefaultCompletionType") + let g:SuperTabDefaultCompletionType = "" + endif + + if !exists("g:SuperTabContextDefaultCompletionType") + let g:SuperTabContextDefaultCompletionType = "" + endif + + if !exists("g:SuperTabContextTextMemberPatterns") + let g:SuperTabContextTextMemberPatterns = ['\.', '>\?::', '->'] + endif + + if !exists("g:SuperTabCompletionContexts") + let g:SuperTabCompletionContexts = ['s:ContextText'] + endif + + if !exists("g:SuperTabRetainCompletionDuration") + let g:SuperTabRetainCompletionDuration = 'insert' + endif + + if !exists("g:SuperTabNoCompleteBefore") + " retain backwards compatability + if exists("g:SuperTabMidWordCompletion") && !g:SuperTabMidWordCompletion + let g:SuperTabNoCompleteBefore = ['\k'] + else + let g:SuperTabNoCompleteBefore = [] + endif + endif + + if !exists("g:SuperTabNoCompleteAfter") + " retain backwards compatability + if exists("g:SuperTabLeadingSpaceCompletion") && g:SuperTabLeadingSpaceCompletion + let g:SuperTabNoCompleteAfter = [] + else + let g:SuperTabNoCompleteAfter = ['^', '\s'] + endif + endif + + if !exists("g:SuperTabMappingForward") + let g:SuperTabMappingForward = '' + endif + if !exists("g:SuperTabMappingBackward") + let g:SuperTabMappingBackward = '' + endif + + if !exists("g:SuperTabMappingTabLiteral") + let g:SuperTabMappingTabLiteral = '' + endif + + if !exists("g:SuperTabLongestEnhanced") + let g:SuperTabLongestEnhanced = 0 + endif + + if !exists("g:SuperTabLongestHighlight") + let g:SuperTabLongestHighlight = 0 + endif + + if !exists("g:SuperTabCrMapping") + let g:SuperTabCrMapping = 0 + endif + + if !exists("g:SuperTabClosePreviewOnPopupClose") + let g:SuperTabClosePreviewOnPopupClose = 0 + endif + + if !exists("g:SuperTabUndoBreak") + let g:SuperTabUndoBreak = 0 + endif + + if !exists("g:SuperTabCompleteCase") + let g:SuperTabCompleteCase = 'inherit' + endif + +" }}} + +" Script Variables {{{ + + " construct the help text. + let s:tabHelp = + \ "Hit or CTRL-] on the completion type you wish to switch to.\n" . + \ "Use :help ins-completion for more information.\n" . + \ "\n" . + \ "|| - Keywords in 'complete' searching down.\n" . + \ "|| - Keywords in 'complete' searching up (SuperTab default).\n" . + \ "|| - Whole lines.\n" . + \ "|| - Keywords in current file.\n" . + \ "|| - Keywords in 'dictionary'.\n" . + \ "|| - Keywords in 'thesaurus', thesaurus-style.\n" . + \ "|| - Keywords in the current and included files.\n" . + \ "|| - Tags.\n" . + \ "|| - File names.\n" . + \ "|| - Definitions or macros.\n" . + \ "|| - Vim command-line.\n" . + \ "|| - User defined completion.\n" . + \ "|| - Omni completion.\n" . + \ "|s| - Spelling suggestions." + + " set the available completion types and modes. + let s:types = + \ "\\\\\\\\" . + \ "\\\\\\\\\s" + let s:modes = '/^E/^Y/^L/^N/^K/^T/^I/^]/^F/^D/^V/^P/^U/^O/s' + let s:types = s:types . "np" + let s:modes = s:modes . '/n/p' + +" }}} + +function! SuperTabSetDefaultCompletionType(type) " {{{ + " Globally available function that users can use to set the default + " completion type for the current buffer, like in an ftplugin. + + " init hack for workaround. + let b:complCommandLine = 0 + + let b:SuperTabDefaultCompletionType = a:type + + " set the current completion type to the default + call SuperTabSetCompletionType(b:SuperTabDefaultCompletionType) +endfunction " }}} + +function! SuperTabSetCompletionType(type) " {{{ + " Globally available function that users can use to create mappings to quickly + " switch completion modes. Useful when a user wants to restore the default or + " switch to another mode without having to kick off a completion of that type + " or use SuperTabHelp. Note, this function only changes the current + " completion type, not the default, meaning that the default will still be + " restored once the configured retension duration has been met (see + " g:SuperTabRetainCompletionDuration). To change the default for the current + " buffer, use SuperTabDefaultCompletionType(type) instead. Example mapping to + " restore SuperTab default: + " nmap :call SetSuperTabCompletionType("") + + call s:InitBuffer() + exec "let b:complType = \"" . escape(a:type, '<') . "\"" +endfunction " }}} + +function! SuperTabAlternateCompletion(type) " {{{ + " Function which can be mapped to a key to kick off an alternate completion + " other than the default. For instance, if you have 'context' as the default + " and want to map ctrl+space to issue keyword completion. + " Note: due to the way vim expands ctrl characters in mappings, you cannot + " create the alternate mapping like so: + " imap =SuperTabAlternateCompletion("") + " instead, you have to use \ to prevent vim from expanding the key + " when creating the mapping. + " gvim: + " imap =SuperTabAlternateCompletion("\c-p>") + " console: + " imap =SuperTabAlternateCompletion("\c-p>") + + call SuperTabSetCompletionType(a:type) + " end any current completion before attempting to start the new one. + " use feedkeys to prevent possible remapping of from causing issues. + "call feedkeys("\", 'n') + " ^ since we can't detect completion mode vs regular insert mode, we force + " vim into keyword completion mode and end that mode to prevent the regular + " insert behavior of from occurring. + call feedkeys("\\\", 'n') + call feedkeys(b:complType, 'n') + return '' +endfunction " }}} + +function! SuperTabLongestHighlight(dir) " {{{ + " When longest highlight is enabled, this function is used to do the actual + " selection of the completion popup entry. + + if !pumvisible() + return '' + endif + return a:dir == -1 ? "\" : "\" +endfunction " }}} + +function! s:Init() " {{{ + " Setup mechanism to restore original completion type upon leaving insert + " mode if configured to do so + if g:SuperTabRetainCompletionDuration == 'insert' + augroup supertab_retain + autocmd! + autocmd InsertLeave * call s:SetDefaultCompletionType() + augroup END + endif +endfunction " }}} + +function! s:InitBuffer() " {{{ + if exists('b:SuperTabNoCompleteBefore') + return + endif + + let b:complReset = 0 + let b:complTypeManual = !exists('b:complTypeManual') ? '' : b:complTypeManual + let b:complTypeContext = '' + + " init hack for workaround. + let b:complCommandLine = 0 + + if !exists('b:SuperTabNoCompleteBefore') + let b:SuperTabNoCompleteBefore = g:SuperTabNoCompleteBefore + endif + if !exists('b:SuperTabNoCompleteAfter') + let b:SuperTabNoCompleteAfter = g:SuperTabNoCompleteAfter + endif + + if !exists('b:SuperTabDefaultCompletionType') + let b:SuperTabDefaultCompletionType = g:SuperTabDefaultCompletionType + endif + + " set the current completion type to the default + call SuperTabSetCompletionType(b:SuperTabDefaultCompletionType) + + " hack to programatically revert a change to snipmate that breaks supertab + " but which the new maintainers don't care about: + " http://github.com/garbas/vim-snipmate/issues/37 + let snipmate = maparg('', 'i') + if snipmate =~ 'u' && g:SuperTabMappingForward =~? '' + let snipmate = substitute(snipmate, 'u', '', '') + iunmap + exec "inoremap " . snipmate + endif +endfunction " }}} + +function! s:ManualCompletionEnter() " {{{ + " Handles manual entrance into completion mode. + + if &smd + echo '' | echohl ModeMsg | echo '-- ^X++ mode (' . s:modes . ')' | echohl None + endif + let complType = nr2char(getchar()) + if stridx(s:types, complType) != -1 + if !exists('b:supertab_close_preview') + let b:supertab_close_preview = !s:IsPreviewOpen() + endif + + if stridx("\\", complType) != -1 " no memory, just scroll... + return "\" . complType + elseif stridx('np', complType) != -1 + let complType = nr2char(char2nr(complType) - 96) + else + let complType = "\" . complType + endif + + let b:complTypeManual = complType + + if index(['insert', 'session'], g:SuperTabRetainCompletionDuration) != -1 + let b:complType = complType + endif + + " Hack to workaround bug when invoking command line completion via = + if complType == "\\" + return s:CommandLineCompletion() + endif + + call s:InitBuffer() + + " optionally enable enhanced longest completion + if g:SuperTabLongestEnhanced && &completeopt =~ 'longest' + call s:EnableLongestEnhancement() + " handle backspacing which triggers g:SuperTabNoCompleteAfter match + elseif s:IsNoCompleteAfterReset() + call s:EnableNoCompleteAfterReset() + endif + + if g:SuperTabLongestHighlight && + \ &completeopt =~ 'longest' && + \ &completeopt =~ 'menu' && + \ !pumvisible() + let dir = (complType == "\\") ? -1 : 1 + call feedkeys("\=SuperTabLongestHighlight(" . dir . ")\", 'n') + endif + + return complType + endif + + echohl "Unknown mode" + return complType +endfunction " }}} + +function! s:SetCompletionType() " {{{ + " Sets the completion type based on what the user has chosen from the help + " buffer. + + let chosen = substitute(getline('.'), '.*|\(.*\)|.*', '\1', '') + if chosen != getline('.') + let winnr = b:winnr + close + exec winnr . 'winc w' + call SuperTabSetCompletionType(chosen) + endif +endfunction " }}} + +function! s:SetDefaultCompletionType() " {{{ + if exists('b:SuperTabDefaultCompletionType') && + \ (!exists('b:complCommandLine') || !b:complCommandLine) + call SuperTabSetCompletionType(b:SuperTabDefaultCompletionType) + endif +endfunction " }}} + +function! SuperTab(command) " {{{ + " Used to perform proper cycle navigation as the user requests the next or + " previous entry in a completion list, and determines whether or not to simply + " retain the normal usage of based on the cursor position. + + if exists('b:SuperTabDisabled') && b:SuperTabDisabled + if exists('s:Tab') + return s:Tab() + endif + return ( + \ g:SuperTabMappingForward ==? '' || + \ g:SuperTabMappingBackward ==? '' + \ ) ? "\" : '' + endif + + call s:InitBuffer() + + if s:WillComplete() + if !exists('b:supertab_close_preview') + let b:supertab_close_preview = !s:IsPreviewOpen() + endif + + " optionally enable enhanced longest completion + if g:SuperTabLongestEnhanced && &completeopt =~ 'longest' + call s:EnableLongestEnhancement() + " handle backspacing which triggers g:SuperTabNoCompleteAfter match + elseif s:IsNoCompleteAfterReset() + call s:EnableNoCompleteAfterReset() + endif + + if !pumvisible() + let b:complTypeManual = '' + endif + + " exception: if in mode, then should move up the list, and + " down the list. + if a:command == 'p' && !b:complReset && + \ (b:complType == "\" || + \ (b:complType == 'context' && + \ b:complTypeManual == '' && + \ b:complTypeContext == "\")) + return "\" + + elseif a:command == 'p' && !b:complReset && + \ (b:complType == "\" || + \ (b:complType == 'context' && + \ b:complTypeManual == '' && + \ b:complTypeContext == "\")) + return "\" + + " already in completion mode and not resetting for longest enhancement, so + " just scroll to next/previous + elseif pumvisible() && !b:complReset + let type = b:complType == 'context' ? b:complTypeContext : b:complType + if a:command == 'n' + return type == "\" || type == "\\" ? "\" : "\" + endif + return type == "\" || type == "\\" ? "\" : "\" + endif + + " handle 'context' completion. + if b:complType == 'context' + let complType = s:ContextCompletion() + if complType == '' + exec "let complType = \"" . + \ escape(g:SuperTabContextDefaultCompletionType, '<') . "\"" + endif + let b:complTypeContext = complType + + " Hack to workaround bug when invoking command line completion via = + elseif b:complType == "\\" + let complType = s:CommandLineCompletion() + else + let complType = b:complType + endif + + " switch / completion in mode + if a:command == 'p' + if complType == "\\" + let complType = "\\" + elseif complType == "\\" + let complType = "\\" + endif + endif + + " highlight first result if longest enabled + if g:SuperTabLongestHighlight && + \ &completeopt =~ 'longest' && + \ &completeopt =~ 'menu' && + \ (!pumvisible() || b:complReset) + let dir = (complType == "\") ? -1 : 1 + call feedkeys("\=SuperTabLongestHighlight(" . dir . ")\", 'n') + endif + + if b:complReset + let b:complReset = 0 + " not an accurate condition for everyone, but better than sending + " at the wrong time. + if pumvisible() + return "\" . complType + endif + endif + + if g:SuperTabUndoBreak && !pumvisible() + return "\u" . complType + endif + + if g:SuperTabCompleteCase == 'ignore' || + \ g:SuperTabCompleteCase == 'match' + if exists('##CompleteDone') + let ignorecase = g:SuperTabCompleteCase == 'ignore' ? 1 : 0 + if &ignorecase != ignorecase + let b:supertab_ignorecase_save = &ignorecase + let &ignorecase = ignorecase + augroup supertab_ignorecase + autocmd CompleteDone + \ let &ignorecase = b:supertab_ignorecase_save | + \ unlet b:supertab_ignorecase_save | + \ autocmd! supertab_ignorecase + augroup END + endif + endif + endif + + return complType + endif + + if (a:command == 'n' && g:SuperTabMappingForward ==? '') || + \ (a:command == 'p' && g:SuperTabMappingBackward ==? '') + + " trigger our func ref to the smart tabs plugin if present. + if exists('s:Tab') + return s:Tab() + endif + + return "\" + endif + + if (a:command == 'n' && g:SuperTabMappingForward ==? '') || + \ (a:command == 'p' && g:SuperTabMappingBackward ==? '') + " support triggering mappings users might have. + if exists('s:ShiftTab') + if type(s:ShiftTab) == 2 + return s:ShiftTab() + else + call feedkeys(s:ShiftTab, 'n') + endif + endif + endif + + return '' +endfunction " }}} + +function! s:SuperTabHelp() " {{{ + " Opens a help window where the user can choose a completion type to enter. + + let winnr = winnr() + if bufwinnr("SuperTabHelp") == -1 + keepalt botright split SuperTabHelp + + setlocal noswapfile + setlocal buftype=nowrite + setlocal bufhidden=wipe + + silent put =s:tabHelp + call cursor(1, 1) + silent 1,delete _ + call cursor(4, 1) + exec "resize " . line('$') + + syntax match Special "|.\{-}|" + + setlocal readonly + setlocal nomodifiable + + nmap :call SetCompletionType() + nmap :call SetCompletionType() + else + exec bufwinnr("SuperTabHelp") . "winc w" + endif + let b:winnr = winnr +endfunction " }}} + +function! s:WillComplete(...) " {{{ + " Determines if completion should be kicked off at the current location. + " Optional arg: + " col: The column to check at, otherwise use the current column. + + " if an arg was supplied, then we will re-check even if already in + " completion mode. + if pumvisible() && !a:0 + return 1 + endif + + let line = getline('.') + let cnum = a:0 ? a:1 : col('.') + + " honor SuperTabNoCompleteAfter + let pre = cnum >= 2 ? line[:cnum - 2] : '' + let complAfterType = type(b:SuperTabNoCompleteAfter) + if complAfterType == 3 + " the option was provided as a list of patterns + for pattern in b:SuperTabNoCompleteAfter + if pre =~ pattern . '$' + return 0 + endif + endfor + elseif complAfterType == 2 + " the option was provided as a funcref + return !b:SuperTabNoCompleteAfter(pre) + endif + + " honor SuperTabNoCompleteBefore + " Within a word, but user does not have mid word completion enabled. + let post = line[cnum - 1:] + let complBeforeType = type(b:SuperTabNoCompleteBefore) + if complBeforeType == 3 + " a list of patterns + for pattern in b:SuperTabNoCompleteBefore + if post =~ '^' . pattern + return 0 + endif + endfor + elseif complBeforeType == 2 + " the option was provided as a funcref + return !b:SuperTabNoCompleteBefore(post) + endif + + return 1 +endfunction " }}} + +function! s:EnableLongestEnhancement() " {{{ + augroup supertab_reset + autocmd! + autocmd InsertLeave,CursorMovedI + \ call s:ReleaseKeyPresses() | autocmd! supertab_reset + augroup END + call s:CaptureKeyPresses() +endfunction " }}} + +function! s:IsNoCompleteAfterReset() " {{{ + " if the user has g:SuperTabNoCompleteAfter set, then re-map so that + " backspacing to a point where one of the g:SuperTabNoCompleteAfter + " entries matches will cause completion mode to exit. + let complAfterType = type(b:SuperTabNoCompleteAfter) + if complAfterType == 2 + return 1 + endif + return len(g:SuperTabNoCompleteAfter) && g:SuperTabNoCompleteAfter != ['^', '\s'] +endfunction " }}} + +function! s:EnableNoCompleteAfterReset() " {{{ + augroup supertab_reset + autocmd! + autocmd InsertLeave,CursorMovedI + \ call s:ReleaseKeyPresses() | autocmd! supertab_reset + augroup END + + " short version of s:CaptureKeyPresses + if !exists('b:capturing') || !b:capturing + let b:capturing = 1 + let b:capturing_start = col('.') + let b:captured = { + \ '': s:CaptureKeyMap(''), + \ '': s:CaptureKeyMap(''), + \ } + imap =CompletionReset("\bs>") + imap =CompletionReset("\c-h>") + endif +endfunction " }}} + +function! s:CompletionReset(char) " {{{ + let b:complReset = 1 + + " handle exiting completion mode if user has g:SuperTabNoCompleteAfter set + " and they are about to backspace to a point where that maches one of the + " entries in that var. + if (a:char == "\" || a:char == "\") && s:IsNoCompleteAfterReset() + if !s:WillComplete(col('.') - 1) + " Exit from completion mode then issue the currently requested + " backspace (mapped). + call feedkeys("\\", 'n') + call s:ReleaseKeyPresses() + call feedkeys("\", 'mt') + return '' + endif + endif + + return a:char +endfunction " }}} + +function! s:CaptureKeyPresses() " {{{ + if !exists('b:capturing') || !b:capturing + let b:capturing = 1 + let b:capturing_start = col('.') + " save any previous mappings + let b:captured = { + \ '': s:CaptureKeyMap(''), + \ '': s:CaptureKeyMap(''), + \ } + " TODO: use &keyword to get an accurate list of chars to map + for c in split('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_', '.\zs') + let existing = s:CaptureKeyMap(c) + let b:captured[c] = existing + exec 'imap ' . c . ' =CompletionReset("' . c . '")' + endfor + imap =CompletionReset("\bs>") + imap =CompletionReset("\c-h>") + endif +endfunction " }}} + +function! s:CaptureKeyMap(key) " {{{ + " as of 7.3.032 maparg supports obtaining extended information about the + " mapping. + if s:has_dict_maparg + return maparg(a:key, 'i', 0, 1) + endif + return maparg(a:key, 'i') +endfunction " }}} + +function! s:IsPreviewOpen() " {{{ + let wins = tabpagewinnr(tabpagenr(), '$') + let winnr = 1 + while winnr <= wins + if getwinvar(winnr, '&previewwindow') == 1 + return 1 + endif + let winnr += 1 + endwhile + return 0 +endfunction " }}} + +function! s:ClosePreview() " {{{ + if exists('b:supertab_close_preview') && b:supertab_close_preview + let preview = 0 + for bufnum in tabpagebuflist() + if getwinvar(bufwinnr(bufnum), '&previewwindow') + let preview = 1 + break + endif + endfor + if preview + pclose + try + doautocmd supertab_preview_closed User + catch /E216/ + " ignore: no autocmds defined + endtry + endif + endif + silent! unlet b:supertab_close_preview +endfunction " }}} + +function! s:ReleaseKeyPresses() " {{{ + if exists('b:capturing') && b:capturing + let b:capturing = 0 + for c in keys(b:captured) + exec 'iunmap ' . c + endfor + + " restore any previous mappings + for [key, mapping] in items(b:captured) + if !len(mapping) + continue + endif + + if type(mapping) == 4 + let restore = mapping.noremap ? "inoremap" : "imap" + let restore .= " " + if mapping.silent + let restore .= " " + endif + if mapping.expr + let restore .= " " + endif + let rhs = substitute(mapping.rhs, '\c', '' . mapping.sid . '_', 'g') + let restore .= ' ' . key . ' ' . rhs + exec restore + elseif type(c) == 1 + let args = substitute(mapping, '.*\(".\{-}"\).*', '\1', '') + if args != mapping + let args = substitute(args, '<', '', 'g') + let expr = substitute(mapping, '\(.*\)".\{-}"\(.*\)', '\1%s\2', '') + let mapping = printf(expr, args) + endif + exec printf("imap %s %s", key, mapping) + endif + endfor + unlet b:captured + + if mode() == 'i' && &completeopt =~ 'menu' && b:capturing_start != col('.') + " force full exit from completion mode (don't exit insert mode since + " that will break repeating with '.') + call feedkeys("\\", 'n') + endif + unlet b:capturing_start + endif +endfunction " }}} + +function! s:CommandLineCompletion() " {{{ + " Hack needed to account for apparent bug in vim command line mode completion + " when invoked via = + + " This hack will trigger InsertLeave which will then invoke + " s:SetDefaultCompletionType. To prevent default completion from being + " restored prematurely, set an internal flag for s:SetDefaultCompletionType + " to check for. + let b:complCommandLine = 1 + return "\\:call feedkeys('\\\', 'n') | " . + \ "let b:complCommandLine = 0\" +endfunction " }}} + +function! s:ContextCompletion() " {{{ + let contexts = exists('b:SuperTabCompletionContexts') ? + \ b:SuperTabCompletionContexts : g:SuperTabCompletionContexts + + for context in contexts + try + let Context = function(context) + let complType = Context() + unlet Context + if type(complType) == 1 && complType != '' + return complType + endif + catch /E700/ + echohl Error + echom 'supertab: no context function "' . context . '" found.' + echohl None + endtry + endfor + return '' +endfunction " }}} + +function! s:ContextDiscover() " {{{ + let discovery = exists('g:SuperTabContextDiscoverDiscovery') ? + \ g:SuperTabContextDiscoverDiscovery : [] + + " loop through discovery list to find the default + if !empty(discovery) + for pair in discovery + let var = substitute(pair, '\(.*\):.*', '\1', '') + let type = substitute(pair, '.*:\(.*\)', '\1', '') + exec 'let value = ' . var + if value !~ '^\s*$' && value != '0' + exec "let complType = \"" . escape(type, '<') . "\"" + return complType + endif + endfor + endif +endfunction " }}} + +function! s:ContextText() " {{{ + let exclusions = exists('g:SuperTabContextTextFileTypeExclusions') ? + \ g:SuperTabContextTextFileTypeExclusions : [] + + if index(exclusions, &ft) == -1 + let curline = getline('.') + let cnum = col('.') + let synname = synIDattr(synID(line('.'), cnum - 1, 1), 'name') + + let member_patterns = exists('b:SuperTabContextTextMemberPatterns') ? + \ b:SuperTabContextTextMemberPatterns : g:SuperTabContextTextMemberPatterns + let member_pattern = join(member_patterns, '\|') + + " don't kick off file completion if the pattern is '\" + + elseif curline =~ '\(' . member_pattern . '\)\w*\%' . cnum . 'c' && + \ synname !~ '\(String\|Comment\)' + let omniPrecedence = exists('g:SuperTabContextTextOmniPrecedence') ? + \ g:SuperTabContextTextOmniPrecedence : ['&completefunc', '&omnifunc'] + let omniPrecedence = exists('b:SuperTabContextTextOmniPrecedence') ? + \ b:SuperTabContextTextOmniPrecedence : omniPrecedence + + for omniFunc in omniPrecedence + if omniFunc !~ '^&' + let omniFunc = '&' . omniFunc + endif + if getbufvar(bufnr('%'), omniFunc) != '' + return omniFunc == '&omnifunc' ? "\\" : "\\" + endif + endfor + endif + endif +endfunction " }}} + +function! s:ExpandMap(map) " {{{ + let map = a:map + if map =~ '' + let plug = substitute(map, '.\{-}\(\w\+\).*', '\1', '') + let plug_map = maparg(plug, 'i') + let map = substitute(map, '.\{-}\(\w\+\).*', plug_map, '') + endif + return map +endfunction " }}} + +function! SuperTabChain(completefunc, completekeys) " {{{ + if a:completefunc != 'SuperTabCodeComplete' + let b:SuperTabChain = [a:completefunc, a:completekeys] + setlocal completefunc=SuperTabCodeComplete + endif +endfunction " }}} + +function! SuperTabCodeComplete(findstart, base) " {{{ + if !exists('b:SuperTabChain') + echoe 'No completion chain has been set.' + return -2 + endif + + if len(b:SuperTabChain) != 2 + echoe 'Completion chain can only be used with 1 completion function ' . + \ 'and 1 fallback completion key binding.' + return -2 + endif + + let Func = function(b:SuperTabChain[0]) + + if a:findstart + let start = Func(a:findstart, a:base) + if start >= 0 + return start + endif + + return col('.') - 1 + endif + + let results = Func(a:findstart, a:base) + " Handle dict case, with 'words' and 'refresh' (optional). + " This is used by YouCompleteMe. (See complete-functions). + if type(results) == type({}) && has_key(results, 'words') + if len(results.words) + return results + endif + elseif len(results) + return results + endif + + exec 'let keys = "' . escape(b:SuperTabChain[1], '<') . '"' + " : stop completion and go back to the originally typed text. + call feedkeys("\" . keys, 'nt') + return [] +endfunction " }}} + +" Autocmds {{{ + if g:SuperTabClosePreviewOnPopupClose + augroup supertab_close_preview + autocmd! + autocmd InsertLeave,CursorMovedI * call s:ClosePreview() + augroup END + endif +" }}} + +" Key Mappings {{{ + " map a regular tab to ctrl-tab (note: doesn't work in console vim) + exec 'inoremap ' . g:SuperTabMappingTabLiteral . ' ' + + inoremap =ManualCompletionEnter() + + imap