LUA and NIX support, company tweaks

This commit is contained in:
Curt Spark 2021-03-14 01:56:48 +00:00
parent a24de4a6cb
commit f001cb47cb
1 changed files with 37 additions and 4 deletions

View File

@ -340,6 +340,7 @@ it.
Install the package, enable it and ensure that it always is installed:
#+BEGIN_SRC emacs-lisp
(use-package pdf-tools
:ensure t
:hook (pdf-tools-enabled . pdf-view-midnight-minor-mode)
;;:hook (pdf-tools-enabled . hide-mode-line-mode)
:init
@ -524,6 +525,18 @@ Install the package, enable it and ensure that it always is installed, and then
; Wrap around when suggestions reach bottom.
(setq company-selection-wrap-around t)
(dolist (key '("<return>" "RET"))
;; Here we are using an advanced feature of define-key that lets
;; us pass an "extended menu item" instead of an interactive
;; function. Doing this allows RET to regain its usual
;; functionality when the user has not explicitly interacted with
;; Company.
(define-key company-active-map (kbd key)
`(menu-item nil company-complete
:filter ,(lambda (cmd)
(when (company-explicit-action-p)
cmd)))))
; Use tab key to cycle through suggestions.
; ('tng' means 'tab and go')
(company-tng-configure-default)
@ -593,6 +606,23 @@ Install the package, enable it and ensure that it always is installed, and then
:init
(elcord-mode 1))
#+END_SRC
** Nix Mode
An Emacs major mode for editing Nix expressions. There is also a manual available at nix-mode.org.
#+BEGIN_SRC emacs-lisp
(use-package nix-mode
:ensure t
:mode "\\.nix\\'")
#+END_SRC
** LUA Mode
lua-mode is a major mode for editing Lua sources in Emacs.
#+BEGIN_SRC emacs-lisp
(use-package lua-mode
:ensure t)
#+END_SRC
** LSP Mode
LSP mode will give you IDE capabilities in Emacs, using Microsoft's
Universal Language Server Protocol. The same one that VSCode uses for
@ -619,14 +649,17 @@ on how to install the Programming Language Servers that you want.
*** Configuration
#+BEGIN_SRC emacs-lisp
;; optionally
(use-package lsp-ui :commands lsp-ui-mode
:ensure t)
(use-package company-lsp :commands company-lsp
(use-package lsp-ui
:commands lsp-ui-mode
:ensure t)
;; (use-package company-lsp
;; :commands company-lsp
;; :ensure t)
;; if you are helm user
;;(use-package helm-lsp :commands helm-lsp-workspace-symbol)
;; if you are ivy user
(use-package lsp-ivy :commands lsp-ivy-workspace-symbol
(use-package lsp-ivy
:commands lsp-ivy-workspace-symbol
:ensure t)
;;(use-package lsp-treemacs :commands lsp-treemacs-errors-list
;; :ensure t)