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

@ -1,22 +1,21 @@
return { return {
require("util").setup_lang({treesitter = {"markdown", "markdown_inline"}}), require("util").setup_lang({ treesitter = { "markdown", "markdown_inline" } }),
{ {
"iamcco/markdown-preview.nvim", "iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = function() build = function()
vim.fn["mkdp#util#install"]() vim.fn["mkdp#util#install"]()
end, end,
keys = { keys = {
{ {
"<leader>cp", "<leader>cp",
ft = "markdown", ft = "markdown",
"<cmd>MarkdownPreviewToggle<cr>", "<cmd>MarkdownPreviewToggle<cr>",
desc = "Markdown Preview", desc = "Markdown Preview",
},
}, },
config = function()
vim.cmd([[do FileType]])
end,
}, },
config = function()
vim.cmd([[do FileType]])
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" } }),
{ {
@ -8,7 +12,7 @@ return {
mason = false, mason = false,
}, },
-- nil_ls = { -- nil_ls = {
-- mason = false, -- mason = false,
-- }, -- },
}, },
}, },

View file

@ -1,7 +1,11 @@
if not vim.fn.executable("nu") then
return
end
return { return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
dependencies = { dependencies = {
{ "nushell/tree-sitter-nu" }, { "nushell/tree-sitter-nu" },
}, },
build = ":TSUpdate", build = ":TSUpdate",
} }

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 {
{ {