Permalink
Browse files

Support for docker-compose

  • Loading branch information...
1 parent 866aa45 commit 106dc07ab3e8954da1d6527b37ad4d62de64d8c2 @taru-m taru-m committed Dec 2, 2016
Showing with 244 additions and 0 deletions.
  1. +3 −0 Makefile
  2. +4 −0 ftdetect/docker-compose.vim
  3. +163 −0 snippets/docker-compose.snippets
  4. +74 −0 syntax/docker-compose.vim
View
@@ -5,8 +5,11 @@ install:
@mkdir -p ~/.vim/snippets
@echo " * Dirs ... success."
@cp ./syntax/Dockerfile.vim ~/.vim/syntax/
+ @cp ./syntax/docker-compose.vim ~/.vim/syntax/
@echo " * Syntax ... success."
@cp ./ftdetect/Dockerfile.vim ~/.vim/ftdetect/
+ @cp ./ftdetect/docker-compose.vim ~/.vim/ftdetect/
@echo " * Filetype ... success."
@cp ./snippets/Dockerfile.snippets ~/.vim/snippets/
+ @cp ./snippets/docker-compose.snippets ~/.vim/snippets/
@echo " * Snippets ... success."
@@ -0,0 +1,4 @@
+" docker-compose.yml
+autocmd BufRead,BufNewFile docker-compose.yml set ft=docker-compose
+autocmd BufRead,BufNewFile docker-compose.yml* setf docker-compose
+autocmd BufRead,BufNewFile docker-compose* setf docker-compose
@@ -0,0 +1,163 @@
+snippet ve
+ version: ${1:2}
+snippet volumes
+ volumes:
+ - ${1:value}
+snippet volume_
+ volume_driver: ${1:driver}
+snippet volumes_
+ volumes_from:
+ - ${1:name}
+snippet exter
+ external: ${1:boolean}
+snippet ser
+ services:
+ ${1:name}
+snippet bu
+ build:
+ ${1:value}
+snippet conte
+ context: ${1:dir}
+snippet com
+ command: ${1:command}
+snippet dep
+ depends_on:
+ ${1:value}
+snippet env
+ environment:
+ ${1:name}: ${2:value}
+snippet doc
+ dockerfile: ${1:file}
+snippet ar
+ args:
+ ${1:name}: ${2:value}
+snippet cap_a
+ cap_add:
+ - ${1:value}
+snippet cap_d
+ cap_drop:
+ - ${1:value}
+snippet cgr
+ cgroup_parent: ${1:cgroup}
+snippet conta
+ container_name: ${1:name}
+snippet dev
+ devices:
+ - ${1:value}
+snippet dn
+ dns:
+ - ${1:ip}
+snippet dns_
+ dns_search:
+ - ${1:ip}
+snippet tm
+ tmpfs:
+ - ${1:dir}
+snippet ent
+ entrypoint: ${1:command}
+snippet env_
+ env_file:
+ - ${1:file}
+snippet exp
+ expose:
+ - ${1:port}
+snippet exten
+ extends:
+ file: ${1:file}
+ service: ${2:name}
+snippet exter
+ extra_hosts:
+ - ${1:host}:${2:ip}
+snippet gr
+ group_add:
+ - ${1:name}
+snippet im
+ image: ${1:image}
+snippet la
+ labels:
+ ${1:dns}: ${2:label}
+snippet links
+ links:
+ - ${1:name}
+snippet logg
+ logging:
+ driver: ${1:driver}
+ options:
+ ${2:value}
+snippet log_d
+ log_driver: ${1:driver}
+snippet log_o
+ log_opt:
+ ${1:value}
+snippet net
+ net: ${1:value}
+snippet network_
+ network_mode: ${1:value}
+snippet networks
+ networks:
+ - ${1:value}
+snippet al
+ networks:
+ - ${1:name}
+snippet ipv4
+ ipv4_address: ${1:ip}
+snippet ipv6
+ ipv6_address: ${1:ip}
+snippet link_
+ link_local_ips:
+ - ${1:ip}
+snippet pi
+ pid: ${1:host}
+snippet po
+ ports:
+ - ${1:value}
+snippet sec
+ security_opt:
+ - ${1:value}
+snippet sto
+ stop_signal: ${1:signal}
+snippet ul
+ ulimits:
+ ${1:value}
+snippet cpu_s
+ cpu_shares: ${1:value}
+snippet cpu_q
+ cpu_quota: ${1:value}
+snippet cpus
+ cpuset: ${1:value}
+snippet dom
+ domainname: ${1:name}
+snippet ho
+ hostname: ${1:name}
+snippet ipc
+ ipc: ${1:host}
+snippet mem_
+ mem_limit: ${1:value}
+snippet mems
+ memswap_limit: ${1:value}
+snippet pr
+ privileged: ${1:boolean}
+snippet oom
+ oom_score_adj: ${1:value}
+snippet res
+ restart: ${1:value}
+snippet us
+ user: ${1:value}
+snippet wo
+ working_dir: ${1:dir}
+snippet rea
+ read_only: ${1:boolean}
+snippet sh
+ shm_size: ${1:value}
+snippet std
+ stdin_open: ${1:boolean}
+snippet tt
+ tty: ${1:boolean}
+snippet driver
+ driver: ${1:value}
+snippet driver_
+ driver_opts:
+ ${1:key}: ${2:value}
+snippet ipa
+ ipam:
+ ${1:value}
@@ -0,0 +1,74 @@
+" 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 dockercomposeKeywords build context dockerfile args cap_add cap_drop
+syn keyword dockercomposeKeywords command cgroup_parent container_name devices depends_on
+syn keyword dockercomposeKeywords dns dns_search tmpfs entrypoint env_file environment
+syn keyword dockercomposeKeywords expose extends extends external_links extra_hosts
+syn keyword dockercomposeKeywords group_add image isolation labels links logging log_driver
+syn keyword dockercomposeKeywords log_opt net network_mode networks aliases
+syn keyword dockercomposeKeywords ipv4_address ipv6_address link_local_ips pid ports
+syn keyword dockercomposeKeywords security_opt stop_signal ulimits volumes volume_driver
+syn keyword dockercomposeKeywords volumes_from cpu_shares cpu_quota cpuset domainname hostname
+syn keyword dockercomposeKeywords ipc mac_address mem_limit memswap_limit oom_score_adj privileged
+syn keyword dockercomposeKeywords read_only restart shm_size stdin_open tty user working_dir
+"" Volume configuration reference
+syn keyword dockercomposeKeywords driver driver_opts external labels
+"" Network configuration reference
+syn keyword dockercomposeKeywords driver driver_opts enable_ipv6 ipam internal labels external
+"" Versioning
+syn keyword dockercomposeKeywords version services
+
+" Bash statements
+setlocal iskeyword+=-
+syn keyword bashStatement add-apt-repository adduser apk 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 pip pip3 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 dockercomposeString start=/"/ skip=/\\"/ end=/"/
+syn region dockercomposeString1 start=/'/ skip=/\\'/ end=/'/
+
+" Emails
+syn region dockercomposeEmail start=/</ end=/>/ contains=@ oneline
+
+" Urls
+syn match dockercomposeUrl /\(http\|https\|ssh\|hg\|git\)\:\/\/[a-zA-Z0-9\/\-\.]\+/
+
+" Task tags
+syn keyword dockercomposeTodo contained TODO FIXME XXX
+
+" Comments
+syn region dockercomposeComment start="#" end="\n" contains=dockercomposeTodo
+
+" Highlighting
+hi link dockercomposeKeywords Keyword
+hi link dockercomposeString String
+hi link dockercomposeString1 String
+hi link dockercomposeComment Comment
+hi link dockercomposeEmail Identifier
+hi link dockercomposeUrl Identifier
+hi link dockercomposeTodo Todo
+hi link bashStatement Function
+
+let b:current_syntax = "dockercompose"
+
+set commentstring=#\ %s
+
+" Enable automatic comment insertion
+setlocal fo+=cro

0 comments on commit 106dc07

Please sign in to comment.