diff --git a/.vim/bundle/Dockerfile.vim/.gitignore b/.vim/bundle/Dockerfile.vim/.gitignore new file mode 100644 index 00000000..38193138 --- /dev/null +++ b/.vim/bundle/Dockerfile.vim/.gitignore @@ -0,0 +1,2 @@ +*.swp +*.swo diff --git a/.vim/bundle/Dockerfile.vim/LICENSE b/.vim/bundle/Dockerfile.vim/LICENSE new file mode 100644 index 00000000..27856ca5 --- /dev/null +++ b/.vim/bundle/Dockerfile.vim/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 Eugene Kalinin + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.vim/bundle/Dockerfile.vim/Makefile b/.vim/bundle/Dockerfile.vim/Makefile new file mode 100644 index 00000000..1e327613 --- /dev/null +++ b/.vim/bundle/Dockerfile.vim/Makefile @@ -0,0 +1,12 @@ +install: + @echo "Installation:" + @mkdir -p ~/.vim/syntax + @mkdir -p ~/.vim/ftdetect + @mkdir -p ~/.vim/snippets + @echo " * Dirs ... success." + @cp ./syntax/Dockerfile.vim ~/.vim/syntax/ + @echo " * Syntax ... success." + @cp ./ftdetect/Dockerfile.vim ~/.vim/ftdetect/ + @echo " * Filetype ... success." + @cp ./snippets/Dockerfile.snippets ~/.vim/snippets/ + @echo " * Snippets ... success." diff --git a/.vim/bundle/Dockerfile.vim/README.md b/.vim/bundle/Dockerfile.vim/README.md new file mode 100644 index 00000000..f30f1d6f --- /dev/null +++ b/.vim/bundle/Dockerfile.vim/README.md @@ -0,0 +1,41 @@ +Dockerfile.vim +============== + +Vim syntax file for [Docker](http://docker.io/)'s [Dockerfile](http://docs.docker.com/reference/builder/) +and snippets for [snipMate](http://www.vim.org/scripts/script.php?script_id=2540). + +Screenshot +========== + +Here is an example in gnome-terminal with [vim-monokai](https://github.com/sickill/vim-monokai) color scheme: + + +![Vim & Dockerfile.vim ](https://raw.github.com/ekalinin/Dockerfile.vim/master/vim-dockerfile-example.png) + + + +Installation +============ + +````bash +$ git clone https://github.com/ekalinin/Dockerfile.vim.git +$ cd Dockerfile.vim +$ make install +```` + +####OR using Pathogen: +```bash +# Clone directly into the bundle folder. +git clone https://github.com/ekalinin/Dockerfile.vim.git bundle/Dockerfile +``` + +####OR using Vundle: +```bash +# near the top of your .vimrc +Plugin 'ekalinin/Dockerfile.vim' +``` + +License +======= + +See [LICENSE](https://github.com/ekalinin/Dockerfile.vim/blob/master/LICENSE) file. diff --git a/.vim/bundle/Dockerfile.vim/ftdetect/Dockerfile.vim b/.vim/bundle/Dockerfile.vim/ftdetect/Dockerfile.vim new file mode 100644 index 00000000..ff20cd91 --- /dev/null +++ b/.vim/bundle/Dockerfile.vim/ftdetect/Dockerfile.vim @@ -0,0 +1,4 @@ +" Dockerfile +autocmd BufRead,BufNewFile Dockerfile set ft=Dockerfile +autocmd BufRead,BufNewFile Dockerfile* setf Dockerfile +autocmd BufRead,BufNewFile *.dock setf Dockerfile diff --git a/.vim/bundle/Dockerfile.vim/snippets/Dockerfile.snippets b/.vim/bundle/Dockerfile.vim/snippets/Dockerfile.snippets new file mode 100644 index 00000000..5f97a510 --- /dev/null +++ b/.vim/bundle/Dockerfile.vim/snippets/Dockerfile.snippets @@ -0,0 +1,66 @@ +snippet F + FROM ${1:ubuntu} +snippet f + FROM ${1:ubuntu} +snippet M + MAINTAINER ${1:name} +snippet m + MAINTAINER ${1:name} +snippet R + RUN ${1:command} +snippet r + RUN ${1:command} +snippet C + CMD ${1:command} +snippet c + CMD ${1:command} +snippet CP + COPY ${1:src} ${2:dest} +snippet cp + COPY ${1:src} ${2:dest} +snippet EXP + EXPOSE ${1:port} +snippet exp + EXPOSE ${1:port} +snippet E + ENV ${1:key} ${2:value} +snippet e + ENV ${1:key} ${2:value} +snippet A + ADD ${1:src} ${2:dst} +snippet a + ADD ${1:src} ${2:dst} +snippet ENT + ENTRYPOINT ${1:command} +snippet ent + ENTRYPOINT ${1:command} +snippet V + VOLUME ["${1:path}"] +snippet v + VOLUME ["${1:path}"] +snippet U + USER ${1:name} +snippet u + USER ${1:name} +snippet W + WORKDIR ${1:path} +snippet w + WORKDIR ${1:path} +snippet upd + # update packages + RUN echo "deb http://archive.ubuntu.com/ubuntu ${1:precise} main universe" > /etc/apt/sources.list; \ + apt-get update && apt-get -y upgrade; \ + ${2} +snippet head + # ${1:Description} + # + # VERSION ${2:0.1.0} + ${3} +snippet O + ONBUILD ${1} +snippet o + ONBUILD ${1} +snippet L + LABEL ${1:label}="${2:value}" +snippet l + LABEL ${1:label}="${2:value}" diff --git a/.vim/bundle/Dockerfile.vim/syntax/Dockerfile.vim b/.vim/bundle/Dockerfile.vim/syntax/Dockerfile.vim new file mode 100644 index 00000000..f8722981 --- /dev/null +++ b/.vim/bundle/Dockerfile.vim/syntax/Dockerfile.vim @@ -0,0 +1,61 @@ +" Vim syntax file +" Language: Dockerfile +" Maintainer: Eugene Kalinin +" Latest Revision: 11 September 2013 +" Source: http://docs.docker.io/en/latest/use/builder/ + +if exists("b:current_syntax") + finish +endif + +" case sensitivity (fix #17) +" syn case ignore + +" Keywords +syn keyword dockerfileKeywords FROM MAINTAINER RUN CMD COPY +syn keyword dockerfileKeywords EXPOSE ENV ADD ENTRYPOINT +syn keyword dockerfileKeywords VOLUME USER WORKDIR ONBUILD +syn keyword dockerfileKeywords LABEL + +" Bash statements +setlocal iskeyword+=- +syn keyword bashStatement add-apt-repository adduser apt-get aptitude apt-key autoconf bundle +syn keyword bashStatement cd chgrp chmod chown clear complete composer cp curl du echo egrep +syn keyword bashStatement expr fgrep find gem gnufind gnugrep gpg grep groupadd head less ln +syn keyword bashStatement ls make mkdir mv node npm pacman php python rails rm rmdir rpm ruby +syn keyword bashStatement sed sleep sort strip tar tail tailf touch useradd virtualenv yum +syn keyword bashStatement usermod bash cat a2ensite a2dissite a2enmod a2dismod apache2ctl +syn keyword bashStatement wget gzip + +" Strings +syn region dockerfileString start=/"/ skip=/\\"/ end=/"/ +syn region dockerfileString1 start=/'/ skip=/\\'/ end=/'/ + +" Emails +syn region dockerfileEmail start=// contains=@ oneline + +" Urls +syn match dockerfileUrl /\(http\|https\|ssh\|hg\|git\)\:\/\/[a-zA-Z0-9\/\-\.]\+/ + +" Task tags +syn keyword dockerfileTodo contained TODO FIXME XXX + +" Comments +syn region dockerfileComment start="#" end="\n" contains=dockerfileTodo + +" Highlighting +hi link dockerfileKeywords Keyword +hi link dockerfileString String +hi link dockerfileString1 String +hi link dockerfileComment Comment +hi link dockerfileEmail Identifier +hi link dockerfileUrl Identifier +hi link dockerfileTodo Todo +hi link bashStatement Function + +let b:current_syntax = "dockerfile" + +set commentstring=#\ %s + +" Enable automatic comment insertion +setlocal fo+=cro diff --git a/.vim/bundle/Dockerfile.vim/vim-dockerfile-example.png b/.vim/bundle/Dockerfile.vim/vim-dockerfile-example.png new file mode 100644 index 00000000..c82f871f Binary files /dev/null and b/.vim/bundle/Dockerfile.vim/vim-dockerfile-example.png differ diff --git a/.vim/update.sh b/.vim/update.sh index 646fc7ae..e742afc2 100755 --- a/.vim/update.sh +++ b/.vim/update.sh @@ -45,6 +45,7 @@ repos=( https://github.com/ctrlpvim/ctrlp.vim.git https://github.com/digitaltoad/vim-jade.git https://github.com/docunext/closetag.vim.git + https://github.com/ekalinin/Dockerfile.vim.git https://github.com/elzr/vim-json.git https://github.com/ervandew/supertab https://github.com/groenewege/vim-less.git