• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

tjdevries/nlua.nvim: Lua Development for Neovim

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

tjdevries/nlua.nvim

开源软件地址(OpenSource Url):

https://github.com/tjdevries/nlua.nvim

开源编程语言(OpenSource Language):

Lua 98.9%

开源软件介绍(OpenSource Introduction):

nlua.nvim

Lua Development for Neovim

Installation Guide

BREAKING:

With the removal of LspInstall I added something that should allow you to install sumneko lua. Check out the scripts/download_sumneko.lua file. You should be able to run this (if you have plenary installed).

I will try and make this better later. Sorry if I messed up your configs with this change.

" Install this plugin.
Plug 'tjdevries/nlua.nvim'

" (OPTIONAL): If you want to use built-in LSP (requires Neovim HEAD)
"   Currently only supported LSP, but others could work in future if people send PRs :)
Plug 'neovim/nvim-lspconfig'

" (OPTIONAL): This is recommended to get better auto-completion UX experience for builtin LSP.
Plug 'nvim-lua/completion-nvim'

" (OPTIONAL): This is a suggested plugin to get better Lua syntax highlighting
"   but it's not currently required
Plug 'euclidianAce/BetterLua.vim'

" (OPTIONAL): If you wish to have fancy lua folds, you can check this out.
Plug 'tjdevries/manillua.nvim'

Configuration

-- Your custom attach function for nvim-lspconfig goes here.
local custom_nvim_lspconfig_attach = function(...) end

-- To get builtin LSP running, do something like:
-- NOTE: This replaces the calls where you would have before done `require('nvim_lsp').sumneko_lua.setup()`
require('nlua.lsp.nvim').setup(require('lspconfig'), {
  on_attach = custom_nvim_lspconfig_attach,

  -- Include globals you want to tell the LSP are real :)
  globals = {
    -- Colorbuddy
    "Color", "c", "Group", "g", "s",
  }
})

Example Completions

ExampleCompletions

TODO:

https://github.com/bfredl/nvim-luadev

Status:

  • gf should work with require and other items
  • Set path correctly for lua.
    • See if we can get checkpath to work.
      • It seems like it should, but not sure how to make that happen
      • I think this requires some understanding of suffixesadd
  • [~] K should figure out if you're:
    • on a vim.fn style function
    • on a vim.api style function
    • on a vim.$something function
    • or on a lua built-in style function
    • Status:
      • It works when you write out the full names... but that doesn't seem super great
      • Kind of words when you type the whole name, but could have name clashes? Not clear.
  • Add a completion.nvim source for currently available globals.
    • This won't be as good as something like sumneko, because that does actual analysis. But it could be good for finding all the things in vim.api.* etc.
  • include should handle all the crazy ways you can make strings in lua.
  • better text object support
    • Consider trying this out w/ tree sitter at some point...
  • Add some "switch to test file" or other kind of thing
    • Could use projections, could use alternate.vim, ...?
  • Set up for lua-formatter, cause that's really nice.
    • Check if sumneko can do lua formatting...
      • Not currently supported as far as I can see
    • Add a "hack" for tempfile (opt-in) that formats the whole file, but we just replace the stuff we want to replace correctly. Could probably work... 90%ish time? We'd have to see.
  • Include nvim-treesitter + nlua



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap