Skip to content

Commit

Permalink
Merge pull request #4 from phenix3443/master
Browse files Browse the repository at this point in the history
add support to emacs
  • Loading branch information
tangzx authored Jan 15, 2019
2 parents 8fa0272 + 43ffa0e commit d933d13
Showing 1 changed file with 57 additions and 2 deletions.
59 changes: 57 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To run the language server use:

$ java -cp EmmyLua-LS-all.jar com.tang.vscode.MainKt`

## Adding to an IDE
## Adding to an Sublime

Just pass the instantiating instruction to the LSP plugin.

Expand Down Expand Up @@ -60,4 +60,59 @@ Example: adding EmmyLua to [SublimeText](https://www.sublimetext.com/) with [Sub
}
}
}
```
```

## Adding to Emacs
add following code to your `~/.emacs` or `.emacs.d/init.el` .
``` emacs-lisp
(use-package lsp-mode
:ensure t
:commands lsp
:hook ((lua-mode) . lsp)
:config
;; register emmy-lua-lsp
(lsp-register-client
(make-lsp-client :new-connection
(lsp-stdio-connection
(list
"/usr/bin/java"
"-cp"
(expand-file-name "EmmyLua-LS-all.jar" user-emacs-directory)
"com.tang.vscode.MainKt"))
:major-modes '(lua-mode)
:server-id 'emmy-lua))
)
(use-package company-lsp
:ensure t
:after lsp-mode
:config
(setq company-lsp-enable-recompletion t)
)
(defun company-lua-mode-setup()
"Create lua company backend."
(setq-local company-backends '(
(
company-lsp
company-lua
company-keywords
company-gtags
company-yasnippet
)
company-capf
company-dabbrev-code
company-files
)
))
(use-package lua-mode
:ensure t
:mode "\\.lua$"
:interpreter "lua"
:hook (lua-mode . company-lua-mode-setup)
:config
)
```

0 comments on commit d933d13

Please sign in to comment.