This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+lang/vimscript/funcs.el

33 lines
979 B
EmacsLisp
Raw Normal View History

2020-07-09 20:03:55 +00:00
;;; funcs.el --- vimscript Layer functions File for Spacemacs
;;
;; Copyright (c) 2012-2020 Sylvain Benner & Contributors
;;
;; Author: Maximilian Wolff <smile13241324@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defun spacemacs//vimscript-backend ()
"Returns selected backend."
(if vimscript-backend
vimscript-backend
(cond
((configuration-layer/layer-used-p 'lsp) 'lsp)
(t 'company-vimscript))))
(defun spacemacs//vimscript-setup-company ()
"Conditionally setup company based on backend."
(pcase (spacemacs//vimscript-backend)
;; Activate lsp company explicitly to activate
;; standard backends as well
(`lsp (spacemacs|add-company-backends
:backends company-capf
:modes vimrc-mode))))
(defun spacemacs//vimscript-setup-backend ()
"Conditionally setup vimscript backend."
(pcase (spacemacs//vimscript-backend)
(`lsp (lsp))))