Skip to content

Conversation

@anuragkanwar
Copy link

Added keymaps for Harpoon integration based on the current keymaps available in LazyVim.

image

@mikeslattery
Copy link
Collaborator

mikeslattery commented Mar 30, 2025

Harpooner. TIL!

  1. I wonder if there is a way to detect if the plugin is installed with if has('<plugin-id>') or if exists('g:<variable>')? It would be nice to not require manual config.
  2. For my own use, I won't un-comment, as I want to get updates often. Instead my config would look like:
" ~/.ideavimrc

" To update lazy-idea:
" curl -Lo ~/.lazy-idea.vim https://raw.githubusercontent.com/cufarvid/lazy-idea/refs/heads/main/.ideavimrc

source ~/.lazy-idea.vim

nmap <leader>1 <action>(HarpoonerOpenFile0)
nmap <leader>2 <action>(HarpoonerOpenFile1)
" ...

@anuragkanwar
Copy link
Author

Ya you are right but I am not author the Harpooner plugin, but In Harpooner we can do something like

    override fun applicationStarted() {
        // other things...
        HarpoonService.getInstance().setVariable("Harpooner", true)
    }

and then in .ideavimrc

if exists('g:Harpooner')
    " Activate Harpooner keymaps
    nmap <leader>1 <action>(HarpoonerOpenFile0)
    "...
endif

I will check with Harpooner author to do so or get if something already exists for this requirement

@cufarvid
Copy link
Owner

cufarvid commented Apr 3, 2025

Thanks for the PR! This is a great addition.

I'm thinking about breaking the config into smaller files (similar to intellimacs), which would make optional plugins much cleaner to manage - users could just include the plugins they want.

@mikeslattery Any thoughts on this?

@mikeslattery
Copy link
Collaborator

mikeslattery commented Apr 5, 2025

I'm thinking about breaking the config into smaller files (similar to intellimacs), which would make optional plugins much cleaner to manage - users could just include the plugins they want.

I've had some ideas. All require sourceing our script from ~/.ideavimrc

  1. Conditionals
" ~/.ideavimrc

set g:lazy_harpoon = 1
set g:lazy_copilot = 1

source ~/.lazy-idea.vim
" ~/.lazy-idea.vim

if exists('g:lazy_harpoon') && g:lazy_harpoon
    ...
endif
  1. Neovim plugin

We could convert this repo to a neovim plugin, and when you first launch Neovim it adds something like this to ~/.ideavimrc.

" lazy-idea start.  This block was generated by the Neovim lazy-idea plugin.  Do not edit.
set g:neovim_data='~/.local/share/nvim'
set g:neovim_config='~/.config/nvim'
" enabled lazyvim extras
source ~/.local/share/nvim/lazy/lazy-idea/idea/lazy-idea.vim
source ~/.local/share/nvim/lazy/lazy-idea/idea/harpoon.vim
source ~/.local/share/nvim/lazy/lazy-idea/idea/copilot.vim
" lazy-idea end

To update, run :LazyIdeaUpdate. It finds and replaces the block with updated config.

@anuragkanwar
Copy link
Author

An update on this, the author of Harpooner has added the requested requirement. here erotourtes/Harpooner#28 (comment). He has provided a build. Can we test it somehow @cufarvid @mikeslattery?

@cufarvid
Copy link
Owner

@anuragkanwar It looks like this is now available in Harpooner. Would you mind updating your PR to use the new approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants