Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add glsl-company to shaders layer #6931

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions layers/+lang/shaders/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ provide highlighting for files ending in:
- =.frag=
- =.geom=

Also this layer provides completion for =.vert=, =.tesc=, =.tese=, =.geom=,
=.frag= and =.comp= shaders via =company-glsl= when [[https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/][=glslangValidator=]] can be
found on your system and =auto-completion= layer is enabled. Note that
completion is [[https://github.com/Kaali/company-glsl][rather simple]].

* Install
To use this configuration layer, add it to your =~.spacemacs=. You will need to
add =shaders= to the existing =dotspacemacs-configuration-layers= list in this
Expand Down
14 changes: 14 additions & 0 deletions layers/+lang/shaders/config.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
;;; config.el --- Shaders Layer configuration File for Spacemacs
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Boris Buliga <boris@d12frosted.io>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3

;; Variables

(spacemacs|defvar-company-backends glsl-mode)
20 changes: 19 additions & 1 deletion layers/+lang/shaders/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,25 @@
;; This file is not part of GNU Emacs.
;;
;;; License: GLPv3
(setq shaders-packages '(glsl-mode))
(setq shaders-packages
'(glsl-mode
company
(company-glsl
:location (recipe
:fetcher github
:repo "Kaali/company-glsl")
:toggle (and (configuration-layer/package-usedp 'company)
(executable-find "glslangValidator")))))

(defun shaders/post-init-company ()
(spacemacs|add-company-hook glsl-mode))

(defun shaders/init-company-glsl ()
(use-package company-glsl
:defer t
:init
(push 'company-glsl
company-backends-glsl-mode)))

(defun shaders/init-glsl-mode ()
"Initialize GLSL mode"
Expand Down