This commit is contained in:
2024-08-22 17:45:46 +04:00
parent 066e3ef14e
commit 445cb399ef
7 changed files with 209 additions and 24 deletions

92
lvim/lua/configs/dap.lua Executable file
View File

@@ -0,0 +1,92 @@
local dap = require('dap')
require("dap-vscode-js").setup({
-- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node"
debugger_path = "/.local/share/lunarvim/site/pack/lazy/opt/vscode-js-debug", -- Path to vscode-js-debug installation.
debugger_cmd = { "js-debug-adapter" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`.
adapters = { 'node-terminal' }, -- which adapters to register in nvim-dap
-- log_file_path = "(stdpath cache)/dap_vscode_js.log", -- Path for file logging
-- log_file_level = false, -- Logging level for output to file. Set to false to disable file logging.
-- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output.
})
dap.configurations.cpp = {
{
name = "Launch file",
type = "codelldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
},
}
dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp
dap.adapters["pwa-node"] = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = "node",
-- 💀 Make sure to update this path to point to your installation
args = {"/.local/share/lvim/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js", "${port}"},
}
}
dap.configurations.javascript = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
}
dap.adapters.chrome = {
type = "executable",
command = "node",
args = {os.getenv("HOME") .. "/.local/share/lvim/mason/packages/chrome-debug-adapter/out/src/chromeDebug.js"},
}
dap.adapters.firefox = {
type = 'executable',
command = 'node',
args = {os.getenv('HOME') .. '/.local/share/lvim/mason/packages/firefox-debug-adapter/dist/adapter.bundle.js'},
}
dap.configurations.typescriptreact = { -- change to typescript if needed
{
name = "Next.js: debug server-side",
type = "node-terminal",
request = "launch",
command = "npm run dev",
sourceMaps= true,
},
{
name = "Next.js: debug client-side with chrome",
type = "chrome",
request = "launch",
url = "http://localhost:3000"
},
{
name = "Next.js: debug client-side with firefox",
type = "firefox",
request = "launch",
url = 'http://localhost:3000',
webRoot = '${workspaceFolder}',
firefoxExecutable = '/usr/bin/waterfox',
pathMappings = {
{
url = "webpack://_n_e/",
path = "${workspaceFolder}/"
}
},
},
}
dap.configurations.javascriptreact = dap.configurations.typescriptreact;

View File

@@ -16,7 +16,7 @@ require("dropbar").setup(
local symbols = sources.path.get_symbols(buf, win, cursor)
for _, symbol in ipairs(symbols) do
-- get correct icon color
-- local icon_fg = get_hl_color(symbol.icon_hl, "fg#")
local icon_fg = get_hl_color(symbol.icon_hl, "fg#")
symbol.icon_hl = "DropbarSymbol" .. symbol.icon_hl
local icon_string = ""

View File

@@ -1,5 +1,4 @@
local map = vim.keymap.set
local ufo = require("ufo")
map("n", ";", ":", { desc = "CMD enter command mode" })
@@ -14,10 +13,20 @@ map("n", "<C-j>", "<C-w>j", { desc = "switch window down" })
map("n", "<C-k>", "<C-w>k", { desc = "switch window up" })
map("n", "<C-n>", "<cmd>NeoTreeShowToggle<CR>", { desc = "nvimtree toggle window" })
map("n", "<leader>e", "<cmd>NeoTreeFocus<CR>", { desc = "nvimtree focus window" })
map("n", "<leader>n", "<cmd>set norelativenumber<CR>", { desc = "toggle line number" })
map("n", "<leader>rn", "<cmd>set relativenumber<CR>", { desc = "toggle relative number" })
map("n", "<C-A-l>", "<cmd>BufferLineMoveNext<cr>", { desc = "move buffer to right" })
map("n", "<C-A-J>", "<cmd>BufferLineMovePrev<cr>", { desc = "move buffer to left" })
map("n", "<Tab>", "<cmd>BufferLineCycleNext<cr>", { desc = "switch to next buffer" })
map("n", "<S-Tab>", "<cmd>BufferLineCyclePrev<cr>", { desc = "switch to prev buffer" })
lvim.builtin.which_key.mappings["ln"] = { "<cmd>set norelativenumber<CR>", "Toggle line number" }
lvim.builtin.which_key.mappings["e"] = { "<cmd>NeoTreeFocus<CR>", "Nvimtree focus window" }
lvim.builtin.which_key.mappings["rn"] = { "<cmd>set relativenumber<CR>", "Toggle relative number" }
lvim.builtin.which_key.mappings["ns"] = { "<Cmd>split<cr>", "Horizontal split" }
lvim.builtin.which_key.mappings["vs"] = { "<Cmd>vsplit<cr>", "Vertical split" }
map("n", "<F9>", "<cmd>DapContinue<cr>")
map("n", "<F5>", "<cmd>DapToggleBreakpoint<cr>")
map("n", "mk", "<cmd>RustLsp moveItem up<cr>")
map("n", "m,", "<cmd>RustLsp moveItem down<cr>")
@@ -27,9 +36,6 @@ map("n", "ca", "<cmd>RustLsp codeAction<cr>")
map("n", "<C-s>", "<cmd>w!<cr>")
map("i", "<C-s>", "<cmd>w!<cr>")
map("n", "<leader>sn", "<Cmd>split<cr>", { desc = "Horizontal split" })
map("n", "<leader>sv", "<Cmd>vsplit<cr>", { desc = "Vertical split" })
map("n", "<leader>dr", "<cmd> DapContinue <cr>", { desc = "Continue debug" } )
map("n", "do", function()
@@ -42,13 +48,9 @@ map("n", "dt", function()
require("dapui").toggle()
end, { desc = "Toggle DAP ui" })
map("n", "<F9>", "<cmd>DapContinue<cr>", { desc = "Start or continue debug" })
map("n", "+", "<cmd>vertical resize +5<cr>", { desc = "Increase vertical buffer" }) -- make the window biger vertically
map("n", "-", "<cmd>vertical resize -5<cr>", { desc = "Decrease vertical buffer" }) -- make the window smaller vertically
map("n", "_", "<cmd>horizontal resize +2<cr>", { desc = "Increase horizontal buffer" }) -- make the window bigger horizontally by pressing shift and =
map("n", "=", "<cmd>horizontal resize -2<cr>", { desc = "Decrease horizontal buffer" }) -- make the window smaller horizontally by pressing shift and -
map('n', 'zR', ufo.openAllFolds)
map('n', 'zM', ufo.closeAllFolds)
map("n", "_", "<cmd>horizontal resize +2<cr>", { desc = "Increase horizontal buffer" }) -- make the window bigger horizontally by pressing shift and =
map("n", "<C-{>", "<cmd>foldopen<cr>")
map("n", "<C-}>", "<cmd>foldclose<cr>")

View File

@@ -10,9 +10,33 @@ lvim.plugins = {
}
}
},
{
"savq/melange-nvim"
},
{
"HoNamDuong/hybrid.nvim",
lazy = false,
priority = 1000,
opts = {},
},
{
'marko-cerovac/material.nvim'
},
{
"rebelot/kanagawa.nvim",
},
{
'mountain-theme/vim'
},
{
'fgheng/winbar.nvim'
},
{
"gbprod/nord.nvim",
},
{
"vague2k/huez.nvim",
},
{
'Bekaboo/dropbar.nvim',
dependencies = {
@@ -35,10 +59,6 @@ lvim.plugins = {
{
'kyazdani42/nvim-web-devicons'
},
{
'kevinhwang91/nvim-ufo',
dependencies = { 'kevinhwang91/promise-async' },
},
{
"mfussenegger/nvim-dap",
event = "VeryLazy",
@@ -54,6 +74,9 @@ lvim.plugins = {
require("dapui").setup()
end
},
{
"mxsdev/nvim-dap-vscode-js"
},
{
"microsoft/vscode-js-debug",
lazy = true,
@@ -65,9 +88,6 @@ lvim.plugins = {
{
"folke/neodev.nvim", opts = {}
},
{
"mxsdev/nvim-dap-vscode-js"
},
{
"mlaursen/vim-react-snippets",
},