feat(extras): added recommended detectors for all languages

This commit is contained in:
Folke Lemaitre
2024-05-18 14:39:20 +02:00
parent 03ea7f6f98
commit c29213416b
18 changed files with 132 additions and 0 deletions

View File

@ -1,4 +1,10 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = "yaml.ansible",
root = { "ansible.cfg", ".ansible-lint" },
})
end,
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)

View File

@ -1,4 +1,17 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
root = {
".clangd",
".clang-tidy",
".clang-format",
"compile_commands.json",
"compile_flags.txt",
"configure.ac", -- AutoTools
},
})
end,
-- Add C/C++ to treesitter
{

View File

@ -1,4 +1,10 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = "cmake",
root = { "CMakePresets.json", "CTestConfig.cmake", "cmake" },
})
end,
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)

View File

@ -1,4 +1,10 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = "dockerfile",
root = { "Dockerfile", "docker-compose.yml", "compose.yml", "docker-compose.yaml", "compose.yaml" },
})
end,
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)

View File

@ -1,4 +1,10 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = { "elixir", "eelixir", "heex", "surface" },
root = "mix.exs",
})
end,
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)

View File

@ -1,4 +1,10 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = { "go", "gomod", "gowork", "gotmpl" },
root = { "go.work", "go.mod" },
})
end,
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)

View File

@ -16,6 +16,20 @@ local function extend_or_override(config, custom, ...)
end
return {
recommended = function()
return LazyVim.extras.wants({
ft = "java",
root = {
"build.gradle",
"build.gradle.kts",
"build.xml", -- Ant
"pom.xml", -- Maven
"settings.gradle", -- Gradle
"settings.gradle.kts", -- Gradle
},
})
end,
-- Add java to treesitter.
{
"nvim-treesitter/nvim-treesitter",

View File

@ -1,4 +1,9 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = { "json", "jsonc", "json5" },
})
end,
-- add json to treesitter
{

View File

@ -1,4 +1,10 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = "markdown",
root = "README.md",
})
end,
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)

View File

@ -1,4 +1,11 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = { "cs", "vb" },
root = { "*.sln", "*.csproj", "omnisharp.json", "function.json" },
})
end,
{ "Hoffs/omnisharp-extended-lsp.nvim", lazy = true },
{
"nvim-treesitter/nvim-treesitter",

View File

@ -1,4 +1,10 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = "ruby",
root = "Gemfile",
})
end,
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)

View File

@ -1,4 +1,10 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = "rust",
root = { "Cargo.toml", "rust-project.json" },
})
end,
-- Extend auto completion
{

View File

@ -3,6 +3,12 @@
-- If you like you can setup your own key bindings.
-- For minimalistic setup have a look at https://github.com/scalameta/nvim-metals/discussions/39
return {
recommended = function()
return LazyVim.extras.wants({
ft = "scala",
root = { "build.sbt", "build.sc", "build.gradle", "pom.xml" },
})
end,
{
"hrsh7th/nvim-cmp",
requires = {

View File

@ -1,4 +1,18 @@
return {
recommended = function()
return LazyVim.extras.wants({
root = {
"tailwind.config.js",
"tailwind.config.cjs",
"tailwind.config.mjs",
"tailwind.config.ts",
"postcss.config.js",
"postcss.config.cjs",
"postcss.config.mjs",
"postcss.config.ts",
},
})
end,
{
"neovim/nvim-lspconfig",
opts = {

View File

@ -1,4 +1,11 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = { "terraform", "hcl" },
root = ".terraform",
})
end,
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)

View File

@ -1,4 +1,10 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = { "tex", "plaintex", "bib" },
root = { ".latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" },
})
end,
{
"folke/which-key.nvim",
optional = true,

View File

@ -1,4 +1,11 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = "vue",
root = { "vue.config.js" },
})
end,
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)

View File

@ -1,4 +1,9 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = "yaml",
})
end,
-- add yaml specific modules to treesitter
{