summaryrefslogtreecommitdiffstats
path: root/after/ftplugin
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2019-06-08 12:44:15 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2019-06-08 12:44:15 +0200
commit671078ef6c851b688b63165761cec82f9f6e03f7 (patch)
treeefde30baaf2ca21a09a35e1ccf1d2ff744482d2b /after/ftplugin
parentaebef2c2e76b88384b1121c237c965e8cf8b3bcb (diff)
downloadvim-polyglot-671078ef6c851b688b63165761cec82f9f6e03f7.tar.gz
vim-polyglot-671078ef6c851b688b63165761cec82f9f6e03f7.zip
Update
Diffstat (limited to 'after/ftplugin')
-rw-r--r--after/ftplugin/terraform.vim85
1 files changed, 0 insertions, 85 deletions
diff --git a/after/ftplugin/terraform.vim b/after/ftplugin/terraform.vim
deleted file mode 100644
index 610fd900..00000000
--- a/after/ftplugin/terraform.vim
+++ /dev/null
@@ -1,85 +0,0 @@
-if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'terraform') != -1
- finish
-endif
-
-if !exists('g:terraform_align')
- let g:terraform_align = 0
-endif
-
-if !exists('g:terraform_remap_spacebar')
- let g:terraform_remap_spacebar = 0
-endif
-
-if !exists('g:terraform_fold_sections')
- let g:terraform_fold_sections = 0
-endif
-
-if g:terraform_align && exists(':Tabularize')
- inoremap <buffer> <silent> = =<Esc>:call <SID>terraformalign()<CR>a
- function! s:terraformalign()
- let p = '^.*=[^>]*$'
- if exists(':Tabularize') && getline('.') =~# '^.*=' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
- let column = strlen(substitute(getline('.')[0:col('.')],'[^=]','','g'))
- let position = strlen(matchstr(getline('.')[0:col('.')],'.*=\s*\zs.*'))
- Tabularize/=/l1
- normal! 0
- call search(repeat('[^=]*=',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
- endif
- endfunction
-endif
-
-if g:terraform_fold_sections
- function! TerraformFolds()
- let thisline = getline(v:lnum)
- if match(thisline, '^resource') >= 0
- return ">1"
- elseif match(thisline, '^provider') >= 0
- return ">1"
- elseif match(thisline, '^module') >= 0
- return ">1"
- elseif match(thisline, '^variable') >= 0
- return ">1"
- elseif match(thisline, '^output') >= 0
- return ">1"
- elseif match(thisline, '^data') >= 0
- return ">1"
- elseif match(thisline, '^terraform') >= 0
- return ">1"
- elseif match(thisline, '^locals') >= 0
- return ">1"
- else
- return "="
- endif
- endfunction
- setlocal foldmethod=expr
- setlocal foldexpr=TerraformFolds()
- setlocal foldlevel=1
-
- function! TerraformFoldText()
- let foldsize = (v:foldend-v:foldstart)
- return getline(v:foldstart).' ('.foldsize.' lines)'
- endfunction
- setlocal foldtext=TerraformFoldText()
-endif
-
-" Re-map the space bar to fold and unfold
-if get(g:, "terraform_remap_spacebar", 1)
- "inoremap <space> <C-O>za
- nnoremap <space> za
- onoremap <space> <C-C>za
- vnoremap <space> zf
-endif
-
-" Match the identation put in place by Hashicorp and :TerraformFmt, https://github.com/hashivim/vim-terraform/issues/21
-if get(g:, "terraform_align", 1)
- setlocal tabstop=2
- setlocal softtabstop=2
- setlocal shiftwidth=2
-endif
-
-" Set the commentstring
-if exists('g:terraform_commentstring')
- let &l:commentstring=g:terraform_commentstring
-else
- setlocal commentstring=#%s
-endif