diff --git a/init.lua b/init.lua index 89f4dc3..178a16d 100644 --- a/init.lua +++ b/init.lua @@ -60,5 +60,9 @@ vim.g.loaded_perl_provider = 0 vim.keymap.set("i", "jk", "") vim.keymap.set("n", "l", "Lazy") --- 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 diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua index a2e91dc..e1cbee1 100644 --- a/lua/plugins/alpha.lua +++ b/lua/plugins/alpha.lua @@ -1,5 +1,6 @@ return { "goolord/alpha-nvim", + cond = not vim.g.vscode, event = "VimEnter", opts = function() local dashboard = require "alpha.themes.dashboard" diff --git a/lua/plugins/barbar.lua b/lua/plugins/barbar.lua index ddd0803..34fcf3e 100644 --- a/lua/plugins/barbar.lua +++ b/lua/plugins/barbar.lua @@ -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" }, diff --git a/lua/plugins/barbecue.lua b/lua/plugins/barbecue.lua index 65083fe..e04d107 100644 --- a/lua/plugins/barbecue.lua +++ b/lua/plugins/barbecue.lua @@ -1,5 +1,6 @@ return { "utilyre/barbecue.nvim", + cond = not vim.g.vscode, name = "barbecue", version = "*", event = { "BufReadPre", "BufNewFile" }, diff --git a/lua/plugins/catppuccin.lua b/lua/plugins/catppuccin.lua index caf81fe..042f885 100644 --- a/lua/plugins/catppuccin.lua +++ b/lua/plugins/catppuccin.lua @@ -1,5 +1,6 @@ return { "catppuccin/nvim", + cond = not vim.g.vscode, name = "catppuccin", lazy = true, config = true, diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua index 316c515..3b77f65 100644 --- a/lua/plugins/comment.lua +++ b/lua/plugins/comment.lua @@ -1,5 +1,6 @@ return { "numToStr/Comment.nvim", + cond = not vim.g.vscode, event = { "BufReadPre", "BufNewFile" }, config = true, opts = { ignore = "^$" }, diff --git a/lua/plugins/diffview.lua b/lua/plugins/diffview.lua index 7e9ea04..d3012ef 100644 --- a/lua/plugins/diffview.lua +++ b/lua/plugins/diffview.lua @@ -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", diff --git a/lua/plugins/direnv.lua b/lua/plugins/direnv.lua index cc74d86..2dd6616 100644 --- a/lua/plugins/direnv.lua +++ b/lua/plugins/direnv.lua @@ -1,5 +1,6 @@ return { "https://github.com/direnv/direnv.vim.git", + cond = not vim.g.vscode, name = "direnv.vim", event = { "DirChangedPre" }, config = function() diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index e25d158..6ab2e11 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -1,5 +1,6 @@ return { "lewis6991/gitsigns.nvim", + cond = not vim.g.vscode, event = { "BufReadPre", "BufNewFile" }, config = true, opts = { diff --git a/lua/plugins/hop.lua b/lua/plugins/hop.lua index daf9491..3b549f1 100644 --- a/lua/plugins/hop.lua +++ b/lua/plugins/hop.lua @@ -1,5 +1,6 @@ return { "phaazon/hop.nvim", + cond = not vim.g.vscode, cmd = { "HopWord", "HopLine" }, init = function() vim.keymap.set("n", "hw", "HopWord") diff --git a/lua/plugins/indent_blankline.lua b/lua/plugins/indent_blankline.lua index 943c4ed..59e0980 100644 --- a/lua/plugins/indent_blankline.lua +++ b/lua/plugins/indent_blankline.lua @@ -1,5 +1,6 @@ return { "lukas-reineke/indent-blankline.nvim", + cond = not vim.g.vscode, event = { "BufReadPre", "BufNewFile" }, config = true, opts = { diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 0d0c6be..903d27c 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -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, diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 0e21167..216374f 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -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, diff --git a/lua/plugins/luasnip.lua b/lua/plugins/luasnip.lua index 2830d48..b4610a3 100644 --- a/lua/plugins/luasnip.lua +++ b/lua/plugins/luasnip.lua @@ -1,5 +1,6 @@ return { "L3MON4D3/LuaSnip", + cond = not vim.g.vscode, lazy = true, dependencies = { "rafamadriz/friendly-snippets", diff --git a/lua/plugins/magma_nvim.lua b/lua/plugins/magma_nvim.lua index ec88bb5..423321d 100644 --- a/lua/plugins/magma_nvim.lua +++ b/lua/plugins/magma_nvim.lua @@ -1,4 +1,5 @@ return { "dccsillag/magma-nvim", + cond = not vim.g.vscode, event = { "FileType python" }, } diff --git a/lua/plugins/neogit.lua b/lua/plugins/neogit.lua index 6a8cf8b..b7be9c7 100644 --- a/lua/plugins/neogit.lua +++ b/lua/plugins/neogit.lua @@ -1,5 +1,6 @@ return { "TimUntersberger/neogit", + cond = not vim.g.vscode, dependencies = { "nvim-lua/plenary.nvim", "sindrets/diffview.nvim", diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua index f2a482c..7dee9b4 100644 --- a/lua/plugins/neotree.lua +++ b/lua/plugins/neotree.lua @@ -1,5 +1,6 @@ return { "nvim-neo-tree/neo-tree.nvim", + cond = not vim.g.vscode, branch = "v2.x", dependencies = { "nvim-lua/plenary.nvim", diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua index a403f79..335d29c 100644 --- a/lua/plugins/noice.lua +++ b/lua/plugins/noice.lua @@ -1,5 +1,6 @@ return { "folke/noice.nvim", + cond = not vim.g.vscode, event = { "VeryLazy" }, dependencies = { "MunifTanjim/nui.nvim", diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua index 00a9dd2..d0a41f8 100644 --- a/lua/plugins/notify.lua +++ b/lua/plugins/notify.lua @@ -1,5 +1,6 @@ return { "rcarriga/nvim-notify", + cond = not vim.g.vscode, lazy = true, config = true, opts = { diff --git a/lua/plugins/nvim_autopairs.lua b/lua/plugins/nvim_autopairs.lua index 88626dc..c708e15 100644 --- a/lua/plugins/nvim_autopairs.lua +++ b/lua/plugins/nvim_autopairs.lua @@ -1,5 +1,6 @@ return { "windwp/nvim-autopairs", + cond = not vim.g.vscode, lazy = true, dependencies = { "nvim-treesitter/nvim-treesitter", diff --git a/lua/plugins/nvim_cmp.lua b/lua/plugins/nvim_cmp.lua index b78c376..6d63aa6 100644 --- a/lua/plugins/nvim_cmp.lua +++ b/lua/plugins/nvim_cmp.lua @@ -52,6 +52,7 @@ end return { "hrsh7th/nvim-cmp", + cond = not vim.g.vscode, event = { "InsertEnter", "CmdlineEnter" }, dependencies = { "hrsh7th/cmp-nvim-lsp", diff --git a/lua/plugins/nvim_navbuddy.lua b/lua/plugins/nvim_navbuddy.lua index a495f4c..e4fb29b 100644 --- a/lua/plugins/nvim_navbuddy.lua +++ b/lua/plugins/nvim_navbuddy.lua @@ -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", "na", "Navbuddy") end, diff --git a/lua/plugins/nvim_navic.lua b/lua/plugins/nvim_navic.lua index 80e8226..e31b9fa 100644 --- a/lua/plugins/nvim_navic.lua +++ b/lua/plugins/nvim_navic.lua @@ -1,5 +1,6 @@ return { "SmiteshP/nvim-navic", + cond = not vim.g.vscode, dependencies = "neovim/nvim-lspconfig", lazy = true, config = true, diff --git a/lua/plugins/nvim_neorg.lua b/lua/plugins/nvim_neorg.lua index 20ac10d..675858d 100644 --- a/lua/plugins/nvim_neorg.lua +++ b/lua/plugins/nvim_neorg.lua @@ -1,5 +1,6 @@ return { "nvim-neorg/neorg", + cond = not vim.g.vscode, build = ":Neorg sync-parsers", event = { "FileType norg" }, cmd = "Neorg", diff --git a/lua/plugins/nvim_neotest.lua b/lua/plugins/nvim_neotest.lua index e0eb75e..ab66a20 100644 --- a/lua/plugins/nvim_neotest.lua +++ b/lua/plugins/nvim_neotest.lua @@ -1,5 +1,6 @@ return { "nvim-neotest/neotest", + cond = not vim.g.vscode, lazy = true, dependencies = { "nvim-lua/plenary.nvim", diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index 72de70c..f65bf6f 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -1,5 +1,6 @@ return { "stevearc/oil.nvim", + cond = not vim.g.vscode, dependencies = { "nvim-tree/nvim-web-devicons" }, cmd = "Oil", init = function() diff --git a/lua/plugins/project.lua b/lua/plugins/project.lua index b7df8ae..2348f67 100644 --- a/lua/plugins/project.lua +++ b/lua/plugins/project.lua @@ -1,5 +1,6 @@ return { "ahmedkhalf/project.nvim", + cond = not vim.g.vscode, name = "project_nvim", event = { "BufReadPre", "BufNewFile" }, config = true, diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index f7efbc0..42b3896 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,5 +1,6 @@ return { "nvim-telescope/telescope.nvim", + cond = not vim.g.vscode, branch = "0.1.x", dependencies = { { diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua index 9a70a68..4387384 100644 --- a/lua/plugins/toggleterm.lua +++ b/lua/plugins/toggleterm.lua @@ -1,5 +1,6 @@ return { "akinsho/toggleterm.nvim", + cond = not vim.g.vscode, version = "*", cmd = { "ToggleTerm" }, init = function() vim.keymap.set("n", "tt", "ToggleTerm direction=tab") end, diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 51bdbfc..2e24d20 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -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 diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua index d302ce2..b9fe241 100644 --- a/lua/plugins/trouble.lua +++ b/lua/plugins/trouble.lua @@ -1,5 +1,6 @@ return { "folke/trouble.nvim", + cond = not vim.g.vscode, dependencies = "nvim-tree/nvim-web-devicons", cmd = "TroubleToggle", init = function() diff --git a/lua/plugins/twilight.lua b/lua/plugins/twilight.lua index 2b31774..f5f6800 100644 --- a/lua/plugins/twilight.lua +++ b/lua/plugins/twilight.lua @@ -1,5 +1,6 @@ return { "folke/twilight.nvim", + cond = not vim.g.vscode, dependencies = { "nvim-treesitter" }, cmd = "Twilight", config = true, diff --git a/lua/plugins/which_key.lua b/lua/plugins/which_key.lua index 2f0fb2d..3823288 100644 --- a/lua/plugins/which_key.lua +++ b/lua/plugins/which_key.lua @@ -1,5 +1,6 @@ return { "folke/which-key.nvim", + cond = not vim.g.vscode, keys = { "" }, init = function() vim.o.timeout = true diff --git a/lua/plugins/zen_mode.lua b/lua/plugins/zen_mode.lua index f661d66..f4fe4a9 100644 --- a/lua/plugins/zen_mode.lua +++ b/lua/plugins/zen_mode.lua @@ -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", "z", "ZenMode") end, diff --git a/lua/ui/vscode.lua b/lua/ui/vscode.lua new file mode 100644 index 0000000..e3e22b3 --- /dev/null +++ b/lua/ui/vscode.lua @@ -0,0 +1 @@ +require "nvim-treesitter"