vim-config icon indicating copy to clipboard operation
vim-config copied to clipboard

nvim branch: adding dap plugins (lua plugins)

Open kraxli opened this issue 4 years ago • 2 comments

I am struggling with the load process of lua plugins in combination with dein. I have tried many things to add dap (Debug Adapter Protocol) plugins.

Everything is loaded and working correctly after calling dein#recache_runtimepath() but without recaching, the plugins are not loaded including the files in lua/plugins.

My latest attempt to include these dap-plugins:

file config/local.plugins.yaml:

- repo: nvim-telescope/telescope-dap.nvim
  if: has('nvim-0.5')
  lazy: true

- repo: mfussenegger/nvim-dap
  if: has('nvim-0.5')
  depends: [ auto-session, telescope.nvim, nvim-dap-python, nvim-dap-ui ]
  hook_post_source: lua require('plugins.dap')

- repo: mfussenegger/nvim-dap-python
  if: has('nvim-0.5')
  hook_post_source: lua require('plugins.dap-python')

- repo: rcarriga/nvim-dap-ui
  if: has('nvim-0.5')
  hook_post_source: lua require('plugins.dap-ui')

To the dependency in config/plugins.yaml for telescope.nvim I have added:

- repo: nvim-telescope/telescope.nvim
  if: has("nvim-0.5")
  depends: [ todo-comments.nvim, session-lens, telescope-dap.nvim ]
  on_cmd: Telescope
  hook_post_source: lua require('plugins.telescope')

At the end of lua/plugins/telescope.lua I added:

-- Telescope extensions
...
telescope.load_extension('dap')

What am I doing wrong? Can anybody help me out on this such that the plugins are loaded also without recaching?

My environment:

Branch: nvim Neovim: version 0.5 System: Linux Mint 20 Ulyana Terminal: GNOME Terminal 3.36.2

Many thanks!

kraxli avatar Jul 12 '21 16:07 kraxli

@kraxli for the dap part plugins, try

- repo: nvim-telescope/telescope-dap.nvim
  if: has('nvim-0.5')
  lazy: true

- repo: mfussenegger/nvim-dap
  if: has('nvim-0.5')
  depends: [ auto-session ]
  on_lua: dap
  hook_post_source: lua require('plugins.dap')

- repo: mfussenegger/nvim-dap-python
  if: has('nvim-0.5')
  depends: mfussenegger/nvim-dap
  on_lua: dap-python
  hook_post_source: lua require('plugins.dap-python')

- repo: rcarriga/nvim-dap-ui
  if: has('nvim-0.5')
  depends: mfussenegger/nvim-dap
  on_lua: dapui
  hook_post_source: lua require('plugins.dap-ui')

rafi avatar Jul 25 '21 19:07 rafi

Thanks @rafi! The hook_post_source do not seem to be executed with a "normal" start-up. The lua files seem to be loaded only after a recache of the runtimepath which seems to be strange. May this be because of some laziness clash between dein and the lua plugins? A way to successfully call lua require('...') is to use ftplugin = {'python': lua require(...)}. However the latter breaks lsp functionalities.

Additionally, telescope-dap does only get active in case telescope had been activated before (e.g. by a search ;g). Would you have any thoughts how to improve this behaviour? Many thanks!

kraxli avatar Sep 14 '21 16:09 kraxli

Pushed a whole new rewrite of vim-config, 100% lua and lazy.nvim as package-manager, check it out...

rafi avatar Apr 07 '23 16:04 rafi