Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
Add terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
ziwon committed Jan 29, 2019
1 parent bc0f7ff commit 159e8f2
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 9 deletions.
57 changes: 52 additions & 5 deletions nvim/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Plug 'tpope/vim-surround'
Plug 'vimwiki/vimwiki'
Plug 'tomlion/vim-solidity'
Plug 'Vimjas/vim-python-pep8-indent'
Plug 'vim-syntastic/syntastic'
Plug 'juliosueiras/vim-terraform-completion'
Plug 'juliosueiras/vim-terraform-snippets'

" Vim only plugins
if !has('nvim')
Expand Down Expand Up @@ -111,6 +114,7 @@ set tabstop=2
set title " let vim set the terminal title
set updatetime=100 " redraw the status bar often
set shiftwidth=4 " virtual tabstops using spaces
set nocompatible

" neovim specific settings
if has('nvim')
Expand Down Expand Up @@ -143,6 +147,10 @@ autocmd BufWritePre * :%s/\s\+$//e
" Center the screen quickly
nnoremap <space> zz
" Hide Info(Preview) window after completions
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif

"----------------------------------------------
" Colors
"----------------------------------------------
Expand Down Expand Up @@ -272,6 +280,12 @@ autocmd BufEnter NERD_tree_* :call BookmarkUnmapKeys()
"----------------------------------------------
" Plugin: Shougo/deoplete.nvim
"----------------------------------------------

set omnifunc='terraformcomplete#Complete'

let g:deoplete#omni_patterns = {}
let g:deoplete#omni_patterns.terraform = '[^ *\t"{=$]\w*'

if has('nvim')
" Enable deoplete on startup
let g:deoplete#enable_at_startup = 1
Expand All @@ -286,6 +300,7 @@ function! Multiple_cursors_after()
let b:deoplete_disable_auto_complete = 0
endfunction

call deoplete#initialize()
"----------------------------------------------
" Plugin: bling/vim-airline
"----------------------------------------------
Expand Down Expand Up @@ -343,11 +358,11 @@ let g:tmux_navigator_no_mappings = 1
let g:tmux_navigator_save_on_switch = 1

" Move between splits with ctrl+h,j,k,l
nnoremap <silent> <c-h> :TmuxNavigateLeft<cr>
nnoremap <silent> <c-j> :TmuxNavigateDown<cr>
nnoremap <silent> <c-k> :TmuxNavigateUp<cr>
nnoremap <silent> <c-l> :TmuxNavigateRight<cr>
nnoremap <silent> <c-\> :TmuxNavigatePrevious<cr>
" nnoremap <silent> <c-h> :TmuxNavigateLeft<cr>
" nnoremap <silent> <c-j> :TmuxNavigateDown<cr>
" nnoremap <silent> <c-k> :TmuxNavigateUp<cr>
" nnoremap <silent> <c-l> :TmuxNavigateRight<cr>
" nnoremap <silent> <c-\> :TmuxNavigatePrevious<cr>

"----------------------------------------------
" Plugin: 'ctrlpvim/ctrlp.vim'
Expand Down Expand Up @@ -449,6 +464,12 @@ nnoremap <leader>a :Ack!<space>
"----------------------------------------------
" Plugin: neomake/neomake
"----------------------------------------------
" Setup to run neomake run automatically
call neomake#configure#automake('w')
call neomake#configure#automake('nw', 750)
call neomake#configure#automake('rw', 1000)
call neomake#configure#automake('nrwi', 500)

" Configure signs.
let g:neomake_error_sign = {'text': '', 'texthl': 'NeomakeErrorSign'}
let g:neomake_warning_sign = {'text': '', 'texthl': 'NeomakeWarningSign'}
Expand Down Expand Up @@ -538,6 +559,10 @@ imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
inoremap <expr><tab> pumvisible() ? "\<C-n>" :
\ neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)" : "\<tab>"
" Set the path to our snippets
let g:neosnippet#snippets_directory='~/.config/nvim/snippets'

Expand Down Expand Up @@ -572,6 +597,28 @@ let g:deoplete#sources#go#pointer = 1
"----------------------------------------------
let g:pymode_indent = 0

"----------------------------------------------
" Plugin: vim-syntastic/syntastic
"----------------------------------------------
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

let g:terraform_fmt_on_save=1
let g:terraform_align=1
let g:terraform_remap_spacebar=1

"----------------------------------------------
" Plug 'juliosueiras/vim-terraform-completion'
"----------------------------------------------
let g:terraform_completion_keys = 1
let g:terraform_registry_module_completion = 1

"----------------------------------------------
" Language: Golang
"----------------------------------------------
Expand Down
96 changes: 96 additions & 0 deletions terraform/.tfcompleterc
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
acme=1.0.1
alicloud=1.29.0
archive=1.1.0
arukas=1.0.0
atlas=0.1.1
aws=1.57.0
azure=0.1.1
azuread=0.1.0
azurerm=1.21.0
azurestack=0.4.0
bigip=0.12.0
brightbox=1.0.5
chef=0.1.0
circonus=0.2.0
clc=0.1.0
cloudflare=1.11.0
cloudscale=1.0.1
cloudstack=0.2.0
cobbler=1.0.1
consul=2.2.0
datadog=1.6.0
digitalocean=1.1.0
dme=0.1.0
dns=2.0.0
dnsimple=0.1.0
docker=1.1.0
dyn=1.1.0
external=1.0.0
fastly=0.5.0
flexibleengine=1.4.0
github=1.3.0
gitlab=1.1.0
google=1.20.0
grafana=1.3.0
hcloud=1.7.0
hedvig=1.0.1
helm=0.7.0
heroku=1.7.3
http=1.0.1
huaweicloud=1.3.0
icinga2=0.2.0
ignition=1.0.1
influxdb=1.0.2
kubernetes=1.5.0
librato=0.1.0
linode=1.4.0
local=1.1.0
logentries=1.0.0
logicmonitor=1.2.0
mailgun=0.1.0
mysql=1.5.1
netlify=0.1.0
newrelic=1.2.0
nomad=1.3.0
ns1=1.1.0
nsxt=1.0.0
null=2.0.0
nutanix=1.0.0
oci=3.13.0
oneandone=1.3.0
opc=1.3.2
openstack=1.14.0
opentelekomcloud=1.5.2
opsgenie=0.1.0
oraclepaas=1.4.2
ovh=0.3.0
packet=1.2.5
pagerduty=1.2.1
panos=1.4.1
postgresql=0.1.3
powerdns=0.1.0
profitbricks=1.4.1
rabbitmq=1.0.0
rancher=1.2.1
random=2.0.0
rightscale=1.3.0
rundeck=0.1.0
runscope=0.5.0
scaleway=1.8.0
selvpc=1.1.0
skytap=0.9.0
softlayer=0.0.1
spotinst=1.6.0
statuscake=0.2.0
telefonicaopencloud=1.0.0
template=2.0.0
tencentcloud=1.2.2
terraform=1.0.2
tfe=0.6.0
tls=1.2.0
triton=0.5.1
ucloud=1.1.0
ultradns=0.1.0
vault=1.4.1
vcd=1.0.0
vsphere=1.9.1
7 changes: 7 additions & 0 deletions terraform/init
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

cd "$(dirname "${BASH_SOURCE}")";

rsync .tfcompleterc ~

command -v terraform &> /dev/null && terraform -install-autocomplete
8 changes: 4 additions & 4 deletions tmux/.tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ bind k select-pane -U
bind l select-pane -R

# Move from pane to pane using ctrl key bindings
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R
#bind -n C-h select-pane -L
#bind -n C-j select-pane -D
#bind -n C-k select-pane -U
#bind -n C-l select-pane -R

# Resize pane
bind -r H resize-pane -L 5
Expand Down
8 changes: 8 additions & 0 deletions zsh/.exports.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ export SHELL='/usr/local/bin/zsh'
# Fix ls: illegal option -- - in tmux
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin"
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/ruby/bin:$PATH"

# Provide ruby/dyn+ in vim
export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"
export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig"

export NVIM_LOG_FILE="${HOME}/.local/share/nvim/log"

# History size
export HISTSIZE='90000';
Expand Down

0 comments on commit 159e8f2

Please sign in to comment.