Files
LazyVim/lua/lazyvim/plugins/extras/vscode.lua
moetayuko ead5955bef feat(vscode): make use of vscode builtin terminal (#4392)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->
make use of vscode builtin terminal

**I don't know how to properly handle cwd so it's implemented as a
simple toggle**

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->
#4280

## Checklist

- [X] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-09-18 08:16:29 +02:00

60 lines
1.4 KiB
Lua

if not vim.g.vscode then
return {}
end
local enabled = {
"dial.nvim",
"flit.nvim",
"lazy.nvim",
"leap.nvim",
"mini.ai",
"mini.comment",
"mini.move",
"mini.pairs",
"mini.surround",
"nvim-treesitter",
"nvim-treesitter-textobjects",
"nvim-ts-context-commentstring",
"ts-comments.nvim",
"vim-repeat",
"yanky.nvim",
"LazyVim",
}
local Config = require("lazy.core.config")
Config.options.checker.enabled = false
Config.options.change_detection.enabled = false
Config.options.defaults.cond = function(plugin)
return vim.tbl_contains(enabled, plugin.name) or plugin.vscode
end
-- Add some vscode specific keymaps
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimKeymapsDefaults",
callback = function()
vim.keymap.set("n", "<leader><space>", "<cmd>Find<cr>")
vim.keymap.set("n", "<leader>/", [[<cmd>lua require('vscode').action('workbench.action.findInFiles')<cr>]])
vim.keymap.set("n", "<leader>ss", [[<cmd>lua require('vscode').action('workbench.action.gotoSymbol')<cr>]])
end,
})
function LazyVim.terminal()
require("vscode").action("workbench.action.terminal.toggleTerminal")
end
return {
{
"LazyVim/LazyVim",
config = function(_, opts)
opts = opts or {}
-- disable the colorscheme
opts.colorscheme = function() end
require("lazyvim").setup(opts)
end,
},
{
"nvim-treesitter/nvim-treesitter",
opts = { highlight = { enable = false } },
},
}