gpt-4-1106-preview· OpenAI Arena Human Preference 55K
Recommend a neovim completion plugin.
- User
Recommend a neovim completion plugin.
- Assistant
One of the most popular completion plugins for Neovim is
nvim-cmp. It is a highly configurable autocompletion plugin that integrates with a variety of sources to provide intelligent completion for different programming languages and file types.Here's how you can install
nvim-cmpwith the popular plugin managerpacker.nvim:- First, ensure you have Neovim (0.5.0 or later) and
packer.nviminstalled. - Include
nvim-cmpand its dependencies in yourpacker.nvimconfiguration:
use { 'hrsh7th/nvim-cmp', requires = { 'hrsh7th/cmp-buffer', -- buffer completions 'hrsh7th/cmp-path', -- path completions 'hrsh7th/cmp-cmdline', -- cmdline completions 'hrsh7th/cmp-nvim-lsp', -- LSP completions 'hrsh7th/cmp-nvim-lua', -- Neovim Lua API completions }, config = function() -- Setup nvim-cmp here or in a separate file end }- Configure
nvim-cmpaccording to your preferences:
-- Get the `cmp` setup function local cmp = require'cmp' cmp.setup({ -- You can set up completion for multiple features (buffer, path, etc.) sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'nvim_lua' }, -- more sources can be added here }), -- Define how the completion menu looks and behaves window = { -- Customize the completion menu window completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), }, -- Set up key mappings (this is an example, customize as needed) mapping = cmp.mapping.preset.insert({ ['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-Space>'] = cmp.mapping.complete(), ['<C-e>'] = cmp.mapping.abort(), ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. }), }) -- You can - First, ensure you have Neovim (0.5.0 or later) and
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.