-
Notifications
You must be signed in to change notification settings - Fork 2
Advanced Configuration
This page covers detailed configuration options for endpoint.nvim.
Tip
Configure your preferred picker interface with custom options for the best experience.
require("endpoint").setup({
picker = {
type = "telescope",
options = {
telescope = {
theme = "dropdown",
previewer = false,
layout_config = {
width = 0.8,
height = 0.6
},
sorting_strategy = "ascending",
layout_strategy = "center",
}
}
}
})Features:
- Rich fuzzy search interface
- File preview with syntax highlighting
- Full Telescope keybinding support
- Customizable themes and layouts
require("endpoint").setup({
picker = {
type = "snacks",
options = {
snacks = {
prompt = "Find Endpoints ",
matcher = { fuzzy = true, smartcase = true },
preview = "file", -- "file", "none"
layout = { width = 0.8, height = 0.6 }
}
}
}
})Features:
- Modern picker interface
- File preview with precise line highlighting
- Fuzzy matching with file position patterns
- Clean, fast interface
require("endpoint").setup({
picker = {
type = "vim_ui_select",
options = {
vim_ui_select = {
prompt = "Choose endpoint: ",
kind = "endpoint", -- Useful for dressing.nvim theming
format_item = function(item)
return item.display_value
end
}
}
}
})Features:
- Native Neovim interface
- Works without external dependencies
- Integrates with vim.ui.select overrides (like dressing.nvim)
- Lightweight and simple
Note
Customize the appearance of endpoints with icons, colors, and display options.
ui = {
show_icons = true, -- Show method icons
show_method = true, -- Show method text
-- Option 1: Icons only
show_icons = true,
show_method = false,
-- Result: π₯ /api/users
-- Option 2: Method text only
show_icons = false,
show_method = true,
-- Result: GET /api/users
-- Option 3: Both icons and method text
show_icons = true,
show_method = true,
-- Result: π₯ GET /api/users
-- Option 4: Minimal (path only)
show_icons = false,
show_method = false,
-- Result: /api/users
}Tip
Define custom icons and colors for each HTTP method to match your preferred style.
ui = {
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"
}, -- React Router
},
}frameworks = {
rails = {
display_format = "smart", -- "action_only", "controller_action", "smart"
show_action_annotation = true, -- Show [controller#action] annotations
},
}Display Format Options:
-
"action_only": Show only action name
βGET[#index] /users -
"controller_action": Show controller#action
βGET[users#index] /users -
"smart": Smart formatting
β Root routes:GET[home#index] /
β Regular:GET[users#index] /users
Action Annotation Control:
-
show_action_annotation = true: Show annotations (default)
βGET[users#index] /users -
show_action_annotation = false: Hide annotations
βGET /users
require("endpoint").setup({
-- Cache configuration
cache = {
mode = "session", -- "none", "session", "persistent"
},
-- Picker configuration
picker = {
type = "telescope", -- "telescope", "vim_ui_select", "snacks"
options = {
telescope = {
theme = "dropdown",
previewer = true,
layout_config = { width = 0.9, height = 0.7 }
},
snacks = {
preview = "file",
layout = { width = 0.8, height = 0.6 }
},
},
},
-- UI customization
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" },
},
},
-- Framework-specific settings
frameworks = {
rails = {
display_format = "smart",
show_action_annotation = true,
},
},
})