Sort.Nvim banner
sQVe sQVe

Sort.Nvim

Development community

Description

Sorting plugin for Neovim that supports line-wise and delimiter sorting.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

🔠 sort.nvim

[![GitHub release](https://img.shields.io/github/v/release/sQVe/sort.nvim?style=flat-square)](https://github.com/sQVe/sort.nvim/releases/latest) [![License](https://img.shields.io/github/license/sQVe/sort.nvim?style=flat-square)](https://github.com/sQVe/sort.nvim/blob/main/LICENSE)

**Sort** is a Neovim plugin for intelligent line and delimiter sorting.

❓ Why

  • Delimiter-aware sorting: Automatically detects and sorts by delimiters like commas, pipes, colons, and more.
  • Natural sorting support: Handles strings with numbers naturally (e.g., "item1", "item2", "item10").
  • Vim-compatible: Mirrors Neovim's built-in :sort command functionality where applicable.
  • Motion-based operations: Provides text objects and motions for efficient sorting workflows.

📦 Installation

[lazy.nvim](https://github.com/folke/lazy.nvim)

{
  'sQVe/sort.nvim',
  config = function()
    require('sort').setup({
      -- Optional configuration overrides.
    })
  end,
}

⚙ Configuration

**Sort** comes with the following defaults:

{
  -- Delimiter priority order.
  delimiters = {
    ',',
    '|',
    ';',
    ':',
    's', -- Space.
    't'  -- Tab.
  },

  -- Natural sorting (default: true).
  natural_sort = true,

  -- Case-insensitive sorting (default: false).
  ignore_case = false,

  -- Remove duplicate items when sorting (default: false).
  unique = false,

  -- Whitespace alignment threshold.
  whitespace = {
    alignment_threshold = 3,
  },

  -- Default keymappings (set to false to disable).
  mappings = {
    operator = 'go',
    textobject = {
      inner = 'io',
      around = 'ao',
    },
    motion = {
      next_delimiter = ']o',
      prev_delimiter = '[o',
    },
  },
}

📗 Usage

Command-based sorting

The `:Sort` command adapts its behavior based on your selection:

Multiple lines

When selecting multiple lines, all arguments are passed to Neovim's built-in `:sort` command:

:[range