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",
})
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.md"},
command = "set conceallevel=0"
pattern = { "*.md" },
command = "set conceallevel=0",
})

View file

@ -10,7 +10,6 @@ vim.opt.timeoutlen = 200
vim.g.autoformat = false
-- make .roc files have the correct filetype
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
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 {
{
"nvim-treesitter/nvim-treesitter",

View file

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

View file

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

View file

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

View file

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