neovim

Personal neovim configuration files
git clone git://gtms.dev:neovim
Log | Files | Refs

commit d3f85004a65e1beb378d8cb59c10b56bbf5b37e7
parent 932b9073101215b7cc14bc56cf5ba1c86ad76c9a
Author: Tomas Nemec <nemi@skaut.cz>
Date:   Wed,  1 Feb 2023 08:42:25 +0100

update

Diffstat:
Mafter/plugin/dap.lua | 113++++++++++++++++++++++++++++++++++++++++++-------------------------------------
Mafter/plugin/no-neck-pain.lua | 2+-
Mafter/plugin/telescope.lua | 7+++++++
Aafter/queries/dart/locals.scm | 3+++
Afiletype.lua | 1+
Aftplugin/latte.lua | 0
Mplugin/trun.lua | 5+++--
7 files changed, 75 insertions(+), 56 deletions(-)

diff --git a/after/plugin/dap.lua b/after/plugin/dap.lua @@ -86,37 +86,45 @@ end -- Virtual Text local has_dapvt, dapvt = pcall(require, 'nvim-dap-virtual-text') if has_dapvt then - dapvt.setup() + dapvt.setup {} end -- cpp --- dap.adapters.cpp = { --- type = 'executable', --- attach = { pidProperty = 'pid', pidSelect = 'ask' }, --- command = 'lldb', -- my binary was called 'lldb-vscode-11' --- env = { LLDB_LAUNCH_FLAG_LAUNCH_IN_TTY = 'YES' }, --- name = 'lldb', --- } --- dap.configurations.cpp = { { type = 'cpp', request = 'launch', name = 'Launch File', program = '${file}' } } +dap.adapters.cpp = { + type = 'executable', + attach = { pidProperty = 'pid', pidSelect = 'ask' }, + command = 'lldb', -- my binary was called 'lldb-vscode-11' + env = { LLDB_LAUNCH_FLAG_LAUNCH_IN_TTY = 'YES' }, + name = 'lldb', +} +dap.configurations.cpp = { { type = 'cpp', request = 'launch', name = 'Launch File', program = '${file}' } } -- dart -- dap.defaults.fallback.external_terminal = { command = '/usr/bin/alacritty', args = { '-e' } } --- dap.adapters.dart = { --- type = 'executable', --- command = 'node', --- args = { os.getenv('HOME') .. '/downloads/Dart-Code/out/dist/debug.js', 'dart' }, --- } --- dap.configurations.dart = { --- { --- type = 'dart', --- request = 'launch', --- name = 'Launch File', --- dartSdkPath = os.getenv('HOME') .. '/.local/lib/dart/stable/', --- -- flutterSdkPath = os.getenv('HOME') .. "/flutter", --- program = '${file}', --- cwd = '${workspaceFolder}', --- }, --- } +dap.adapters.dart = { + type = 'executable', + command = 'dart', + -- This command was introduced upstream in https://github.com/dart-lang/sdk/commit/b68ccc9a + args = { 'debug_adapter' }, +} +dap.configurations.dart = { + { + -- + type = 'dart', + request = 'launch', + name = 'Launch File', + program = '${file}', + cwd = '${workspaceFolder}', + }, +} +table.insert(dap.configurations.dart, { + type = 'dart', + request = 'launch', + name = 'Launch build', + program = '.dart_tool/build/entrypoint/build.dart', + args = { 'build', '--delete-conflicting-outputs' }, + cwd = '${workspaceFolder}', +}) -- lua -- dap.configurations.lua = { @@ -141,39 +149,38 @@ end -- DAP CHROME local has_vscode, vscode = pcall(require, 'dap-vscode-js') if has_vscode then - dap.configurations.dart = { - { - type = 'pwa-chrome', - request = 'attach', - name = 'Attach to :9222', - - cwd = vim.fn.getcwd(), - port = 9222, - webRoot = '${workspaceFolder}/web', - - pathMapping = function() - local has_pm, pm = pcall(require, 'tms.ft.dart.path_mapping') - if has_pm then - return pm.load() - end - return {} - end, - sourceMapPathOverrides = {}, - }, - { -- - type = 'pwa-chrome', - request = 'launch', - name = 'Launch', - webRoot = '${workspaceFolder}', - }, - } - -- The VSCode Debugger requires a special setup vscode.setup({ adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' }, - debugger_path = vim.fn.stdpath('data') .. '/mason/bin/js-debug-adapter', -- Path to VSCode Debugger debugger_cmd = { 'js-debug-adapter' }, }) + + table.insert(dap.configurations.dart, { + -- + type = 'pwa-chrome', + request = 'attach', + name = 'Attach to :9222', + cwd = vim.fn.getcwd(), + port = 9222, + webRoot = '${workspaceFolder}/web', + + -- pathMapping = function() + -- local has_pm, pm = pcall(require, 'tms.ft.dart.path_mapping') + -- if has_pm then + -- return pm.load() + -- end + -- return {} + -- end, + -- sourceMapPathOverrides = {}, + }) + + table.insert(dap.configurations.dart, { + -- + type = 'pwa-chrome', + request = 'launch', + name = 'Launch', + webRoot = '${workspaceFolder}', + }) end -- ALT CHROME diff --git a/after/plugin/no-neck-pain.lua b/after/plugin/no-neck-pain.lua @@ -2,4 +2,4 @@ if not pcall(require, 'no-neck-pain') then return end -require('no-neck-pain').setup {} +require('no-neck-pain').setup { width = 130 } diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua @@ -38,6 +38,13 @@ vim.keymap.set('n', '<space>d', function() builtin.find_files(layout.dd_large_noprev) end, { desc = 'Telescope Find Files' }) +vim.keymap.set('n', '<space>D', function() + local opts = layout.dd_large_noprev + opts.no_ignore = true + opts.hidden = true + builtin.find_files(opts) +end, { desc = 'Telescope Find Files' }) + vim.keymap.set('n', '<space>g', function() builtin.git_files() end, { desc = 'Telescope Git Files' }) diff --git a/after/queries/dart/locals.scm b/after/queries/dart/locals.scm @@ -0,0 +1,3 @@ +;; extends + +[(identifier) (type_identifier)] @definition.var diff --git a/filetype.lua b/filetype.lua @@ -0,0 +1 @@ +vim.filetype.add { extension = { latte = 'html' } } diff --git a/ftplugin/latte.lua b/ftplugin/latte.lua diff --git a/plugin/trun.lua b/plugin/trun.lua @@ -61,8 +61,9 @@ local function trun_to_qf(name) -- translate if package_name and packages_paths then local package_root = packages_paths[package_name].root - line = string.gsub(line, '^.-:%d+:%d+:', - package_root .. '/' .. '.dart_tool/build/generated/' .. package_name .. '/%0') + line = string.gsub(line, '^packages/(.-)/(.-:%d+:%d+:)', function(package, path) + return package_root .. '/' .. '.dart_tool/build/generated/' .. package .. '/lib/' .. path + end) line = string.gsub(line, 'asset:(.-)/(.-):', function(package, path) local root = packages_paths[package].lib return root .. '/' .. path