moving on

This commit is contained in:
Daniel Lundin 2021-06-17 11:29:04 +02:00
parent 820041c273
commit 5298af4c1e
6 changed files with 69 additions and 12 deletions

View file

@ -13,6 +13,8 @@ augroup recompile_plugins
augroup END augroup END
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab 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 "" Temporary hacks

View file

@ -95,6 +95,8 @@ lspconfig.sumneko_lua.setup {
} }
} }
lspconfig.terraformls.setup {}
local yaml_is_k8s = function(bufnr) local yaml_is_k8s = function(bufnr)
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, 50, false) -- Stop after the first 50 lines local lines = vim.api.nvim_buf_get_lines(bufnr, 0, 50, false) -- Stop after the first 50 lines
for _, l in pairs(lines) do for _, l in pairs(lines) do
@ -107,12 +109,39 @@ lspconfig.yamlls.setup {
settings = { settings = {
yaml = { yaml = {
format = {enable = true, singleQuote = true}, format = {enable = true, singleQuote = true},
schemaStore = {enable = true}, schemaStore = {enable = true, url = "https://json.schemastore.org"},
schemas = { schemas = {
-- ["https://json.schemastore.org/github-workflow"] = "*.github/workflows/*", -- ["https://json.schemastore.org/github-workflow"] = "*.github/workflows/*",
["https://json.schemastore.org/kustomization.json"] = "kustomization.yaml", ["https://json.schemastore.org/kustomization.json"] = "kustomization.yaml",
-- ["https://json.schemastore.org/ansible-role-2.9.json"] = "*/tasks/*.y*ml", -- ["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 validate = true

View file

@ -11,8 +11,8 @@ vim.o.ttimeout = true
vim.o.ttimeoutlen = 50 vim.o.ttimeoutlen = 50
vim.o.updatetime = 100 vim.o.updatetime = 100
vim.o.autochdir = true 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 --- Indent
vim.bo.autoindent = true vim.bo.autoindent = true
@ -24,9 +24,9 @@ vim.o.listchars = 'extends:,precedes:,nbsp:·,tab:→ ,trail:·'
vim.wo.foldlevel = 99 vim.wo.foldlevel = 99
vim.wo.linebreak = true vim.wo.linebreak = true
vim.wo.list = true vim.wo.list = true
vim.o.shiftwidth = 4 vim.o.shiftwidth = 2
vim.o.tabstop = 4 vim.o.tabstop = 2
vim.o.softtabstop = 4 vim.o.softtabstop = 2
--- Search --- Search
vim.cmd('set path+=**') vim.cmd('set path+=**')

View file

@ -1,5 +1,6 @@
return require('packer').startup(function() return require('packer').startup(function()
use "pierreglaser/folding-nvim" use 'hashivim/vim-terraform'
use 'pierreglaser/folding-nvim'
use 'tjdevries/colorbuddy.vim' use 'tjdevries/colorbuddy.vim'
use 'wbthomason/packer.nvim' use 'wbthomason/packer.nvim'
@ -164,4 +165,16 @@ return require('packer').startup(function()
end 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) end)

View file

@ -94,10 +94,13 @@ helper = store
[commit] [commit]
# gpgsign = true # gpgsign = true
[user "arity"] [user]
name = Daniel Lundin name = Daniel Lundin
email = daniel@arity.se email = daniel@arity.se
signingkey = 79020DB026385D4C signingkey = 79020DB026385D4C
[init] [init]
defaultBranch = main defaultBranch = main
[url "git@github.com:"]
insteadOf = https://github.com/
insteadOf = https://github.com/

16
.zshrc
View file

@ -1,5 +1,6 @@
source ~/.zplug/init.zsh source ~/.zplug/init.zsh
zplug "plugins/git", from:oh-my-zsh zplug "plugins/git", from:oh-my-zsh
zplug "zsh-users/zsh-completions" zplug "zsh-users/zsh-completions"
zplug 'zsh-users/zsh-syntax-highlighting', defer:2 zplug 'zsh-users/zsh-syntax-highlighting', defer:2
@ -43,7 +44,7 @@ setopt extended_glob
setopt ksh_glob setopt ksh_glob
setopt null_glob setopt null_glob
## Completion # ## Completion
autoload -Uz compinit autoload -Uz compinit
compinit compinit
@ -129,7 +130,7 @@ export NVIM_LISTEN_ADDRESS=/tmp/nvimsocket
e () e ()
{ {
nvr --remote $(readlink -f "$@") nvr --nostart --remote $(readlink -f "$@")
echo -e "\x1b]2;$(_title) $(date +%s):nvim\x1b\\" 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 ## Tekton cli
command -v tkn >/dev/null 2>&1 && source <(tkn completion zsh) 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 ## Google Cloud
[ -f /opt/google-cloud-sdk/completion.zsh.inc ] && source /opt/google-cloud-sdk/completion.zsh.inc [ -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 export PATH=$HOME/bin:$PATH
autoload -U +X bashcompinit && bashcompinit #autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /usr/bin/vault vault complete -o nospace -C /usr/bin/vault vault
autoload -Uz compinit
compinit