From cb81dc8d53639300bedb41d89054d6de2af54ccb Mon Sep 17 00:00:00 2001 From: js0ny Date: Sun, 23 Feb 2025 19:52:54 +0000 Subject: [PATCH] feat(nvim): Neovide integration --- tools/nvim/init.lua | 25 ++++++++++++++++++++++-- tools/nvim/lua/config/icons.lua | 1 + tools/nvim/lua/config/vscode.lua | 16 +++++++++++++++ tools/nvim/lua/plugins/dap.lua | 4 +--- tools/nvim/lua/plugins/edit.lua | 18 +++++++++-------- tools/nvim/lua/plugins/init.lua | 18 ++++++++++++++++- tools/nvim/lua/plugins/lazy-nvim.lua | 18 ----------------- tools/nvim/lua/plugins/mod/dap-setup.lua | 3 +++ 8 files changed, 71 insertions(+), 32 deletions(-) create mode 100644 tools/nvim/lua/config/vscode.lua create mode 100644 tools/nvim/lua/plugins/mod/dap-setup.lua diff --git a/tools/nvim/init.lua b/tools/nvim/init.lua index 8279f3a..215b740 100644 --- a/tools/nvim/init.lua +++ b/tools/nvim/init.lua @@ -8,7 +8,28 @@ -- Entry point of neovim configuration require("config.options") -require("config.plugins") -require("config.colorscheme") +if vim.g.vscode then -- TODO: VSCode Neovim Integration + require("config.vscode") +else -- Vanilla neovim + require("config.plugins") + require("config.colorscheme") +end require("config.keymaps") require("config.diagnostics") + +-- If current session is spawn by neovide, do: +if vim.g.neovide then + -- Enable input method + vim.g.neovide_input_ime = true + vim.g.neovide_transparency = 0.85 + vim.g.transparency = 0.85 + vim.g.neovide_normal_opacity = 0.85 + vim.g.neovide_window_blurred = true -- macOS only + vim.g.neovide_floating_blur_amount_x = 2.0 + vim.g.neovide_floating_blur_amount_y = 2.0 + vim.g.neovide_floating_shadow = true + vim.g.neovide_floating_z_height = 10 + vim.g.neovide_light_angle_degrees = 45 + vim.g.neovide_light_radius = 5 + vim.g.neovide_input_macos_option_key_is_meta = "only_left" +end diff --git a/tools/nvim/lua/config/icons.lua b/tools/nvim/lua/config/icons.lua index 31c944b..d7ed72e 100644 --- a/tools/nvim/lua/config/icons.lua +++ b/tools/nvim/lua/config/icons.lua @@ -45,6 +45,7 @@ local M = { TypeParameter = "󰅲", Copilot = "", }, + telescope = " ", } return M diff --git a/tools/nvim/lua/config/vscode.lua b/tools/nvim/lua/config/vscode.lua new file mode 100644 index 0000000..58a3903 --- /dev/null +++ b/tools/nvim/lua/config/vscode.lua @@ -0,0 +1,16 @@ +require("plugins.lazy-nvim") + +require("lazy").setup({ + spec = { + -- import your plugins + -- { import = "plugins.completion" }, + -- { import = "plugins.fileutils" }, + -- { import = "plugins.lsp" }, + -- { import = "plugins.edit" }, + -- { import = "plugins.misc" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/tools/nvim/lua/plugins/dap.lua b/tools/nvim/lua/plugins/dap.lua index 659ef2a..049923b 100644 --- a/tools/nvim/lua/plugins/dap.lua +++ b/tools/nvim/lua/plugins/dap.lua @@ -1,6 +1,4 @@ -- Debugger setups return { - { - "mfussenegger/nvim-dap", - } + { import = "plugins.mod.dap-setup" }, } diff --git a/tools/nvim/lua/plugins/edit.lua b/tools/nvim/lua/plugins/edit.lua index 1293d48..25dc599 100644 --- a/tools/nvim/lua/plugins/edit.lua +++ b/tools/nvim/lua/plugins/edit.lua @@ -20,19 +20,21 @@ return { { "echasnovski/mini.pairs", version = false, - config = function() - require("mini.pairs").setup() - end, + opts = {}, + -- config = function() + -- require("mini.pairs").setup() + -- end, }, { "kylechui/nvim-surround", version = "*", -- Use for stability; omit to use `main` branch for the latest features event = "VeryLazy", - config = function() - require("nvim-surround").setup({ - -- Configuration here, or leave empty to use defaults - }) - end, + opts = {}, + -- config = function() + -- require("nvim-surround").setup({ + -- -- Configuration here, or leave empty to use defaults + -- }) + -- end, }, { "MagicDuck/grug-far.nvim", diff --git a/tools/nvim/lua/plugins/init.lua b/tools/nvim/lua/plugins/init.lua index 89b5a13..59fa3cb 100644 --- a/tools/nvim/lua/plugins/init.lua +++ b/tools/nvim/lua/plugins/init.lua @@ -1,2 +1,18 @@ --- Entry point of the plugin manager require("plugins.lazy-nvim") + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins.appearance" }, + { import = "plugins.completion" }, + { import = "plugins.fileutils" }, + { import = "plugins.lsp" }, + { import = "plugins.edit" }, + { import = "plugins.misc" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/tools/nvim/lua/plugins/lazy-nvim.lua b/tools/nvim/lua/plugins/lazy-nvim.lua index 1564c80..a5b8fbf 100644 --- a/tools/nvim/lua/plugins/lazy-nvim.lua +++ b/tools/nvim/lua/plugins/lazy-nvim.lua @@ -20,21 +20,3 @@ vim.opt.rtp:prepend(lazypath) -- This is also a good place to setup other settings (vim.opt) vim.g.mapleader = " " vim.g.maplocalleader = "\\" - --- Setup lazy.nvim -require("lazy").setup({ - spec = { - -- import your plugins - { import = "plugins.appearance" }, - { import = "plugins.completion" }, - { import = "plugins.fileutils" }, - { import = "plugins.dap" }, - { import = "plugins.lsp" }, - { import = "plugins.edit" }, - { import = "plugins.misc" }, - }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - -- automatically check for plugin updates - checker = { enabled = true }, -}) diff --git a/tools/nvim/lua/plugins/mod/dap-setup.lua b/tools/nvim/lua/plugins/mod/dap-setup.lua new file mode 100644 index 0000000..99e1741 --- /dev/null +++ b/tools/nvim/lua/plugins/mod/dap-setup.lua @@ -0,0 +1,3 @@ +return { + "mfussenegger/nvim-dap", +}