├── .gitignore ├── Gemfile ├── Guardfile ├── LICENSE.txt ├── README.adoc ├── Rakefile ├── backup └── backup-demo.adoc ├── dotfiles ├── .bash_profile ├── .bash_profile_local ├── .gitconfig ├── .inputrc ├── .mailcap ├── .mailrc ├── .msmtprc ├── .mutt │ ├── color-light.muttrc │ ├── color.muttrc │ ├── colortest.pl │ ├── muttrc │ └── view_attachment.sh ├── .netrc ├── .offlineimaprc ├── .rsync-filter ├── .ssh │ └── config ├── .tigrc ├── .tmux.conf ├── .urlview ├── .vim │ ├── .netrwhist │ ├── autoload │ │ └── pathogen.vim │ ├── bundle │ │ ├── fuzzyfinder │ │ │ ├── .hg_archival.txt │ │ │ ├── .hgtags │ │ │ ├── autoload │ │ │ │ ├── fuf.vim │ │ │ │ └── fuf │ │ │ │ │ ├── bookmarkdir.vim │ │ │ │ │ ├── bookmarkfile.vim │ │ │ │ │ ├── buffer.vim │ │ │ │ │ ├── buffertag.vim │ │ │ │ │ ├── callbackfile.vim │ │ │ │ │ ├── callbackitem.vim │ │ │ │ │ ├── changelist.vim │ │ │ │ │ ├── coveragefile.vim │ │ │ │ │ ├── dir.vim │ │ │ │ │ ├── file.vim │ │ │ │ │ ├── givencmd.vim │ │ │ │ │ ├── givendir.vim │ │ │ │ │ ├── givenfile.vim │ │ │ │ │ ├── help.vim │ │ │ │ │ ├── jumplist.vim │ │ │ │ │ ├── line.vim │ │ │ │ │ ├── mrucmd.vim │ │ │ │ │ ├── mrufile.vim │ │ │ │ │ ├── quickfix.vim │ │ │ │ │ ├── tag.vim │ │ │ │ │ └── taggedfile.vim │ │ │ ├── doc │ │ │ │ ├── fuf.jax │ │ │ │ └── fuf.txt │ │ │ └── plugin │ │ │ │ └── fuf.vim │ │ ├── l9 │ │ │ ├── .hg_archival.txt │ │ │ ├── .hgtags │ │ │ ├── autoload │ │ │ │ ├── l9.vim │ │ │ │ └── l9 │ │ │ │ │ ├── async.py │ │ │ │ │ ├── async.vim │ │ │ │ │ ├── quickfix.vim │ │ │ │ │ ├── tempbuffer.vim │ │ │ │ │ └── tempvariables.vim │ │ │ ├── doc │ │ │ │ ├── l9.jax │ │ │ │ └── l9.txt │ │ │ └── plugin │ │ │ │ └── l9.vim │ │ ├── nerdtree │ │ │ ├── .gitignore │ │ │ ├── README.markdown │ │ │ ├── autoload │ │ │ │ └── nerdtree.vim │ │ │ ├── doc │ │ │ │ └── NERD_tree.txt │ │ │ ├── lib │ │ │ │ └── nerdtree │ │ │ │ │ ├── bookmark.vim │ │ │ │ │ ├── creator.vim │ │ │ │ │ ├── key_map.vim │ │ │ │ │ ├── menu_controller.vim │ │ │ │ │ ├── menu_item.vim │ │ │ │ │ ├── opener.vim │ │ │ │ │ ├── path.vim │ │ │ │ │ ├── tree_dir_node.vim │ │ │ │ │ └── tree_file_node.vim │ │ │ ├── nerdtree_plugin │ │ │ │ ├── exec_menuitem.vim │ │ │ │ └── fs_menu.vim │ │ │ ├── plugin │ │ │ │ └── NERD_tree.vim │ │ │ └── syntax │ │ │ │ └── nerdtree.vim │ │ ├── vim-colors-solarized │ │ │ ├── README.mkd │ │ │ ├── autoload │ │ │ │ └── togglebg.vim │ │ │ ├── bitmaps │ │ │ │ └── togglebg.png │ │ │ ├── colors │ │ │ │ └── solarized.vim │ │ │ └── doc │ │ │ │ ├── solarized.txt │ │ │ │ └── tags │ │ └── xterm-color-table │ │ │ ├── .gitignore │ │ │ ├── README.markdown │ │ │ ├── Rakefile │ │ │ ├── doc │ │ │ └── xterm-color-table.txt │ │ │ ├── plugin │ │ │ └── xterm-color-table.vim │ │ │ └── vim-readme.txt │ ├── colors │ │ ├── mustang-adjusted.vim │ │ ├── mustang.vim │ │ ├── whitebackground.vim │ │ └── wombat.vim │ ├── ftdetect │ │ └── markdown.vim │ ├── snippets │ │ └── markdown.snippets │ ├── spell │ │ ├── en.utf-8.add │ │ ├── en.utf-8.add.spl │ │ ├── fr.utf-8.add │ │ ├── fr.utf-8.add.spl │ │ ├── fr.utf-8.spl │ │ └── fr.utf-8.sug │ └── syntax │ │ ├── asciidoc.vim │ │ └── markdown.vim ├── .vimrc └── .weechat │ ├── alias.conf │ ├── aspell.conf │ ├── buffers.conf │ ├── charset.conf │ ├── exec.conf │ ├── icon.png │ ├── irc.conf │ ├── iset.conf │ ├── logger.conf │ ├── perl │ ├── autoload │ │ ├── beep-custom.pl │ │ ├── buffers.pl │ │ └── iset.pl │ ├── beep-custom.pl │ ├── buffers.pl │ └── iset.pl │ ├── plugins.conf │ ├── python │ ├── autoload │ │ ├── chanpriority.py │ │ └── go.py │ ├── chanpriority.py │ └── go.py │ ├── relay.conf │ ├── rmodifier.conf │ ├── script.conf │ ├── script │ └── plugins.xml.gz │ ├── sec.conf │ ├── trigger.conf │ ├── urlgrab.conf │ ├── weechat.conf │ └── xfer.conf ├── examples └── vim.adoc ├── images ├── beard-dark.jpg └── beard.jpg ├── presentation.adoc ├── publish-episode.sh ├── reveal.js ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── Gruntfile.js ├── LICENSE ├── README.md ├── css │ ├── print │ │ ├── paper.css │ │ └── pdf.css │ ├── reveal.css │ ├── reveal.min.css │ └── theme │ │ ├── README.md │ │ ├── beige.css │ │ ├── blood.css │ │ ├── default.css │ │ ├── moon.css │ │ ├── night.css │ │ ├── serif.css │ │ ├── simple.css │ │ ├── sky.css │ │ ├── solarized.css │ │ ├── source │ │ ├── beige.scss │ │ ├── blood.scss │ │ ├── default.scss │ │ ├── moon.scss │ │ ├── night.scss │ │ ├── serif.scss │ │ ├── simple.scss │ │ ├── sky.scss │ │ └── solarized.scss │ │ └── template │ │ ├── mixins.scss │ │ ├── settings.scss │ │ └── theme.scss ├── index.html ├── js │ ├── reveal.js │ └── reveal.min.js ├── lib │ ├── css │ │ └── zenburn.css │ ├── font │ │ ├── league_gothic-webfont.eot │ │ ├── league_gothic-webfont.svg │ │ ├── league_gothic-webfont.ttf │ │ ├── league_gothic-webfont.woff │ │ └── league_gothic_license │ └── js │ │ ├── classList.js │ │ ├── head.min.js │ │ └── html5shiv.js ├── package.json ├── plugin │ ├── highlight │ │ └── highlight.js │ ├── leap │ │ └── leap.js │ ├── markdown │ │ ├── example.html │ │ ├── example.md │ │ ├── markdown.js │ │ └── marked.js │ ├── math │ │ └── math.js │ ├── multiplex │ │ ├── client.js │ │ ├── index.js │ │ └── master.js │ ├── notes-server │ │ ├── client.js │ │ ├── index.js │ │ └── notes.html │ ├── notes │ │ ├── notes.html │ │ └── notes.js │ ├── postmessage │ │ ├── example.html │ │ └── postmessage.js │ ├── print-pdf │ │ └── print-pdf.js │ ├── remotes │ │ └── remotes.js │ ├── search │ │ └── search.js │ └── zoom-js │ │ └── zoom.js └── test │ ├── examples │ ├── assets │ │ ├── image1.png │ │ └── image2.png │ ├── barebones.html │ ├── embedded-media.html │ ├── math.html │ └── slide-backgrounds.html │ ├── qunit-1.12.0.css │ ├── qunit-1.12.0.js │ ├── test-markdown-element-attributes.html │ ├── test-markdown-element-attributes.js │ ├── test-markdown-slide-attributes.html │ ├── test-markdown-slide-attributes.js │ ├── test-markdown.html │ ├── test-markdown.js │ ├── test.html │ └── test.js ├── scripts ├── 3way-rsync.sh ├── crypt ├── git-clean-merged-branches ├── git-force-clean ├── git-merge-to ├── git-send-pull-request ├── git-upsert ├── jira ├── killname.sh ├── msmtpq ├── notify ├── remote └── setjdk.sh └── sshconfig-example /.gitignore: -------------------------------------------------------------------------------- 1 | .bundle 2 | .rvmrc 3 | _bin 4 | .DS_Store 5 | /*.html 6 | 7 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # gem install bundler 2 | # bundle install 3 | source 'https://rubygems.org' 4 | gem 'asciidoctor', '~>1.5.1' 5 | gem 'haml', '~>4.0.0' 6 | gem 'tilt', '~>2.0.0' 7 | gem 'slim', '~>2.0.0' 8 | #gem 'thread_safe', '~> 0.1.3' 9 | gem 'asciidoctor-pdf', '~>1.5.0.alpha.6' 10 | #gem 'asciidoctor-pdf', :git => 'git@github.com:asciidoctor/asciidoctor-pdf.git' 11 | gem 'coderay', '1.1.0' 12 | ##gem 'thread-safe', '0.2.0' 13 | 14 | # guarding 15 | gem 'guard' 16 | gem 'guard-shell' 17 | gem 'guard-livereload' 18 | -------------------------------------------------------------------------------- /Guardfile: -------------------------------------------------------------------------------- 1 | # A sample Guardfile 2 | # More info at https://github.com/guard/guard#readme 3 | guard :shell do 4 | # watch(/.*\.adoc/) { `rake build_reveal` } 5 | watch(/presentation.adoc/) { `rake build_reveal` } 6 | end 7 | guard 'livereload' do 8 | watch(/.*.html/) 9 | end 10 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | = Read me 2 | Emmanuel Bernard 3 | 4 | Git repository containing the command line nuts presentation and samples. 5 | 6 | == How to build the presentation 7 | 8 | The presentation is based on the Asciidoctor reveal.js backend. 9 | 10 | === Setup 11 | 12 | You need Ruby (tested on 2.1), and make sure you have Bundler and Rake installed 13 | 14 | [source, language="bash"] 15 | -- 16 | gem install bundler 17 | gem install rake 18 | -- 19 | 20 | Then install the necessary gems 21 | 22 | [source, language="bash"] 23 | -- 24 | rake setup 25 | -- 26 | 27 | === Generating the presentation 28 | 29 | [source, language="bash"] 30 | -- 31 | rake build_reveal 32 | -- 33 | 34 | === Generating the presentation on every change 35 | 36 | 37 | [source, language="bash"] 38 | -- 39 | rake guard 40 | -- 41 | 42 | Also install the live reload plugin from Chrome and activate it when displaying the presentation. 43 | 44 | == License 45 | 46 | Release under the WTFPL 2.0 available in LICENSE.txt 47 | -------------------------------------------------------------------------------- /backup/backup-demo.adoc: -------------------------------------------------------------------------------- 1 | = Backup demo 2 | Emmanuel Bernard 3 | 2014-10-24 4 | 5 | * Show 3way-rsync.sh 6 | ** Show the rsync and options 7 | ** Show `-F` as the `.rsync-filter` 8 | ** Show `~/.rsync-filter` 9 | * Run a backup 10 | 11 | [source, language="bash"] 12 | -- 13 | 3way-rsync.sh examples/ /Users/emmanuel/Documents/projectPres/various/commandline/backup 14 | -- 15 | 16 | * show `backup` 17 | * remove / add `sshconfig-example` in `examples` 18 | * run backup again 19 | * show `ll -i` on the two nodes 20 | -------------------------------------------------------------------------------- /dotfiles/.bash_profile: -------------------------------------------------------------------------------- 1 | LANG="en_US.UTF-8" 2 | 3 | #Aliases and terminal colors 4 | alias ll='ls -al' 5 | alias marked='open -a Marked' 6 | alias git=hub 7 | # add in path rather than alias otherwise Git fails to open it 8 | alias 'postgres-start'='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start' 9 | alias 'postgres-stop'='pg_ctl -D /usr/local/var/postgres stop -s -m fast' 10 | 11 | export CLICOLOR=1 12 | export LSCOLORS=gxfxcxdxbxegedabagacad 13 | export EDITOR=vim 14 | alias crontab="export EDITOR=vim;crontab" #crontab does not like mvim -f 15 | 16 | #tab title in iTerm 17 | 18 | function local_dir_and_within { 19 | __LAST="${PWD##*/}" 20 | __IN="${PWD%/*}" 21 | __IN="${__IN/#$HOME/~}" 22 | TITLE_TAB="$__LAST in $__IN" 23 | echo -n $TITLE_TAB 24 | } 25 | export PROMPT_COMMAND='echo -ne "\033]0;$(local_dir_and_within)\007"' 26 | 27 | #Add Macport to the path 28 | PATH=/opt/local/bin:/opt/local/sbin:$PATH 29 | export MANPATH=/opt/local/share/man:$MANPATH 30 | PATH=$PATH:/Applications/MacPorts/KDE4/po2xml.app/Contents/MacOS:/Applications/MacPorts/KDE4/xml2pot.app/Contents/MacOS 31 | 32 | #Give /usr/local priority 33 | PATH=/usr/local/sbin:/usr/local/bin:/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin:$PATH 34 | #Personal scripts 35 | PATH=~/usr/local/bin:~/usr/local/bin/shared:$PATH 36 | 37 | #Keychain / ssh-agent 38 | # if not in the agent, prompt for the key to be added 39 | ssh-add -l | grep 4096 | grep --quiet id_rsa 40 | if [[ "$?" -ne "0" ]]; then 41 | ssh-add ~/.ssh/id_rsa 42 | eval `keychain --eval --agents ssh --inherit any id_rsa` 43 | fi 44 | 45 | #Java 46 | export JAVA_HOME=`/usr/libexec/java_home -v 1.7` 47 | export PATH=$JAVA_HOME/bin:$PATH 48 | 49 | #set jdk routines 50 | source ~/usr/local/bin/shared/setjdk.sh 51 | 52 | #Gradle, Maven, Ant, Forge 53 | # Brew put the executables for gradle, mvn and ant in /usr/local/bin, no need to update it anymore 54 | export GRADLE_HOME=/usr/local/Cellar/gradle/1.10 55 | export MAVEN_HOME=/usr/local/Cellar/maven/3.2.3 56 | export ANT_HOME=/Developer/Java/apache-ant-1.9.4 57 | export PATH=$GRADLE_HOME/bin:$MAVEN_HOME/bin:$ANT_HOME/bin:$PATH 58 | export GRADLE_OPTS="-Xmx1024M" 59 | export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=256m" 60 | #export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" 61 | 62 | # docker 63 | export DOCKER_HOST=tcp://localhost:4243 64 | function docker_fwd_port { 65 | VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port$1,tcp,127.0.0.1,$1,,$1" 66 | } 67 | function docker_delete_fwd_port { 68 | VBoxManage modifyvm "boot2docker-vm" --natpf1 delete "tcp-$1" 69 | } 70 | 71 | #Git completion 72 | GIT_COMPLETION_PATH="/usr/local/etc/bash_completion.d/git-completion.bash" 73 | GIT_PROMPT_PATH="/usr/local/etc/bash_completion.d/git-prompt.sh" 74 | if [ -f "$GIT_COMPLETION_PATH" ]; then 75 | GIT_PS1_SHOWDIRTYSTATE=true 76 | . "$GIT_PROMPT_PATH" 77 | . "$GIT_COMPLETION_PATH" 78 | ADD_PS1='$(__git_ps1)' 79 | fi 80 | #docker completion 81 | COMPL=/usr/local/etc/bash_completion.d/docker 82 | if [ -f "$COMPL" ]; then 83 | . "$COMPL" 84 | fi 85 | #tmux completion 86 | COMPL=/usr/local/etc/bash_completion.d/tmux 87 | if [ -f "$COMPL" ]; then 88 | . "$COMPL" 89 | fi 90 | 91 | if [[ ${EUID} == 0 ]] ; then 92 | PS1="\[\033[01;31m\]\h\[\033[01;34m\] \W\[\033[33m\]$ADD_PS1\[\033[34m\] \$\[\033[00m\] " 93 | else 94 | PS1="\[\033[00;32m\]\u@\h\[\033[01;34m\] \W\[\033[33m\]$ADD_PS1\[\033[34m\] \$\[\033[00m\] " 95 | fi 96 | 97 | # RVM 98 | [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 99 | 100 | test -f $HOME/.bash_profile_local && source $HOME/.bash_profile_local 101 | -------------------------------------------------------------------------------- /dotfiles/.bash_profile_local: -------------------------------------------------------------------------------- 1 | #export MONGODB_HOSTNAME=192.168.56.100 2 | export COUCHDB_HOSTNAME=localhost 3 | export DOCKER_HOST=tcp://localhost:4243 4 | -------------------------------------------------------------------------------- /dotfiles/.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Real Name 3 | email = myemail@somedomain.com 4 | [core] 5 | editor = vim 6 | [merge] 7 | tool = opendiff 8 | mergeoptions = --ff-only 9 | [color] 10 | ui = auto 11 | [color "branch"] 12 | current = yellow reverse 13 | local = yellow 14 | remote = green 15 | [color "diff"] 16 | meta = yellow bold 17 | frag = magenta bold 18 | old = red bold 19 | new = green bold 20 | [color "status"] 21 | added = yellow 22 | changed = green 23 | untracked = cyan 24 | [github] 25 | user = mygithubusername 26 | [alias] 27 | co = checkout 28 | undo = reset --hard 29 | cb = checkout -b 30 | br = branch 31 | cp = cherry-pick 32 | tree = log --graph --oneline --all --decorate 33 | ri = rebase -i 34 | rim = rebase -i master 35 | re = rebase 36 | ru = rebase upstream/master 37 | fu = fetch upstream 38 | [branch] 39 | autosetuprebase = always 40 | [push] 41 | default = simple 42 | -------------------------------------------------------------------------------- /dotfiles/.inputrc: -------------------------------------------------------------------------------- 1 | set editing-mode vi 2 | -------------------------------------------------------------------------------- /dotfiles/.mailcap: -------------------------------------------------------------------------------- 1 | # Images 2 | image/jpg; $HOME/.mutt/view_attachment.sh %s - 3 | image/jpeg; $HOME/.mutt/view_attachment.sh %s - 4 | image/pjpeg; $HOME/.mutt/view_attachment.sh %s - 5 | image/png; $HOME/.mutt/view_attachment.sh %s - 6 | image/gif; $HOME/.mutt/view_attachment.sh %s - 7 | image/tiff; $HOME/.mutt/view_attachment.sh %s - 8 | 9 | # PDF 10 | application/pdf; $HOME/.mutt/view_attachment.sh %s pdf 11 | application/x-pdf; $HOME/.mutt/view_attachment.sh %s pdf 12 | image/pdf; $HOME/.mutt/view_attachment.sh %s pdf 13 | 14 | # Office 15 | application/msword; $HOME/.mutt/view_attachment.sh %s - 16 | application/vnd.oasis; $HOME/.mutt/view_attachment.sh %s - 17 | applica/vnd.oasis.; $HOME/.mutt/view_attachment.sh %s - 18 | application/vnd.oasis.opendocument.spreadsheet; $HOME/.mutt/view_attachment.sh %s - 19 | application/vnd.oasis.opendocument.presentation; $HOME/.mutt/view_attachment.sh %s - 20 | application/vnd.ms-excel; $HOME/.mutt/view_attachment.sh %s - 21 | 22 | #ical 23 | text/calendar; $HOME/.mutt/view_attachment.sh %s ics 24 | 25 | # HTML 26 | # -- always use lynx 27 | # text/html; elinks -force-html %s ; 28 | text/html; $HOME/.mutt/view_attachment.sh %s html ; 29 | text/html; elinks -force-html %s; copiousoutput 30 | -------------------------------------------------------------------------------- /dotfiles/.mailrc: -------------------------------------------------------------------------------- 1 | set sendmail=/usr/local/bin/msmtp 2 | -------------------------------------------------------------------------------- /dotfiles/.msmtprc: -------------------------------------------------------------------------------- 1 | # Begin msmtprc 2 | # Set default values for all following accounts. 3 | defaults 4 | tls on 5 | logfile ~/.msmtp.log 6 | 7 | # Add Hibernate bluehost account 8 | account myemailaccountname 9 | host mail.myemailaccount.com 10 | port 465 11 | protocol smtp 12 | auth on 13 | from emmanuel@myemailaccount.com 14 | user emmanuel 15 | tls on 16 | tls_starttls off 17 | tls_certcheck on 18 | tls_trust_file ~/Mail/certs/ca-bundle.crt 19 | 20 | # Set a default account 21 | # You need to set a default account for Mail 22 | account default : myemailaccountname 23 | 24 | # end msmtprc 25 | -------------------------------------------------------------------------------- /dotfiles/.mutt/color-light.muttrc: -------------------------------------------------------------------------------- 1 | # 2 | # colors 3 | # 4 | 5 | # combinations: 6 | # green: color28 color194 7 | # red: color124 color223 8 | # magenta: color90 color225 9 | # yellow: color214 color230 (unreadable) 10 | # orange: color202 color230 11 | # blue: color20 color153 12 | # blue: color33 color153 13 | 14 | #set arrow_cursor 15 | color normal black color231 16 | color status color123 color245 17 | color error red color231 18 | color indicator color202 color230 19 | color index color18 color231 ~A 20 | color tree color18 color231 21 | color index color26 color231 "~P" # from me 22 | color index color124 color223 "~F" # flagged 23 | color index color28 color194 "~N | ~O" 24 | color index color90 color182 ~T 25 | color index color88 color225 ~D 26 | color sidebar_new color28 color194 27 | color header color18 color253 . 28 | color signature brightblack color231 29 | color attachment color90 color225 30 | color quoted color20 color231 31 | color quoted1 color52 color231 32 | color quoted2 color22 color231 33 | color quoted3 magenta color231 34 | color quoted4 yellow color231 35 | color body color27 color231 (https?|ftp|news|irc)://[_a-zA-Zäöü0-9%\\.,/~\\-\\?\\=@\#&+:-]+ # URLs 36 | color body color27 color231 www\\.[_a-zA-Zäöü0-9\\.~\\-]+\\.,[_a-zA-Z0-9\\.~\\-]{2,4} # domain names 37 | color body color27 color231 [_a-zA-Z0-9\\.~\\-]+@[_a-zA-Z0-9\\.~\\-]+\\.[_a-zA-Z0-9\\.~\\-]{2,4} # eMail adresses 38 | color body color20 color255 \\[---\\=\\|.*\\|\\=---\\] 39 | color body color90 color225 "^gpg: .*" 40 | color body color90 color225 "^Primary key fingerprint: .*" 41 | color body color28 color194 "^gpg: Good signature.*" 42 | color body color124 color223 "^(gpg: (Can't check signature|BAD signature from.*|WARNING: This key is not certified with a trusted signature!| There is no indication that the signature belongs to the owner.)|Verification failure).*" 43 | 44 | 45 | #color normal black color231 46 | #color status color123 color36 47 | #color error red color231 48 | #color indicator color28 color194 49 | #color index color18 color153 ~A 50 | #color tree color18 color153 51 | #color index color26 color153 "~P" # from me 52 | #color index color124 color223 "~F" # flagged 53 | #color index color202 color230 "~N | ~O" 54 | #color index color90 color182 ~T 55 | #color index color18 color250 ~D 56 | #color sidebar_new color202 color230 57 | #color header color18 color153 . 58 | #color signature brightblack color231 59 | #color attachment color90 color225 60 | #color quoted blue color231 61 | #color quoted1 red color231 62 | #color quoted2 green color231 63 | #color quoted3 magenta color231 64 | #color quoted4 yellow color231 65 | #color body color27 color231 (https?|ftp|news|irc)://[_a-zA-Zäöü0-9%\\.,/~\\-\\?\\=@\#&+:-]+ # URLs 66 | #color body color27 color231 www\\.[_a-zA-Zäöü0-9\\.~\\-]+\\.,[_a-zA-Z0-9\\.~\\-]{2,4} # domain names 67 | #color body color27 color231 [_a-zA-Z0-9\\.~\\-]+@[_a-zA-Z0-9\\.~\\-]+\\.[_a-zA-Z0-9\\.~\\-]{2,4} # eMail adresses 68 | #color body color20 color255 \\[---\\=\\|.*\\|\\=---\\] 69 | #color body color90 color225 "^gpg: .*" 70 | #color body color90 color225 "^Primary key fingerprint: .*" 71 | #color body color28 color194 "^gpg: Good signature.*" 72 | #color body color124 color223 "^(gpg: (Can't check signature|BAD signature from.*|WARNING: This key is not certified with a trusted signature!| There is no indication that the signature belongs to the owner.)|Verification failure).*" 73 | -------------------------------------------------------------------------------- /dotfiles/.mutt/color.muttrc: -------------------------------------------------------------------------------- 1 | color header cyan default . 2 | color header yellow black ^From 3 | color header yellow black ^Subject 4 | color body yellow black [_a-z\.\$A-Z0-9-]+@[a-zA-Z0-9\./\-]+ 5 | color body yellow black (http|ftp)://[_a-zA-Z0-9\?\=\&\@\%\#\:\,\./~\-]+ 6 | color quoted green black 7 | color quoted1 cyan black 8 | color quoted2 yellow black 9 | color signature cyan black 10 | color attachment yellow black 11 | color tree white black 12 | color indicator black cyan 13 | color status yellow blue 14 | color tilde blue black 15 | color normal white black 16 | color index green black ~N 17 | color index green black ~O 18 | color index red black ~D 19 | color search black yellow 20 | color index black yellow ~F 21 | color sidebar_new yellow default 22 | -------------------------------------------------------------------------------- /dotfiles/.mutt/muttrc: -------------------------------------------------------------------------------- 1 | #sett move=ask-no 2 | set move=no 3 | 4 | source ~/.mutt/color-light.muttrc 5 | 6 | # use vim + cursor function 7 | set editor="vim " 8 | 9 | set mbox_type=Maildir 10 | set folder=$HOME/Mail 11 | set spoolfile=+myemailaccountname/INBOX 12 | 13 | # SMTP 14 | set realname="Emmanuel Bernard" 15 | set sendmail_wait = -1 16 | set edit_headers=yes 17 | set envelope_from = yes 18 | 19 | folder-hook . set record=+myemailaccountname/INBOX.Sent 20 | folder-hook . set sendmail = '"$HOME/usr/local/bin/shared/msmtpq -a myemailaccountname"' 21 | folder-hook . set from="emmanuel@myemailaccount.com" 22 | folder-hook . set postponed=+myemailaccountname/INBOX.Drafts 23 | folder-hook . set trash=+myemailaccountname/INBOX.Trash 24 | 25 | folder-hook myemailaccountname set record=+myemailaccountname/INBOX.Sent 26 | folder-hook myemailaccountname set sendmail = '"$HOME/usr/local/bin/shared/msmtpq -a hibernate"' 27 | folder-hook myemailaccountname set from="emmanuel@hibernate.org" 28 | folder-hook myemailaccountname set postponed=+myemailaccountname/INBOX.Drafts 29 | folder-hook myemailaccountname set trash=+myemailaccountname/INBOX.Trash 30 | folder-hook myemailaccountname set hostname=myemailaccount.com 31 | 32 | # Mu (search) integration 33 | macro index "mu find --clearlinks --format=links --linksdir=~/Mail/search " "mu find" 34 | macro index "~/Mail/search" "mu find results" 35 | 36 | # urlview integration 37 | macro index \cb "|urlview\n" "open url with urlview" 38 | macro pager \cb "|urlview\n" "open url with urlview" 39 | 40 | # Sidebar 41 | set sidebar_width=36 42 | set sidebar_visible=yes 43 | # Those two do not seem to work 44 | # set sidebar-format = "%B - %N" 45 | # set sidebar-folderident = yes 46 | 47 | 48 | # cache 49 | set header_cache = $HOME/Mail/cache 50 | 51 | # behaviors options 52 | set mark_old = no 53 | set recall=no 54 | set sort=threads 55 | set sort_aux=last-date-received 56 | set implicit_autoview = yes 57 | auto_view text/html 58 | alternative_order text/enriched text/plain text/html 59 | 60 | set pager_index_lines=8 61 | set tilde 62 | 63 | set timeout=10 # press artificially a key after 10 seconds 64 | set mail_check=5 # mutt checks for new mails on every keystrokes 65 | # but not more often then once in 5 seconds 66 | set beep_new # beep on new messages in the mailboxes 67 | 68 | ignore * # with only that, no mail - headers should get shown normally 69 | unignore From: To: subject date cc reply-to # I want these to see 70 | unignore User-Agent: 71 | 72 | # set index_format=”%?M?+& ?%2M %2e %Z %D %-20.20F (%4c) %s” 73 | # "%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s" 74 | set index_format="%?M?+& ?%2M %4C | %Z | %D | %-20.20F | %s" 75 | set date_format="!%a %Y-%m-%d %k:%M" 76 | set mime_forward=ask-yes 77 | set forward_decode=no 78 | set forward_format="Fwd: %s" 79 | set pager_context=5 80 | hdr_order From: Date: To: Cc: Subject: 81 | set delete = yes 82 | 83 | # Key binding 84 | bind index - collapse-thread 85 | # ctrl-n, ctrl-p to select next, prev folder 86 | # ctrl-o to open selected folder 87 | bind index \CP sidebar-prev 88 | bind index \CN sidebar-next 89 | bind index \CO sidebar-open 90 | bind index \CL sidebar-open 91 | bind pager \CP sidebar-prev 92 | bind pager \CN sidebar-next 93 | bind pager \CO sidebar-open 94 | bind pager \CL sidebar-open 95 | # b toggles sidebar visibility 96 | macro index b 'toggle sidebar_visible 97 | macro pager b 'toggle sidebar_visible' 98 | # Remap bounce-message function to “B” 99 | bind index B bounce-message 100 | bind generic L bottom-page 101 | bind generic M middle-page 102 | bind generic H top-page 103 | bind index [ previous-unread 104 | bind index ] next-unread 105 | bind pager [ previous-unread 106 | bind pager ] next-unread 107 | bind pager previous-line 108 | bind pager next-line 109 | 110 | # GPG 111 | # set crypt_use_gpgme=yes 112 | -------------------------------------------------------------------------------- /dotfiles/.netrc: -------------------------------------------------------------------------------- 1 | machine mail.myemailaccount.com 2 | login emmanuel 3 | password some_secret_password 4 | 5 | # used by ftp command line tool 6 | machine ftp.someserver.com 7 | login emmanuel 8 | password other-secret-password 9 | -------------------------------------------------------------------------------- /dotfiles/.offlineimaprc: -------------------------------------------------------------------------------- 1 | [general] 2 | accounts = myemailaccountname 3 | maxsyncaccounts = 2 4 | socktimeout = 15 5 | fsync = false 6 | 7 | [mbnames] 8 | enabled = yes 9 | # filename = ~/.mutt/mailboxes 10 | header = "mailboxes " 11 | peritem = "+%(accountname)s/%(foldername)s" 12 | sep = " " 13 | footer = "\n" 14 | 15 | [Account myemailaccountname] 16 | localrepository=LocalMyemailaccountname 17 | remoterepository=RemoteMyemailaccountname 18 | maxage = 60 19 | 20 | [Repository LocalMyemailaccountname] 21 | type = Maildir 22 | localfolders = ~/Mail/myemailaccountname 23 | 24 | [Repository RemoteMyemailaccountname] 25 | type = IMAP 26 | remotehost = mail.myemailaccount.com 27 | remoteuser = emmanuel 28 | ssl = yes 29 | maxconnections = 1 30 | cert_fingerprint = 123456789012345678901234567890123456789 31 | folderfilter = lambda foldername: foldername in ['INBOX', 'INBOX.dev', 'INBOX.Sent', 'INBOX.Trash', 'INBOX.Drafts'] 32 | -------------------------------------------------------------------------------- /dotfiles/.rsync-filter: -------------------------------------------------------------------------------- 1 | - /.embedmongo 2 | - /.Trash 3 | - .FBC* 4 | - .DS_Store 5 | - /Library/Caches 6 | - /logs 7 | - /.dropbox 8 | - /.gradle/caches 9 | - /.gradle/wrapper 10 | - /.m2/repository 11 | - /.karaf/ 12 | - /Music/LesCastCodeurs/episodes 13 | + /Music/LesCastCodeurs/episodes/publish-episode.sh 14 | - /.offlineimap 15 | - /.rvm/archives 16 | - privatebuild 17 | - _site 18 | - .awestruct 19 | - /Code/**/target/ 20 | - /Downloads/nobackup/ 21 | -------------------------------------------------------------------------------- /dotfiles/.ssh/config: -------------------------------------------------------------------------------- 1 | ForwardAgent yes 2 | 3 | Host nas 4 | User emmanuel 5 | IdentityFile ~/.ssh/id_rsa 6 | Hostname nas-034.internal.emmanuelbernard.com 7 | 8 | 9 | Host prod 10 | User manu 11 | IdentityFile ~/.ssh/id_rsa_pro 12 | Port 34 13 | Hostname super-secret.redhat.com 14 | -------------------------------------------------------------------------------- /dotfiles/.tigrc: -------------------------------------------------------------------------------- 1 | # do a hard reset on the selected commit 2 | bind main r !git reset --hard %(commit) 3 | 4 | # push the current branch to a remote. tig prompts for the remote 5 | bind main p !git push %(prompt) %(branch) 6 | -------------------------------------------------------------------------------- /dotfiles/.tmux.conf: -------------------------------------------------------------------------------- 1 | # improve colors 2 | set -g default-terminal "screen-256color" 3 | set-option -g default-command "reattach-to-user-namespace -l bash" 4 | setw -g xterm-keys on 5 | 6 | # mouse support 7 | setw -g mode-mouse on 8 | set -g mouse-resize-pane on 9 | set -g mouse-select-pane on 10 | set -g mouse-select-window on 11 | 12 | ## Status bar and windowing 13 | # 14 | # soften status bar color from harsh green to light gray 15 | set -g status-left '#[fg=black bg=green]#S' 16 | set -g status-right '#[fg=black bg=green]#(echo $USER)@#H' 17 | set -g status-left-length 40 18 | set -g status-utf8 on 19 | set -g status-justify centre 20 | 21 | #colors 22 | set -g status-bg '#666666' 23 | set -g status-fg white 24 | 25 | 26 | setw -g window-status-current-fg white 27 | setw -g window-status-current-bg red 28 | setw -g window-status-current-attr bright 29 | 30 | setw -g window-status-bell-fg white 31 | setw -g window-status-bell-bg '#222222' 32 | setw -g window-status-bell-attr bright 33 | setw -g window-status-activity-fg white 34 | setw -g window-status-activity-bg '#222222' 35 | setw -g window-status-activity-attr bright 36 | setw -g window-status-content-fg white 37 | setw -g window-status-content-bg '#222222' 38 | setw -g window-status-content-attr bright 39 | 40 | setw -g window-status-fg white 41 | setw -g window-status-bg '#666666' 42 | setw -g window-status-attr bright 43 | 44 | set -g message-fg white 45 | set -g message-bg black 46 | set -g message-attr bright 47 | 48 | # highlight active windows 49 | setw -g monitor-activity on 50 | set -g visual-activity on 51 | set -g pane-active-border-fg yellow 52 | set -g pane-active-border-bg yellow 53 | set -g pane-border-fg green 54 | 55 | set -g display-panes-time 2000 56 | set -g base-index 1 57 | set -g repeat-time 500 58 | 59 | ## Key binding 60 | # 61 | # Bindings 62 | set -g prefix C-a 63 | unbind C-b 64 | set -s escape-time 1 65 | #bind C-a send-prefix 66 | # 67 | setw -g mode-keys vi 68 | set -g status-keys vi 69 | 70 | unbind % 71 | bind | split-window -h -c "#{pane_current_path}" 72 | #bind \ split-window -h 73 | bind _ split-window -v -c "#{pane_current_path}" 74 | bind - split-window -v -c "#{pane_current_path}" 75 | 76 | #vi bindings 77 | bind h select-pane -L 78 | bind j select-pane -D 79 | bind k select-pane -U 80 | bind l select-pane -R 81 | 82 | # resizing binding 83 | bind -r H resize-pane -L 5 84 | bind -r L resize-pane -R 5 85 | bind -r K resize-pane -U 5 86 | bind -r J resize-pane -D 5 87 | 88 | #copy mode ala vi 89 | unbind [ 90 | bind y copy-mode 91 | unbind p 92 | bind p paste-buffer 93 | bind -t vi-copy H start-of-line 94 | bind -t vi-copy L end-of-line 95 | bind -t vi-copy v begin-selection 96 | bind -t vi-copy y copy-selection 97 | bind -t vi-copy Escape cancel 98 | 99 | # Move to different sessions 100 | unbind ( 101 | unbind ) 102 | bind -r ( switch-client -p 103 | bind -r ) switch-client -n 104 | 105 | bind R source-file ~/.tmux.conf \; display "Reloaded!" 106 | -------------------------------------------------------------------------------- /dotfiles/.urlview: -------------------------------------------------------------------------------- 1 | COMMAND open %s 2 | -------------------------------------------------------------------------------- /dotfiles/.vim/.netrwhist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emmanuelbernard/command-line-nuts/afc6b21255da0e7f27ae9394cee7e305d694f6aa/dotfiles/.vim/.netrwhist -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/fuzzyfinder/.hg_archival.txt: -------------------------------------------------------------------------------- 1 | repo: 12fd426abbc05bbacb1b24aab95dd1f7961df865 2 | node: 8a46435f4532a77102eff580e2be44c9737ec89f 3 | branch: default 4 | tag: 4.2.2 5 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/fuzzyfinder/.hgtags: -------------------------------------------------------------------------------- 1 | 12fd426abbc05bbacb1b24aab95dd1f7961df865 2.6 2 | fe1572fcdfedd27cf816dbb533acfa403ad626a6 2.6.1 3 | 23cf697e42ec871e391a097c811f2337c1a3b4a0 2.6.2 4 | cf9f65e5dd9e06fbdd28864fbe62fc0688afd02d 2.7 5 | ab897fc2f4c1bb5d30918a925bcc123bab59a79f 2.8 6 | 90d30a932a172df9e8d94333092440db668fa301 2.8.1 7 | 8b503e03294bfee2391550ea1c25d9abe619d947 2.9 8 | 7423b8e0af6b25e3c86c2e5285951a32d45cff85 2.10 9 | 1d04353cf94a95da831add20bcae270f52e0df5d 2.11 10 | ae392ea7870399aa91b1f227fb851c35373778aa 2.12 11 | 29e0f8d83208931bd7a3b0d50f8c6aff26189e1e 2.13 12 | 910105ab1b8eda365c4074fc272dc564dfe0f4bb 2.14 13 | 5830ee92a86aea9e19e87c94ef4e07babd80e02a 2.15 14 | 3dfda50187099bda28dec2035b9d0197cc3e60ee 2.16 15 | 2acd9f721c0ee8852c8a2f5d2764a1ddafd01b95 2.17 16 | 1c1996f7dc544ac58ce3690093de1aea968dcad6 2.18 17 | ca56346d327bbcb61ba47dfc9e9cf31792b78cec 2.19 18 | adcae4f87ad44e9ed1d864acf69d8b1c232fe68c 2.20 19 | eca54ee53e9c4e8a26585d882fb3cb63938aedbd 2.21.0 20 | 96c547a54644878708a2155f33cb5547fe3cbf70 2.22.0 21 | b72936ccf5a96340dcfd6742b574a35313642c70 2.22.1 22 | 2ce20535b10cde9c8c76f23a5ce66a6b64cc8775 2.22.2 23 | 1934aa0f4065b702c379f3b7abc4bda1526eeffe 2.22.3 24 | e8bcbf4bf440ad14602cb8d11f2c15447a38df60 3.0 25 | ea42cdfe7cdd635d5965b4dc6edda0ae5e374f38 3.1 26 | 1bdf383f40c90ed71dc4aaa25ca50e9afc1d95ea 3.2 27 | 747edb3f3b4c187fcd38aac896fc8d8a107b8e1c 3.3 28 | 13463a6e73364f373618b322ff509266bfc33e35 3.4 29 | 21629b1a14f4b86396898532dee5e58ca0843082 3.5 30 | 7d7aa8a1c62c41d3064125e7f9dafddd31c9bb78 4.0 31 | 1117ddd9a19b525c324b10b4911dcd67fb89eb66 4.1 32 | 6686856c4cd7a3ba0a35edaf333f78d06609ed48 4.1.1 33 | dee72a3e6790d6859454653b8eec56b37359247a 4.2 34 | 672cfc1651da9e8fb2025846fb7c4a8fb6c9aa98 4.2.1 35 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/fuzzyfinder/autoload/fuf/callbackfile.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " Copyright (c) 2007-2010 Takeshi NISHIDA 3 | " 4 | "============================================================================= 5 | " LOAD GUARD {{{1 6 | 7 | if !l9#guardScriptLoading(expand(':p'), 0, 0, []) 8 | finish 9 | endif 10 | 11 | " }}}1 12 | "============================================================================= 13 | " GLOBAL FUNCTIONS {{{1 14 | 15 | " 16 | function fuf#callbackfile#createHandler(base) 17 | return a:base.concretize(copy(s:handler)) 18 | endfunction 19 | 20 | " 21 | function fuf#callbackfile#getSwitchOrder() 22 | return -1 23 | endfunction 24 | 25 | " 26 | function fuf#callbackfile#getEditableDataNames() 27 | return [] 28 | endfunction 29 | 30 | " 31 | function fuf#callbackfile#renewCache() 32 | let s:cache = {} 33 | endfunction 34 | 35 | " 36 | function fuf#callbackfile#requiresOnCommandPre() 37 | return 0 38 | endfunction 39 | 40 | " 41 | function fuf#callbackfile#onInit() 42 | endfunction 43 | 44 | " 45 | function fuf#callbackfile#launch(initialPattern, partialMatching, prompt, exclude, listener) 46 | let s:prompt = (empty(a:prompt) ? '>' : a:prompt) 47 | let s:exclude = a:exclude 48 | let s:listener = a:listener 49 | call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching) 50 | endfunction 51 | 52 | " }}}1 53 | "============================================================================= 54 | " LOCAL FUNCTIONS/VARIABLES {{{1 55 | 56 | let s:MODE_NAME = expand(':t:r') 57 | 58 | " 59 | function s:enumItems(dir) 60 | let key = getcwd() . g:fuf_ignoreCase . s:exclude . "\n" . a:dir 61 | if !exists('s:cache[key]') 62 | let s:cache[key] = fuf#enumExpandedDirsEntries(a:dir, s:exclude) 63 | if isdirectory(a:dir) 64 | call insert(s:cache[key], fuf#makePathItem(a:dir . '.', '', 0)) 65 | endif 66 | call fuf#mapToSetSerialIndex(s:cache[key], 1) 67 | call fuf#mapToSetAbbrWithSnippedWordAsPath(s:cache[key]) 68 | endif 69 | return s:cache[key] 70 | endfunction 71 | 72 | " }}}1 73 | "============================================================================= 74 | " s:handler {{{1 75 | 76 | let s:handler = {} 77 | 78 | " 79 | function s:handler.getModeName() 80 | return s:MODE_NAME 81 | endfunction 82 | 83 | " 84 | function s:handler.getPrompt() 85 | return fuf#formatPrompt(s:prompt, self.partialMatching, '') 86 | endfunction 87 | 88 | " 89 | function s:handler.getPreviewHeight() 90 | return g:fuf_previewHeight 91 | endfunction 92 | 93 | " 94 | function s:handler.isOpenable(enteredPattern) 95 | return a:enteredPattern =~# '[^/\\]$' 96 | endfunction 97 | 98 | " 99 | function s:handler.makePatternSet(patternBase) 100 | return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPathTail', 101 | \ self.partialMatching) 102 | endfunction 103 | 104 | " 105 | function s:handler.makePreviewLines(word, count) 106 | return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight()) 107 | endfunction 108 | 109 | " 110 | function s:handler.getCompleteItems(patternPrimary) 111 | let items = copy(s:enumItems(fuf#splitPath(a:patternPrimary).head)) 112 | return filter(items, 'bufnr("^" . v:val.word . "$") != self.bufNrPrev') 113 | endfunction 114 | 115 | " 116 | function s:handler.onOpen(word, mode) 117 | call s:listener.onComplete(a:word, a:mode) 118 | endfunction 119 | 120 | " 121 | function s:handler.onModeEnterPre() 122 | endfunction 123 | 124 | " 125 | function s:handler.onModeEnterPost() 126 | endfunction 127 | 128 | " 129 | function s:handler.onModeLeavePost(opened) 130 | if !a:opened && exists('s:listener.onAbort()') 131 | call s:listener.onAbort() 132 | endif 133 | endfunction 134 | 135 | " }}}1 136 | "============================================================================= 137 | " vim: set fdm=marker: 138 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/fuzzyfinder/autoload/fuf/callbackitem.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " Copyright (c) 2007-2010 Takeshi NISHIDA 3 | " 4 | "============================================================================= 5 | " LOAD GUARD {{{1 6 | 7 | if !l9#guardScriptLoading(expand(':p'), 0, 0, []) 8 | finish 9 | endif 10 | 11 | " }}}1 12 | "============================================================================= 13 | " GLOBAL FUNCTIONS {{{1 14 | 15 | " 16 | function fuf#callbackitem#createHandler(base) 17 | return a:base.concretize(copy(s:handler)) 18 | endfunction 19 | 20 | " 21 | function fuf#callbackitem#getSwitchOrder() 22 | return -1 23 | endfunction 24 | 25 | " 26 | function fuf#callbackitem#getEditableDataNames() 27 | return [] 28 | endfunction 29 | 30 | " 31 | function fuf#callbackitem#renewCache() 32 | endfunction 33 | 34 | " 35 | function fuf#callbackitem#requiresOnCommandPre() 36 | return 0 37 | endfunction 38 | 39 | " 40 | function fuf#callbackitem#onInit() 41 | endfunction 42 | 43 | " 44 | function fuf#callbackitem#launch(initialPattern, partialMatching, prompt, listener, items, forPath) 45 | let s:prompt = (empty(a:prompt) ? '>' : a:prompt) 46 | let s:listener = a:listener 47 | let s:forPath = a:forPath 48 | let s:items = copy(a:items) 49 | if s:forPath 50 | call map(s:items, 'fuf#makePathItem(v:val, "", 1)') 51 | call fuf#mapToSetSerialIndex(s:items, 1) 52 | call fuf#mapToSetAbbrWithSnippedWordAsPath(s:items) 53 | else 54 | call map(s:items, 'fuf#makeNonPathItem(v:val, "")') 55 | call fuf#mapToSetSerialIndex(s:items, 1) 56 | call map(s:items, 'fuf#setAbbrWithFormattedWord(v:val, 1)') 57 | endif 58 | call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching) 59 | endfunction 60 | 61 | " }}}1 62 | "============================================================================= 63 | " LOCAL FUNCTIONS/VARIABLES {{{1 64 | 65 | let s:MODE_NAME = expand(':t:r') 66 | 67 | " }}}1 68 | "============================================================================= 69 | " s:handler {{{1 70 | 71 | let s:handler = {} 72 | 73 | " 74 | function s:handler.getModeName() 75 | return s:MODE_NAME 76 | endfunction 77 | 78 | " 79 | function s:handler.getPrompt() 80 | return fuf#formatPrompt(s:prompt, self.partialMatching, '') 81 | endfunction 82 | 83 | " 84 | function s:handler.getPreviewHeight() 85 | if s:forPath 86 | return g:fuf_previewHeight 87 | endif 88 | return 0 89 | endfunction 90 | 91 | " 92 | function s:handler.isOpenable(enteredPattern) 93 | return 1 94 | endfunction 95 | 96 | " 97 | function s:handler.makePatternSet(patternBase) 98 | let parser = (s:forPath 99 | \ ? 's:interpretPrimaryPatternForPath' 100 | \ : 's:interpretPrimaryPatternForNonPath') 101 | return fuf#makePatternSet(a:patternBase, parser, self.partialMatching) 102 | endfunction 103 | 104 | " 105 | function s:handler.makePreviewLines(word, count) 106 | if s:forPath 107 | return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight()) 108 | endif 109 | return [] 110 | endfunction 111 | 112 | " 113 | function s:handler.getCompleteItems(patternPrimary) 114 | return s:items 115 | endfunction 116 | 117 | " 118 | function s:handler.onOpen(word, mode) 119 | call s:listener.onComplete(a:word, a:mode) 120 | endfunction 121 | 122 | " 123 | function s:handler.onModeEnterPre() 124 | endfunction 125 | 126 | " 127 | function s:handler.onModeEnterPost() 128 | endfunction 129 | 130 | " 131 | function s:handler.onModeLeavePost(opened) 132 | if !a:opened && exists('s:listener.onAbort()') 133 | call s:listener.onAbort() 134 | endif 135 | endfunction 136 | 137 | " }}}1 138 | "============================================================================= 139 | " vim: set fdm=marker: 140 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/fuzzyfinder/autoload/fuf/dir.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " Copyright (c) 2007-2010 Takeshi NISHIDA 3 | " 4 | "============================================================================= 5 | " LOAD GUARD {{{1 6 | 7 | if !l9#guardScriptLoading(expand(':p'), 0, 0, []) 8 | finish 9 | endif 10 | 11 | " }}}1 12 | "============================================================================= 13 | " GLOBAL FUNCTIONS {{{1 14 | 15 | " 16 | function fuf#dir#createHandler(base) 17 | return a:base.concretize(copy(s:handler)) 18 | endfunction 19 | 20 | " 21 | function fuf#dir#getSwitchOrder() 22 | return g:fuf_dir_switchOrder 23 | endfunction 24 | 25 | " 26 | function fuf#dir#getEditableDataNames() 27 | return [] 28 | endfunction 29 | 30 | " 31 | function fuf#dir#renewCache() 32 | let s:cache = {} 33 | endfunction 34 | 35 | " 36 | function fuf#dir#requiresOnCommandPre() 37 | return 0 38 | endfunction 39 | 40 | " 41 | function fuf#dir#onInit() 42 | call fuf#defineLaunchCommand('FufDir' , s:MODE_NAME, '""', []) 43 | call fuf#defineLaunchCommand('FufDirWithFullCwd' , s:MODE_NAME, 'fnamemodify(getcwd(), '':p'')', []) 44 | call fuf#defineLaunchCommand('FufDirWithCurrentBufferDir', s:MODE_NAME, 'expand(''%:~:.'')[:-1-len(expand(''%:~:.:t''))]', []) 45 | endfunction 46 | 47 | " }}}1 48 | "============================================================================= 49 | " LOCAL FUNCTIONS/VARIABLES {{{1 50 | 51 | let s:MODE_NAME = expand(':t:r') 52 | 53 | " 54 | function s:enumItems(dir) 55 | let key = getcwd() . g:fuf_ignoreCase . g:fuf_dir_exclude . "\n" . a:dir 56 | if !exists('s:cache[key]') 57 | let s:cache[key] = fuf#enumExpandedDirsEntries(a:dir, g:fuf_dir_exclude) 58 | call filter(s:cache[key], 'v:val.word =~# ''[/\\]$''') 59 | if isdirectory(a:dir) 60 | call insert(s:cache[key], fuf#makePathItem(a:dir . '.', '', 0)) 61 | endif 62 | call fuf#mapToSetSerialIndex(s:cache[key], 1) 63 | call fuf#mapToSetAbbrWithSnippedWordAsPath(s:cache[key]) 64 | endif 65 | return s:cache[key] 66 | endfunction 67 | 68 | " }}}1 69 | "============================================================================= 70 | " s:handler {{{1 71 | 72 | let s:handler = {} 73 | 74 | " 75 | function s:handler.getModeName() 76 | return s:MODE_NAME 77 | endfunction 78 | 79 | " 80 | function s:handler.getPrompt() 81 | return fuf#formatPrompt(g:fuf_dir_prompt, self.partialMatching, '') 82 | endfunction 83 | 84 | " 85 | function s:handler.getPreviewHeight() 86 | return g:fuf_previewHeight 87 | endfunction 88 | 89 | " 90 | function s:handler.isOpenable(enteredPattern) 91 | return a:enteredPattern =~# '[^/\\]$' 92 | endfunction 93 | 94 | " 95 | function s:handler.makePatternSet(patternBase) 96 | return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPathTail', 97 | \ self.partialMatching) 98 | endfunction 99 | 100 | " 101 | function s:handler.makePreviewLines(word, count) 102 | return fuf#makePreviewLinesAround( 103 | \ fuf#glob(fnamemodify(a:word, ':p') . '*'), 104 | \ [], a:count, self.getPreviewHeight()) 105 | return 106 | endfunction 107 | 108 | " 109 | function s:handler.getCompleteItems(patternPrimary) 110 | return s:enumItems(fuf#splitPath(a:patternPrimary).head) 111 | endfunction 112 | 113 | " 114 | function s:handler.onOpen(word, mode) 115 | execute ':cd ' . fnameescape(a:word) 116 | endfunction 117 | 118 | " 119 | function s:handler.onModeEnterPre() 120 | endfunction 121 | 122 | " 123 | function s:handler.onModeEnterPost() 124 | endfunction 125 | 126 | " 127 | function s:handler.onModeLeavePost(opened) 128 | endfunction 129 | 130 | " }}}1 131 | "============================================================================= 132 | " vim: set fdm=marker: 133 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/fuzzyfinder/autoload/fuf/givencmd.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " Copyright (c) 2007-2010 Takeshi NISHIDA 3 | " 4 | "============================================================================= 5 | " LOAD GUARD {{{1 6 | 7 | if !l9#guardScriptLoading(expand(':p'), 0, 0, []) 8 | finish 9 | endif 10 | 11 | " }}}1 12 | "============================================================================= 13 | " GLOBAL FUNCTIONS {{{1 14 | 15 | " 16 | function fuf#givencmd#createHandler(base) 17 | return a:base.concretize(copy(s:handler)) 18 | endfunction 19 | 20 | " 21 | function fuf#givencmd#getSwitchOrder() 22 | return -1 23 | endfunction 24 | 25 | " 26 | function fuf#givencmd#getEditableDataNames() 27 | return [] 28 | endfunction 29 | 30 | " 31 | function fuf#givencmd#renewCache() 32 | endfunction 33 | 34 | " 35 | function fuf#givencmd#requiresOnCommandPre() 36 | return 0 37 | endfunction 38 | 39 | " 40 | function fuf#givencmd#onInit() 41 | endfunction 42 | 43 | " 44 | function fuf#givencmd#launch(initialPattern, partialMatching, prompt, items) 45 | let s:prompt = (empty(a:prompt) ? '>' : a:prompt) 46 | let s:items = copy(a:items) 47 | call map(s:items, 'fuf#makeNonPathItem(v:val, "")') 48 | call fuf#mapToSetSerialIndex(s:items, 1) 49 | call map(s:items, 'fuf#setAbbrWithFormattedWord(v:val, 1)') 50 | call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching) 51 | endfunction 52 | 53 | " }}}1 54 | "============================================================================= 55 | " LOCAL FUNCTIONS/VARIABLES {{{1 56 | 57 | let s:MODE_NAME = expand(':t:r') 58 | 59 | " }}}1 60 | "============================================================================= 61 | " s:handler {{{1 62 | 63 | let s:handler = {} 64 | 65 | " 66 | function s:handler.getModeName() 67 | return s:MODE_NAME 68 | endfunction 69 | 70 | " 71 | function s:handler.getPrompt() 72 | return fuf#formatPrompt(s:prompt, self.partialMatching, '') 73 | endfunction 74 | 75 | " 76 | function s:handler.getPreviewHeight() 77 | return 0 78 | endfunction 79 | 80 | " 81 | function s:handler.isOpenable(enteredPattern) 82 | return 1 83 | endfunction 84 | 85 | " 86 | function s:handler.makePatternSet(patternBase) 87 | return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath', 88 | \ self.partialMatching) 89 | endfunction 90 | 91 | " 92 | function s:handler.makePreviewLines(word, count) 93 | return [] 94 | endfunction 95 | 96 | " 97 | function s:handler.getCompleteItems(patternPrimary) 98 | return s:items 99 | endfunction 100 | 101 | " 102 | function s:handler.onOpen(word, mode) 103 | if a:word[0] =~# '[:/?]' 104 | call histadd(a:word[0], a:word[1:]) 105 | endif 106 | call feedkeys(a:word . "\", 'n') 107 | endfunction 108 | 109 | " 110 | function s:handler.onModeEnterPre() 111 | endfunction 112 | 113 | " 114 | function s:handler.onModeEnterPost() 115 | endfunction 116 | 117 | " 118 | function s:handler.onModeLeavePost(opened) 119 | endfunction 120 | 121 | " }}}1 122 | "============================================================================= 123 | " vim: set fdm=marker: 124 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/fuzzyfinder/autoload/fuf/givendir.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " Copyright (c) 2007-2010 Takeshi NISHIDA 3 | " 4 | "============================================================================= 5 | " LOAD GUARD {{{1 6 | 7 | if !l9#guardScriptLoading(expand(':p'), 0, 0, []) 8 | finish 9 | endif 10 | 11 | " }}}1 12 | "============================================================================= 13 | " GLOBAL FUNCTIONS {{{1 14 | 15 | " 16 | function fuf#givendir#createHandler(base) 17 | return a:base.concretize(copy(s:handler)) 18 | endfunction 19 | 20 | " 21 | function fuf#givendir#getSwitchOrder() 22 | return -1 23 | endfunction 24 | 25 | " 26 | function fuf#givendir#getEditableDataNames() 27 | return [] 28 | endfunction 29 | 30 | " 31 | function fuf#givendir#renewCache() 32 | endfunction 33 | 34 | " 35 | function fuf#givendir#requiresOnCommandPre() 36 | return 0 37 | endfunction 38 | 39 | " 40 | function fuf#givendir#onInit() 41 | endfunction 42 | 43 | " 44 | function fuf#givendir#launch(initialPattern, partialMatching, prompt, items) 45 | let s:prompt = (empty(a:prompt) ? '>' : a:prompt) 46 | let s:items = map(copy(a:items), 'substitute(v:val, ''[/\\]\?$'', "", "")') 47 | let s:items = map(s:items, 'fuf#makePathItem(v:val, "", 0)') 48 | call fuf#mapToSetSerialIndex(s:items, 1) 49 | call fuf#mapToSetAbbrWithSnippedWordAsPath(s:items) 50 | call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching) 51 | endfunction 52 | 53 | " }}}1 54 | "============================================================================= 55 | " LOCAL FUNCTIONS/VARIABLES {{{1 56 | 57 | let s:MODE_NAME = expand(':t:r') 58 | 59 | " }}}1 60 | "============================================================================= 61 | " s:handler {{{1 62 | 63 | let s:handler = {} 64 | 65 | " 66 | function s:handler.getModeName() 67 | return s:MODE_NAME 68 | endfunction 69 | 70 | " 71 | function s:handler.getPrompt() 72 | return fuf#formatPrompt(s:prompt, self.partialMatching, '') 73 | endfunction 74 | 75 | " 76 | function s:handler.getPreviewHeight() 77 | return g:fuf_previewHeight 78 | endfunction 79 | 80 | " 81 | function s:handler.isOpenable(enteredPattern) 82 | return 1 83 | endfunction 84 | 85 | " 86 | function s:handler.makePatternSet(patternBase) 87 | return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath', 88 | \ self.partialMatching) 89 | endfunction 90 | 91 | " 92 | function s:handler.makePreviewLines(word, count) 93 | return fuf#makePreviewLinesAround( 94 | \ fuf#glob(fnamemodify(a:word, ':p') . '*'), 95 | \ [], a:count, self.getPreviewHeight()) 96 | return 97 | endfunction 98 | 99 | " 100 | function s:handler.getCompleteItems(patternPrimary) 101 | return s:items 102 | endfunction 103 | 104 | " 105 | function s:handler.onOpen(word, mode) 106 | execute ':cd ' . fnameescape(a:word) 107 | endfunction 108 | 109 | " 110 | function s:handler.onModeEnterPre() 111 | endfunction 112 | 113 | " 114 | function s:handler.onModeEnterPost() 115 | endfunction 116 | 117 | " 118 | function s:handler.onModeLeavePost(opened) 119 | endfunction 120 | 121 | " }}}1 122 | "============================================================================= 123 | " vim: set fdm=marker: 124 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/fuzzyfinder/autoload/fuf/givenfile.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " Copyright (c) 2007-2010 Takeshi NISHIDA 3 | " 4 | "============================================================================= 5 | " LOAD GUARD {{{1 6 | 7 | if !l9#guardScriptLoading(expand(':p'), 0, 0, []) 8 | finish 9 | endif 10 | 11 | " }}}1 12 | "============================================================================= 13 | " GLOBAL FUNCTIONS {{{1 14 | 15 | " 16 | function fuf#givenfile#createHandler(base) 17 | return a:base.concretize(copy(s:handler)) 18 | endfunction 19 | 20 | " 21 | function fuf#givenfile#getSwitchOrder() 22 | return -1 23 | endfunction 24 | 25 | " 26 | function fuf#givenfile#getEditableDataNames() 27 | return [] 28 | endfunction 29 | 30 | " 31 | function fuf#givenfile#renewCache() 32 | endfunction 33 | 34 | " 35 | function fuf#givenfile#requiresOnCommandPre() 36 | return 0 37 | endfunction 38 | 39 | " 40 | function fuf#givenfile#onInit() 41 | endfunction 42 | 43 | " 44 | function fuf#givenfile#launch(initialPattern, partialMatching, prompt, items) 45 | let s:prompt = (empty(a:prompt) ? '>' : a:prompt) 46 | let s:items = map(copy(a:items), 'fuf#makePathItem(v:val, "", 0)') 47 | call fuf#mapToSetSerialIndex(s:items, 1) 48 | call map(s:items, 'fuf#setAbbrWithFormattedWord(v:val, 1)') 49 | call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching) 50 | endfunction 51 | 52 | 53 | " }}}1 54 | "============================================================================= 55 | " LOCAL FUNCTIONS/VARIABLES {{{1 56 | 57 | let s:MODE_NAME = expand(':t:r') 58 | 59 | " }}}1 60 | "============================================================================= 61 | " s:handler {{{1 62 | 63 | let s:handler = {} 64 | 65 | " 66 | function s:handler.getModeName() 67 | return s:MODE_NAME 68 | endfunction 69 | 70 | " 71 | function s:handler.getPrompt() 72 | return fuf#formatPrompt(s:prompt, self.partialMatching, '') 73 | endfunction 74 | 75 | " 76 | function s:handler.getPreviewHeight() 77 | return g:fuf_previewHeight 78 | endfunction 79 | 80 | " 81 | function s:handler.isOpenable(enteredPattern) 82 | return 1 83 | endfunction 84 | 85 | " 86 | function s:handler.makePatternSet(patternBase) 87 | return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath', 88 | \ self.partialMatching) 89 | endfunction 90 | 91 | " 92 | function s:handler.makePreviewLines(word, count) 93 | return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight()) 94 | endfunction 95 | 96 | " 97 | function s:handler.getCompleteItems(patternPrimary) 98 | return s:items 99 | endfunction 100 | 101 | " 102 | function s:handler.onOpen(word, mode) 103 | call fuf#openFile(a:word, a:mode, g:fuf_reuseWindow) 104 | endfunction 105 | 106 | 107 | " 108 | function s:handler.onModeEnterPre() 109 | endfunction 110 | 111 | " 112 | function s:handler.onModeEnterPost() 113 | endfunction 114 | 115 | " 116 | function s:handler.onModeLeavePost(opened) 117 | endfunction 118 | 119 | " }}}1 120 | "============================================================================= 121 | " vim: set fdm=marker: 122 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/fuzzyfinder/autoload/fuf/line.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " Copyright (c) 2007-2010 Takeshi NISHIDA 3 | " 4 | "============================================================================= 5 | " LOAD GUARD {{{1 6 | 7 | if !l9#guardScriptLoading(expand(':p'), 0, 0, []) 8 | finish 9 | endif 10 | 11 | " }}}1 12 | "============================================================================= 13 | " GLOBAL FUNCTIONS {{{1 14 | 15 | " 16 | function fuf#line#createHandler(base) 17 | return a:base.concretize(copy(s:handler)) 18 | endfunction 19 | 20 | " 21 | function fuf#line#getSwitchOrder() 22 | return g:fuf_line_switchOrder 23 | endfunction 24 | 25 | " 26 | function fuf#line#getEditableDataNames() 27 | return [] 28 | endfunction 29 | 30 | " 31 | function fuf#line#renewCache() 32 | endfunction 33 | 34 | " 35 | function fuf#line#requiresOnCommandPre() 36 | return 0 37 | endfunction 38 | 39 | " 40 | function fuf#line#onInit() 41 | call fuf#defineLaunchCommand('FufLine', s:MODE_NAME, '""', []) 42 | endfunction 43 | 44 | " }}}1 45 | "============================================================================= 46 | " LOCAL FUNCTIONS/VARIABLES {{{1 47 | 48 | let s:MODE_NAME = expand(':t:r') 49 | let s:OPEN_TYPE_DELETE = -1 50 | 51 | " }}}1 52 | "============================================================================= 53 | " s:handler {{{1 54 | 55 | let s:handler = {} 56 | 57 | " 58 | function s:handler.getModeName() 59 | return s:MODE_NAME 60 | endfunction 61 | 62 | " 63 | function s:handler.getPrompt() 64 | return fuf#formatPrompt(g:fuf_line_prompt, self.partialMatching, '') 65 | endfunction 66 | 67 | " 68 | function s:handler.getPreviewHeight() 69 | return g:fuf_previewHeight 70 | endfunction 71 | 72 | " 73 | function s:handler.isOpenable(enteredPattern) 74 | return 1 75 | endfunction 76 | 77 | " 78 | function s:handler.makePatternSet(patternBase) 79 | return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath', 80 | \ self.partialMatching) 81 | endfunction 82 | 83 | " 84 | function s:handler.makePreviewLines(word, count) 85 | let items = filter(copy(self.items), 'v:val.word ==# a:word') 86 | if empty(items) 87 | return [] 88 | endif 89 | let lines = fuf#getFileLines(self.bufNrPrev) 90 | return fuf#makePreviewLinesAround( 91 | \ lines, [items[0].index - 1], a:count, self.getPreviewHeight()) 92 | endfunction 93 | 94 | " 95 | function s:handler.getCompleteItems(patternPrimary) 96 | return self.items 97 | endfunction 98 | 99 | " 100 | function s:handler.onOpen(word, mode) 101 | call fuf#prejump(a:mode) 102 | call filter(self.items, 'v:val.word ==# a:word') 103 | if empty(self.items) 104 | return 105 | execute 'cc ' . self.items[0].index 106 | endif 107 | call cursor(self.items[0].index, 0) 108 | normal! zvzz 109 | endfunction 110 | 111 | " 112 | function s:handler.onModeEnterPre() 113 | endfunction 114 | 115 | " 116 | function s:handler.onModeEnterPost() 117 | let tab = repeat(' ', getbufvar(self.bufNrPrev, '&tabstop')) 118 | let self.items = getbufline(self.bufNrPrev, 1, '$') 119 | let lnumFormat = '%' . len(string(len(self.items) + 1)) . 'd|' 120 | for i in range(len(self.items)) 121 | let self.items[i] = printf(lnumFormat, i + 1) 122 | \ . substitute(self.items[i], "\t", tab, 'g') 123 | endfor 124 | call map(self.items, 'fuf#makeNonPathItem(v:val, "")') 125 | call fuf#mapToSetSerialIndex(self.items, 1) 126 | call map(self.items, 'fuf#setAbbrWithFormattedWord(v:val, 0)') 127 | endfunction 128 | 129 | " 130 | function s:handler.onModeLeavePost(opened) 131 | endfunction 132 | 133 | " }}}1 134 | "============================================================================= 135 | " vim: set fdm=marker: 136 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/fuzzyfinder/autoload/fuf/mrucmd.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " Copyright (c) 2007-2010 Takeshi NISHIDA 3 | " 4 | "============================================================================= 5 | " LOAD GUARD {{{1 6 | 7 | if !l9#guardScriptLoading(expand(':p'), 0, 0, []) 8 | finish 9 | endif 10 | 11 | " }}}1 12 | "============================================================================= 13 | " GLOBAL FUNCTIONS {{{1 14 | 15 | " 16 | function fuf#mrucmd#createHandler(base) 17 | return a:base.concretize(copy(s:handler)) 18 | endfunction 19 | 20 | " 21 | function fuf#mrucmd#getSwitchOrder() 22 | return g:fuf_mrucmd_switchOrder 23 | endfunction 24 | 25 | " 26 | function fuf#mrucmd#getEditableDataNames() 27 | return ['items'] 28 | endfunction 29 | 30 | " 31 | function fuf#mrucmd#renewCache() 32 | endfunction 33 | 34 | " 35 | function fuf#mrucmd#requiresOnCommandPre() 36 | return 1 37 | endfunction 38 | 39 | " 40 | function fuf#mrucmd#onInit() 41 | call fuf#defineLaunchCommand('FufMruCmd', s:MODE_NAME, '""', []) 42 | endfunction 43 | 44 | " 45 | function fuf#mrucmd#onCommandPre(cmd) 46 | if getcmdtype() =~# '^[:/?]' 47 | call s:updateInfo(a:cmd) 48 | endif 49 | endfunction 50 | 51 | 52 | " }}}1 53 | "============================================================================= 54 | " LOCAL FUNCTIONS/VARIABLES {{{1 55 | 56 | let s:MODE_NAME = expand(':t:r') 57 | 58 | " 59 | function s:updateInfo(cmd) 60 | let items = fuf#loadDataFile(s:MODE_NAME, 'items') 61 | let items = fuf#updateMruList( 62 | \ items, { 'word' : a:cmd, 'time' : localtime() }, 63 | \ g:fuf_mrucmd_maxItem, g:fuf_mrucmd_exclude) 64 | call fuf#saveDataFile(s:MODE_NAME, 'items', items) 65 | endfunction 66 | 67 | " }}}1 68 | "============================================================================= 69 | " s:handler {{{1 70 | 71 | let s:handler = {} 72 | 73 | " 74 | function s:handler.getModeName() 75 | return s:MODE_NAME 76 | endfunction 77 | 78 | " 79 | function s:handler.getPrompt() 80 | return fuf#formatPrompt(g:fuf_mrucmd_prompt, self.partialMatching, '') 81 | endfunction 82 | 83 | " 84 | function s:handler.getPreviewHeight() 85 | return 0 86 | endfunction 87 | 88 | " 89 | function s:handler.isOpenable(enteredPattern) 90 | return 1 91 | endfunction 92 | 93 | " 94 | function s:handler.makePatternSet(patternBase) 95 | return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath', 96 | \ self.partialMatching) 97 | endfunction 98 | 99 | " 100 | function s:handler.makePreviewLines(word, count) 101 | return [] 102 | endfunction 103 | 104 | " 105 | function s:handler.getCompleteItems(patternPrimary) 106 | return self.items 107 | endfunction 108 | 109 | " 110 | function s:handler.onOpen(word, mode) 111 | call s:updateInfo(a:word) 112 | call histadd(a:word[0], a:word[1:]) 113 | call feedkeys(a:word . "\", 'n') 114 | endfunction 115 | 116 | " 117 | function s:handler.onModeEnterPre() 118 | endfunction 119 | 120 | " 121 | function s:handler.onModeEnterPost() 122 | let self.items = fuf#loadDataFile(s:MODE_NAME, 'items') 123 | call map(self.items, 'fuf#makeNonPathItem(v:val.word, strftime(g:fuf_timeFormat, v:val.time))') 124 | call fuf#mapToSetSerialIndex(self.items, 1) 125 | call map(self.items, 'fuf#setAbbrWithFormattedWord(v:val, 1)') 126 | endfunction 127 | 128 | " 129 | function s:handler.onModeLeavePost(opened) 130 | endfunction 131 | 132 | " }}}1 133 | "============================================================================= 134 | " vim: set fdm=marker: 135 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/l9/.hg_archival.txt: -------------------------------------------------------------------------------- 1 | repo: 4d5305d0e643bf0b1deca1e9270d2db044d07b2d 2 | node: c3f242518bd4b8131a2c277a7f8c492b56375dff 3 | branch: default 4 | tag: 1.1 5 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/l9/.hgtags: -------------------------------------------------------------------------------- 1 | f6420a42fc69dd7fc08aa5426c4b3fb10e78020d 1.0 2 | f6f3e9bae8770abb41259d42ab65721f6915fe22 1.0.1 3 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/l9/autoload/l9/async.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from __future__ import with_statement 4 | import vim 5 | import os 6 | import subprocess 7 | import threading 8 | import Queue 9 | 10 | 11 | class Asyncer: 12 | 13 | def __init__(self): 14 | self._workers = {} 15 | 16 | def execute(self, var_key, var_command, var_cwd, var_input, var_appends): 17 | key = vim.eval(var_key) 18 | command = vim.eval(var_command) 19 | cwd = vim.eval(var_cwd) 20 | input = vim.eval(var_input) 21 | appends = vim.eval(var_appends) 22 | if key not in self._workers: 23 | self._workers[key] = Worker() 24 | self._workers[key].start() 25 | self._workers[key].put(Executor(command, cwd, input, appends)) 26 | 27 | def print_output(self, var_key): 28 | key = vim.eval(var_key) 29 | if key not in self._workers: 30 | return 31 | for l in self._workers[key].copy_outputs(): 32 | print l, 33 | 34 | def print_worker_keys(self): 35 | for k in self._workers.keys(): 36 | print k 37 | 38 | def print_active_worker_keys(self): 39 | for k in self._workers.keys(): 40 | print k 41 | 42 | 43 | class Worker(threading.Thread): 44 | 45 | def __init__(self): 46 | threading.Thread.__init__(self) 47 | self._queue = Queue.Queue() 48 | self._lines = [] 49 | self._lock = threading.Lock() 50 | 51 | def run(self): 52 | while True: 53 | self._queue.get().execute(self) 54 | self._queue.task_done() 55 | 56 | def put(self, executor): 57 | self._queue.put(executor) 58 | 59 | def clear_outputs(self): 60 | with self._lock: 61 | self._lines = [] 62 | 63 | def record_output(self, line): 64 | with self._lock: 65 | self._lines.append(line) 66 | 67 | def copy_outputs(self): 68 | with self._lock: 69 | return self._lines[:] 70 | 71 | 72 | class Executor: 73 | 74 | def __init__(self, command, cwd, input, appends): 75 | self._command = command 76 | self._cwd = cwd 77 | self._input = input 78 | self._appends = appends 79 | 80 | def execute(self, worker): 81 | if not self._appends: 82 | worker.clear_outputs() 83 | os.chdir(self._cwd) 84 | p = subprocess.Popen(self._command, shell=True, stdin=subprocess.PIPE, 85 | stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 86 | p.stdin.write(self._input) 87 | line = p.stdout.readline() 88 | while line: 89 | worker.record_output(line) 90 | line = p.stdout.readline() 91 | 92 | 93 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/l9/autoload/l9/async.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " Copyright (C) 2009-2010 Takeshi NISHIDA 3 | " 4 | "============================================================================= 5 | " LOAD GUARD {{{1 6 | 7 | if !l9#guardScriptLoading(expand(':p'), 0, 0, ['has("python")']) 8 | finish 9 | endif 10 | 11 | " }}}1 12 | "============================================================================= 13 | " ASYNC EXECUTE {{{1 14 | 15 | " 16 | function s:checkKey(key) 17 | if a:key =~ '\n' || a:key !~ '\S' 18 | throw "Asyncer: Invalid key: " . a:key 19 | endif 20 | endfunction 21 | 22 | " 23 | function l9#async#execute(key, cmd, cwd, input, appends) 24 | call s:checkKey(a:key) 25 | python asyncer.execute('a:key', 'a:cmd', 'a:cwd', 'a:input', 'a:appends') 26 | endfunction 27 | 28 | " 29 | function l9#async#read(key) 30 | call s:checkKey(a:key) 31 | redir => result 32 | silent python asyncer.print_output('a:key') 33 | redir END 34 | " NOTE: "\n" is somehow inserted by redir. 35 | return (result[0] ==# "\n" ? result[1:] : result) 36 | endfunction 37 | 38 | " 39 | function l9#async#listWorkers() 40 | redir => result 41 | silent python asyncer.print_worker_keys() 42 | redir END 43 | return split(result, "\n") 44 | endfunction 45 | 46 | " 47 | function l9#async#listActiveWorkers() 48 | redir => result 49 | silent python asyncer.print_active_worker_keys() 50 | redir END 51 | return split(result, "\n") 52 | endfunction 53 | 54 | " }}}1 55 | "============================================================================= 56 | " INITIALIZATION {{{1 57 | 58 | let s:ASYNC_PY_PATH = fnamemodify(expand(':p:h'), ':p') . 'async.py' 59 | 60 | pyfile `=s:ASYNC_PY_PATH` 61 | python asyncer = Asyncer() 62 | 63 | " }}}1 64 | "============================================================================= 65 | " vim: set fdm=marker: 66 | 67 | 68 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/l9/autoload/l9/quickfix.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " Copyright (C) 2009-2010 Takeshi NISHIDA 3 | " 4 | "============================================================================= 5 | " LOAD GUARD {{{1 6 | 7 | if !l9#guardScriptLoading(expand(':p'), 0, 0, []) 8 | finish 9 | endif 10 | 11 | " }}}1 12 | "============================================================================= 13 | " QUICKFIX {{{1 14 | 15 | " Returns non-zero if quickfix window is opened. 16 | function l9#quickfix#isWindowOpened() 17 | return count(map(range(1, winnr('$')), 'getwinvar(v:val, "&buftype")'), 'quickfix') > 0 18 | endfunction 19 | 20 | " Opens quickfix window if quickfix is not empty, and echo the number of errors. 21 | " 22 | " a:onlyRecognized: if non-zero, opens only if quickfix has recognized errors. 23 | " a:holdCursor: if non-zero, the cursor won't move to quickfix window. 24 | function l9#quickfix#openIfNotEmpty(onlyRecognized, holdCursor) 25 | let numErrors = len(filter(getqflist(), 'v:val.valid')) 26 | let numOthers = len(getqflist()) - numErrors 27 | if numErrors > 0 || (!a:onlyRecognized && numOthers > 0) 28 | copen 29 | if a:holdCursor 30 | wincmd p 31 | endif 32 | else 33 | cclose 34 | endif 35 | redraw 36 | if numOthers > 0 37 | echo printf('Quickfix: %d(+%d)', numErrors, numOthers) 38 | else 39 | echo printf('Quickfix: %d', numErrors) 40 | endif 41 | endfunction 42 | 43 | " Toggles Quickfix window 44 | function l9#quickfix#toggleWindow() 45 | if l9#quickfix#isWindowOpened() 46 | cclose 47 | else 48 | call l9#quickfix#openIfNotEmpty(0, 0) 49 | endif 50 | endfunction 51 | 52 | " Creates quickfix list form given lines and opens the quickfix window if 53 | " errors exists. 54 | " 55 | " a:lines: 56 | " a:jump: if non-zero, jump to the first error. 57 | function l9#quickfix#setMakeResult(lines) 58 | cexpr a:lines 59 | call l9#quickfix#openIfNotEmpty(0, 1) 60 | endfunction 61 | 62 | " Compares quickfix entries for sorting. 63 | function l9#quickfix#compareEntries(e0, e1) 64 | if a:e0.bufnr != a:e1.bufnr 65 | let i0 = bufname(a:e0.bufnr) 66 | let i1 = bufname(a:e1.bufnr) 67 | elseif a:e0.lnum != a:e1.lnum 68 | let i0 = a:e0.lnum 69 | let i1 = a:e1.lnum 70 | elseif a:e0.col != a:e1.col 71 | let i0 = a:e0.col 72 | let i1 = a:e1.col 73 | else 74 | return 0 75 | endif 76 | return (i0 > i1 ? +1 : -1) 77 | endfunction 78 | 79 | " Sorts quickfix 80 | function l9#quickfix#sort() 81 | call setqflist(sort(getqflist(), 'l9#quickfix#compareEntries'), 'r') 82 | endfunction 83 | 84 | " Highlights Quickfix lines by :sign. 85 | " Inspired by errormarker plugin. 86 | " 87 | " You can customize the highlighting via L9ErrorLine and L9WarningLine 88 | " highlight groups. 89 | function l9#quickfix#placeSign() 90 | let warnings = [] 91 | let errors = [] 92 | for e in filter(getqflist(), 'v:val.valid') 93 | let warning = (e.type ==? 'w' || e.text =~? '^\s*warning:') 94 | call add((warning ? warnings : errors), [e.bufnr, e.lnum]) 95 | endfor 96 | sign unplace * 97 | call l9#placeSign('L9WarningLine', '>>', '', warnings) 98 | call l9#placeSign('L9ErrorLine', '>>', '', errors) 99 | endfunction 100 | 101 | highlight default L9ErrorLine ctermfg=white ctermbg=52 guibg=#5F0000 102 | highlight default L9WarningLine ctermfg=white ctermbg=17 guibg=#00005F 103 | 104 | " }}}1 105 | "============================================================================= 106 | " vim: set fdm=marker: 107 | 108 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/l9/autoload/l9/tempvariables.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " Copyright (C) 2010 Takeshi NISHIDA 3 | " 4 | "============================================================================= 5 | " LOAD GUARD {{{1 6 | 7 | if !l9#guardScriptLoading(expand(':p'), 0, 0, []) 8 | finish 9 | endif 10 | 11 | " }}}1 12 | "============================================================================= 13 | " TEMPORARY VARIABLES {{{1 14 | 15 | " 16 | let s:origMap = {} 17 | 18 | " set temporary variables 19 | function l9#tempvariables#set(group, name, value) 20 | if !exists('s:origMap[a:group]') 21 | let s:origMap[a:group] = {} 22 | endif 23 | if !exists('s:origMap[a:group][a:name]') 24 | let s:origMap[a:group][a:name] = eval(a:name) 25 | endif 26 | execute 'let ' . a:name . ' = a:value' 27 | endfunction 28 | 29 | " set temporary variables 30 | function l9#tempvariables#setList(group, variables) 31 | for [name, value] in a:variables 32 | call l9#tempvariables#set(a:group, name, value) 33 | unlet value " to avoid E706 34 | endfor 35 | endfunction 36 | 37 | " get temporary variables 38 | function l9#tempvariables#getList(group) 39 | if !exists('s:origMap[a:group]') 40 | return [] 41 | endif 42 | return map(keys(s:origMap[a:group]), '[v:val, eval(v:val)]') 43 | endfunction 44 | 45 | " restore original variables and clean up. 46 | function l9#tempvariables#end(group) 47 | if !exists('s:origMap[a:group]') 48 | return 49 | endif 50 | for [name, value] in items(s:origMap[a:group]) 51 | execute 'let ' . name . ' = value' 52 | unlet value " to avoid E706 53 | endfor 54 | unlet s:origMap[a:group] 55 | endfunction 56 | 57 | " }}}1 58 | "============================================================================= 59 | " vim: set fdm=marker: 60 | 61 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/l9/doc/l9.jax: -------------------------------------------------------------------------------- 1 | *l9.txt* Vimスクリプトライブラリ 2 | 3 | Copyright (c) 2009-2010 Takeshi NISHIDA 4 | 5 | l9 *l9* 6 | 7 | 概要 |l9-introduction| 8 | インストール |l9-installation| 9 | 使い方 |l9-usage| 10 | CHANGELOG |l9-changelog| 11 | あばうと |l9-about| 12 | 13 | ============================================================================== 14 | 概要 *l9-introduction* 15 | 16 | l9はVimスクリプトの関数やコマンドを提供するライブラリです。 17 | 18 | 19 | ============================================================================== 20 | インストール *l9-installation* 21 | 22 | ZIPファイルをランタイムディレクトリに展開します。 23 | 24 | 以下のようにファイルが配置されるはずです。 25 | > 26 | /plugin/l9.vim 27 | /doc/l9.txt 28 | ... 29 | < 30 | もしランタイムディレクトリが多数のプラグインでごちゃごちゃになるのが嫌なら、各 31 | プラグインを個別のディレクトリに配置し、そのディレクトリのパスを 'runtimepath' 32 | に追加してください。アンインストールも楽になります。 33 | 34 | その後、ヘルプを有効にするためにタグファイルを更新してください。詳しくは 35 | |add-local-help|を参照してください。 36 | 37 | ============================================================================== 38 | 使い方 *l9-usage* 39 | 40 | ソースコードを参照してください。 41 | 42 | ============================================================================== 43 | あばうと *l9-about* *l9-contact* *l9-author* 44 | 45 | 作者: Takeshi NISHIDA 46 | ライセンス: MIT Licence 47 | URL: http://www.vim.org/scripts/script.php?script_id=3252 48 | http://bitbucket.org/ns9tks/vim-l9/ 49 | 50 | バグや要望など ~ 51 | 52 | こちらへどうぞ: http://bitbucket.org/ns9tks/vim-l9/issues/ 53 | 54 | ============================================================================== 55 | vim:tw=78:ts=8:ft=help:norl: 56 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/l9/doc/l9.txt: -------------------------------------------------------------------------------- 1 | *l9.txt* Vim-script library 2 | 3 | Copyright (c) 2009-2010 Takeshi NISHIDA 4 | 5 | l9 *l9* 6 | 7 | INTRODUCTION |l9-introduction| 8 | INSTALLATION |l9-installation| 9 | USAGE |l9-usage| 10 | CHANGELOG |l9-changelog| 11 | ABOUT |l9-about| 12 | 13 | ============================================================================== 14 | INTRODUCTION *l9-introduction* 15 | 16 | l9 is a Vim-script library, which provides some utility functions and commands 17 | for programming in Vim. 18 | 19 | ============================================================================== 20 | INSTALLATION *l9-installation* 21 | 22 | Put all files into your runtime directory. If you have the zip file, extract 23 | it to your runtime directory. 24 | 25 | You should place the files as follows: 26 | > 27 | /plugin/l9.vim 28 | /doc/l9.txt 29 | ... 30 | < 31 | If you are disgusted to make your runtime directory confused with a lot of 32 | plugins, put each of the plugins into a directory individually and just add 33 | the directory path to 'runtimepath'. It's easy to uninstall the plugin. 34 | 35 | Then update your help tags files to enable fuzzyfinder help. See 36 | |add-local-help| for details. 37 | 38 | ============================================================================== 39 | USAGE *l9-usage* 40 | 41 | See source code. 42 | 43 | ============================================================================== 44 | CHANGELOG *l9-changelog* 45 | 46 | 1.1: 47 | - Added l9#zip() 48 | - Added l9#tempvariables#getList() 49 | - Changed l9#guardScriptLoading() 50 | - Removed l9#tempvariables#swap() 51 | 52 | 1.0.1: 53 | - Fixed a bug that floating point numbers weren't evaluated correctly and 54 | caused errors on some non-English locales. 55 | 56 | 1.0: 57 | - First release. 58 | 59 | 60 | ============================================================================== 61 | ABOUT *l9-about* *l9-contact* *l9-author* 62 | 63 | Author: Takeshi NISHIDA 64 | Licence: MIT Licence 65 | URL: http://www.vim.org/scripts/script.php?script_id=3252 66 | http://bitbucket.org/ns9tks/vim-l9/ 67 | 68 | Bugs/Issues/Suggestions/Improvements ~ 69 | 70 | Please submit to http://bitbucket.org/ns9tks/vim-l9/issues/ . 71 | 72 | ============================================================================== 73 | vim:tw=78:ts=8:ft=help:norl: 74 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/l9/plugin/l9.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " Copyright (C) 2009-2010 Takeshi NISHIDA 3 | " 4 | " GetLatestVimScripts: 3252 1 :AutoInstall: L9 5 | "============================================================================= 6 | " LOAD GUARD {{{1 7 | 8 | if !l9#guardScriptLoading(expand(':p'), 702, 0, []) 9 | finish 10 | endif 11 | 12 | " }}}1 13 | "============================================================================= 14 | " OPTIONS: {{{1 15 | 16 | call l9#defineVariableDefault('g:l9_balloonly', 'balloonly.exe') 17 | 18 | " }}}1 19 | "============================================================================= 20 | " ASSERTION: {{{1 21 | 22 | " This command has effect only if $L9_DEBUG is non-zero. 23 | " Used as follows: 24 | " L9Assert a:i > 0 25 | " This command can't interpret script-local variables directly. 26 | " NG: L9Assert s:a == 1 27 | " OK: execute 'L9Assert ' . s:a . ' == 1' 28 | " 29 | if $L9_DEBUG 30 | command -nargs=* L9Assert call eval(() ? 0 : s:handleFailedAssersion()) 31 | 32 | function s:handleFailedAssersion(expr) 33 | echoerr '[L9Assert] Assersion failure: ' . a:expr 34 | if input('[L9Assert] Continue? (Y/N) ', 'Y') !=? 'Y' 35 | throw 'L9Assert ' . a:expr 36 | endif 37 | endfunction 38 | 39 | else 40 | command -nargs=* L9Assert : 41 | endif 42 | 43 | " }}}1 44 | "============================================================================= 45 | " TIMER: {{{1 46 | 47 | " These commands have effect only if $L9_TIMER is non-zero. 48 | " Used as follows: 49 | " L9Timer foo 50 | " ... (1) 51 | " L9Timer bar 52 | " ... (2) 53 | " L9TimerStop 54 | " ... 55 | " L9TimerDump <- shows each elapsed time of (1) and (2) 56 | " 57 | if $L9_TIMER 58 | command -nargs=1 L9Timer call s:timerBegin() 59 | command -nargs=0 L9TimerStop call s:timerStop() 60 | command -nargs=0 L9TimerDump call s:timerDump() 61 | 62 | let s:timerData = [] 63 | let s:timerTagMaxLen = 0 64 | 65 | function s:timerBegin(tag) 66 | L9TimerStop 67 | let s:timerCurrent = {'tag': strftime('%c ') . a:tag . ' ', 'time': reltime()} 68 | let s:timerTagMaxLen = max([len(s:timerCurrent.tag), s:timerTagMaxLen]) 69 | endfunction 70 | 71 | function s:timerStop() 72 | if !exists('s:timerCurrent') 73 | return 74 | endif 75 | let s:timerCurrent.time = reltimestr(reltime(s:timerCurrent.time)) 76 | call add(s:timerData, s:timerCurrent) 77 | unlet s:timerCurrent 78 | endfunction 79 | 80 | function s:timerDump() 81 | L9TimerStop 82 | let lines = map(s:timerData, 'v:val.tag . repeat(" ", s:timerTagMaxLen - len(v:val.tag)) . v:val.time') 83 | call l9#tempbuffer#openReadOnly('[l9-timer]', '', lines, 0, 0, 0, {}) 84 | let s:timerData = [] 85 | let s:timerTagMaxLen = 0 86 | endfunction 87 | 88 | else 89 | command -nargs=1 L9Timer : 90 | command -nargs=0 L9TimerStop : 91 | command -nargs=0 L9TimerDump : 92 | endif 93 | 94 | " }}}1 95 | "============================================================================= 96 | " GREP BUFFER: {{{1 97 | 98 | " Grep for current buffer by l9#grepBuffers() 99 | " Used as :L9GrepBuffer/pattern 100 | command -nargs=? L9GrepBuffer call l9#grepBuffers(, [bufnr('%')]) 101 | 102 | " Grep for all buffers by l9#grepBuffers() 103 | " Used as :L9GrepBufferAll/pattern 104 | command -nargs=? L9GrepBufferAll call l9#grepBuffers(, range(1, bufnr('$'))) 105 | 106 | " }}}1 107 | "============================================================================= 108 | " vim: set fdm=marker: 109 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/nerdtree/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | tags 4 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/nerdtree/lib/nerdtree/menu_item.vim: -------------------------------------------------------------------------------- 1 | "CLASS: MenuItem 2 | "============================================================ 3 | let s:MenuItem = {} 4 | let g:NERDTreeMenuItem = s:MenuItem 5 | 6 | "FUNCTION: MenuItem.All() {{{1 7 | "get all top level menu items 8 | function! s:MenuItem.All() 9 | if !exists("s:menuItems") 10 | let s:menuItems = [] 11 | endif 12 | return s:menuItems 13 | endfunction 14 | 15 | "FUNCTION: MenuItem.AllEnabled() {{{1 16 | "get all top level menu items that are currently enabled 17 | function! s:MenuItem.AllEnabled() 18 | let toReturn = [] 19 | for i in s:MenuItem.All() 20 | if i.enabled() 21 | call add(toReturn, i) 22 | endif 23 | endfor 24 | return toReturn 25 | endfunction 26 | 27 | "FUNCTION: MenuItem.Create(options) {{{1 28 | "make a new menu item and add it to the global list 29 | function! s:MenuItem.Create(options) 30 | let newMenuItem = copy(self) 31 | 32 | let newMenuItem.text = a:options['text'] 33 | let newMenuItem.shortcut = a:options['shortcut'] 34 | let newMenuItem.children = [] 35 | 36 | let newMenuItem.isActiveCallback = -1 37 | if has_key(a:options, 'isActiveCallback') 38 | let newMenuItem.isActiveCallback = a:options['isActiveCallback'] 39 | endif 40 | 41 | let newMenuItem.callback = -1 42 | if has_key(a:options, 'callback') 43 | let newMenuItem.callback = a:options['callback'] 44 | endif 45 | 46 | if has_key(a:options, 'parent') 47 | call add(a:options['parent'].children, newMenuItem) 48 | else 49 | call add(s:MenuItem.All(), newMenuItem) 50 | endif 51 | 52 | return newMenuItem 53 | endfunction 54 | 55 | "FUNCTION: MenuItem.CreateSeparator(options) {{{1 56 | "make a new separator menu item and add it to the global list 57 | function! s:MenuItem.CreateSeparator(options) 58 | let standard_options = { 'text': '--------------------', 59 | \ 'shortcut': -1, 60 | \ 'callback': -1 } 61 | let options = extend(a:options, standard_options, "force") 62 | 63 | return s:MenuItem.Create(options) 64 | endfunction 65 | 66 | "FUNCTION: MenuItem.CreateSubmenu(options) {{{1 67 | "make a new submenu and add it to global list 68 | function! s:MenuItem.CreateSubmenu(options) 69 | let standard_options = { 'callback': -1 } 70 | let options = extend(a:options, standard_options, "force") 71 | 72 | return s:MenuItem.Create(options) 73 | endfunction 74 | 75 | "FUNCTION: MenuItem.enabled() {{{1 76 | "return 1 if this menu item should be displayed 77 | " 78 | "delegates off to the isActiveCallback, and defaults to 1 if no callback was 79 | "specified 80 | function! s:MenuItem.enabled() 81 | if self.isActiveCallback != -1 82 | return {self.isActiveCallback}() 83 | endif 84 | return 1 85 | endfunction 86 | 87 | "FUNCTION: MenuItem.execute() {{{1 88 | "perform the action behind this menu item, if this menuitem has children then 89 | "display a new menu for them, otherwise deletegate off to the menuitem's 90 | "callback 91 | function! s:MenuItem.execute() 92 | if len(self.children) 93 | let mc = s:MenuController.New(self.children) 94 | call mc.showMenu() 95 | else 96 | if self.callback != -1 97 | call {self.callback}() 98 | endif 99 | endif 100 | endfunction 101 | 102 | "FUNCTION: MenuItem.isSeparator() {{{1 103 | "return 1 if this menuitem is a separator 104 | function! s:MenuItem.isSeparator() 105 | return self.callback == -1 && self.children == [] 106 | endfunction 107 | 108 | "FUNCTION: MenuItem.isSubmenu() {{{1 109 | "return 1 if this menuitem is a submenu 110 | function! s:MenuItem.isSubmenu() 111 | return self.callback == -1 && !empty(self.children) 112 | endfunction 113 | 114 | " vim: set sw=4 sts=4 et fdm=marker: 115 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/nerdtree/nerdtree_plugin/exec_menuitem.vim: -------------------------------------------------------------------------------- 1 | " ============================================================================ 2 | " File: exec_menuitem.vim 3 | " Description: plugin for NERD Tree that provides an execute file menu item 4 | " Maintainer: Martin Grenfell 5 | " Last Change: 22 July, 2009 6 | " License: This program is free software. It comes without any warranty, 7 | " to the extent permitted by applicable law. You can redistribute 8 | " it and/or modify it under the terms of the Do What The Fuck You 9 | " Want To Public License, Version 2, as published by Sam Hocevar. 10 | " See http://sam.zoy.org/wtfpl/COPYING for more details. 11 | " 12 | " ============================================================================ 13 | if exists("g:loaded_nerdtree_exec_menuitem") 14 | finish 15 | endif 16 | let g:loaded_nerdtree_exec_menuitem = 1 17 | 18 | call NERDTreeAddMenuItem({ 19 | \ 'text': '(!)Execute file', 20 | \ 'shortcut': '!', 21 | \ 'callback': 'NERDTreeExecFile', 22 | \ 'isActiveCallback': 'NERDTreeExecFileActive' }) 23 | 24 | function! NERDTreeExecFileActive() 25 | let node = g:NERDTreeFileNode.GetSelected() 26 | return !node.path.isDirectory && node.path.isExecutable 27 | endfunction 28 | 29 | function! NERDTreeExecFile() 30 | let treenode = g:NERDTreeFileNode.GetSelected() 31 | echo "==========================================================\n" 32 | echo "Complete the command to execute (add arguments etc):\n" 33 | let cmd = treenode.path.str({'escape': 1}) 34 | let cmd = input(':!', cmd . ' ') 35 | 36 | if cmd != '' 37 | exec ':!' . cmd 38 | else 39 | echo "Aborted" 40 | endif 41 | endfunction 42 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/nerdtree/syntax/nerdtree.vim: -------------------------------------------------------------------------------- 1 | let s:tree_up_dir_line = '.. (up a dir)' 2 | "NERDTreeFlags are syntax items that should be invisible, but give clues as to 3 | "how things should be highlighted 4 | syn match NERDTreeFlag #\~# 5 | syn match NERDTreeFlag #\[RO\]# 6 | 7 | "highlighting for the .. (up dir) line at the top of the tree 8 | execute "syn match NERDTreeUp #\\V". s:tree_up_dir_line ."#" 9 | 10 | "highlighting for the ~/+ symbols for the directory nodes 11 | syn match NERDTreeClosable #\~\<# 12 | syn match NERDTreeClosable #\~\.# 13 | syn match NERDTreeOpenable #+\<# 14 | syn match NERDTreeOpenable #+\.#he=e-1 15 | 16 | "highlighting for the tree structural parts 17 | syn match NERDTreePart #|# 18 | syn match NERDTreePart #`# 19 | syn match NERDTreePartFile #[|`]-#hs=s+1 contains=NERDTreePart 20 | 21 | "quickhelp syntax elements 22 | syn match NERDTreeHelpKey #" \{1,2\}[^ ]*:#hs=s+2,he=e-1 23 | syn match NERDTreeHelpKey #" \{1,2\}[^ ]*,#hs=s+2,he=e-1 24 | syn match NERDTreeHelpTitle #" .*\~#hs=s+2,he=e-1 contains=NERDTreeFlag 25 | syn match NERDTreeToggleOn #".*(on)#hs=e-2,he=e-1 contains=NERDTreeHelpKey 26 | syn match NERDTreeToggleOff #".*(off)#hs=e-3,he=e-1 contains=NERDTreeHelpKey 27 | syn match NERDTreeHelpCommand #" :.\{-}\>#hs=s+3 28 | syn match NERDTreeHelp #^".*# contains=NERDTreeHelpKey,NERDTreeHelpTitle,NERDTreeFlag,NERDTreeToggleOff,NERDTreeToggleOn,NERDTreeHelpCommand 29 | 30 | "highlighting for readonly files 31 | syn match NERDTreeRO #.*\[RO\]#hs=s+2 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile 32 | 33 | "highlighting for sym links 34 | syn match NERDTreeLink #[^-| `].* -> # contains=NERDTreeBookmark,NERDTreeOpenable,NERDTreeClosable,NERDTreeDirSlash 35 | 36 | "highlighing for directory nodes and file nodes 37 | syn match NERDTreeDirSlash #/# 38 | syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeLink,NERDTreeDirSlash,NERDTreeOpenable,NERDTreeClosable 39 | syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark 40 | syn match NERDTreeFile #|-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile 41 | syn match NERDTreeFile #`-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile 42 | syn match NERDTreeCWD #^[# 49 | syn match NERDTreeBookmarksHeader #^>-\+Bookmarks-\+$# contains=NERDTreeBookmarksLeader 50 | syn match NERDTreeBookmarkName #^>.\{-} #he=e-1 contains=NERDTreeBookmarksLeader 51 | syn match NERDTreeBookmark #^>.*$# contains=NERDTreeBookmarksLeader,NERDTreeBookmarkName,NERDTreeBookmarksHeader 52 | 53 | if exists("g:NERDChristmasTree") && g:NERDChristmasTree 54 | hi def link NERDTreePart Special 55 | hi def link NERDTreePartFile Type 56 | hi def link NERDTreeFile Normal 57 | hi def link NERDTreeExecFile Title 58 | hi def link NERDTreeDirSlash Identifier 59 | hi def link NERDTreeClosable Type 60 | else 61 | hi def link NERDTreePart Normal 62 | hi def link NERDTreePartFile Normal 63 | hi def link NERDTreeFile Normal 64 | hi def link NERDTreeClosable Title 65 | endif 66 | 67 | hi def link NERDTreeBookmarksHeader statement 68 | hi def link NERDTreeBookmarksLeader ignore 69 | hi def link NERDTreeBookmarkName Identifier 70 | hi def link NERDTreeBookmark normal 71 | 72 | hi def link NERDTreeHelp String 73 | hi def link NERDTreeHelpKey Identifier 74 | hi def link NERDTreeHelpCommand Identifier 75 | hi def link NERDTreeHelpTitle Macro 76 | hi def link NERDTreeToggleOn Question 77 | hi def link NERDTreeToggleOff WarningMsg 78 | 79 | hi def link NERDTreeDir Directory 80 | hi def link NERDTreeUp Directory 81 | hi def link NERDTreeCWD Statement 82 | hi def link NERDTreeLink Macro 83 | hi def link NERDTreeOpenable Title 84 | hi def link NERDTreeFlag ignore 85 | hi def link NERDTreeRO WarningMsg 86 | hi def link NERDTreeBookmark Statement 87 | 88 | hi def link NERDTreeCurrentNode Search 89 | -------------------------------------------------------------------------------- /dotfiles/.vim/bundle/vim-colors-solarized/autoload/togglebg.vim: -------------------------------------------------------------------------------- 1 | " Toggle Background 2 | " Modified: 2011 Apr 29 3 | " Maintainer: Ethan Schoonover 4 | " License: OSI approved MIT license 5 | 6 | if exists("g:loaded_togglebg") 7 | finish 8 | endif 9 | let g:loaded_togglebg = 1 10 | 11 | " noremap is a bit misleading here if you are unused to vim mapping. 12 | " in fact, there is remapping, but only of script locally defined remaps, in 13 | " this case TogBG. The 105 | 106 | 107 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /reveal.js/plugin/notes/notes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Handles opening of and synchronization with the reveal.js 3 | * notes window. 4 | */ 5 | var RevealNotes = (function() { 6 | 7 | function openNotes() { 8 | var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path 9 | jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path 10 | var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1120,height=850' ); 11 | 12 | // Fires when slide is changed 13 | Reveal.addEventListener( 'slidechanged', post ); 14 | 15 | // Fires when a fragment is shown 16 | Reveal.addEventListener( 'fragmentshown', post ); 17 | 18 | // Fires when a fragment is hidden 19 | Reveal.addEventListener( 'fragmenthidden', post ); 20 | 21 | /** 22 | * Posts the current slide data to the notes window 23 | */ 24 | function post() { 25 | var slideElement = Reveal.getCurrentSlide(), 26 | slideIndices = Reveal.getIndices(), 27 | messageData; 28 | 29 | var notes = slideElement.querySelector( 'aside.notes' ), 30 | nextindexh, 31 | nextindexv; 32 | 33 | if( slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION' ) { 34 | nextindexh = slideIndices.h; 35 | nextindexv = slideIndices.v + 1; 36 | } else { 37 | nextindexh = slideIndices.h + 1; 38 | nextindexv = 0; 39 | } 40 | 41 | messageData = { 42 | notes : notes ? notes.innerHTML : '', 43 | indexh : slideIndices.h, 44 | indexv : slideIndices.v, 45 | indexf : slideIndices.f, 46 | nextindexh : nextindexh, 47 | nextindexv : nextindexv, 48 | markdown : notes ? typeof notes.getAttribute( 'data-markdown' ) === 'string' : false 49 | }; 50 | 51 | notesPopup.postMessage( JSON.stringify( messageData ), '*' ); 52 | } 53 | 54 | // Navigate to the current slide when the notes are loaded 55 | notesPopup.addEventListener( 'load', function( event ) { 56 | post(); 57 | }, false ); 58 | } 59 | 60 | // If the there's a 'notes' query set, open directly 61 | if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) { 62 | openNotes(); 63 | } 64 | 65 | // Open the notes when the 's' key is hit 66 | document.addEventListener( 'keydown', function( event ) { 67 | // Disregard the event if the target is editable or a 68 | // modifier is present 69 | if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return; 70 | 71 | if( event.keyCode === 83 ) { 72 | event.preventDefault(); 73 | openNotes(); 74 | } 75 | }, false ); 76 | 77 | return { open: openNotes }; 78 | })(); 79 | -------------------------------------------------------------------------------- /reveal.js/plugin/postmessage/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 |
11 | 12 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /reveal.js/plugin/postmessage/postmessage.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | simple postmessage plugin 4 | 5 | Useful when a reveal slideshow is inside an iframe. 6 | It allows to call reveal methods from outside. 7 | 8 | Example: 9 | var reveal = window.frames[0]; 10 | 11 | // Reveal.prev(); 12 | reveal.postMessage(JSON.stringify({method: 'prev', args: []}), '*'); 13 | // Reveal.next(); 14 | reveal.postMessage(JSON.stringify({method: 'next', args: []}), '*'); 15 | // Reveal.slide(2, 2); 16 | reveal.postMessage(JSON.stringify({method: 'slide', args: [2,2]}), '*'); 17 | 18 | Add to the slideshow: 19 | 20 | dependencies: [ 21 | ... 22 | { src: 'plugin/postmessage/postmessage.js', async: true, condition: function() { return !!document.body.classList; } } 23 | ] 24 | 25 | */ 26 | 27 | (function (){ 28 | 29 | window.addEventListener( "message", function ( event ) { 30 | var data = JSON.parse( event.data ), 31 | method = data.method, 32 | args = data.args; 33 | 34 | if( typeof Reveal[method] === 'function' ) { 35 | Reveal[method].apply( Reveal, data.args ); 36 | } 37 | }, false); 38 | 39 | }()); 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /reveal.js/plugin/print-pdf/print-pdf.js: -------------------------------------------------------------------------------- 1 | /** 2 | * phantomjs script for printing presentations to PDF. 3 | * 4 | * Example: 5 | * phantomjs print-pdf.js "http://lab.hakim.se/reveal-js?print-pdf" reveal-demo.pdf 6 | * 7 | * By Manuel Bieh (https://github.com/manuelbieh) 8 | */ 9 | 10 | // html2pdf.js 11 | var page = new WebPage(); 12 | var system = require( 'system' ); 13 | 14 | page.viewportSize = { 15 | width: 1024, 16 | height: 768 17 | }; 18 | 19 | page.paperSize = { 20 | format: 'letter', 21 | orientation: 'landscape', 22 | margin: { 23 | left: '0', 24 | right: '0', 25 | top: '0', 26 | bottom: '0' 27 | } 28 | }; 29 | 30 | var revealFile = system.args[1] || 'index.html?print-pdf'; 31 | var slideFile = system.args[2] || 'slides.pdf'; 32 | 33 | if( slideFile.match( /\.pdf$/gi ) === null ) { 34 | slideFile += '.pdf'; 35 | } 36 | 37 | console.log( 'Printing PDF...' ); 38 | 39 | page.open( revealFile, function( status ) { 40 | console.log( 'Printed succesfully' ); 41 | page.render( slideFile ); 42 | phantom.exit(); 43 | } ); 44 | 45 | -------------------------------------------------------------------------------- /reveal.js/plugin/remotes/remotes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Touch-based remote controller for your presentation courtesy 3 | * of the folks at http://remotes.io 4 | */ 5 | 6 | (function(window){ 7 | 8 | /** 9 | * Detects if we are dealing with a touch enabled device (with some false positives) 10 | * Borrowed from modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touch.js 11 | */ 12 | var hasTouch = (function(){ 13 | return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; 14 | })(); 15 | 16 | /** 17 | * Detects if notes are enable and the current page is opened inside an /iframe 18 | * this prevents loading Remotes.io several times 19 | */ 20 | var isNotesAndIframe = (function(){ 21 | return window.RevealNotes && !(self == top); 22 | })(); 23 | 24 | if(!hasTouch && !isNotesAndIframe){ 25 | head.ready( 'remotes.ne.min.js', function() { 26 | new Remotes("preview") 27 | .on("swipe-left", function(e){ Reveal.right(); }) 28 | .on("swipe-right", function(e){ Reveal.left(); }) 29 | .on("swipe-up", function(e){ Reveal.down(); }) 30 | .on("swipe-down", function(e){ Reveal.up(); }) 31 | .on("tap", function(e){ Reveal.next(); }) 32 | .on("zoom-out", function(e){ Reveal.toggleOverview(true); }) 33 | .on("zoom-in", function(e){ Reveal.toggleOverview(false); }) 34 | ; 35 | } ); 36 | 37 | head.js('https://hakim-static.s3.amazonaws.com/reveal-js/remotes.ne.min.js'); 38 | } 39 | })(window); -------------------------------------------------------------------------------- /reveal.js/test/examples/assets/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emmanuelbernard/command-line-nuts/afc6b21255da0e7f27ae9394cee7e305d694f6aa/reveal.js/test/examples/assets/image1.png -------------------------------------------------------------------------------- /reveal.js/test/examples/assets/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emmanuelbernard/command-line-nuts/afc6b21255da0e7f27ae9394cee7e305d694f6aa/reveal.js/test/examples/assets/image2.png -------------------------------------------------------------------------------- /reveal.js/test/examples/barebones.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Barebones 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 | 18 |
19 |

Barebones Presentation

20 |

This example contains the bare minimum includes and markup required to run a reveal.js presentation.

21 |
22 | 23 |
24 |

No Theme

25 |

There's no theme included, so it will fall back on browser defaults.

26 |
27 | 28 |
29 | 30 |
31 | 32 | 33 | 34 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /reveal.js/test/examples/embedded-media.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Embedded Media 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 |
22 |

Embedded Media Test

23 |
24 | 25 |
26 | 27 |
28 | 29 |
30 |

Empty Slide

31 |
32 | 33 |
34 | 35 |
36 | 37 | 38 | 39 | 40 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /reveal.js/test/examples/slide-backgrounds.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Slide Backgrounds 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 |
22 |

data-background: #00ffff

23 |
24 | 25 |
26 |

data-background: #bb00bb

27 |
28 | 29 |
30 |
31 |

data-background: #ff0000

32 |
33 |
34 |

data-background: rgba(0, 0, 0, 0.2)

35 |
36 |
37 |

data-background: salmon

38 |
39 |
40 | 41 |
42 |
43 |

Background applied to stack

44 |
45 |
46 |

Background applied to stack

47 |
48 |
49 |

Background applied to slide inside of stack

50 |
51 |
52 | 53 |
54 |

Background image

55 |
56 | 57 |
58 |
59 |

Background image

60 |
61 |
62 |

Background image

63 |
64 |
65 | 66 |
67 |

Background image

68 |
data-background-size="100px" data-background-repeat="repeat" data-background-color="#111"
69 |
70 | 71 |
72 |

Same background twice (1/2)

73 |
74 |
75 |

Same background twice (2/2)

76 |
77 | 78 |
79 |
80 |

Same background twice vertical (1/2)

81 |
82 |
83 |

Same background twice vertical (2/2)

84 |
85 |
86 | 87 |
88 |

Same background from horizontal to vertical (1/3)

89 |
90 |
91 |
92 |

Same background from horizontal to vertical (2/3)

93 |
94 |
95 |

Same background from horizontal to vertical (3/3)

96 |
97 |
98 | 99 |
100 | 101 |
102 | 103 | 104 | 105 | 106 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /reveal.js/test/test-markdown-element-attributes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test Markdown Element Attributes 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /reveal.js/test/test-markdown-element-attributes.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | Reveal.addEventListener( 'ready', function() { 4 | 5 | QUnit.module( 'Markdown' ); 6 | 7 | test( 'Vertical separator', function() { 8 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 4, 'found four slides' ); 9 | }); 10 | 11 | 12 | test( 'Attributes on element header in vertical slides', function() { 13 | strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.fade-out' ).length, 1, 'found one vertical slide with class fragment.fade-out on header' ); 14 | strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.shrink' ).length, 1, 'found one vertical slide with class fragment.shrink on header' ); 15 | }); 16 | 17 | test( 'Attributes on element paragraphs in vertical slides', function() { 18 | strictEqual( document.querySelectorAll( '.reveal .slides section>section p.fragment.grow' ).length, 2, 'found a vertical slide with two paragraphs with class fragment.grow' ); 19 | }); 20 | 21 | test( 'Attributes on element list items in vertical slides', function() { 22 | strictEqual( document.querySelectorAll( '.reveal .slides section>section li.fragment.roll-in' ).length, 3, 'found a vertical slide with three list items with class fragment.roll-in' ); 23 | }); 24 | 25 | test( 'Attributes on element paragraphs in horizontal slides', function() { 26 | strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-red' ).length, 4, 'found a horizontal slide with four paragraphs with class fragment.grow' ); 27 | }); 28 | test( 'Attributes on element list items in horizontal slides', function() { 29 | strictEqual( document.querySelectorAll( '.reveal .slides section li.fragment.highlight-green' ).length, 5, 'found a horizontal slide with five list items with class fragment.roll-in' ); 30 | }); 31 | test( 'Attributes on element list items in horizontal slides', function() { 32 | strictEqual( document.querySelectorAll( '.reveal .slides section img.reveal.stretch' ).length, 1, 'found a horizontal slide with stretched image, class img.reveal.stretch' ); 33 | }); 34 | 35 | test( 'Attributes on elements in vertical slides with default element attribute separator', function() { 36 | strictEqual( document.querySelectorAll( '.reveal .slides section h2.fragment.highlight-red' ).length, 2, 'found two h2 titles with fragment highlight-red in vertical slides with default element attribute separator' ); 37 | }); 38 | 39 | test( 'Attributes on elements in single slides with default element attribute separator', function() { 40 | strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-blue' ).length, 3, 'found three elements with fragment highlight-blue in single slide with default element attribute separator' ); 41 | }); 42 | 43 | } ); 44 | 45 | Reveal.initialize(); 46 | 47 | -------------------------------------------------------------------------------- /reveal.js/test/test-markdown-slide-attributes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test Markdown Attributes 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /reveal.js/test/test-markdown-slide-attributes.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | Reveal.addEventListener( 'ready', function() { 4 | 5 | QUnit.module( 'Markdown' ); 6 | 7 | test( 'Vertical separator', function() { 8 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 6, 'found six vertical slides' ); 9 | }); 10 | 11 | test( 'Id on slide', function() { 12 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section#slide2' ).length, 1, 'found one slide with id slide2' ); 13 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section a[href="#/slide2"]' ).length, 1, 'found one slide with a link to slide2' ); 14 | }); 15 | 16 | test( 'data-background attributes', function() { 17 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A0C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' ); 18 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#ff0000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' ); 19 | strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C6916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' ); 20 | }); 21 | 22 | test( 'data-transition attributes', function() { 23 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="zoom"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' ); 24 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="fade"]' ).length, 1, 'found one vertical slide with data-transition="fade"' ); 25 | strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="zoom"]' ).length, 1, 'found one slide with data-transition="zoom"' ); 26 | }); 27 | 28 | test( 'data-background attributes with default separator', function() { 29 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A7C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' ); 30 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#f70000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' ); 31 | strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C7916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' ); 32 | }); 33 | 34 | test( 'data-transition attributes with default separator', function() { 35 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="concave"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' ); 36 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="page"]' ).length, 1, 'found one vertical slide with data-transition="fade"' ); 37 | strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="concave"]' ).length, 1, 'found one slide with data-transition="zoom"' ); 38 | }); 39 | 40 | test( 'data-transition attributes with inline content', function() { 41 | strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#ff0000"]' ).length, 3, 'found three horizontal slides with data-background="#ff0000"' ); 42 | }); 43 | 44 | } ); 45 | 46 | Reveal.initialize(); 47 | 48 | -------------------------------------------------------------------------------- /reveal.js/test/test-markdown.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test Markdown 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /reveal.js/test/test-markdown.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | Reveal.addEventListener( 'ready', function() { 4 | 5 | QUnit.module( 'Markdown' ); 6 | 7 | test( 'Vertical separator', function() { 8 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' ); 9 | }); 10 | 11 | 12 | } ); 13 | 14 | Reveal.initialize(); 15 | 16 | -------------------------------------------------------------------------------- /reveal.js/test/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Tests 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /scripts/crypt: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Encrypt files with aes-256-cbc cipher using openssl 3 | # From http://superuser.com/questions/370388/simple-built-in-way-to-encrypt-and-decrypt-a-file-on-a-mac-via-command-line 4 | 5 | #crypt files 6 | if [[ $1 == "-e" ]]; 7 | then 8 | if [[ -f "$2" ]]; 9 | then 10 | openssl aes-256-cbc -a -e -salt -in "$2" -out "$2.crypt" 11 | else 12 | echo "This file does not exist!" 13 | fi 14 | #decrypt files 15 | elif [[ $1 == "-d" ]]; 16 | then 17 | if [[ -f "$2" ]]; 18 | then 19 | openssl aes-256-cbc -a -d -salt -in "$2" -out "$2.decrypt" 20 | else 21 | echo "This file does not exist!" 22 | fi 23 | #show help 24 | elif [[ $1 == "--help" ]]; 25 | then 26 | echo "This software uses openssl for encrypting files with the aes-256-cbc cipher" 27 | echo "Usage for encrypting: ./crypt -e [file]" 28 | echo "Usage for decrypting: ./crypt -d [file]" 29 | else 30 | echo "This action does not exist!" 31 | echo "Use ./crypt --help to show help." 32 | fi 33 | -------------------------------------------------------------------------------- /scripts/git-clean-merged-branches: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script to loop on local and remote branches, to delete all those which are 3 | # already merged in master. 4 | # Assumes "$USER" as your remote repository and "master" as your main branch. 5 | # Careful if you use branches as tags! 6 | # 7 | # Inspired from http://devblog.springest.com/a-script-to-remove-old-git-branches 8 | # Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/ 9 | # Copyright (c) 2012 Sanne Grinovero 10 | # Copyright (c) 2012 Emmanuel Bernard - made remote repo parameterized 11 | 12 | if [[ $# -eq 0 ]]; then 13 | own_remote=$USER 14 | elif [[ $# -eq 1 ]]; then 15 | own_remote="$1" 16 | else 17 | echo "Error: only accept one parameter - the remote name to consider" 18 | exit 1; 19 | fi 20 | 21 | # Prune stale references to remote, and fetch information on new branches: 22 | git fetch $own_remote --prune 23 | 24 | # Delete local branches which are merged in master 25 | git branch --merged master | grep -v 'master$' | xargs git branch -d 26 | 27 | # Remove remote fully merged branches 28 | git branch -r --merged master | grep "$own_remote/" | grep -v "$own_remote/master" | sed -e "s/\s*$own_remote\///" | xargs -I% git push $own_remote :% 29 | -------------------------------------------------------------------------------- /scripts/git-force-clean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/ 4 | # 5 | # Copyright (c) 2012 Emmanuel Bernard 6 | LENGTH=`expr ${#USER} + 1 + 3` 7 | 8 | git branch -r | \ 9 | grep "$USER" | \ 10 | grep -v "master" | \ 11 | awk -v l=$LENGTH -v u=$USER '{print "git push " u " :" substr($0,l)}' > git-clean-remote.out 12 | 13 | source git-clean-remote.out 14 | rm git-clean-remote.out -------------------------------------------------------------------------------- /scripts/git-merge-to: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/ 4 | # 5 | # Copyright (c) 2012 Emmanuel Bernard 6 | 7 | #not the right amount of params => help 8 | BRANCH=`git branch | grep "*" | awk '{print $NF}'` 9 | 10 | if [[ $# -eq 0 ]]; then 11 | TARGET="master" 12 | elif [[ $# -eq 1 ]]; then 13 | TARGET="$1" 14 | else 15 | echo "apply-to-master [target branch]" 16 | exit 1; 17 | fi 18 | 19 | echo "Merging $BRANCH in $TARGET" 20 | 21 | # if the branch exists ask before erasing it 22 | git branch --merged | grep -q $TARGET 23 | if [[ $? -ne 0 ]]; then 24 | echo "$TARGET cannot be fast forwarded to $BRANCH" 25 | exit 2; 26 | fi 27 | 28 | jira 29 | 30 | git checkout $TARGET 31 | git merge $BRANCH 32 | 33 | read -p "Erase local branch $BRANCH? " yn 34 | case $yn in 35 | [Nn]* ) exit 0;; 36 | [Yy]* ) git branch -D $BRANCH;; 37 | * ) echo "Please answer yes or no.";; 38 | esac 39 | -------------------------------------------------------------------------------- /scripts/git-send-pull-request: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/ 4 | # 5 | # Copyright (c) 2012 Sanne Grinovero 6 | 7 | # Open a pull request pushing branch to the repo $USER and opening the pull request page 8 | # 9 | 10 | function parse_git_branch { 11 | git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/" 12 | } 13 | 14 | function git_project_id { 15 | git remote --verbose 2>/dev/null | grep $USER | sed -e "s/$USER\(.*\)git@github.com:\(.*\)\.git.*/\2/" | uniq -d 16 | } 17 | 18 | BRANCH=$(parse_git_branch) 19 | PROJ=$(git_project_id) 20 | echo " project id: $PROJ" 21 | URL=https://github.com/$PROJ/compare/$BRANCH?expand=1 22 | echo Prepare pull request $BRANCH to $URL 23 | git push $USER $BRANCH 24 | open $URL 25 | -------------------------------------------------------------------------------- /scripts/git-upsert: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/ 4 | # 5 | # Copyright (c) 2012 Emmanuel Bernard 6 | 7 | #not the right amount of params => help 8 | if [[ $# -ne 2 ]]; then 9 | echo "Create or update localbranch based on remote branch" 10 | echo -e "\tgit upsert remote branch" 11 | echo -e "\tgit upsert remote local:remote" 12 | exit 0; 13 | fi 14 | 15 | PARAM2="$2" 16 | BRANCHES=(${PARAM2//:/ }) 17 | 18 | if [[ ${#BRANCHES[@]} -eq 1 ]]; then 19 | LOCAL=${BRANCHES[0]} 20 | REMOTE=${BRANCHES[0]} 21 | elif [[ ${#BRANCHES[@]} -eq 2 ]]; then 22 | LOCAL=${BRANCHES[0]} 23 | REMOTE=${BRANCHES[1]} 24 | fi 25 | 26 | REPO=$1 27 | 28 | echo "Creating branch $LOCAL from $REPO/$REMOTE" 29 | 30 | # if the branch exists ask before erasing it 31 | git branch | grep -q $LOCAL 32 | if [[ $? -eq 0 ]]; then 33 | read -p "Branch $LOCAL already exists, do you want to erase it? " yn 34 | case $yn in 35 | [Nn]* ) exit 0;; 36 | [Yy]* ) git checkout -b tempbranchfor$LOCAL; git branch -D $LOCAL;; 37 | * ) echo "Please answer yes or no.";; 38 | esac 39 | fi 40 | 41 | # fetch and verify the branch exists in the remote 42 | git fetch $REPO 43 | git branch -a | grep -q $REPO/$REMOTE 44 | if [[ $? -ne 0 ]]; then 45 | echo "Cannot find branch $REPO/$REMOTE" 46 | exit 1; 47 | fi 48 | 49 | # create local branch 50 | git checkout -b $LOCAL $REPO/$REMOTE 51 | 52 | # if temp branch created, erase it 53 | git branch -a | grep -q tempbranchfor$LOCAL 54 | if [[ $? -eq 0 ]]; then 55 | git branch -D tempbranchfor$LOCAL 56 | fi -------------------------------------------------------------------------------- /scripts/jira: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script will look into the GIT commit log of the current directory, backwards since the branch 3 | # from master, searching for references to JIRA issues of a set of known projects. 4 | # It will then open all relevant issues in different tabs of Firefox: this is useful 5 | # in my workflow as I often want to comment and/or close the issues when merging work in upstream. 6 | # 7 | # Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/ 8 | # 9 | # Copyright (c) 2011 Sanne Grinovero 10 | 11 | seeProjectIssues() { 12 | BRANCHES=$(git log master.. --no-decorate | grep -o -E $PROJECTCODE-[0-9]+ | sort | uniq) 13 | for ISSUE in $(echo $BRANCHES | tr ";" "\n") 14 | do 15 | open $JIRA_SERVER/browse/$ISSUE 16 | done 17 | } 18 | 19 | JIRA_SERVER="https://hibernate.atlassian.net" 20 | for PROJECTCODE in "HSEARCH" "HHH" "OGM" "BVAL" "BVTCK" "HCANN" "METAGEN" "JPA" "ANN" "EJB" 21 | do 22 | seeProjectIssues 23 | done 24 | 25 | JIRA_SERVER="https://issues.jboss.org" 26 | for PROJECTCODE in "ISPN" "JGRP" 27 | do 28 | seeProjectIssues 29 | done 30 | 31 | JIRA_SERVER="https://issues.apache.org/jira" 32 | for PROJECTCODE in "LUCENE" "SOLR" 33 | do 34 | seeProjectIssues 35 | done 36 | -------------------------------------------------------------------------------- /scripts/killname.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Adapted from http://teh-geek.com/?tag=bash 3 | 4 | if [[ "$#" -ne "1" ]]; then 5 | echo -e "Offer the list of processes to kill from their name" 6 | echo -e "Usage:\n" 7 | echo -e " killname searchstring" 8 | exit 1; 9 | fi 10 | search=$1 11 | # Creates an array that finds Process ID (PID) 12 | pids=(`(ps uax | grep "$search" | grep -v grep | grep -v "$0") | awk '{print $2}'`) 13 | 14 | #Creates an array that finds the name of process ID (PID) 15 | OIFS=$IFS #save original 16 | IFS=',' 17 | commandlines=(`(ps uax | grep "$search" | grep -v grep | grep -v "$0") | awk '{printf $11 " " $12 " " $13 ","}'`) 18 | IFS=$OIFS 19 | 20 | len=${#pids[*]} 21 | 22 | if [[ $len -eq 0 ]]; then 23 | echo "No matching process found" 24 | exit 0; 25 | fi 26 | 27 | i=0 28 | while [ $i -lt $len ]; do 29 | j=$((i+1)) 30 | echo "$j: ${pids[$i]} ${commandlines[$i]}" 31 | let i++ 32 | done 33 | 34 | echo "" 35 | echo "What process do you want to kill?" 36 | echo "press CTRL^C to cancel" 37 | read varkill 38 | 39 | $shiftedKill=$((varkill-1)) 40 | kill -9 "${pids[$shiftedKill]}" 41 | 42 | echo "${pids[$varkill]} ${commandlines[$varkill]} was killed" 43 | 44 | -------------------------------------------------------------------------------- /scripts/notify: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Notify you when a task is done 3 | # 4 | # $ notify mvn clean install 5 | # runs 'mvn clean install' 6 | # notify you when it's done 7 | # 8 | # A notification is sent upon build completion if your OS supports it: 9 | # - on Mac OS, install Growl and grownnotifier 10 | # - on Linux, install send-notify 11 | # 12 | # Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/ 13 | # 14 | # Copyright (c) 2010 David Gageot 15 | # Copyright (c) 2011 Sanne Grinovero 16 | # Copyright (c) 2010-2015 Emmanuel Bernard 17 | 18 | say() { 19 | if [ `uname -s` == "Darwin" ]; then 20 | # On Mac OS, notify via Growl 21 | which -s growlnotify && growlnotify --name "Command line" --sticky --message "'$CMD_DISPLAY' has finished - $RESULT" 22 | fi 23 | if [ `uname -s` == "Linux" ]; then 24 | # On Linux, notify via notify-send 25 | which notify-send && notify-send "'$CMD_DISPLAY' has finished" "$RESULT" 26 | fi 27 | } 28 | 29 | if [[ $# -eq 0 ]]; then 30 | echo "Usage notify " 31 | else 32 | CMD_DISPLAY="$@" 33 | fi 34 | 35 | $@ 36 | EXIT_CODE=$? 37 | 38 | if [ $EXIT_CODE -eq 0 ]; then 39 | RESULT="SUCCESS" 40 | echo $RESULT 41 | say 42 | else 43 | RESULT="FAILURE" 44 | echo $RESULT 45 | say 46 | exit $EXIT_CODE 47 | fi 48 | -------------------------------------------------------------------------------- /scripts/remote: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Clones your existing repo and run the subsequent command off this clone 3 | # Tests are run on the the current branch at the time of cloning 4 | # 5 | # Note that you can work on the next bug while this is going on as 6 | # tests are run off a cloned repo. 7 | # 8 | # $ remote mvn clean install 9 | # runs 'mvn clean install' 10 | # 11 | # A notification is sent upon build completion if your OS supports it: 12 | # - on Mac OS, install Growl and grownnotifier 13 | # - on Linux, install send-notify 14 | # 15 | # Many thanks to David Gageot (http://blog.javabien.net) for the inspiration and optimization of this script. 16 | # 17 | # Released under the WTFPL license version 2 http://sam.zoy.org/wtfpl/ 18 | # 19 | # Copyright (c) 2010 David Gageot 20 | # Copyright (c) 2010-2012 Emmanuel Bernard 21 | # Copyright (c) 2011 Sanne Grinovero 22 | 23 | #the cloned repo will live in ../DIRECTORY_ROOT/REPO_DIRECTORY 24 | if [ -d "/Volumes/ramdisk" ]; then 25 | # diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://1165430` 26 | # RAM disk of 550MB 27 | DIRECTORY_ROOT="/Volumes/ramdisk/" 28 | else 29 | DIRECTORY_ROOT="../privatebuild/" 30 | fi 31 | 32 | #get the lastest part of the directory name 33 | IFS="/" 34 | SPLIT_DIR=(`pwd`) 35 | SIZE=${#SPLIT_DIR[@]} 36 | let LAST_INDEX=$SIZE-1 37 | DIRECTORY_SUFFIX=${SPLIT_DIR[$LAST_INDEX]} 38 | IFS="" 39 | 40 | DIRECTORY="${DIRECTORY_ROOT}${DIRECTORY_SUFFIX}" 41 | 42 | BRANCH=`git branch | grep "*" | awk '{print $NF}'` 43 | 44 | #fresh clone 45 | rm -Rf $DIRECTORY 46 | git clone -slb "$BRANCH" . $DIRECTORY 47 | cd $DIRECTORY 48 | 49 | echo "" 50 | echo "***** Working on branch $BRANCH *****" 51 | echo "" 52 | 53 | say() { 54 | if [ `uname -s` == "Darwin" ]; then 55 | # On Mac OS, notify via Growl 56 | which -s growlnotify && growlnotify --name "Remote" --sticky --message "'$CMD_DISPLAY' on branch $BRANCH - $RESULT" 57 | fi 58 | if [ `uname -s` == "Linux" ]; then 59 | # On Linux, notify via notify-send 60 | which notify-send && notify-send "'$CMD_DISPLAY' on branch $BRANCH" "$RESULT" 61 | fi 62 | } 63 | 64 | if [[ $# -eq 0 ]]; then 65 | echo "Usage remote " 66 | else 67 | CMD_DISPLAY="$@" 68 | fi 69 | 70 | $@ 71 | 72 | if [ $? -eq 0 ]; then 73 | RESULT="SUCCESS" 74 | echo $RESULT 75 | say 76 | else 77 | RESULT="FAILURE" 78 | echo $RESULT 79 | say 80 | exit $? 81 | fi 82 | -------------------------------------------------------------------------------- /scripts/setjdk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function defaultjdk { 4 | local vmdir=/System/Library/Frameworks/JavaVM.framework/Versions 5 | local ver=${1?Usage: defaultjdk } 6 | 7 | [ -z "$2" ] || error="Too many arguments" 8 | [ -d $vmdir/$ver ] || error="Unknown JDK version: $ver" 9 | [ "$(readlink $vmdir/CurrentJDK)" != "$ver" ] || error="JDK already set to $ver" 10 | 11 | 12 | if [ -n "$error" ]; then 13 | echo $error 14 | return 1 15 | fi 16 | 17 | echo -n "Setting default JDK & HotSpot to $ver ... " 18 | 19 | if [ "$(/usr/bin/id -u)" != "0" ]; then 20 | SUDO=sudo 21 | fi 22 | 23 | $SUDO /bin/rm /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK 24 | $SUDO /bin/ln -s $ver /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK 25 | 26 | echo Done. 27 | } 28 | 29 | function setjdk { 30 | local vmdir=/System/Library/Frameworks/JavaVM.framework/Versions 31 | local ver=${1?Usage: setjdk } 32 | 33 | [ -d $vmdir/$ver ] || { 34 | echo Unknown JDK version: $ver 35 | return 1 36 | } 37 | 38 | echo -n "Setting this terminal's JDK to $ver ... " 39 | 40 | # Pre Oracle JDK, JDK is under /Home, not anymore 41 | export JAVA_HOME=$vmdir/$ver/Home 42 | if [ ! -d "$JAVA_HOME" ]; then 43 | export JAVA_HOME=$vmdir/$ver 44 | fi 45 | 46 | PATH=$(echo $PATH | tr ':' '\n' | grep -v $vmdir | tr '\n' ':') 47 | export PATH=$JAVA_HOME/bin:$PATH 48 | 49 | java -version 50 | } 51 | 52 | function _setjdk_completion (){ 53 | COMPREPLY=() 54 | 55 | local vmdir=/System/Library/Frameworks/JavaVM.framework/Versions 56 | local cur=${COMP_WORDS[COMP_CWORD]//\\\\/} 57 | local options=$(cd $vmdir; ls | grep 1. | tr '\n' ' ') 58 | 59 | COMPREPLY=($(compgen -W "${options}" ${cur})) 60 | } 61 | 62 | complete -F _setjdk_completion -o filenames setjdk 63 | complete -F _setjdk_completion -o filenames defaultjdk 64 | -------------------------------------------------------------------------------- /sshconfig-example: -------------------------------------------------------------------------------- 1 | ForwardAgent yes 2 | 3 | Host nas 4 | User emmanuel 5 | IdentityFile ~/.ssh/id_rsa 6 | Hostname nas-034.internal.emmanuelbernard.com 7 | 8 | 9 | Host prod 10 | User manu-masterorslave 11 | IdentityFile ~/.ssh/id_rsa_pro 12 | Port 34 13 | Hostname super-secret.redhat.com 14 | --------------------------------------------------------------------------------