diff --git a/playground/README.md b/playground/README.md index 3cc7b5d..e929157 100644 --- a/playground/README.md +++ b/playground/README.md @@ -14,6 +14,12 @@ most used plugins for programmer. There also three folder `js`, `go`, `py`. Those folder have some basic source code you can play with. +## Install LSP + +The playground has js, py, go folder, so you can install either one your self in your PATH. +If you want to try lua, Please check sumneko setup in init.lua make sure it pointed to correct path. By default it +potint to ~/github/sumneko + ## run init.lua ```bash diff --git a/playground/init.lua b/playground/init.lua index d8e180b..fb29b5f 100644 --- a/playground/init.lua +++ b/playground/init.lua @@ -4,6 +4,21 @@ vim.cmd([[set packpath=/tmp/nvim/site]]) local package_root = '/tmp/nvim/site/pack' local install_path = package_root .. '/packer/start/packer.nvim' +-- IMPORTANT: update the sumneko setup if you need lua language server +-- I installed it in '/github/sumneko/lua-language-server' +local sumneko_root_path = vim.fn.expand('$HOME') .. '/github/sumneko/lua-language-server' +local sumneko_binary = vim.fn.expand('$HOME') .. '/github/sumneko/lua-language-server/bin/macOS/lua-language-server' + +local lua_cfg = { + cmd = { sumneko_binary, '-E', sumneko_root_path .. '/main.lua' }, + settings = { + Lua = { + runtime = { version = 'LuaJIT', path = vim.split(package.path, ';') }, + diagnostics = { enable = true }, + }, + }, +} + local function load_plugins() require('packer').startup({ function(use) @@ -96,7 +111,6 @@ if vim.fn.isdirectory(install_path) == 0 then load_plugins() require('packer').sync() vim.cmd('colorscheme aurora') - else load_plugins() vim.cmd('colorscheme aurora')