✨ feat(nvim): added vscode extra
This commit is contained in:
parent
da7e86ef09
commit
d89af5cd48
2 changed files with 64 additions and 0 deletions
|
@ -66,6 +66,7 @@
|
|||
"plugins.extras.util.bigfile",
|
||||
"plugins.extras.util.discordrcp",
|
||||
"plugins.extras.util.icon-picker",
|
||||
"plugins.extras.util.vscode",
|
||||
"plugins.extras.util.wakatime"
|
||||
],
|
||||
"news": {
|
||||
|
|
63
.config/nvim/lua/plugins/extras/util/vscode.lua
Normal file
63
.config/nvim/lua/plugins/extras/util/vscode.lua
Normal file
|
@ -0,0 +1,63 @@
|
|||
if not vim.g.vscode then
|
||||
return {}
|
||||
end
|
||||
|
||||
-- Add any additional plugins in vscode, you can set vscode=true on a plugin spec.
|
||||
local enabled = {
|
||||
"flash.nvim",
|
||||
"lazy.nvim",
|
||||
"mini.ai",
|
||||
"mini.comment",
|
||||
"mini.pairs",
|
||||
"mini.surround",
|
||||
"nvim-treesitter",
|
||||
"nvim-treesitter-textobjects",
|
||||
"nvim-ts-context-commentstring",
|
||||
"vim-repeat",
|
||||
"LazyVim",
|
||||
}
|
||||
|
||||
local Config = require("lazy.core.config")
|
||||
local Plugin = require("lazy.core.plugin")
|
||||
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 = "LazyVimKeymaps",
|
||||
callback = function()
|
||||
-- find file
|
||||
vim.keymap.set("n", "<leader><space>", "<cmd>Find<cr>")
|
||||
-- find in files
|
||||
vim.keymap.set("n", "<leader>/", [[<cmd>call VSCodeNotify('workbench.action.findInFiles')<cr>]])
|
||||
-- open symbol
|
||||
vim.keymap.set("n", "<leader>ss", [[<cmd>call VSCodeNotify('workbench.action.gotoSymbol')<cr>]])
|
||||
-- view problem
|
||||
vim.keymap.set("n", "<leader>xx", [[<cmd>call VSCodeNotify('workbench.actions.view.problems')<cr>]])
|
||||
-- open file explorer in left sidebar
|
||||
vim.keymap.set("n", "<leader>e", [[<cmd>call VSCodeNotify('workbench.view.explorer')<cr>]])
|
||||
-- Code Action
|
||||
vim.keymap.set("n", "<leader>ca", [[<cmd>call VSCodeNotify('editor.action.codeAction')<cr>]])
|
||||
-- Open terminal
|
||||
vim.keymap.set("n", "<leader>ft", [[<cmd>call VSCodeNotify('workbench.action.terminal.focus')<cr>]])
|
||||
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 } },
|
||||
},
|
||||
}
|
Loading…
Add table
Reference in a new issue