├── Dockerfile ├── bash_profile ├── gitconfig ├── vim ├── ftdetect │ └── go.vim └── syntax │ └── go.vim └── vimrc /Dockerfile: -------------------------------------------------------------------------------- 1 | from ubuntu:14.04 2 | 3 | run apt-get update -y 4 | run apt-get install -y mercurial 5 | run apt-get install -y git 6 | run apt-get install -y python 7 | run apt-get install -y curl 8 | run apt-get install -y vim 9 | run apt-get install -y strace 10 | run apt-get install -y diffstat 11 | run apt-get install -y pkg-config 12 | run apt-get install -y cmake 13 | run apt-get install -y build-essential 14 | run apt-get install -y tcpdump 15 | run apt-get install -y screen 16 | 17 | # Install go 18 | run curl https://go.googlecode.com/files/go1.2.1.linux-amd64.tar.gz | tar -C /usr/local -zx 19 | env GOROOT /usr/local/go 20 | env PATH /usr/local/go/bin:$PATH 21 | 22 | # Setup home environment 23 | run useradd dev 24 | run mkdir /home/dev && chown -R dev: /home/dev 25 | run mkdir -p /home/dev/go /home/dev/bin /home/dev/lib /home/dev/include 26 | env PATH /home/dev/bin:$PATH 27 | env PKG_CONFIG_PATH /home/dev/lib/pkgconfig 28 | env LD_LIBRARY_PATH /home/dev/lib 29 | env GOPATH /home/dev/go:$GOPATH 30 | 31 | run go get github.com/dotcloud/gordon/pulls 32 | 33 | # Create a shared data volume 34 | # We need to create an empty file, otherwise the volume will 35 | # belong to root. 36 | # This is probably a Docker bug. 37 | run mkdir /var/shared/ 38 | run touch /var/shared/placeholder 39 | run chown -R dev:dev /var/shared 40 | volume /var/shared 41 | 42 | workdir /home/dev 43 | env HOME /home/dev 44 | add vimrc /home/dev/.vimrc 45 | add vim /home/dev/.vim 46 | add bash_profile /home/dev/.bash_profile 47 | add gitconfig /home/dev/.gitconfig 48 | 49 | # Link in shared parts of the home directory 50 | run ln -s /var/shared/.ssh 51 | run ln -s /var/shared/.bash_history 52 | run ln -s /var/shared/.maintainercfg 53 | 54 | run chown -R dev: /home/dev 55 | user dev 56 | -------------------------------------------------------------------------------- /bash_profile: -------------------------------------------------------------------------------- 1 | export GOPATH=~/go:$GOPATH 2 | export PATH=~/bin:~/go/bin:$PATH 3 | -------------------------------------------------------------------------------- /gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | email = solomon@docker.com 3 | name = Solomon Hykes 4 | -------------------------------------------------------------------------------- /vim/ftdetect/go.vim: -------------------------------------------------------------------------------- 1 | au BufRead,BufNewFile *.go set filetype=go 2 | -------------------------------------------------------------------------------- /vim/syntax/go.vim: -------------------------------------------------------------------------------- 1 | " Copyright 2009 The Go Authors. All rights reserved. 2 | " Use of this source code is governed by a BSD-style 3 | " license that can be found in the LICENSE file. 4 | " 5 | " go.vim: Vim syntax file for Go. 6 | " 7 | " Options: 8 | " There are some options for customizing the highlighting; the recommended 9 | " settings are the default values, but you can write: 10 | " let OPTION_NAME = 0 11 | " in your ~/.vimrc file to disable particular options. You can also write: 12 | " let OPTION_NAME = 1 13 | " to enable particular options. At present, all options default to on. 14 | " 15 | " - go_highlight_array_whitespace_error 16 | " Highlights white space after "[]". 17 | " - go_highlight_chan_whitespace_error 18 | " Highlights white space around the communications operator that don't follow 19 | " the standard style. 20 | " - go_highlight_extra_types 21 | " Highlights commonly used library types (io.Reader, etc.). 22 | " - go_highlight_space_tab_error 23 | " Highlights instances of tabs following spaces. 24 | " - go_highlight_trailing_whitespace_error 25 | " Highlights trailing white space. 26 | 27 | " Quit when a (custom) syntax file was already loaded 28 | if exists("b:current_syntax") 29 | finish 30 | endif 31 | 32 | if !exists("go_highlight_array_whitespace_error") 33 | let go_highlight_array_whitespace_error = 1 34 | endif 35 | if !exists("go_highlight_chan_whitespace_error") 36 | let go_highlight_chan_whitespace_error = 1 37 | endif 38 | if !exists("go_highlight_extra_types") 39 | let go_highlight_extra_types = 1 40 | endif 41 | if !exists("go_highlight_space_tab_error") 42 | let go_highlight_space_tab_error = 1 43 | endif 44 | if !exists("go_highlight_trailing_whitespace_error") 45 | let go_highlight_trailing_whitespace_error = 1 46 | endif 47 | 48 | syn case match 49 | 50 | syn keyword goDirective package import 51 | syn keyword goDeclaration var const type 52 | syn keyword goDeclType struct interface 53 | 54 | hi def link goDirective Statement 55 | hi def link goDeclaration Keyword 56 | hi def link goDeclType Keyword 57 | 58 | " Keywords within functions 59 | syn keyword goStatement defer go goto return break continue fallthrough 60 | syn keyword goConditional if else switch select 61 | syn keyword goLabel case default 62 | syn keyword goRepeat for range 63 | 64 | hi def link goStatement Statement 65 | hi def link goConditional Conditional 66 | hi def link goLabel Label 67 | hi def link goRepeat Repeat 68 | 69 | " Predefined types 70 | syn keyword goType chan map bool string error 71 | syn keyword goSignedInts int int8 int16 int32 int64 rune 72 | syn keyword goUnsignedInts byte uint uint8 uint16 uint32 uint64 uintptr 73 | syn keyword goFloats float32 float64 74 | syn keyword goComplexes complex64 complex128 75 | 76 | hi def link goType Type 77 | hi def link goSignedInts Type 78 | hi def link goUnsignedInts Type 79 | hi def link goFloats Type 80 | hi def link goComplexes Type 81 | 82 | " Treat func specially: it's a declaration at the start of a line, but a type 83 | " elsewhere. Order matters here. 84 | syn match goType /\/ 85 | syn match goDeclaration /^func\>/ 86 | 87 | " Predefined functions and values 88 | syn keyword goBuiltins append cap close complex copy delete imag len 89 | syn keyword goBuiltins make new panic print println real recover 90 | syn keyword goConstants iota true false nil 91 | 92 | hi def link goBuiltins Keyword 93 | hi def link goConstants Keyword 94 | 95 | " Comments; their contents 96 | syn keyword goTodo contained TODO FIXME XXX BUG 97 | syn cluster goCommentGroup contains=goTodo 98 | syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell 99 | syn region goComment start="//" end="$" contains=@goCommentGroup,@Spell 100 | 101 | hi def link goComment Comment 102 | hi def link goTodo Todo 103 | 104 | " Go escapes 105 | syn match goEscapeOctal display contained "\\[0-7]\{3}" 106 | syn match goEscapeC display contained +\\[abfnrtv\\'"]+ 107 | syn match goEscapeX display contained "\\x\x\{2}" 108 | syn match goEscapeU display contained "\\u\x\{4}" 109 | syn match goEscapeBigU display contained "\\U\x\{8}" 110 | syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+ 111 | 112 | hi def link goEscapeOctal goSpecialString 113 | hi def link goEscapeC goSpecialString 114 | hi def link goEscapeX goSpecialString 115 | hi def link goEscapeU goSpecialString 116 | hi def link goEscapeBigU goSpecialString 117 | hi def link goSpecialString Special 118 | hi def link goEscapeError Error 119 | 120 | " Strings and their contents 121 | syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError 122 | syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup 123 | syn region goRawString start=+`+ end=+`+ 124 | 125 | hi def link goString String 126 | hi def link goRawString String 127 | 128 | " Characters; their contents 129 | syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU 130 | syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup 131 | 132 | hi def link goCharacter Character 133 | 134 | " Regions 135 | syn region goBlock start="{" end="}" transparent fold 136 | syn region goParen start='(' end=')' transparent 137 | 138 | " Integers 139 | syn match goDecimalInt "\<\d\+\([Ee]\d\+\)\?\>" 140 | syn match goHexadecimalInt "\<0x\x\+\>" 141 | syn match goOctalInt "\<0\o\+\>" 142 | syn match goOctalError "\<0\o*[89]\d*\>" 143 | 144 | hi def link goDecimalInt Integer 145 | hi def link goHexadecimalInt Integer 146 | hi def link goOctalInt Integer 147 | hi def link Integer Number 148 | 149 | " Floating point 150 | syn match goFloat "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>" 151 | syn match goFloat "\<\.\d\+\([Ee][-+]\d\+\)\?\>" 152 | syn match goFloat "\<\d\+[Ee][-+]\d\+\>" 153 | 154 | hi def link goFloat Float 155 | 156 | " Imaginary literals 157 | syn match goImaginary "\<\d\+i\>" 158 | syn match goImaginary "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>" 159 | syn match goImaginary "\<\.\d\+\([Ee][-+]\d\+\)\?i\>" 160 | syn match goImaginary "\<\d\+[Ee][-+]\d\+i\>" 161 | 162 | hi def link goImaginary Number 163 | 164 | " Spaces after "[]" 165 | if go_highlight_array_whitespace_error != 0 166 | syn match goSpaceError display "\(\[\]\)\@<=\s\+" 167 | endif 168 | 169 | " Spacing errors around the 'chan' keyword 170 | if go_highlight_chan_whitespace_error != 0 171 | " receive-only annotation on chan type 172 | syn match goSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@=" 173 | " send-only annotation on chan type 174 | syn match goSpaceError display "\(\/ 182 | syn match goExtraType /\/ 183 | syn match goExtraType /\/ 184 | syn match goExtraType /\/ 185 | endif 186 | 187 | " Space-tab error 188 | if go_highlight_space_tab_error != 0 189 | syn match goSpaceError display " \+\t"me=e-1 190 | endif 191 | 192 | " Trailing white space error 193 | if go_highlight_trailing_whitespace_error != 0 194 | syn match goSpaceError display excludenl "\s\+$" 195 | endif 196 | 197 | hi def link goExtraType Type 198 | hi def link goSpaceError Error 199 | 200 | " Search backwards for a global declaration to start processing the syntax. 201 | "syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/ 202 | 203 | " There's a bug in the implementation of grouphere. For now, use the 204 | " following as a more expensive/less precise workaround. 205 | syn sync minlines=500 206 | 207 | let b:current_syntax = "go" 208 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | au! BufRead,BufNewFile *.sass setfiletype sass 2 | au! BufRead,BufNewFile *.scss setfiletype css 3 | " Use vim settings, instead of vi 4 | set nocompatible 5 | set loadplugins 6 | " Reindent operations (<< and >>) 7 | """ BIKESHEDDING set shiftwidth=4 8 | " 4 space tab 9 | """ BIKESHEDDING set tabstop=4 10 | " Causes backspace to delete 4 spaces 11 | """ BIKESHEDDING set softtabstop=4 12 | " Replaces a with spaces 13 | """ BIKESHEDDING set expandtab 14 | " Uses shiftwidth instead of tabstop at start of lines 15 | set smarttab 16 | set modeline 17 | set ruler 18 | set history=100 19 | set nowrap 20 | " Change terminal title 21 | set title 22 | " No annoying error noises 23 | set noerrorbells 24 | " Make backspace delete lots of things 25 | set backspace=indent,eol,start 26 | " Show us the command we're typing 27 | set showcmd 28 | " Highlight matching parens 29 | set showmatch 30 | " Search options: incremental search, highlight search 31 | set hlsearch 32 | set incsearch 33 | " Selective case insensitivity 34 | set smartcase 35 | " Show full tags when doing search completion 36 | set showfulltag 37 | " Speed up macros 38 | set lazyredraw 39 | " No annoying error noises 40 | set noerrorbells 41 | " Wrap on these 42 | set whichwrap+=<,>,[,] 43 | " Use the cool tab complete menu 44 | set wildmenu 45 | set wildmode=longest,full 46 | set wildignore+=*.o,*~,*.pyc 47 | " Allow edit buffers to be hidden 48 | set hidden 49 | " 1 height windows 50 | set winminheight=1 51 | " misc 52 | set autowrite 53 | 54 | if exists('+autochdir') 55 | set autochdir 56 | endif 57 | set ttyfast 58 | set smartcase 59 | 60 | filetype indent on 61 | filetype plugin on 62 | set autoindent 63 | set smartindent 64 | syntax on 65 | 66 | colorscheme slate 67 | " make the mouse works under screen : 68 | set ttymouse=xterm2 69 | set mouse=ar 70 | 71 | if has("gui_running") 72 | set guifont=Monospace\ 8 73 | set guioptions-=T 74 | set guioptions-=m 75 | set guioptions-=l 76 | set guioptions-=L 77 | set guioptions-=r 78 | set guioptions-=R 79 | set mousemodel=extend 80 | set mousefocus 81 | set mousehide 82 | set noguipty 83 | set guicursor=a:blinkon0 84 | 85 | "Stupid comment character" 86 | "# Custom options" 87 | set fuoptions=maxvert,maxhorz 88 | set lines=24 columns=80 89 | 90 | 91 | highlight Normal gui=NONE guibg=Black guifg=White 92 | highlight NonText gui=NONE guibg=Black 93 | highlight Pmenu gui=NONE guifg=Black guibg=LightGrey 94 | highlight PmenuSel gui=NONE guifg=LightGrey guibg=Black 95 | highlight PmenuSbar gui=NONE guifg=LightGrey guibg=Black 96 | highlight PmenuThumb gui=NONE guifg=Black guibg=LightGrey 97 | endif 98 | 99 | " Change buffer 100 | map :bn 101 | map :bp 102 | 103 | " Shell like Home / End 104 | inoremap 105 | inoremap 106 | 107 | " Hide coloration of found words 108 | map :nohlsearch 109 | 110 | autocmd FileType Makefile noexpandtab 111 | au filetype tmpl set omnifunc=htmlcomplete#CompleteTags 112 | 113 | " Change the current tab with ^j and ^k (normal mode only) 114 | nnoremap :tabnext 115 | nnoremap :tabprevious 116 | --------------------------------------------------------------------------------