null-ls includes a library of built-in sources meant to provide out-of-the-box functionality. Built-in sources run with optimizations to reduce startup time and enable user customization.
null-ls exposes built-ins on null_ls.builtins
, which contains the following
groups of sources:
-- code action sources
null_ls.builtins.code_actions
-- diagnostic sources
null_ls.builtins.diagnostics
-- formatting sources
null_ls.builtins.formatting
-- hover sources
null_ls.builtins.hover
You can then register sources by passing a sources
list into your config
function:
local null_ls = require("null-ls")
-- register any number of sources simultaneously
local sources = {
null_ls.builtins.formatting.prettier,
null_ls.builtins.diagnostics.write_good,
null_ls.builtins.code_actions.gitsigns,
}
null_ls.config({ sources = sources })
To run built-in sources, the command specified below must be available on your
$PATH
and visible to Neovim. For example, to check if eslint
is available,
run the following (Vim, not Lua) command:
" should echo 1 if available (and 0 if not)
:echo executable("eslint")
Built-in sources have access to a special method, with()
, which modifies the
source's default options. For example, you can alter a source's file types as
follows:
local sources = {
null_ls.builtins.formatting.prettier.with({
filetypes = { "html", "json", "yaml", "markdown" },
}),
}
See the descriptions below or the relevant builtins
source file to see the
default options passed to each built-in source.
Note that setting filetypes = {}
will enable the source for all filetypes,
which isn't recommended for most sources.
You can override args
using with({ args = your_args })
, but if you want to
add more flags, you should use extra_args
instead:
local sources = {
null_ls.builtins.formatting.shfmt.with({
extra_args = { "-i", "2", "-ci" }
})
}
Note that environment variables and ~
aren't expanded in arguments. As a
workaround, you can use vim.fn.expand
:
local sources = {
null_ls.builtins.formatting.stylua.with({
extra_args = { "--config-path", vim.fn.expand("~/.config/stylua.toml") },
}),
}
For diagnostics sources, you can change the format of diagnostic messages by
setting diagnostics_format
:
local sources = {
-- will show code and source name
null_ls.builtins.diagnostics.shellcheck.with({
diagnostics_format = "[#{c}] #{m} (#{s})"
}),
}
See CONFIG to learn about diagnostics_format
. Note that
specifying diagnostics_format
for a built-in will override your global
diagnostics_format
for that source.
null-ls supports dynamic registration, meaning that you can register sources
whenever you want. To simplify this, built-ins have access to the conditional
option, which should be a function that returns a boolean or nil
indicating
whether null-ls should register the source. null-ls will pass a single argument
to the function, which is a table of utilities to handle common conditional
checks (though you can use whatever you want, as long as the return value
matches).
For example, to conditionally register stylua
by checking if the root
directory has a stylua.toml
file:
local sources = {
null_ls.builtins.formatting.stylua.with({
condition = function(utils)
return utils.root_has_file("stylua.toml")
end,
}),
}
To conditionally register one of two or more sources, you can use the
conditional
helper, which should return a source or nil
and will register
the first source returned.
local sources = {
require("null-ls.helpers").conditional(function(utils)
return utils.root_has_file(".eslintrc.js") and b.formatting.eslint_d or b.formatting.prettier
end),
}
Note that if you pass conditional sources into null_ls.config
, null-ls will
check and register them at the point that you source your plugin config. To
handle advanced dynamic registration behavior, you can use null_ls.register
with a relevant autocommand
event listener.
Format your assembler code in a similar way that gofmt
formats your go
code.
local sources = { null_ls.builtins.formatting.asmfmt }
filetypes = { "asm" }
command = "asmfmt"
args = {}
This pure text processing tool will reformat beancount
input to right-align all
the numbers at the same, minimal column.
- It left-aligns all the currencies.
- It only modifies whitespace.
local sources = { null_ls.builtins.formatting.bean_format }
filetypes = { "beancount" }
command = "bean-format"
args = { "-" }
Uncompromising Python code formatter.
local sources = { null_ls.builtins.formatting.black }
filetypes = { "python" }
command = "black"
args = { "--quiet", "--fast", "-" }
Tool to format C
/C++
/… code according to a set of rules and heuristics.
local sources = { null_ls.builtins.formatting.clang_format }
filetypes = { "c", "cpp", "cs", "java" }
command = "clang-format"
args = { "-assume-filename=<FILENAME>" }
Format your listfiles
nicely so that they don't look like crap.
local sources = { null_ls.builtins.formatting.cmake_format }
filetypes = { "cmake" }
command = "cmake-format"
args = { "-" }
codespell
fix common misspellings in text files.
local sources = { null_ls.builtins.formatting.codespell }
filetypes = {}
command = "codespell"
args = { "--write-changes", "$FILENAME" }
Static analysis for elixir
files for enforcing code consistency.
- Searches upwards from the buffer to the project root and tries to find the first
.credo.exs
file in case nested credo configs are used. - When not using a global credo install, the diagnostic can be disable with a conditional checking for the config file with
utils.root_has_file('.credo.exs')
local sources = { null_ls.builtins.diagnostics.credo }
filetypes = { "elixir" }
command = "mix"
args = { "credo", "suggest", "--format", "json", "--read-from-stdin", "$FILENAME" }
A tool for automatically checking and correcting the style of code in a project.
local sources = { null_ls.builtins.formatting.crystal_format }
filetypes = { "crystal" }
command = "crystal"
args = { "tool", "format" }
Formatter for D
source code
local sources = { null_ls.builtins.formatting.dfmt }
filetypes = { "d" }
command = "dfmt"
args = {}
Replace the whitespace in your program with formatting that follows Dart guidelines.
local sources = { null_ls.builtins.formatting.dart_format }
filetypes = { "dart" }
command = "dart"
args = { "format" }
Use deno to format TypeScript and JavaScript code
local sources = { null_ls.builtins.formatting.deno_fmt }
filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact" }
command = "deno"
args = { "fmt", "-"}
elm-format
formats Elm source code according to a standard set of rules based
on the official Elm Style Guide
local sources = { null_ls.builtins.formatting.elm_format }
filetypes = { "elm" }
command = "elm-format"
args = { "--stdin", "--elm-version=0.19" }
Fixes problems in your JavaScript code.
- Slow and not suitable for formatting on save. If at all possible, use
eslint_d
(described below).
local sources = { null_ls.builtins.formatting.eslint }
filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "svelte" }
command = "eslint"
args = { "--fix-dry-run", "--format", "JSON", "--stdin", "--stdin-filename", "$FILENAME" }
An absurdly fast formatter (and linter).
local sources = { null_ls.builtins.formatting.eslint_d }
filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "svelte" }
command = "eslint_d"
args = { "--fix-to-stdout", "--stdin", "--stdin-filepath", "$FILENAME" }
Opinionated erlang
code formatter.
local sources = { null_ls.builtins.formatting.erlfmt }
filetypes = { "erlang" }
command = "erlfmt"
args = { "-" }
Indent or otherwise prettify a piece of fish
code.
local sources = { null_ls.builtins.formatting.fish_indent }
filetypes = { "fish" }
command = "fish_indent"
args = {}
fixjson
is a JSON file fixer/formatter for humans using (relaxed) JSON5.
local sources = { null_ls.builtins.formatting.fixjson }
filetypes = { "json" }
command = "fixjson"
args = {}
local sources = {null_ls.builtins.formatting.fnlfmt}
fnlfmt
is a Fennel code formatter which follows established lisp conventions when determining how to format a given piece of code.
filetypes: { "fennel", "fnl" }
command: "fnlfmt"
args: { "--fix" }
fprettify
is an auto-formatter for modern Fortran code that imposes strict whitespace formattin.
local sources = { null_ls.builtins.formatting.fprettify }
filetypes = { "fortran" }
command = "fprettify"
args = { "--silent" }
Applies a base formatter (eg. goimports
or gofmt
), then shorten long lines of code
local sources = { null_ls.builtins.formatting.golines }
filetypes = { "go" }
command = "golines"
args = {}
Updates your Go import lines, adding missing ones and removing unreferenced ones.
local sources = { null_ls.builtins.formatting.goimports }
filetypes = { "go" }
command = "goimports"
args = {}
Formats go
programs.
- It uses tabs for indentation and blanks for alignment.
- Alignment assumes that an editor is using a fixed-width font.
local sources = { null_ls.builtins.formatting.gofmt }
filetypes = { "go" }
command = "gofmt"
args = {}
Enforce a stricter format than gofmt
, while being backwards compatible.
That is, gofumpt
is happy with a subset of the formats that gofmt
is happy with.
local sources = { null_ls.builtins.formatting.gofumpt }
filetypes = { "go" }
command = "gofumpt"
args = {}
python
utility / library to sort imports alphabetically, and automatically
separated into sections and by type.
local sources = { null_ls.builtins.formatting.isort }
filetypes = { "python" }
command = "isort"
args = { "--stdout", "--profile", "black", "-" }
python
utility tool for automatically reordering python imports. Similar to isort but uses static analysis more.
local sources = { null_ls.builtins.formatting.reorder_python_imports }
filetypes = { "python" }
command = "reorder-python-imports"
args = { "-", "--exit-zero-even-if-changed" }
Provides a simple command line interface to validate and pretty-print JSON
objects.
local sources = { null_ls.builtins.formatting.json_tool }
filetypes = { "json" }
command = "python"
args = { "-m", "json.tool" }
A flexible but slow lua
formatter. Not recommended for formatting on save.
local sources = { null_ls.builtins.formatting.lua_format }
filetypes = { "lua" }
command = "lua-format"
args = { "-i" }
Can fix some (but not all!) markdownlint
issues. If possible, use
Prettier, which can also fix Markdown
files.
local sources = { null_ls.builtins.formatting.markdownlint }
filetypes = { "markdown" }
command = "markdownlint"
args = { "--fix", "$FILENAME" }
Build tool that provides tasks for creating, compiling, and testing elixir
projects,
managing its dependencies, and more.
local sources = { null_ls.builtins.formatting.mix }
filetypes = { "elixir" }
command = "mix"
args = { "format", "-" }
A code formatter for Surface, the server-side rendering component library for Phoenix.
local sources = { null_ls.builtins.formatting.surface }
filetypes = { "elixir", "surface" }
command = "mix"
args = { "surface.format", "-" }
Beautifies and formats nginx
configuration files.
local sources = { null_ls.builtins.formatting.nginx_beautifier }
filetypes = { "nginx" }
command = "nginxbeautifier"
args = { "-i" }
nixfmt
is a formatter for Nix code, intended to easily apply a uniform style.
local sources = { null_ls.builtins.formatting.nixfmt }
filetypes = { "nix" }
command = "nixfmt"
perl
script which indents and reformats perl
scripts to make them
easier to read. If you write perl
scripts, or spend much time reading them,
you will probably find it useful.
local sources = { null_ls.builtins.formatting.perltidy }
filetypes = { "perl" }
command = "perltidy"
args = { "-q" }
Tokenizes PHP files and detects violations of a defined set of coding standards.
local sources = { null_ls.builtins.formatting.phpcbf }
filetypes = { "php" }
command = "phpcbf"
args = { "--standard=PSR12", "-" }
- Supports both
textDocument/formatting
andtextDocument/rangeFormatting
- May not work on some filetypes.
local sources = { null_ls.builtins.formatting.prettier }
filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "svelte", "css", "scss", "less", "html", "json", "yaml", "markdown", "graphql" }
command = "prettier"
args = { "--stdin-filepath", "$FILENAME" }
- A faster version of
prettier
that doesn't seem to work well on non-JavaScript filetypes. - Supports both
textDocument/formatting
andtextDocument/rangeFormatting
- May not work on some filetypes.
prettierd
is more stable and recommended.
local sources = { null_ls.builtins.formatting.prettier_d_slim }
filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "svelte", "css", "scss", "less", "html", "json", "yaml", "markdown", "graphql" }
command = "prettier_d_slim"
args = { "--stdin", "--stdin-filepath", "$FILENAME" }
-
Another "
prettier
, but faster" formatter, with better support for non-JavaScript filetypes. -
Does not support
textDocument/rangeFormatting
.
local sources = { null_ls.builtins.formatting.prettierd }
filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "svelte", "css", "scss", "less", "html", "json", "yaml", "markdown", "graphql" }
command = "prettierd"
args = { "$FILENAME" }
Formatter for prisma filetype.
local sources = { null_ls.builtins.formatting.prismaFmt }
filetypes = { "prisma" }
command = "prisma-fmt"
args = { "format", "-i", "$FILENAME" }
- Format R code automatically.
- Supports both
textDocument/formatting
andtextDocument/rangeFormatting
.
local sources = { null_ls.builtins.formatting.format_r }
filetypes = { "r", "rmd" }
command = "R"
args = { "--slave", "--no-restore", "--no-save", "-e", 'formatR::tidy_source(source="stdin")' }
Ruby static code analyzer and formatter, based on the community Ruby style guide.
local sources = { null_ls.builtins.formatting.rubocop }
filetypes = { "ruby" }
command = "rubocop"
args = { "--auto-correct", "-f", "quiet", "--stderr", "--stdin", "$FILENAME" }
Opinionated ruby
formatter.
local sources = { null_ls.builtins.formatting.rufo }
filetypes = { "ruby" }
command = "rufo"
args = { "-x" }
Reformat Zig source into canonical form
local sources = { null_ls.builtins.formatting.zigfmt }
filetypes = { "zig" }
command = "zig"
args = { "fmt", "--stdin" }
A tool for formatting rust
code according to style guidelines.
local sources = { null_ls.builtins.formatting.rustfmt }
filetypes = { "rust" }
command = "rustfmt"
args = { "--emit=stdout", "--edition=2018" }
CLI for organizing Tailwind CSS classes.
local sources = { null_ls.builtins.formatting.rustywind }
filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "svelte", "html", }
command = "rustywind"
args = { "--stdin" }
A shell script static analysis tool.
local sources = { null_ls.builtins.diagnostics.shellcheck }
filetypes = { "sh" }
command = "shellcheck"
- args = { "--format", "json1", "-" },
The sqlformat
command-line tool can be used to reformat SQL file
according to specified options.
local sources = { null_ls.builtins.formatting.sqlformat }
filetypes = { "sql" }
command = "sqlformat"
args = { "--reindent", "-" }
Code formatter for Scala
local sources = { null_ls.builtins.formatting.scalafmt }
filetypes = { "scala" }
command = "scalafmt"
args = { "--stdin" }
A shell
parser, formatter, and interpreter with bash
support
local sources = { null_ls.builtins.formatting.shfmt }
filetypes = { "sh", "zsh" }
command = "shfmt"
args = {}
Hardens shell scripts by quoting variables, replacing `function_call`
with $(function_call)
, and more
local sources = { null_ls.builtins.formatting.shellharden }
filetypes = { "sh" }
command = "shellharden"
args = { "--transform", "$FILENAME" }
Ruby Style Guide, with linter & automatic code fixer. Based on Rubocop.
local sources = { null_ls.builtins.formatting.standardrb }
filetypes = { "ruby" }
command = "standardrb"
args = { "--fix", "--format", "quiet", "--stderr", "--stdin", "$FILENAME" }
- Non-invasive pretty printing of R code.
- Supports both
textDocument/formatting
andtextDocument/rangeFormatting
.
local sources = { null_ls.builtins.formatting.styler }
filetypes = { "r", "rmd" }
command = "R"
args = { "--slave", "--no-restore", "--no-save", "-e", 'con=file("stdin");output=styler::style_text(readLines(con));close(con);print(output, colored=FALSE)' }
- A fast and opinionated Lua formatter written in Rust. Highly recommended!
- Supports both
textDocument/formatting
andtextDocument/rangeFormatting
. Note that as of now, the range must include a top-level statement for range formatting to work (see this issue for details).
local sources = { null_ls.builtins.formatting.stylua }
filetypes = { "lua" }
command = "stylua"
args = { "-s", "-" }
SwiftFormat
is a code library and command-line tool for reformatting
swift
code on macOS or Linux.
local sources = { null_ls.builtins.formatting.swiftformat }
filetypes = { "swift" }
command = "swiftformat"
args = {}
The terraform-fmt
command is used to rewrite terraform
configuration files to a canonical format and style.
local sources = { null_ls.builtins.formatting.terraform_fmt }
filetypes = { "tf", "hcl" }
command = "terraform"
args = { "fmt", "-" }
A simple wrapper around awk
to remove trailing newlines.
local sources = { null_ls.builtins.formatting.trim_newlines }
filetypes = { }
command = "awk"
args = { 'NF{print s $0; s=""; next} {s=s ORS}' }
if you want to use this with specific filetypes you can set using with
local sources = { null_ls.builtins.formatting.trim_newlines.with({
filetypes = { "lua", "c", "cpp }
}) }
A simple wrapper around awk
to remove trailing whitespace.
local sources = { null_ls.builtins.formatting.trim_whitespace }
filetypes = { }
command = "awk"
args = { '{ sub(/[ \t]+$/, ""); print }' }
if you want to use this with specific filetypes you can set using with
local sources = { null_ls.builtins.formatting.trim_whitespace.with({
filetypes = { "lua", "c", "cpp }
}) }
A source code beautifier for C
, C++
, C#
, ObjectiveC
, D
, java
,
pawn
and VALA
.
local sources = { null_ls.builtins.formatting.uncrustify }
filetypes = { "c", "cpp", "cs", "java" }
command = "uncrustify"
args = { "-q", "-l <LANG>" }
Formatter for python
files
local sources = { null_ls.builtins.formatting.yapf }
filetypes = { "python" }
command = "yapf"
args = { "--quiet" }
Formatter for python
files
local sources = { null_ls.builtins.formatting.autopep8 }
filetypes = { "python" }
command = "autopep8"
args = { "-" }
Formatter for php
files
local sources = { null_ls.builtins.formatting.phpcsfixer }
filetypes = { "php" }
command = "php-cs-fixer"
args = { '--no-interaction', '--quiet', 'fix', "$FILENAME" }
A mighty, modern linter that helps you avoid errors and enforce conventions in your styles.
local sources = { null_ls.builtins.formatting.stylelint }
filetypes = { "scss", "less", "css", "sass" }
command = "stylelint"
args = { "--fix", "--stdin", "-" }
latex
semantic linter.
local sources = { null_ls.builtins.diagnostics.chktex }
filetypes = { "tex" }
command = "chktex"
args = { "-q", "-I0", "-f%l:%c:%d:%k:%m\n" }
codespell
fix common misspellings in text files.
local sources = { null_ls.builtins.diagnostics.codespell }
filetypes = {}
command = "codespell"
args = { "-" }
A linter for the javascript
ecosystem.
- Note that the
null-ls
builtin requires youreslint
executable to be available on your$PATH
. - To use local (project) executables, use the integration in nvim-lsp-ts-utils or try the ESLint language server.
local sources = { null_ls.builtins.diagnostics.eslint }
filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "svelte" }
command = "eslint"
args = { "-f", "json", "--stdin", "--stdin-filename", "$FILENAME" }
An absurdly fast linter (and formatter).
- See the notes re: ESLint above.
local sources = { null_ls.builtins.diagnostics.eslint_d }
filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "svelte" }
command = "eslint"
args = { "-f", "json", "--stdin", "--stdin-filename", "$FILENAME" }
flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.
local sources = { null_ls.builtins.diagnostics.flake8 }
filetypes = { "python" }
command = "flake8"
args = { "--stdin-display-name", "$FILENAME", "-" }
A smarter Dockerfile
linter that helps you build best practice Docker images.
local sources = { null_ls.builtins.diagnostics.hadolint }
filetypes = { "Dockerfile", "dockerfile" }
command = "hadolint"
args = { "--no-fail", "--format=json", "$FILENAME" }
A tool for linting and static analysis of lua
code.
local sources = { null_ls.builtins.diagnostics.luacheck }
filetypes = { "lua" }
command = "luacheck"
args = { "--formatter", "plain", "--codes", "--ranges", "--filename", "$FILENAME", "-" }
A tool for fast static analysis of C/C++
code
local sources = { null_ls.builtins.diagnostics.cppcheck }
filetypes = { "cpp" , "c" }
command = "cppcheck"
args = { "--enable=warning,style,performance,portability", "--template=gcc", "$FILENAME" }
English prose linter.
local sources = {null_ls.builtins.diagnostics.write_good}
filetypes = { "markdown" }
command = "write"-good
args = { "--text=$TEXT", "--parse" }
An English prose linter.
proselint places the world’s greatest writers and editors by your side, where they whisper suggestions on how to improve your prose.
-- Proselint
local sources = { null_ls.builtins.diagnostics.proselint }
filetypes = { "markdown", "tex" }
command = "proselint"
args = { "--json" }
markdown
style and syntax checker.
local sources = { null_ls.builtins.diagnostics.markdownlint }
filetypes = { "markdown" }
command = "markdownlint"
args = { "--stdin" }
Pylint is a Python static code analysis tool which looks for programming errors, helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions.
local sources = { null_ls.builtins.diagnostics.pylint }
filetypes = { "python" }
command = "pylint"
args = {"--from-stdin", "$FILENAME", "-f", "json"}
Syntax-aware linter for prose built with speed and extensibility in mind.
vale
does not include a syntax by itself, so you probably need to grab avale.ini
(at"~/.vale.ini"
) and aStylesPath
(somewhere, pointed fromvale.ini
) from here.
local sources = {null_ls.builtins.diagnostics.vale}
filetypes = { "markdown", "tex" }
command = "vale"
args = { "--no-exit", "--output=JSON", "$FILENAME" }
Lints and suggestions for the nix programming language
local sources = {null_ls.builtins.diagnostics.statix}
filetypes = { "nix" }
command = "statix"
args = { "check", "--format=errfmt", "--", "$FILENAME" }
Turns tl check
command into a linter. Works on change.
local sources = { null_ls.builtins.diagnostics.teal }
filetypes = { "teal" }
command = "tl"
args = { "check", "$FILENAME" }
Correct commonly misspelled English words in source files
local sources = { null_ls.builtins.diagnostics.misspell }
filetypes = {}
command = "misspell"
args = { "$FILENAME" }
Linter for vimscript
.
local sources = { null_ls.builtins.diagnostics.vint }
filetypes = { "vim" }
command = "vint"
args = { "-s", "-j", "$FILENAME" }
Command line tool designed to help write correct and idiomatic lua
code.
local sources = { null_ls.builtins.diagnostics.selene }
filetypes = { "lua" }
command = "selene"
args = { "--display-style", "quiet", "-" }
The Ruby Linter/Formatter that Serves and Protects.
local sources = { null_ls.builtins.diagnostics.standardrb }
filetypes = { "ruby" }
command = "standardrb"
args = { "--no-fix", "-f", "json", "--stdin", "$FILENAME" }
PHP Static Analysis Tool
local sources = { null_ls.builtins.diagnostics.phpstan }
filetypes = { "php" }
command = "phpstan"
args = { "analyze", "--error-format", "json", "--no-progress", "$FILENAME" }
A valid phpstan.neon
at root.
A static analysis tool for finding errors in PHP applications
local sources = { null_ls.builtins.diagnostics.psalm }
filetypes = { "php" }
command = "psalm"
args = { "--output-format=json", "--no-progress", "$FILENAME" }
A valid psalm.xml
at root.
PHP_CodeSniffer is a script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard.
local sources = { null_ls.builtins.diagnostics.phpcs }
filetypes = { "php" }
command = "phpcs"
args = { "--report=json", "-s", "-" }
The Ruby Linter/Formatter that Serves and Protects.
local sources = { null_ls.builtins.diagnostics.rubocop }
filetypes = { "ruby" }
command = "rubocop"
args = { "-f", "json", "--stdin", "$FILENAME" }
A mighty, modern linter that helps you avoid errors and enforce conventions in your styles.
local sources = { null_ls.builtins.diagnostics.stylelint }
filetypes = { "scss", "less", "css", "sass" }
command = "stylelint"
args = { "--formatter", "json", "--stdin-filename", "$FILENAME" }
A linter for YAML files.
local sources = { null_ls.builtins.diagnostics.yamllint }
filetypes = { "yaml" }
command = "yamllint"
args = { "--format", "parsable", "-" }
Injects code actions for Git operations at the current cursor position (stage / preview / reset hunks, blame, etc.).
local sources = { null_ls.builtins.code_actions.gitsigns }
filetypes = {}
The Refactoring library based off the Refactoring book by Martin Fowler.
- Requires visually selecting the code you want to refactor and calling
:'<,'>lua vim.lsp.buf.range_code_action()
(for the default handler) or:'<,'>Telescope lsp_range_code_actions
(for Telescope).
local sources = { null_ls.builtins.code_actions.refactoring }
filetypes = { "go", "javascript", "lua", "python", "typescript" }
Lints and suggestions for the nix programming language.
local sources = { null_ls.builtins.code_actions.statix }
filetypes = { "nix" }
command = "statix"
args = { "check", "--format=json", "--", "$FILENAME" }
An English prose linter. Can fix some issues via code actions.
local source = { null_ls.builtins.code_actions.proselint }
filetypes = { "markdown", "tex" }
command = "proselint"
args = { "--json" }
Dictionary definitions via dictionaryapi.dev
Shows the first available definition for the current word under the cursor.
- Proof-of-concept for hover functionality. PRs to add more info (e.g. more than one definition, part of speech) are welcome.
- Depends on Plenary's
curl
module, which itself depends on havingcurl
installed and available on your$PATH
. - See the Hover section of the documentation for limitations.
local sources = { null_ls.builtins.hover.dictionary }
filetypes = { "txt", "markdown" }