Add condition to not load most plugins if running in vscode mode

This commit is contained in:
Evie Litherland-Smith 2023-05-31 16:47:30 +01:00
parent 3acdc1ff73
commit 664f70c857
35 changed files with 47 additions and 3 deletions

View file

@ -60,5 +60,9 @@ vim.g.loaded_perl_provider = 0
vim.keymap.set("i", "jk", "<esc>")
vim.keymap.set("n", "<leader>l", "<cmd>Lazy<CR>")
-- neovide
if vim.g.neovide then require "ui.neovide" end
-- GUI settings
if vim.g.neovide then
require "ui.neovide"
elseif vim.g.vscode then
require "ui.vscode"
end

View file

@ -1,5 +1,6 @@
return {
"goolord/alpha-nvim",
cond = not vim.g.vscode,
event = "VimEnter",
opts = function()
local dashboard = require "alpha.themes.dashboard"

View file

@ -1,5 +1,6 @@
return {
"romgrk/barbar.nvim",
cond = not vim.g.vscode,
version = "^1.0.0", -- optional: only update when a new 1.x version is released
dependencies = { "lewis6991/gitsigns.nvim", "nvim-tree/nvim-web-devicons" },
event = { "BufReadPre", "BufNewFile" },

View file

@ -1,5 +1,6 @@
return {
"utilyre/barbecue.nvim",
cond = not vim.g.vscode,
name = "barbecue",
version = "*",
event = { "BufReadPre", "BufNewFile" },

View file

@ -1,5 +1,6 @@
return {
"catppuccin/nvim",
cond = not vim.g.vscode,
name = "catppuccin",
lazy = true,
config = true,

View file

@ -1,5 +1,6 @@
return {
"numToStr/Comment.nvim",
cond = not vim.g.vscode,
event = { "BufReadPre", "BufNewFile" },
config = true,
opts = { ignore = "^$" },

View file

@ -1,5 +1,6 @@
return {
"sindrets/diffview.nvim",
cond = not vim.g.vscode,
dependencies = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons" },
cmd = {
"DiffviewFileHistory",

View file

@ -1,5 +1,6 @@
return {
"https://github.com/direnv/direnv.vim.git",
cond = not vim.g.vscode,
name = "direnv.vim",
event = { "DirChangedPre" },
config = function()

View file

@ -1,5 +1,6 @@
return {
"lewis6991/gitsigns.nvim",
cond = not vim.g.vscode,
event = { "BufReadPre", "BufNewFile" },
config = true,
opts = {

View file

@ -1,5 +1,6 @@
return {
"phaazon/hop.nvim",
cond = not vim.g.vscode,
cmd = { "HopWord", "HopLine" },
init = function()
vim.keymap.set("n", "<leader>hw", "<cmd>HopWord<cr>")

View file

@ -1,5 +1,6 @@
return {
"lukas-reineke/indent-blankline.nvim",
cond = not vim.g.vscode,
event = { "BufReadPre", "BufNewFile" },
config = true,
opts = {

View file

@ -87,6 +87,7 @@ end
return {
"neovim/nvim-lspconfig",
cond = not vim.g.vscode,
event = { "BufReadPre", "BufNewFile" },
dependencies = { "cmp-nvim-lsp", "folke/neodev.nvim", "jose-elias-alvarez/null-ls.nvim" },
config = config,

View file

@ -1,5 +1,6 @@
return {
"nvim-lualine/lualine.nvim",
cond = not vim.g.vscode,
dependencies = { "nvim-tree/nvim-web-devicons", "folke/noice.nvim", "folke/tokyonight.nvim" },
event = { "BufReadPre", "BufNewFile" },
config = true,

View file

@ -1,5 +1,6 @@
return {
"L3MON4D3/LuaSnip",
cond = not vim.g.vscode,
lazy = true,
dependencies = {
"rafamadriz/friendly-snippets",

View file

@ -1,4 +1,5 @@
return {
"dccsillag/magma-nvim",
cond = not vim.g.vscode,
event = { "FileType python" },
}

View file

@ -1,5 +1,6 @@
return {
"TimUntersberger/neogit",
cond = not vim.g.vscode,
dependencies = {
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim",

View file

@ -1,5 +1,6 @@
return {
"nvim-neo-tree/neo-tree.nvim",
cond = not vim.g.vscode,
branch = "v2.x",
dependencies = {
"nvim-lua/plenary.nvim",

View file

@ -1,5 +1,6 @@
return {
"folke/noice.nvim",
cond = not vim.g.vscode,
event = { "VeryLazy" },
dependencies = {
"MunifTanjim/nui.nvim",

View file

@ -1,5 +1,6 @@
return {
"rcarriga/nvim-notify",
cond = not vim.g.vscode,
lazy = true,
config = true,
opts = {

View file

@ -1,5 +1,6 @@
return {
"windwp/nvim-autopairs",
cond = not vim.g.vscode,
lazy = true,
dependencies = {
"nvim-treesitter/nvim-treesitter",

View file

@ -52,6 +52,7 @@ end
return {
"hrsh7th/nvim-cmp",
cond = not vim.g.vscode,
event = { "InsertEnter", "CmdlineEnter" },
dependencies = {
"hrsh7th/cmp-nvim-lsp",

View file

@ -1,5 +1,6 @@
return {
"SmiteshP/nvim-navbuddy",
cond = not vim.g.vscode,
dependencies = { "SmiteshP/nvim-navic", "MunifTanjim/nui.nvim", "neovim/nvim-lspconfig" },
cmd = { "Navbuddy" },
init = function() vim.keymap.set("n", "<leader>na", "<cmd>Navbuddy<cr>") end,

View file

@ -1,5 +1,6 @@
return {
"SmiteshP/nvim-navic",
cond = not vim.g.vscode,
dependencies = "neovim/nvim-lspconfig",
lazy = true,
config = true,

View file

@ -1,5 +1,6 @@
return {
"nvim-neorg/neorg",
cond = not vim.g.vscode,
build = ":Neorg sync-parsers",
event = { "FileType norg" },
cmd = "Neorg",

View file

@ -1,5 +1,6 @@
return {
"nvim-neotest/neotest",
cond = not vim.g.vscode,
lazy = true,
dependencies = {
"nvim-lua/plenary.nvim",

View file

@ -1,5 +1,6 @@
return {
"stevearc/oil.nvim",
cond = not vim.g.vscode,
dependencies = { "nvim-tree/nvim-web-devicons" },
cmd = "Oil",
init = function()

View file

@ -1,5 +1,6 @@
return {
"ahmedkhalf/project.nvim",
cond = not vim.g.vscode,
name = "project_nvim",
event = { "BufReadPre", "BufNewFile" },
config = true,

View file

@ -1,5 +1,6 @@
return {
"nvim-telescope/telescope.nvim",
cond = not vim.g.vscode,
branch = "0.1.x",
dependencies = {
{

View file

@ -1,5 +1,6 @@
return {
"akinsho/toggleterm.nvim",
cond = not vim.g.vscode,
version = "*",
cmd = { "ToggleTerm" },
init = function() vim.keymap.set("n", "<leader>tt", "<cmd>ToggleTerm direction=tab<CR>") end,

View file

@ -1,9 +1,16 @@
local dependencies
if vim.g.vscode then
dependencies = { "nvim-treesitter/nvim-treesitter-refactor" }
else
dependencies = { "nvim-treesitter/nvim-treesitter-refactor", "nvim-neorg/neorg" }
end
return {
"nvim-treesitter/nvim-treesitter",
version = false,
build = ":TSUpdate",
event = { "BufReadPre", "BufNewFile" },
dependencies = { "nvim-treesitter/nvim-treesitter-refactor", "nvim-neorg/neorg" },
dependencies = dependencies,
config = function(_, opts)
if type(opts.ensure_installed) == "table" then
-- @type table<string, boolean>

View file

@ -1,5 +1,6 @@
return {
"folke/trouble.nvim",
cond = not vim.g.vscode,
dependencies = "nvim-tree/nvim-web-devicons",
cmd = "TroubleToggle",
init = function()

View file

@ -1,5 +1,6 @@
return {
"folke/twilight.nvim",
cond = not vim.g.vscode,
dependencies = { "nvim-treesitter" },
cmd = "Twilight",
config = true,

View file

@ -1,5 +1,6 @@
return {
"folke/which-key.nvim",
cond = not vim.g.vscode,
keys = { "<leader>" },
init = function()
vim.o.timeout = true

View file

@ -1,5 +1,6 @@
return {
"folke/zen-mode.nvim",
cond = not vim.g.vscode,
dependencies = { "folke/twilight.nvim" },
cmd = { "ZenMode" },
init = function() vim.keymap.set("n", "<leader>z", "<cmd>ZenMode<CR>") end,

1
lua/ui/vscode.lua Normal file
View file

@ -0,0 +1 @@
require "nvim-treesitter"