txgvnn / emacs-k8s-mode Goto Github PK
View Code? Open in Web Editor NEWKubernetes mode in Emacs
License: GNU General Public License v3.0
Kubernetes mode in Emacs
License: GNU General Public License v3.0
When I edit a kubernetes yaml and hit <tab>
or <return>
keys within any indented region I get this error:
funcall-interactively: Wrong type argument: number-or-marker-p, nil
Emacs version 25.2.2.
Do you know of a way to get completion added? I would be willing to add some for this mode, but I do not know where I would find the keywords for kubernetes files. Also do you plan to do anything with Helm in the future?
debian/testing64
machine (I used Vagrant: vagrant up debian/testing64
+ vagrant ssh
)emacs-nox
package: sudo apt update && sudo apt install -y --no-install-recommends emacs-nox
emacs
; Enable MELPA and more
(setq package-archives
'(("Gnu" . "https://elpa.gnu.org/packages/")
;("marmalade" . "https://marmalade-repo.org/packages/")
("Melpa" . "https://melpa.org/packages/")
("Org" . "https://orgmode.org/elpa/"))
package-archive-priorities
'(("Org" . 10)
("Melpa" . 5)
("Gnu" . 0)))
; Bootstrap use-package library
(if (not (locate-library "use-package"))
(progn
(package-refresh-contents)
(package-install 'use-package)))
(require 'use-package)
; Force-install missing packages
(setq use-package-always-ensure t)
; Load yasnippet for our purposes
(use-package yasnippet
:diminish yas-minor-mode
:config
;; Fix indentation of snippets in yaml
;; https://github.com/joaotavora/yasnippet/issues/1020#issuecomment-539787929
(add-hook 'yaml-mode-hook
'(lambda () (set (make-local-variable 'yas-indent-line) 'fixed)))
(yas-global-mode 1))
; Now install/load k8s-mode as a normal user would
(use-package k8s-mode)
M-x k8s-mode
to switch modepod<TAB>
(yas-describe-tables)
not showing any k8s related entriesOn M-x k8s-mode
, typing pod<TAB>
should complete, as should
(yas-describe-tables)
show k8s-related snippets.
As a user, forcing loading the directory on mode enter
;; Force loading the k8s-snip-dir on k8s-mode loading
(use-package k8s-mode
:config (add-hook 'k8s-mode-hook
(lambda () (yas-load-directory k8s-snip-dir))))
I am not an elisp master, sorry, so I don't know what magic is missing, but I'm forced to accept that the snippet-loading script of
Line 125 in 083bcff
I searched my existing packages for such snippet-loading, and best I found was ansible
(Github package), which does work on my machine, and uses a more complicated system I don't fully understand (a concern on unloading snippets, perhaps?)
I'd recommend trying to remove the eval-after-load
at module load, keeping an on-mode-enter (when (featurep 'yasnippet)
to do the right thing.
Good luck, and thanks for sharing the module!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.