Coder Social home page Coder Social logo

vim-helm's Introduction

vim-helm

vim syntax for helm templates (yaml + gotmpl + sprig + custom)

Install via vundle:

Plugin 'towolf/vim-helm'

vim-helm's People

Contributors

avorima avatar eshepelyuk avatar joanayma avatar luisdavim avatar richardkraus avatar siraphobk avatar towolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vim-helm's Issues

How do you deal with LSP YAML detection?

Helm files are handled as YAML and produces much LSP errors.
I've got this in my on_attach function:

local on_attach = function(client, bufnr)
	-- Short-circuit for Helm template files
	if vim.bo[bufnr].buftype ~= '' or vim.bo[bufnr].filetype == 'helm' then
		vim.diagnostic.disable(bufnr)
		vim.defer_fn(function()
			vim.diagnostic.reset(nil, bufnr)
		end, 1000)
		return
	end
...

It's not perfect (defer_fn), the statusline still reports error summary sometimes, but it's the best I came up with.
Anybody has better workarounds?

Every yaml file is detected as Helm inside a project containing Chart.yaml

Hello @towolf @luisdavim

After the latest update 69a5117

Every *.yaml file within the folder containing Chart.yaml is detected as helm.
Even Chart.yaml itself is detected as helm

E.g. in such structure, all three yaml files are detected as helm, and that's wrong.

Only ones located in templates folder should be considered as helm.

├── Chart.yaml
├── src
│  └── model
│     └── test.yaml
└── templates
   └── deployment.yaml

This plugins should set commentstring

Hello

Currently, default Vim's commentstring is used, it's usually C-style comment /* ... */.

The plugin should set it to {{/* ... */}} - this will be a proper comment both for Go template and Yaml within Helm template or similar files.

Bad compatibility with Oil file explorer

Oil is an alternative file explorer for Neovim that lets you edit the filesystem inside a normal buffer. The buffer has the type oil and is named oil:///<file path> (or, I believe, oil-ssh:///<file path>, since Oil also has ssh support)

The issue is that since the Oil opens directories in simple buffers, vim-helm calls this function on them (also, I'm not sure why, but findfile("Chart.yaml", expand('%:p:h').';') is always returning something, regardless of the current directory being emtpy. i.e. if I'm on an empty /foo directory and I call findfile("Chart.yaml", expand('%:p:h').';') on it, it will return /foo/Chart.yaml)

Reproducing:

Considering a neovim installation with both Oil.nvim and vim-helm, and an empty directory /Users/foo, when I open that directory with nvim /Users/foo and execute:

:echo findfile("Chart.yaml", expand('%:p:h').';')

I see:
Screenshot 2024-05-21 at 10 44 42
(notice the filetype set to helm and the output of the findfile command)

Readme file precision for .tpl file

Hello,

I wanted to do a small PR to add a little precision in the README file, for the new user. (but it seems you are not accepting PR?)

changed proposed

" set the .tpl file type to yaml to get basic syntax and indentation
autocmd BufNewFile,BufRead *.tpl   set filetype=yaml
" set the file type to helm to augment the syntax 
autocmd BufRead,BufNewFile */templates/*.yaml,*/templates/*.tpl set ft=helm

this way it would colorize the Helm .tpl files

thank you for your work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.