Initial commit.
This commit is contained in:
commit
65a4600b98
14 changed files with 1735 additions and 0 deletions
5
vim/.netrwhist
Normal file
5
vim/.netrwhist
Normal file
|
@ -0,0 +1,5 @@
|
|||
let g:netrw_dirhistmax =10
|
||||
let g:netrw_dirhist_cnt =3
|
||||
let g:netrw_dirhist_1='/Users/ftpd/.oh-my-zsh/plugins/github'
|
||||
let g:netrw_dirhist_2='/Users/ftpd/tf/arkadia'
|
||||
let g:netrw_dirhist_3='/Users/ftpd/Lab/puppet/modules/ventures/otrs_test'
|
250
vim/autoload/pathogen.vim
Normal file
250
vim/autoload/pathogen.vim
Normal file
|
@ -0,0 +1,250 @@
|
|||
" pathogen.vim - path option manipulation
|
||||
" Maintainer: Tim Pope <http://tpo.pe/>
|
||||
" Version: 2.0
|
||||
|
||||
" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
|
||||
"
|
||||
" For management of individually installed plugins in ~/.vim/bundle (or
|
||||
" ~\vimfiles\bundle), adding `call pathogen#infect()` to your .vimrc
|
||||
" prior to `filetype plugin indent on` is the only other setup necessary.
|
||||
"
|
||||
" The API is documented inline below. For maximum ease of reading,
|
||||
" :set foldmethod=marker
|
||||
|
||||
if exists("g:loaded_pathogen") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_pathogen = 1
|
||||
|
||||
" Point of entry for basic default usage. Give a directory name to invoke
|
||||
" pathogen#runtime_append_all_bundles() (defaults to "bundle"), or a full path
|
||||
" to invoke pathogen#runtime_prepend_subdirectories(). Afterwards,
|
||||
" pathogen#cycle_filetype() is invoked.
|
||||
function! pathogen#infect(...) abort " {{{1
|
||||
let source_path = a:0 ? a:1 : 'bundle'
|
||||
if source_path =~# '[\\/]'
|
||||
call pathogen#runtime_prepend_subdirectories(source_path)
|
||||
else
|
||||
call pathogen#runtime_append_all_bundles(source_path)
|
||||
endif
|
||||
call pathogen#cycle_filetype()
|
||||
endfunction " }}}1
|
||||
|
||||
" Split a path into a list.
|
||||
function! pathogen#split(path) abort " {{{1
|
||||
if type(a:path) == type([]) | return a:path | endif
|
||||
let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
|
||||
return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
|
||||
endfunction " }}}1
|
||||
|
||||
" Convert a list to a path.
|
||||
function! pathogen#join(...) abort " {{{1
|
||||
if type(a:1) == type(1) && a:1
|
||||
let i = 1
|
||||
let space = ' '
|
||||
else
|
||||
let i = 0
|
||||
let space = ''
|
||||
endif
|
||||
let path = ""
|
||||
while i < a:0
|
||||
if type(a:000[i]) == type([])
|
||||
let list = a:000[i]
|
||||
let j = 0
|
||||
while j < len(list)
|
||||
let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
|
||||
let path .= ',' . escaped
|
||||
let j += 1
|
||||
endwhile
|
||||
else
|
||||
let path .= "," . a:000[i]
|
||||
endif
|
||||
let i += 1
|
||||
endwhile
|
||||
return substitute(path,'^,','','')
|
||||
endfunction " }}}1
|
||||
|
||||
" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
|
||||
function! pathogen#legacyjoin(...) abort " {{{1
|
||||
return call('pathogen#join',[1] + a:000)
|
||||
endfunction " }}}1
|
||||
|
||||
" Remove duplicates from a list.
|
||||
function! pathogen#uniq(list) abort " {{{1
|
||||
let i = 0
|
||||
let seen = {}
|
||||
while i < len(a:list)
|
||||
if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
|
||||
call remove(a:list,i)
|
||||
elseif a:list[i] ==# ''
|
||||
let i += 1
|
||||
let empty = 1
|
||||
else
|
||||
let seen[a:list[i]] = 1
|
||||
let i += 1
|
||||
endif
|
||||
endwhile
|
||||
return a:list
|
||||
endfunction " }}}1
|
||||
|
||||
" \ on Windows unless shellslash is set, / everywhere else.
|
||||
function! pathogen#separator() abort " {{{1
|
||||
return !exists("+shellslash") || &shellslash ? '/' : '\'
|
||||
endfunction " }}}1
|
||||
|
||||
" Convenience wrapper around glob() which returns a list.
|
||||
function! pathogen#glob(pattern) abort " {{{1
|
||||
let files = split(glob(a:pattern),"\n")
|
||||
return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
|
||||
endfunction "}}}1
|
||||
|
||||
" Like pathogen#glob(), only limit the results to directories.
|
||||
function! pathogen#glob_directories(pattern) abort " {{{1
|
||||
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
|
||||
endfunction "}}}1
|
||||
|
||||
" Turn filetype detection off and back on again if it was already enabled.
|
||||
function! pathogen#cycle_filetype() " {{{1
|
||||
if exists('g:did_load_filetypes')
|
||||
filetype off
|
||||
filetype on
|
||||
endif
|
||||
endfunction " }}}1
|
||||
|
||||
" Checks if a bundle is 'disabled'. A bundle is considered 'disabled' if
|
||||
" its 'basename()' is included in g:pathogen_disabled[]' or ends in a tilde.
|
||||
function! pathogen#is_disabled(path) " {{{1
|
||||
if a:path =~# '\~$'
|
||||
return 1
|
||||
elseif !exists("g:pathogen_disabled")
|
||||
return 0
|
||||
endif
|
||||
let sep = pathogen#separator()
|
||||
return index(g:pathogen_disabled, strpart(a:path, strridx(a:path, sep)+1)) != -1
|
||||
endfunction "}}}1
|
||||
|
||||
" Prepend all subdirectories of path to the rtp, and append all 'after'
|
||||
" directories in those subdirectories.
|
||||
function! pathogen#runtime_prepend_subdirectories(path) " {{{1
|
||||
let sep = pathogen#separator()
|
||||
let before = filter(pathogen#glob_directories(a:path.sep."*"), '!pathogen#is_disabled(v:val)')
|
||||
let after = filter(pathogen#glob_directories(a:path.sep."*".sep."after"), '!pathogen#is_disabled(v:val[0:-7])')
|
||||
let rtp = pathogen#split(&rtp)
|
||||
let path = expand(a:path)
|
||||
call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
|
||||
let &rtp = pathogen#join(pathogen#uniq(before + rtp + after))
|
||||
return &rtp
|
||||
endfunction " }}}1
|
||||
|
||||
" For each directory in rtp, check for a subdirectory named dir. If it
|
||||
" exists, add all subdirectories of that subdirectory to the rtp, immediately
|
||||
" after the original directory. If no argument is given, 'bundle' is used.
|
||||
" Repeated calls with the same arguments are ignored.
|
||||
function! pathogen#runtime_append_all_bundles(...) " {{{1
|
||||
let sep = pathogen#separator()
|
||||
let name = a:0 ? a:1 : 'bundle'
|
||||
if "\n".s:done_bundles =~# "\\M\n".name."\n"
|
||||
return ""
|
||||
endif
|
||||
let s:done_bundles .= name . "\n"
|
||||
let list = []
|
||||
for dir in pathogen#split(&rtp)
|
||||
if dir =~# '\<after$'
|
||||
let list += filter(pathogen#glob_directories(substitute(dir,'after$',name,'').sep.'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir]
|
||||
else
|
||||
let list += [dir] + filter(pathogen#glob_directories(dir.sep.name.sep.'*[^~]'), '!pathogen#is_disabled(v:val)')
|
||||
endif
|
||||
endfor
|
||||
let &rtp = pathogen#join(pathogen#uniq(list))
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
let s:done_bundles = ''
|
||||
" }}}1
|
||||
|
||||
" Invoke :helptags on all non-$VIM doc directories in runtimepath.
|
||||
function! pathogen#helptags() " {{{1
|
||||
let sep = pathogen#separator()
|
||||
for dir in pathogen#split(&rtp)
|
||||
if (dir.sep)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir.sep.'doc') == 2 && !empty(filter(split(glob(dir.sep.'doc'.sep.'*'),"\n>"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags'))
|
||||
helptags `=dir.'/doc'`
|
||||
endif
|
||||
endfor
|
||||
endfunction " }}}1
|
||||
|
||||
command! -bar Helptags :call pathogen#helptags()
|
||||
|
||||
" Like findfile(), but hardcoded to use the runtimepath.
|
||||
function! pathogen#runtime_findfile(file,count) "{{{1
|
||||
let rtp = pathogen#join(1,pathogen#split(&rtp))
|
||||
let file = findfile(a:file,rtp,a:count)
|
||||
if file ==# ''
|
||||
return ''
|
||||
else
|
||||
return fnamemodify(file,':p')
|
||||
endif
|
||||
endfunction " }}}1
|
||||
|
||||
" Backport of fnameescape().
|
||||
function! pathogen#fnameescape(string) " {{{1
|
||||
if exists('*fnameescape')
|
||||
return fnameescape(a:string)
|
||||
elseif a:string ==# '-'
|
||||
return '\-'
|
||||
else
|
||||
return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
|
||||
endif
|
||||
endfunction " }}}1
|
||||
|
||||
function! s:find(count,cmd,file,lcd) " {{{1
|
||||
let rtp = pathogen#join(1,pathogen#split(&runtimepath))
|
||||
let file = pathogen#runtime_findfile(a:file,a:count)
|
||||
if file ==# ''
|
||||
return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
|
||||
elseif a:lcd
|
||||
let path = file[0:-strlen(a:file)-2]
|
||||
execute 'lcd `=path`'
|
||||
return a:cmd.' '.pathogen#fnameescape(a:file)
|
||||
else
|
||||
return a:cmd.' '.pathogen#fnameescape(file)
|
||||
endif
|
||||
endfunction " }}}1
|
||||
|
||||
function! s:Findcomplete(A,L,P) " {{{1
|
||||
let sep = pathogen#separator()
|
||||
let cheats = {
|
||||
\'a': 'autoload',
|
||||
\'d': 'doc',
|
||||
\'f': 'ftplugin',
|
||||
\'i': 'indent',
|
||||
\'p': 'plugin',
|
||||
\'s': 'syntax'}
|
||||
if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
|
||||
let request = cheats[a:A[0]].a:A[1:-1]
|
||||
else
|
||||
let request = a:A
|
||||
endif
|
||||
let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
|
||||
let found = {}
|
||||
for path in pathogen#split(&runtimepath)
|
||||
let path = expand(path, ':p')
|
||||
let matches = split(glob(path.sep.pattern),"\n")
|
||||
call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
|
||||
call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
|
||||
for match in matches
|
||||
let found[match] = 1
|
||||
endfor
|
||||
endfor
|
||||
return sort(keys(found))
|
||||
endfunction " }}}1
|
||||
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
|
||||
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
|
||||
|
||||
" vim:set ft=vim ts=8 sw=2 sts=2:
|
1
vim/bundle/nerdtree
Submodule
1
vim/bundle/nerdtree
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 1dc3891f960c25aa3f23aa46f5afc8d41db38233
|
1
vim/bundle/powerline
Submodule
1
vim/bundle/powerline
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 7f53b5c3919bde9a4259d0c725d453ef2337a4ed
|
1117
vim/colors/solarized.vim
Normal file
1117
vim/colors/solarized.vim
Normal file
File diff suppressed because it is too large
Load diff
2
vim/ftdetect/puppet.vim
Normal file
2
vim/ftdetect/puppet.vim
Normal file
|
@ -0,0 +1,2 @@
|
|||
" detect puppet filetype
|
||||
au BufRead,BufNewFile *.pp set filetype=puppet
|
94
vim/ftplugin/puppet.vim
Normal file
94
vim/ftplugin/puppet.vim
Normal file
|
@ -0,0 +1,94 @@
|
|||
" Vim filetype plugin
|
||||
" Language: Puppet
|
||||
" Maintainer: Todd Zullinger <tmz@pobox.com>
|
||||
" Last Change: 2009 Aug 19
|
||||
" vim: set sw=4 sts=4:
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
if !exists("no_plugin_maps") && !exists("no_puppet_maps")
|
||||
if !hasmapto("<Plug>AlignRange")
|
||||
map <buffer> <LocalLeader>= <Plug>AlignRange
|
||||
endif
|
||||
endif
|
||||
|
||||
noremap <buffer> <unique> <script> <Plug>AlignArrows :call <SID>AlignArrows()<CR>
|
||||
noremap <buffer> <unique> <script> <Plug>AlignRange :call <SID>AlignRange()<CR>
|
||||
|
||||
iabbrev => =><C-R>=<SID>AlignArrows('=>')<CR>
|
||||
iabbrev +> +><C-R>=<SID>AlignArrows('+>')<CR>
|
||||
|
||||
if exists('*s:AlignArrows')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:arrow_re = '[=+]>'
|
||||
let s:selector_re = '[=+]>\s*\$.*\s*?\s*{\s*$'
|
||||
|
||||
function! s:AlignArrows(op)
|
||||
let cursor_pos = getpos('.')
|
||||
let lnum = line('.')
|
||||
let line = getline(lnum)
|
||||
if line !~ s:arrow_re
|
||||
return
|
||||
endif
|
||||
let pos = stridx(line, a:op)
|
||||
let start = lnum
|
||||
let end = lnum
|
||||
let pnum = lnum - 1
|
||||
while 1
|
||||
let pline = getline(pnum)
|
||||
if pline !~ s:arrow_re || pline =~ s:selector_re
|
||||
break
|
||||
endif
|
||||
let start = pnum
|
||||
let pnum -= 1
|
||||
endwhile
|
||||
let cnum = end
|
||||
while 1
|
||||
let cline = getline(cnum)
|
||||
if cline !~ s:arrow_re ||
|
||||
\ (indent(cnum) != indent(cnum+1) && getline(cnum+1) !~ '\s*}')
|
||||
break
|
||||
endif
|
||||
let end = cnum
|
||||
let cnum += 1
|
||||
endwhile
|
||||
call s:AlignSection(start, end)
|
||||
let cursor_pos[2] = stridx(getline('.'), a:op) + strlen(a:op) + 1
|
||||
call setpos('.', cursor_pos)
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:AlignRange() range
|
||||
call s:AlignSection(a:firstline, a:lastline)
|
||||
endfunction
|
||||
|
||||
" AlignSection and AlignLine are from the vim wiki:
|
||||
" http://vim.wikia.com/wiki/Regex-based_text_alignment
|
||||
function! s:AlignSection(start, end)
|
||||
let extra = 1
|
||||
let sep = s:arrow_re
|
||||
let maxpos = 0
|
||||
let section = getline(a:start, a:end)
|
||||
for line in section
|
||||
let pos = match(line, ' *'.sep)
|
||||
if maxpos < pos
|
||||
let maxpos = pos
|
||||
endif
|
||||
endfor
|
||||
call map(section, 's:AlignLine(v:val, sep, maxpos, extra)')
|
||||
call setline(a:start, section)
|
||||
endfunction
|
||||
|
||||
function! s:AlignLine(line, sep, maxpos, extra)
|
||||
let m = matchlist(a:line, '\(.\{-}\) \{-}\('.a:sep.'.*\)')
|
||||
if empty(m)
|
||||
return a:line
|
||||
endif
|
||||
let spaces = repeat(' ', a:maxpos - strlen(m[1]) + a:extra)
|
||||
return m[1] . spaces . m[2]
|
||||
endfunction
|
76
vim/indent/puppet.vim
Normal file
76
vim/indent/puppet.vim
Normal file
|
@ -0,0 +1,76 @@
|
|||
" Vim indent file
|
||||
" Language: Puppet
|
||||
" Maintainer: Todd Zullinger <tmz@pobox.com>
|
||||
" Last Change: 2009 Aug 19
|
||||
" vim: set sw=4 sts=4:
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal autoindent smartindent
|
||||
setlocal indentexpr=GetPuppetIndent()
|
||||
setlocal indentkeys+=0],0)
|
||||
|
||||
if exists("*GetPuppetIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Check if a line is part of an include 'block', e.g.:
|
||||
" include foo,
|
||||
" bar,
|
||||
" baz
|
||||
function! s:PartOfInclude(lnum)
|
||||
let lnum = a:lnum
|
||||
while lnum
|
||||
let lnum = lnum - 1
|
||||
let line = getline(lnum)
|
||||
if line !~ ',$'
|
||||
break
|
||||
endif
|
||||
if line =~ '^\s*include\s\+[^,]\+,$'
|
||||
return 1
|
||||
endif
|
||||
endwhile
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:OpenBrace(lnum)
|
||||
call cursor(a:lnum, 1)
|
||||
return searchpair('{\|\[\|(', '', '}\|\]\|)', 'nbW')
|
||||
endfunction
|
||||
|
||||
function! GetPuppetIndent()
|
||||
let pnum = prevnonblank(v:lnum - 1)
|
||||
if pnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let line = getline(v:lnum)
|
||||
let pline = getline(pnum)
|
||||
let ind = indent(pnum)
|
||||
|
||||
if pline =~ '^\s*#'
|
||||
return ind
|
||||
endif
|
||||
|
||||
if pline =~ '\({\|\[\|(\|:\)$'
|
||||
let ind += &sw
|
||||
elseif pline =~ ';$' && pline !~ '[^:]\+:.*[=+]>.*'
|
||||
let ind -= &sw
|
||||
elseif pline =~ '^\s*include\s\+.*,$'
|
||||
let ind += &sw
|
||||
endif
|
||||
|
||||
if pline !~ ',$' && s:PartOfInclude(pnum)
|
||||
let ind -= &sw
|
||||
endif
|
||||
|
||||
" Match } }, }; ] ]: )
|
||||
if line =~ '^\s*\(}\(,\|;\)\?$\|]:\?$\|)\)'
|
||||
let ind = indent(s:OpenBrace(v:lnum))
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
4
vim/rcfiles/gvimrc
Normal file
4
vim/rcfiles/gvimrc
Normal file
|
@ -0,0 +1,4 @@
|
|||
set background=dark
|
||||
colorscheme solarized
|
||||
set guifont=Menlo:h11
|
||||
set guioptions-=rL
|
61
vim/rcfiles/vimrc
Normal file
61
vim/rcfiles/vimrc
Normal file
|
@ -0,0 +1,61 @@
|
|||
version 7.3
|
||||
|
||||
syntax on
|
||||
set background=dark
|
||||
colorscheme solarized
|
||||
hi BadWhitespace ctermbg=red guibg=red
|
||||
|
||||
let g:Powerline_symbols='fancy'
|
||||
|
||||
set gdefault
|
||||
set nobackup
|
||||
set nodigraph
|
||||
set incsearch
|
||||
set nohlsearch
|
||||
set nojoinspaces
|
||||
set nocompatible
|
||||
set nowritebackup
|
||||
|
||||
set title
|
||||
set number
|
||||
set showcmd "show combo command as you type it in the bottom right corner
|
||||
set showmode "show what mode you're in (Insert, Replace, Visual, etc.)
|
||||
set ruler laststatus=2 "show rulers for buffers and the status line even if there's only 1 file
|
||||
set clipboard+=unnamed "the same clipboard is used for Visual mode
|
||||
set ignorecase smartcase "when searching, match case only when at least one char is upper
|
||||
set backspace=eol,start,indent "make backspace work between lines and with indentation
|
||||
set winminheight=0 "Allow windows to get fully squashed
|
||||
set scrolloff=5 "start scrolling 10 lines before the end of the buffer
|
||||
set cursorline "highlight current line
|
||||
set cursorcolumn "highlight current column
|
||||
|
||||
set shiftwidth=2 tabstop=2 softtabstop=2 "by default, Tab moves by 2 spaces
|
||||
set shiftround "tabbing and detabbing also uses shiftwidth
|
||||
set autoindent "keep current indent state when starting a new line
|
||||
set matchpairs+=(:),{:},[:],<:>,':',":" "join these pairs of characters; useful for highlighting and jumping between with %
|
||||
|
||||
set bs=2
|
||||
|
||||
nmap <tab> w
|
||||
nmap
:wq!
|
||||
imap <BS>
|
||||
|
||||
map <leader>b <Esc>:set cc=79<CR>
|
||||
map <leader>nb <Esc>:set cc=0<CR>
|
||||
map <leader>n <Esc>:set nonumber!<CR>
|
||||
map <leader>\ <Esc>:setlocal nospell<CR>
|
||||
map <leader>pl <Esc>:setlocal spell spelllang=pl<CR>
|
||||
map <leader>en <Esc>:setlocal spell spelllang=en_gb<CR>
|
||||
map <leader>p <Esc>:set paste!<CR>
|
||||
map <F2> :NERDTreeToggle<CR>
|
||||
|
||||
call pathogen#runtime_append_all_bundles()
|
||||
|
||||
nnoremap n nzzzv
|
||||
nnoremap N Nzzzv¬
|
||||
|
||||
au BufRead,BufNewFile *.pp
|
||||
\ set filetype=puppet
|
||||
au BufRead,BufNewFile *_spec.rb
|
||||
\ nmap <F8> :!rspec --color %<CR>
|
||||
filetype plugin indent on
|
BIN
vim/spell/en.utf-8.spl
Normal file
BIN
vim/spell/en.utf-8.spl
Normal file
Binary file not shown.
BIN
vim/spell/pl.utf-8.spl
Normal file
BIN
vim/spell/pl.utf-8.spl
Normal file
Binary file not shown.
9
vim/spell/pl.utf-8.sug
Normal file
9
vim/spell/pl.utf-8.sug
Normal file
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
|
||||
<html><head>
|
||||
<title>404 Not Found</title>
|
||||
</head><body>
|
||||
<h1>Not Found</h1>
|
||||
<p>The requested URL /pub/vim/runtime/spell/pl.utf-8.sug was not found on this server.</p>
|
||||
<hr>
|
||||
<address>Apache/2.2.3 (CentOS) Server at ftp.vim.org Port 80</address>
|
||||
</body></html>
|
115
vim/syntax/puppet.vim
Normal file
115
vim/syntax/puppet.vim
Normal file
|
@ -0,0 +1,115 @@
|
|||
" puppet syntax file
|
||||
" Filename: puppet.vim
|
||||
" Language: puppet configuration file
|
||||
" Maintainer: Luke Kanies <luke@madstop.com>
|
||||
" URL:
|
||||
" Last Change:
|
||||
" Version:
|
||||
"
|
||||
|
||||
" Copied from the cfengine, ruby, and perl syntax files
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" match class/definition/node declarations
|
||||
syn region puppetDefine start="^\s*\(class\|define\|node\)\s" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments,puppetNodeRe
|
||||
syn keyword puppetDefType class define node inherits contained
|
||||
syn region puppetDefArguments start="(" end=")" contained contains=puppetArgument,puppetString
|
||||
syn match puppetArgument "\w\+" contained
|
||||
syn match puppetArgument "\$\w\+" contained
|
||||
syn match puppetArgument "'[^']+'" contained
|
||||
syn match puppetArgument '"[^"]+"' contained
|
||||
syn match puppetDefName "\w\+" contained
|
||||
syn match puppetNodeRe "/.*/" contained
|
||||
|
||||
" match 'foo' in 'class foo { ...'
|
||||
" match 'foo::bar' in 'class foo::bar { ...'
|
||||
" match 'Foo::Bar' in 'Foo::Bar["..."]
|
||||
"FIXME: "Foo-bar" doesn't get highlighted as expected, although "foo-bar" does.
|
||||
syn match puppetInstance "[A-Za-z0-9_-]\+\(::[A-Za-z0-9_-]\+\)*\s*{" contains=puppetTypeName,puppetTypeDefault
|
||||
syn match puppetInstance "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*[[{]" contains=puppetTypeName,puppetTypeDefault
|
||||
syn match puppetInstance "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*<\?<|" contains=puppetTypeName,puppetTypeDefault
|
||||
syn match puppetTypeName "[a-z]\w*" contained
|
||||
syn match puppetTypeDefault "[A-Z]\w*" contained
|
||||
|
||||
" match 'foo' in 'foo => "bar"'
|
||||
syn match puppetParam "\w\+\s*[=+]>" contains=puppetParamName
|
||||
syn match puppetParamName "\w\+" contained
|
||||
|
||||
" match 'present' in 'ensure => present'
|
||||
" match '2755' in 'mode => 2755'
|
||||
" don't match 'bar' in 'foo => bar'
|
||||
syn match puppetParam "\w\+\s*[=+]>\s*[a-z0-9]\+" contains=puppetParamString,puppetParamName
|
||||
syn match puppetParamString "[=+]>\s*\w\+" contains=puppetParamKeyword,puppetParamSpecial,puppetParamDigits contained
|
||||
syn keyword puppetParamKeyword present absent purged latest installed running stopped mounted unmounted role configured file directory link contained
|
||||
syn keyword puppetParamSpecial true false undef contained
|
||||
syn match puppetParamDigits "[0-9]\+"
|
||||
|
||||
" match 'template' in 'content => template("...")'
|
||||
syn match puppetParam "\w\+\s*[=+]>\s*\w\+\s*(" contains=puppetFunction,puppetParamName
|
||||
" statements
|
||||
syn region puppetFunction start="^\s*\(alert\|crit\|debug\|emerg\|err\|fail\|include\|info\|notice\|realize\|require\|search\|tag\|warning\)\s*(" end=")" contained contains=puppetString
|
||||
" rvalues
|
||||
syn region puppetFunction start="^\s*\(defined\|file\|fqdn_rand\|generate\|inline_template\|regsubst\|sha1\|shellquote\|split\|sprintf\|tagged\|template\|versioncmp\)\s*(" end=")" contained contains=puppetString
|
||||
|
||||
syn match puppetVariable "$[a-zA-Z0-9_:]\+"
|
||||
syn match puppetVariable "${[a-zA-Z0-9_:]\+}"
|
||||
|
||||
" match anything between simple/double quotes.
|
||||
" don't match variables if preceded by a backslash.
|
||||
syn region puppetString start=+'+ skip=+\\\\\|\\'+ end=+'+
|
||||
syn region puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=puppetVariable,puppetNotVariable
|
||||
syn match puppetString "/[^/]*/"
|
||||
syn match puppetNotVariable "\\$\w\+" contained
|
||||
syn match puppetNotVariable "\\${\w\+}" contained
|
||||
|
||||
syn keyword puppetKeyword import inherits include
|
||||
syn keyword puppetControl case default if else elsif
|
||||
syn keyword puppetSpecial true false undef
|
||||
|
||||
" comments last overriding everything else
|
||||
syn match puppetComment "\s*#.*$" contains=puppetTodo
|
||||
syn region puppetComment start="/\*" end="\*/" contains=puppetTodo extend
|
||||
syn keyword puppetTodo TODO NOTE FIXME XXX BUG HACK contained
|
||||
|
||||
" Define the default highlighting.
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||
if version >= 508 || !exists("did_puppet_syn_inits")
|
||||
if version < 508
|
||||
let did_puppet_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink puppetVariable Identifier
|
||||
HiLink puppetType Identifier
|
||||
HiLink puppetKeyword Define
|
||||
HiLink puppetComment Comment
|
||||
HiLink puppetString String
|
||||
HiLink puppetParamKeyword String
|
||||
HiLink puppetParamDigits String
|
||||
HiLink puppetNotVariable String
|
||||
HiLink puppetParamSpecial Special
|
||||
HiLink puppetSpecial Special
|
||||
HiLink puppetTodo Todo
|
||||
HiLink puppetControl Statement
|
||||
HiLink puppetDefType Define
|
||||
HiLink puppetDefName Type
|
||||
HiLink puppetNodeRe Type
|
||||
HiLink puppetTypeName Statement
|
||||
HiLink puppetTypeDefault Type
|
||||
HiLink puppetParamName Identifier
|
||||
HiLink puppetArgument Identifier
|
||||
HiLink puppetFunction Function
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "puppet"
|
Loading…
Add table
Add a link
Reference in a new issue