All Projects → lukas-reineke → cmp-under-comparator

lukas-reineke / cmp-under-comparator

Licence: MIT License
nvim-cmp comparator function for completion items that start with one or more underlines

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to cmp-under-comparator

Vim Clap
👏 Modern performant fuzzy picker for Vim and NeoVim
Stars: ✭ 1,802 (+2240.26%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
cmp-rg
ripgrep source for nvim-cmp
Stars: ✭ 165 (+114.29%)
Mutual labels:  vim-plugin, neovim-plugin, nvim-cmp
Vem Tabline
A lightweight Vim/Neovim plugin to display buffers and tabs in the tabline
Stars: ✭ 129 (+67.53%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Asyncrun.vim
🚀 Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
Stars: ✭ 1,332 (+1629.87%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
virt-column.nvim
Display a character as the colorcolumn
Stars: ✭ 64 (-16.88%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Neovim Fuzzy
Fuzzy file finding for neovim
Stars: ✭ 103 (+33.77%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Vim Dadbod Completion
Database autocompletion powered by https://github.com/tpope/vim-dadbod
Stars: ✭ 163 (+111.69%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Alchemist.vim
Elixir Integration Into Vim
Stars: ✭ 632 (+720.78%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Visual Split.vim
Vim plugin to control splits with visual selections or text objects
Stars: ✭ 190 (+146.75%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Animate.vim
A Vim Window Animation Library
Stars: ✭ 173 (+124.68%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Todoist.nvim
A todoist extension for neovim
Stars: ✭ 84 (+9.09%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Vim Vsnip
Snippet plugin for vim/nvim that supports LSP/VSCode's snippet format.
Stars: ✭ 224 (+190.91%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Crease.vim
Easy foldtext customization for [neo]vim.
Stars: ✭ 19 (-75.32%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Nvim Treesitter Context
Show code context
Stars: ✭ 113 (+46.75%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Context.vim
Vim plugin that shows the context of the currently visible buffer contents
Stars: ✭ 688 (+793.51%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Targets.vim
Vim plugin that provides additional text objects
Stars: ✭ 2,114 (+2645.45%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Tmux Complete.vim
Vim plugin for insert mode completion of words in adjacent tmux panes
Stars: ✭ 447 (+480.52%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Vim Markdown Composer
An asynchronous markdown preview plugin for Vim and Neovim.
Stars: ✭ 501 (+550.65%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Neotex
latex live preview - plugin for neovim and vim 8
Stars: ✭ 170 (+120.78%)
Mutual labels:  neovim, vim-plugin, neovim-plugin
Indent Blankline.nvim
Indent guides for Neovim
Stars: ✭ 203 (+163.64%)
Mutual labels:  neovim, vim-plugin, neovim-plugin

cmp-under-comparator

A tiny function for nvim-cmp to better sort completion items that start with one or more underlines.

In most languages, especially Python, items that start with one or more underlines should be at the end of the completion suggestion.

Before After

Install

Use your favourite plugin manager to install.

Example with Packer

wbthomason/packer.nvim

-- init.lua
require("packer").startup(
    function()
        use "lukas-reineke/cmp-under-comparator"
    end
)

Example with Plug

junegunn/vim-plug

" init.vim
call plug#begin('~/.vim/plugged')
Plug 'lukas-reineke/cmp-under-comparator'
call plug#end()

Setup

Add the under function to the list of comparators in the cmp setup function.

local cmp = require "cmp"
cmp.setup {
    -- ... rest of your setup ...

    sorting = {
        comparators = {
            cmp.config.compare.offset,
            cmp.config.compare.exact,
            cmp.config.compare.score,
            require "cmp-under-comparator".under,
            cmp.config.compare.kind,
            cmp.config.compare.sort_text,
            cmp.config.compare.length,
            cmp.config.compare.order,
        },
    },
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].