add existence checks for neovim

This commit is contained in:
Daylin Morgan 2024-06-13 13:22:15 -05:00
parent d3acc18eea
commit 4894ea6588
Signed by: daylin
GPG key ID: 950D13E9719334AD
10 changed files with 57 additions and 34 deletions

View file

@ -6,8 +6,7 @@ vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
command = "set syntax=lua", command = "set syntax=lua",
}) })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.md" }, pattern = { "*.md" },
command = "set conceallevel=0" command = "set conceallevel=0",
}) })

View file

@ -10,7 +10,6 @@ vim.opt.timeoutlen = 200
vim.g.autoformat = false vim.g.autoformat = false
-- make .roc files have the correct filetype -- make .roc files have the correct filetype
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.roc" }, pattern = { "*.roc" },

View file

@ -1,5 +1,8 @@
-- adapted from https://www.lazyvim.org/extras/lang/go if not vim.fn.executable("go") then
return
end
-- adapted from https://www.lazyvim.org/extras/lang/go
return { return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",

View file

@ -17,6 +17,5 @@ return {
config = function() config = function()
vim.cmd([[do FileType]]) vim.cmd([[do FileType]])
end, end,
} },
} }

View file

@ -1,3 +1,7 @@
if not vim.fn.executable("nim") then
return
end
return { return {
require("util").setup_lang({ treesitter = { "nim", "nim_format_string" } }), require("util").setup_lang({ treesitter = { "nim", "nim_format_string" } }),
{ {
@ -6,8 +10,8 @@ return {
servers = { servers = {
nim_langserver = { nim_langserver = {
mason = false, mason = false,
} },
} },
} },
} },
} }

View file

@ -1,3 +1,7 @@
if not vim.fn.executable("nix") then
return
end
return { return {
require("util").setup_lang({ treesitter = { "nix" } }), require("util").setup_lang({ treesitter = { "nix" } }),
{ {

View file

@ -1,3 +1,7 @@
if not vim.fn.executable("nu") then
return
end
return { return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
dependencies = { dependencies = {

View file

@ -1,3 +1,7 @@
if not vim.fn.executable("roc") then
return
end
-- make .roc files have the correct filetype -- make .roc files have the correct filetype
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.roc" }, pattern = { "*.roc" },
@ -15,8 +19,7 @@ vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
-- } -- }
return { return {
{ "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = { "roc" } } { "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = { "roc" } } },
},
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
opts = { opts = {

View file

@ -1,3 +1,7 @@
if not vim.fn.executable("rust") then
return
end
-- adapted from https://www.lazyvim.org/extras/lang/rust -- adapted from https://www.lazyvim.org/extras/lang/rust
return { return {
{ {

View file

@ -1,3 +1,7 @@
if not vim.fn.executable("zig") then
return
end
-- adapted from https://www.lazyvim.org/extras/lang/rust -- adapted from https://www.lazyvim.org/extras/lang/rust
return { return {
{ {