Skip to content

Commit

Permalink
keymap: -b =b 보정, <leader>b 는 디버깅용으로 사용할 예정
Browse files Browse the repository at this point in the history
  • Loading branch information
deptno committed Nov 5, 2023
1 parent a599af9 commit abff614
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lua/custom/mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ local get_git_root = require('lab.gx.lib.get_git_root')
-- In order to disable a default keymap, use
M.disabled = {
n = {
-- chad
["<leader>b"] = "",
-- nvimtree
["<C-n>"] = "",
["<leader>e"] = "",
Expand Down Expand Up @@ -313,9 +315,16 @@ M.tabufline = {
end,
"Goto prev buffer",
},
["=b"] = {
function()
vim.cmd("enew")
end,
"New buffer"
},
["-b"] = {
function()
require("tabscope").remove_tab_buffer()
-- require("tabscope").remove_tab_buffer()
vim.cmd("bwipeout")
end,
"Close buffer",
},
Expand Down
97 changes: 97 additions & 0 deletions lua/custom/plugins.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local file_exists = require "lab.gx.lib.file_exists"
return {
{
"neovim/nvim-lspconfig",
Expand Down Expand Up @@ -247,4 +248,100 @@ return {
end,
event = 'VeryLazy'
},
{
'mfussenegger/nvim-dap',
dependencies = {
'rcarriga/nvim-dap-ui',
'mxsdev/nvim-dap-vscode-js',
{
'microsoft/vscode-js-debug',
version = '1.x',
build = 'npm i && npm run compile vsDebugServerBundle && mv dist out'
}
},
config = function ()
require('dapui').setup()

local debugger_path = vim.fn.stdpath('data') .. "/lazy/vscode-js-debug"
require('dap-vscode-js').setup({
debugger_path = debugger_path,
adapters = {
'pwa-node',
'pwa-chrome',
'pwa-msedge',
'node-terminal',
'pwa-extensionHost',
}
})

local js_based_languages = { "typescript", "javascript", "typescriptreact" }
for _, language in ipairs(js_based_languages) do
require("dap").configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require('dap.utils').pick_process,
cwd = "${workspaceFolder}",
},
{
type = "pwa-chrome",
request = "launch",
name = "Start Chrome with 'localhost:3000'",
url = "http://localhost:3000",
webRoot = "${workspaceFolder}",
userDataDir = "${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir"
},
{
type = "pwa-chrome",
request = "launch",
name = "Start Chrome with 'localhost:3001'",
url = "http://localhost:3001",
webRoot = "${workspaceFolder}",
userDataDir = "${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir"
},
{
type = "pwa-chrome",
request = "launch",
name = "Start Chrome with 'localhost:3002'",
url = "http://localhost:3002",
webRoot = "${workspaceFolder}",
userDataDir = "${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir"
},
{
type = "pwa-chrome",
request = "launch",
name = "Start Chrome with 'localhost:4000'",
url = "http://localhost:4000",
webRoot = "${workspaceFolder}",
userDataDir = "${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir"
},
{
type = "pwa-chrome",
request = "launch",
name = "Start Chrome with 'localhost:4001'",
url = "http://localhost:4001",
webRoot = "${workspaceFolder}",
userDataDir = "${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir"
},
{
type = "pwa-chrome",
request = "launch",
name = "Start Chrome with 'localhost:4002'",
url = "http://localhost:4002",
webRoot = "${workspaceFolder}",
userDataDir = "${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir"
},
}
end
end,
event = 'LspAttach'
},
}

0 comments on commit abff614

Please sign in to comment.