diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 13b408d..2b5404c 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -13,6 +13,8 @@ augroup recompile_plugins augroup END autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab +autocmd BufRead,BufNewFile *.hcl set filetype=terraform +autocmd BufRead,BufNewFile *.tf set filetype=terraform "" Temporary hacks diff --git a/.config/nvim/lua/dln/lsp-config.lua b/.config/nvim/lua/dln/lsp-config.lua index 8d0fa14..ab0e03e 100644 --- a/.config/nvim/lua/dln/lsp-config.lua +++ b/.config/nvim/lua/dln/lsp-config.lua @@ -95,6 +95,8 @@ lspconfig.sumneko_lua.setup { } } +lspconfig.terraformls.setup {} + local yaml_is_k8s = function(bufnr) local lines = vim.api.nvim_buf_get_lines(bufnr, 0, 50, false) -- Stop after the first 50 lines for _, l in pairs(lines) do @@ -107,12 +109,39 @@ lspconfig.yamlls.setup { settings = { yaml = { format = {enable = true, singleQuote = true}, - schemaStore = {enable = true}, + schemaStore = {enable = true, url = "https://json.schemastore.org"}, schemas = { -- ["https://json.schemastore.org/github-workflow"] = "*.github/workflows/*", ["https://json.schemastore.org/kustomization.json"] = "kustomization.yaml", -- ["https://json.schemastore.org/ansible-role-2.9.json"] = "*/tasks/*.y*ml", - -- kubernetes = "*.yaml", + kubernetes = { + "clusterrolebinding.yaml", + "clusterrole-contour.yaml", + "clusterrole.yaml", + "configmap.yaml", + "cronjob.yaml", + "daemonset.yaml", + "deployment-*.yaml", + "deployment.yaml", + "*-deployment.yaml", + "hpa.yaml", + "ingress.yaml", + "job.yaml", + "namespace.yaml", + "pvc.yaml", + "rbac.yaml", + "rolebinding.yaml", + "role.yaml", + "sa.yaml", + "secret.yaml", + "serviceaccounts.yaml", + "service-account.yaml", + "serviceaccount.yaml", + "service-*.yaml", + "service.yaml", + "*-service.yaml", + "statefulset.yaml", + }, }, validate = true diff --git a/.config/nvim/lua/init.lua b/.config/nvim/lua/init.lua index ab3ec22..ef33ba9 100644 --- a/.config/nvim/lua/init.lua +++ b/.config/nvim/lua/init.lua @@ -11,8 +11,8 @@ vim.o.ttimeout = true vim.o.ttimeoutlen = 50 vim.o.updatetime = 100 vim.o.autochdir = true -vim.o.backupdir = "/home/dln/.local/share/nvim/backup//" - +vim.o.backupdir = "/home/dln/.local/share/nvim/backup/" +vim.o.backup = true --- Indent vim.bo.autoindent = true @@ -24,9 +24,9 @@ vim.o.listchars = 'extends:›,precedes:‹,nbsp:·,tab:→ ,trail:·' vim.wo.foldlevel = 99 vim.wo.linebreak = true vim.wo.list = true -vim.o.shiftwidth = 4 -vim.o.tabstop = 4 -vim.o.softtabstop = 4 +vim.o.shiftwidth = 2 +vim.o.tabstop = 2 +vim.o.softtabstop = 2 --- Search vim.cmd('set path+=**') diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index adc7eb9..16036f7 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -1,5 +1,6 @@ return require('packer').startup(function() - use "pierreglaser/folding-nvim" + use 'hashivim/vim-terraform' + use 'pierreglaser/folding-nvim' use 'tjdevries/colorbuddy.vim' use 'wbthomason/packer.nvim' @@ -164,4 +165,16 @@ return require('packer').startup(function() end } + use { + "cuducos/yaml.nvim", + ft = {"yaml"}, + requires = { + "nvim-treesitter/nvim-treesitter", + -- "nvim-telescope/telescope.nvim" -- optional + }, + config = function () + require("yaml_nvim").init() + end + } + end) diff --git a/.gitconfig b/.gitconfig index bd69fea..3f15a1e 100644 --- a/.gitconfig +++ b/.gitconfig @@ -94,10 +94,13 @@ helper = store [commit] # gpgsign = true -[user "arity"] +[user] name = Daniel Lundin email = daniel@arity.se signingkey = 79020DB026385D4C [init] defaultBranch = main +[url "git@github.com:"] + insteadOf = https://github.com/ + insteadOf = https://github.com/ diff --git a/.zshrc b/.zshrc index 5122602..5cba5e9 100644 --- a/.zshrc +++ b/.zshrc @@ -1,5 +1,6 @@ source ~/.zplug/init.zsh + zplug "plugins/git", from:oh-my-zsh zplug "zsh-users/zsh-completions" zplug 'zsh-users/zsh-syntax-highlighting', defer:2 @@ -43,7 +44,7 @@ setopt extended_glob setopt ksh_glob setopt null_glob -## Completion +# ## Completion autoload -Uz compinit compinit @@ -129,7 +130,7 @@ export NVIM_LISTEN_ADDRESS=/tmp/nvimsocket e () { - nvr --remote $(readlink -f "$@") + nvr --nostart --remote $(readlink -f "$@") echo -e "\x1b]2;$(_title) $(date +%s):nvim\x1b\\" } @@ -156,6 +157,12 @@ command -v flux >/dev/null 2>&1 && source <(flux completion zsh) ## Tekton cli command -v tkn >/dev/null 2>&1 && source <(tkn completion zsh) +## kapp +command -v kapp >/dev/null 2>&1 && source <(kapp completion zsh) + +## talos cli +command -v talosctl >/dev/null 2>&1 && source <(talosctl completion zsh) + ## Google Cloud [ -f /opt/google-cloud-sdk/completion.zsh.inc ] && source /opt/google-cloud-sdk/completion.zsh.inc @@ -183,5 +190,8 @@ export PGO_NAMESPACE=pgo export PATH=$HOME/bin:$PATH -autoload -U +X bashcompinit && bashcompinit +#autoload -U +X bashcompinit && bashcompinit complete -o nospace -C /usr/bin/vault vault + +autoload -Uz compinit +compinit