Skip to content

zerochae/endpoint.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

image

endpoint.nvim

A powerful Neovim plugin for quickly finding and navigating web framework API endpoints with multiple picker interfaces and smart caching.

Supported Frameworks:

  • Spring Boot (Java)
  • Rails (Ruby)
  • Symfony (PHP)
  • Express (Node.js)
  • NestJS (TypeScript/JavaScript)
  • FastAPI (Python)
  • .NET Core (C#)
  • Ktor (Kotlin)
  • Java Servlet (Java)
  • React Router (Client-side routing)

πŸ–₯️ Demo

μŠ€ν¬λ¦°μƒ· 2025-09-06 16 46 59 μŠ€ν¬λ¦°μƒ· 2025-09-14 01 08 58 μŠ€ν¬λ¦°μƒ· 2025-09-13 21 49 37 μŠ€ν¬λ¦°μƒ· 2025-09-13 20 18 11

✨ Features

  • πŸ” Multi-Framework Support: Automatically detects and supports 10 web frameworks
  • 🎯 Multiple Picker Interfaces: Telescope, vim.ui.select, or Snacks.nvim
  • ⚑ Smart Caching: Real-time, session, or persistent modes
  • πŸ“ Precise Navigation: Jump directly to endpoint definitions
  • πŸ€– Auto-Detection: Automatically detects your project's framework
  • πŸ”§ Simple Setup: Just call require("endpoint").setup()

πŸš€ Usage

:Endpoint          " Find all endpoints
:Endpoint Get      " Find GET endpoints
:Endpoint Post     " Find POST endpoints
:Endpoint Put      " Find PUT endpoints
:Endpoint Delete   " Find DELETE endpoints
:Endpoint Patch    " Find PATCH endpoints
:EndpointRefresh   " Force refresh (bypass cache)

πŸ“¦ Installation

lazy.nvim

{
  "zerochae/endpoint.nvim",
  dependencies = {
    -- Choose one or more pickers (all optional):
    "nvim-telescope/telescope.nvim", -- For telescope picker
    "folke/snacks.nvim",            -- For snacks picker
    "stevearc/dressing.nvim",       -- Enhances vim.ui.select with telescope backend
    -- vim.ui.select picker works without dependencies
  },
  cmd = { "Endpoint", "EndpointRefresh" },
  config = function()
    require("endpoint").setup()
  end,
}

βš™οΈ Configuration

require("endpoint").setup({
  -- Picker configuration
  picker = {
    type = "vim_ui_select", -- "telescope", "vim_ui_select", "snacks"
    options = {
      telescope = {},     -- Telescope-specific options
      snacks = {},        -- Snacks-specific options
      vim_ui_select = {   -- vim.ui.select-specific options
        enable_filter = false,        -- Enable filtering for large lists
        filter_threshold = 20,        -- Show filter prompt when endpoints > threshold
        filter_prompt = "Filter: ",   -- Custom filter prompt
        show_filter_examples = true,  -- Show filter examples in prompt
      },
    },
    -- Previewer configuration
    previewer = {
      enable_highlighting = true, -- Enable syntax highlighting in previewer (default: true)
    },
  },

  -- Cache configuration
  cache = {
    mode = "session",   -- "none", "session", "persistent"
  },

  -- UI configuration
  ui = {
    show_icons = true,
    show_method = true,
    methods = {
      GET = { icon = "πŸ“₯", color = "TelescopeResultsNumber" },
      POST = { icon = "πŸ“€", color = "TelescopeResultsConstant" },
      PUT = { icon = "✏️", color = "TelescopeResultsKeyword" },
      DELETE = { icon = "πŸ—‘οΈ", color = "TelescopeResultsSpecialChar" },
      PATCH = { icon = "πŸ”§", color = "TelescopeResultsFunction" },
      ROUTE = { icon = "πŸ”—", color = "TelescopeResultsIdentifier" },
    },
  },
})

Legacy Configuration (still supported with deprecation warnings):

require("endpoint").setup({
  picker = "telescope",       -- @deprecated: use picker.type
  picker_opts = {             -- @deprecated: use picker.options
    telescope = { theme = "dropdown" },
  },
})

🎯 Picker Options

⚠️ Important: You must set picker.type to match your installed picker!

  • Telescope: picker.type = "telescope" - Rich fuzzy search with preview
  • vim.ui.select: picker.type = "vim_ui_select" - Native Neovim interface with smart filtering, enhanced by dressing.nvim
  • Snacks: picker.type = "snacks" - Modern picker with file preview and line highlighting
-- If you use snacks.nvim
{
  "zerochae/endpoint.nvim",
  dependencies = { "folke/snacks.nvim" },
  config = function()
    require("endpoint").setup({
      picker = { type = "snacks" }
    })
  end,
}

-- If you use telescope.nvim
{
  "zerochae/endpoint.nvim",
  dependencies = { "nvim-telescope/telescope.nvim" },
  config = function()
    require("endpoint").setup({
      picker = { type = "telescope" }
    })
  end,
}

-- If you use vim.ui.select with dressing.nvim
{
  "zerochae/endpoint.nvim",
  dependencies = { "stevearc/dressing.nvim" },
  config = function()
    require("endpoint").setup({
      picker = {
        type = "vim_ui_select",
        options = {
          vim_ui_select = {
            enable_filter = true,
            filter_threshold = 20,
            filter_prompt = "Filter endpoints: ",
          }
        }
      }
    })
  end,
}

πŸ”§ Caching

Configure caching behavior for optimal performance:

  • "none": Real-time search, always up-to-date (no caching)
  • "session" (default): Cache until nvim closes, good performance balance
  • "persistent": Disk cache, survives nvim restarts until manual refresh

Cache Storage

Persistent cache files are stored in:

  • Location: ~/.cache/nvim/endpoint.nvim/
  • Format: Lua files for optimal performance
  • Naming:
    • {project}.lua (all endpoints)
    • {project}_GET.lua (GET endpoints only)
    • {project}_POST.lua (POST endpoints only)

Example cache files:

~/.cache/nvim/endpoint.nvim/
β”œβ”€β”€ myproject.lua              # All endpoints
β”œβ”€β”€ myproject_GET.lua          # GET endpoints
└── myproject_POST.lua         # POST endpoints

Use :EndpointRefresh to force refresh (bypass cache).

⚑️ Requirements

  • Neovim >= 0.8.0
  • ripgrep
  • Optional: telescope.nvim or snacks.nvim for enhanced UI

πŸ“„ License

MIT License