Vscode-Neovim Support

- NeoVIM: Updates to NOT certain plugins in VSCode
- NeoVIM: Keymaps loaded only when neovim and NOT for VSCode
- VSCode: Added NeoVIM plugin with corresponding settings
This commit is contained in:
Pratik Tripathy
2024-07-01 22:08:08 +05:30
parent 98578abf18
commit 4c5aa8ff03
15 changed files with 81 additions and 17 deletions

View File

@@ -1,6 +1,7 @@
-- Load Keybindings from VIM
local vim_mappings = os.getenv("HOME") .. "/.vim/key_maps.vim"
if vim.loop.fs_stat(vim_mappings) then
local util = require("config.util")
if vim.loop.fs_stat(vim_mappings) and util.is_not_vscode() then
vim.cmd("source " .. vim_mappings)
end
@@ -43,8 +44,10 @@ vim.keymap.set("i", ";", ";<C-g>u", { desc = "Auto add undo breakpoints on ';'"
vim.keymap.set("i", "\r", "\r<C-g>u", { desc = "Auto add undo breakpoints on new lines" })
-- Traverse Buffer
vim.keymap.set("n", "<Tab>", "<cmd>bnext<CR>", { desc = "Switch to next buffer" })
vim.keymap.set("n", "<S-Tab>", "<cmd>bprevious<CR>", { desc = "Switch to previous buffer" })
if require("config.util").is_not_vscode() then
vim.keymap.set("n", "<Tab>", "<cmd>bnext<CR>", { desc = "Switch to next buffer" })
vim.keymap.set("n", "<S-Tab>", "<cmd>bprevious<CR>", { desc = "Switch to previous buffer" })
end
-- Save file
vim.keymap.set({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })

View File

@@ -98,6 +98,10 @@ local M = {
},
}
function M.is_not_vscode()
return not vim.g.vscode
end
function M.fg(name)
---@type {foreground?:number}?
---@diagnostic disable-next-line: deprecated