Comments (5)
这是不同语言对应的格式化工具,根据需要安装对应的就好了,你现在有rustfmt就应该可以格式化rust代码了。
比如 stylelua 是格式化 lua 代码的,也可以去装一下 https://github.com/JohnnyMorganz/StyLua
from learn-neovim-lua.
每个格式化工具都需要手动安装吗?能不能配置自动安装呢? https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting 目录中的这些lua文件,是否和/null-ls.nvim插件配置有所关联呢?就是说,能否通过这些lua文件,来配置实现自动安装格式化工具呢?
from learn-neovim-lua.
应该还没有自动安装功能。那些lua文件只知道怎么调用对应的工具,需要手动安装后,在source里引用对应的lua文件。
sources = {
require("null-ls").builtins.formatting.stylua,
require("null-ls").builtins.diagnostics.eslint,
require("null-ls").builtins.completion.spell,
},
from learn-neovim-lua.
应该还没有自动安装功能。那些lua文件只知道怎么调用对应的工具,需要手动安装后,在source里引用对应的lua文件。
sources = { require("null-ls").builtins.formatting.stylua, require("null-ls").builtins.diagnostics.eslint, require("null-ls").builtins.completion.spell, },
这个配置语句是要写在.config/nvim/lua/lspnull-ls.lua文件中吗?
还有prettier和eslint这两个格式化工具安装比较特殊,在.config/nvim/lua/lspnull-ls.lua中的如下配置语句,指示的node_modules文件夹应该放在什么位置?我试着将已经下载配置好的prettier和eslint格式化工具所在的node_modules文件夹,复制到config/nvim/lua/lspnull-ls.lua文件所在的同级目录:config/nvim/lua/ ,但是打开nvim checkhealth,仍然会报错。
但是如果通过软链接的方式,将prettier和eslint放到/usr/bin/全局目录,报错就会消失,但这么做应该会有问题吧?
from learn-neovim-lua.
并不是所有前端都用 eslint 和prettier,所以 可以不全局安装,checkhealth 应该只会检测是否全局安装,所以报错也应该没关系。
设置 prefer_local 优先查找本地项目里是否有,没有再fallback到全局。
from learn-neovim-lua.
Related Issues (20)
- turn off different tab sizes for each language HOT 1
- Auto command does not enable automatic plugin update when `plugins.lua` is saved HOT 4
- 某个组合按键映射无反应
- 使用安装脚本,检验环境时提示【rg 没有找到,请安装后再尝试】 HOT 1
- keybindings comment部分出问题 HOT 1
- 掘金小册有优惠吗吗? HOT 3
- [Mac] terminal 的颜色很奇怪 HOT 1
- 关于LSP设置问题 HOT 3
- 退出自动格式化文档怎么配置呢? HOT 6
- 引入autocmds.lua 报错 HOT 2
- 打开neovim报错, bufferline.nvim安装失败 HOT 1
- 设置keybindings 不生效 HOT 7
- 预览图片全是乱码 HOT 1
- attempt to call field "cmp_format" ( a nil value) HOT 2
- /.config/nvim/lua/lsp/cmp.lua:55: attempt to index field 'preset' (a nil value) HOT 3
- init.lua 报错 nvim-lsp-ts-utils 找不到 HOT 3
- Mac InserLeave 参数无效 HOT 2
- 语法高亮不生效 HOT 10
- 陈年 Issues 全部关闭了,有问题欢迎到 Discussions 讨论
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learn-neovim-lua.