From 4292b41bb45629bcf18036aa086298bcacb3dc9a Mon Sep 17 00:00:00 2001 From: Max Richter Date: Mon, 21 Nov 2022 15:27:39 +0100 Subject: [PATCH] some shit --- .luarc.json | 100 +++++++++++++------------- configs/.zshrc | 12 ++++ configs/lazygit/state.yml | 6 +- configs/nvim/init.lua | 1 + configs/nvim/lua/configs/dap.lua | 70 ++++++++++++++++-- configs/nvim/lua/configs/lsp.lua | 2 +- configs/nvim/lua/core/keymappings.lua | 2 +- configs/nvim/lua/core/options.lua | 2 +- configs/nvim/lua/core/plugins.lua | 11 ++- 9 files changed, 144 insertions(+), 62 deletions(-) diff --git a/.luarc.json b/.luarc.json index 30a3e78..98058bc 100644 --- a/.luarc.json +++ b/.luarc.json @@ -1,53 +1,49 @@ { - "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", - "Lua.diagnostics.globals": [ - "require", - "vim", - "pcall" - ], - "Lua.workspace.library": [ - "/home/max/.config/nvim", - "/home/max/.local/share/nvim/site", - "/home/max/.local/share/nvim/site/pack/packer/start/FixCursorHold.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/LuaSnip", - "/home/max/.local/share/nvim/site/pack/packer/start/alpha-nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/catppuccin", - "/home/max/.local/share/nvim/site/pack/packer/start/cmp_luasnip", - "/home/max/.local/share/nvim/site/pack/packer/start/copilot-cmp", - "/home/max/.local/share/nvim/site/pack/packer/start/copilot.lua", - "/home/max/.local/share/nvim/site/pack/packer/start/editorconfig-vim", - "/home/max/.local/share/nvim/site/pack/packer/start/friendly-snippets", - "/home/max/.local/share/nvim/site/pack/packer/start/fwatch.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/fzf", - "/home/max/.local/share/nvim/site/pack/packer/start/harpoon", - "/home/max/.local/share/nvim/site/pack/packer/start/impatient.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/leap.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/lsp-colors.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/lspkind.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/lspsaga.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/lualine.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/mason.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/neotest-jest", - "/home/max/.local/share/nvim/site/pack/packer/start/neotest-vitest", - "/home/max/.local/share/nvim/site/pack/packer/start/null-ls.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/nvim-autopairs", - "/home/max/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", - "/home/max/.local/share/nvim/site/pack/packer/start/nvim-scrollview", - "/home/max/.local/share/nvim/site/pack/packer/start/nvim-toggleterm.lua", - "/home/max/.local/share/nvim/site/pack/packer/start/nvim-treesitter-textobjects", - "/home/max/.local/share/nvim/site/pack/packer/start/nvim-web-devicons", - "/home/max/.local/share/nvim/site/pack/packer/start/packer.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/plenary.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/popup.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/projections.nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/vim-dadbod", - "/home/max/.local/share/nvim/site/pack/packer/start/vim-dadbod-ui", - "/home/max/.local/share/nvim/site/pack/packer/start/vim-surround", - "/home/max/.asdf/installs/neovim/nightly/share/nvim/runtime", - "/home/max/.asdf/installs/neovim/nightly/lib/nvim", - "/home/max/.local/share/nvim/site/pack/packer/start/catppuccin/after", - "/home/max/.local/share/nvim/site/pack/packer/start/cmp_luasnip/after", - "${3rd}/luassert/library" - ] -} \ No newline at end of file + "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", + "Lua.diagnostics.globals": ["require", "vim", "pcall"], + "Lua.workspace.library": [ + "/home/max/.config/nvim", + "/home/max/.local/share/nvim/site", + "/home/max/.local/share/nvim/site/pack/packer/start/FixCursorHold.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/LuaSnip", + "/home/max/.local/share/nvim/site/pack/packer/start/alpha-nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/catppuccin", + "/home/max/.local/share/nvim/site/pack/packer/start/cmp_luasnip", + "/home/max/.local/share/nvim/site/pack/packer/start/copilot-cmp", + "/home/max/.local/share/nvim/site/pack/packer/start/copilot.lua", + "/home/max/.local/share/nvim/site/pack/packer/start/editorconfig-vim", + "/home/max/.local/share/nvim/site/pack/packer/start/friendly-snippets", + "/home/max/.local/share/nvim/site/pack/packer/start/fwatch.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/fzf", + "/home/max/.local/share/nvim/site/pack/packer/start/harpoon", + "/home/max/.local/share/nvim/site/pack/packer/start/impatient.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/leap.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/lsp-colors.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/lspkind.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/lspsaga.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/lualine.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/mason.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/neotest-jest", + "/home/max/.local/share/nvim/site/pack/packer/start/neotest-vitest", + "/home/max/.local/share/nvim/site/pack/packer/start/null-ls.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/nvim-autopairs", + "/home/max/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", + "/home/max/.local/share/nvim/site/pack/packer/start/nvim-scrollview", + "/home/max/.local/share/nvim/site/pack/packer/start/nvim-toggleterm.lua", + "/home/max/.local/share/nvim/site/pack/packer/start/nvim-treesitter-textobjects", + "/home/max/.local/share/nvim/site/pack/packer/start/nvim-web-devicons", + "/home/max/.local/share/nvim/site/pack/packer/start/packer.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/plenary.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/popup.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/projections.nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/vim-dadbod", + "/home/max/.local/share/nvim/site/pack/packer/start/vim-dadbod-ui", + "/home/max/.local/share/nvim/site/pack/packer/start/vim-surround", + "/home/max/.asdf/installs/neovim/nightly/share/nvim/runtime", + "/home/max/.asdf/installs/neovim/nightly/lib/nvim", + "/home/max/.local/share/nvim/site/pack/packer/start/catppuccin/after", + "/home/max/.local/share/nvim/site/pack/packer/start/cmp_luasnip/after", + "${3rd}/luassert/library" + ] +} diff --git a/configs/.zshrc b/configs/.zshrc index 77f4714..9467ea3 100644 --- a/configs/.zshrc +++ b/configs/.zshrc @@ -13,6 +13,17 @@ fi # Enable vim mode in zsh bindkey -v +if [[ -z "$XDG_RUNTIME_DIR" ]]; then + export XDG_RUNTIME_DIR=/run/user/$UID + if [[ ! -d "$XDG_RUNTIME_DIR" ]]; then + export XDG_RUNTIME_DIR=/tmp/$USER-runtime + if [[ ! -d "$XDG_RUNTIME_DIR" ]]; then + mkdir -m 0700 "$XDG_RUNTIME_DIR" + fi + fi +fi + + ZSH_THEME="powerlevel10k/powerlevel10k" # ZSH_TMUX_AUTOSTART=true ZSH_TMUX_AUTOCONNECT=false @@ -23,6 +34,7 @@ plugins=( asdf tmux nx-completion + sudo zsh-autosuggestions ) diff --git a/configs/lazygit/state.yml b/configs/lazygit/state.yml index f1166c0..10f24fd 100644 --- a/configs/lazygit/state.yml +++ b/configs/lazygit/state.yml @@ -1,9 +1,13 @@ lastupdatecheck: 0 recentrepos: -- /home/max/.dotfiles - /home/max/Projects/silvester - /home/max/Projects/ruumio/main +- /home/max/Projects/ruumio/feat-prejoin-avatar-soon +- /home/max/Projects/ruumio/feat-wavy-bg - /home/max/Projects/ruumio/feat-3d-poi +- /home/max/.dotfiles +- /home/max/Projects/plantarium +- /home/max/Projects/jim-fx.com - /home/max/Projects/ruumio - /home/max/Projects/gainz startuppopupversion: 5 diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index 3bcdd15..120b13e 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -8,6 +8,7 @@ require("core.keymappings") require("configs.dashboard") require("configs.lsp") +require("configs.dap") require("theme.catpuccin") diff --git a/configs/nvim/lua/configs/dap.lua b/configs/nvim/lua/configs/dap.lua index 4b4a434..ac79f3f 100644 --- a/configs/nvim/lua/configs/dap.lua +++ b/configs/nvim/lua/configs/dap.lua @@ -1,15 +1,28 @@ local dap, dapui = require("dap"), require("dapui") dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open() + dapui.open({}) end dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close() + dapui.close({}) end dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close() + dapui.close({}) end +require("dap-vscode-js").setup({ + -- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node" + -- debugger_path = "(runtimedir)/site/pack/packer/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 = { 'pwa-node', 'pwa-chrome' }, -- which adapters to register in nvim-dap +}) + +dap.adapters.node2 = { + type = 'executable'; + command = 'node', + args = { vim.fn.stdpath "data" .. '/mason/packages/node-debug2-adapter/out/src/nodeDebug.js' }; +} + dap.adapters.firefox = { type = "executable", command = "node", @@ -18,7 +31,7 @@ dap.adapters.firefox = { disconnect_timeout_sec = 10, max_retries = 30, }, - args = { os.getenv("HOME") .. "/.local/share/nvim/mason/packages/firefox-debug-adapter/dist/adapter.bundle.js" }, + args = { vim.fn.stdpath("data") .. "/mason/packages/firefox-debug-adapter/dist/adapter.bundle.js" }, } dap.configurations.typescript = { @@ -31,4 +44,53 @@ dap.configurations.typescript = { url = "http://localhost:8080", firefoxExecutable = "/sbin/firefox-developer-edition", }, + { + name = 'Launch', + type = 'node2', + request = 'launch', + program = '${file}', + cwd = vim.fn.getcwd(), + sourceMaps = true, + protocol = 'inspector', + console = 'integratedTerminal', + }, + { + -- For this to work you need to make sure the node process is started with the `--inspect` flag. + name = 'Attach to process', + type = 'node2', + request = 'attach', + sourceMaps = true, + cwd = "${workspaceFolder}", + processId = require 'dap.utils'.pick_process, + }, + { + type = "pwa-node", + request = "attach", + name = "Attach", + processId = require 'dap.utils'.pick_process, + cwd = "${workspaceFolder}", + } } + +dap.configurations.typescriptreact = { + { + name = 'debug with firefox', + type = 'firefox', + request = 'launch', + reattach = true, + url = 'http://localhost:4200', + webRoot = '/home/max/Projects/ruumio/main/apps/events-standalone/', + firefoxExecutable = '/home/max/Downloads/firefox/firefox' + }, + { + name = 'debug with chrome', + type = 'pwa-chrome', + request = 'launch', + reattach = true, + url = 'http://localhost:4200', + webroot = '${workspacefolder}', + runtimeExecutable = '/mnt/c/Program Files/Google/Chrome/Application/chrome.exe' + }, +} + +dap.configurations.javascript = dap.configurations.typescript; diff --git a/configs/nvim/lua/configs/lsp.lua b/configs/nvim/lua/configs/lsp.lua index 4ebb90c..0cc63f9 100644 --- a/configs/nvim/lua/configs/lsp.lua +++ b/configs/nvim/lua/configs/lsp.lua @@ -6,7 +6,7 @@ require("null-ls").setup({ sources = { require("null-ls").builtins.formatting.stylua, require("null-ls").builtins.diagnostics.eslint, - -- require("null-ls").builtins.completion.spell, + require("null-ls").builtins.completion.spell, }, }) diff --git a/configs/nvim/lua/core/keymappings.lua b/configs/nvim/lua/core/keymappings.lua index a06f934..f92e40d 100644 --- a/configs/nvim/lua/core/keymappings.lua +++ b/configs/nvim/lua/core/keymappings.lua @@ -39,7 +39,7 @@ map("n", "t", translate, remap) map("v", "t", translate, remap) -- DAP Functionality -map("n", "b", ":lua require('dap').toggle_breakpoint()", options) +map("n", "b", ":lua require('dap').toggle_breakpoint()", options) -- Test Functionality map("n", "tt", ":lua require('neotest').run.run()", options) diff --git a/configs/nvim/lua/core/options.lua b/configs/nvim/lua/core/options.lua index ca032ce..f1dae42 100644 --- a/configs/nvim/lua/core/options.lua +++ b/configs/nvim/lua/core/options.lua @@ -58,7 +58,7 @@ vim.cmd("syntax sync minlines=256") set.mousescroll = "ver:1,hor:1" set.shiftwidth = 2 -- Change the number of space characters inserted for indentation set.showtabline = 1 -- Always show tabs -set.cmdheight = 0 -- More space for displaying messages +set.cmdheight = 1 -- More space for displaying messages vim.cmd([[set nowrap]]) -- Display long lines as just one line vim.cmd([[set noshowmode]]) -- We don't need to see things like -- INSERT -- anymore vim.cmd([[syntax enable]]) -- Enables syntax highlighing diff --git a/configs/nvim/lua/core/plugins.lua b/configs/nvim/lua/core/plugins.lua index 40b3f0b..d019eb3 100644 --- a/configs/nvim/lua/core/plugins.lua +++ b/configs/nvim/lua/core/plugins.lua @@ -103,6 +103,11 @@ return packer.startup(function(use) --------------- use("neovim/nvim-lspconfig") + use({ 'j-hui/fidget.nvim', + config = function() + require('fidget').setup() + end + }) use("williamboman/mason.nvim") use("williamboman/mason-lspconfig.nvim") use("jose-elias-alvarez/null-ls.nvim") @@ -213,8 +218,10 @@ return packer.startup(function(use) }) -- Dap Debugger -- Have not yet been able to set this up - -- use({ "mfussenegger/nvim-dap" }) - -- use({ "rcarriga/nvim-dap-ui" free + use({ "mfussenegger/nvim-dap" }) + use({ "rcarriga/nvim-dap-ui" }) + use { "mxsdev/nvim-dap-vscode-js", requires = { "mfussenegger/nvim-dap" } } + use("editorconfig/editorconfig-vim") use({ "michaelb/sniprun",