You open your favorite editor, Neovim, and navigate to a new Java class you're unfamiliar with. You want to preview all available methods, easily search through them, and navigate to each one for exploration, but this seems impossible.
This Neovim plugin integrates with telescope.nvim and nvim-treesitter to enable interactive fuzzy finding and navigation through Java methods within a file.
java-method-search.nvim/
├── LICENSE
├── lua
│ └── java-method-search
│ ├── commands.lua # Commands exposed to Neovim
│ ├── init.lu # Plugin entry pint
│ ├── java_method.lu # Mostly UI logic (.. telescope)
│ └── util.lu # Utility functions
└── README.md
- Fuzzy find trough all java methods in a class
- Easily navigate to all java methods in a class
- Preview all java methods in a class
- Make sure you have Neovim v0.9.0 or greater. ❗
- Dependecies: treesiter && telescope && plenary (telescope dep)
- Install using you plugin manager
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-treesitter/nvim-treesitter'
Plug 'jkeresman01/java-method-search.nvim'
use {
'nvim-telescope/telescope.nvim', tag = '0.1.8',
-- or , branch = '0.1.x',
requires = { {'nvim-lua/plenary.nvim'} }
}
use 'nvim-treesitter/nvim-treesitter'
use 'jkeresman01/java-method-search.nvim'
Following commands have been exposed to Neovim:
Commands
:JavaMethodSearch -- Launch picker (select your java method and navigate to it)
Set the keybindings as you see fit, here is one example:
require ("java-method-search").setup()
vim.keymap.set("n", "<leader>jms", "<CMD>JavaMethodSearch")
Key - map | Action |
---|---|
<leader>fm |
Search through Java methods within a file. |