mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 23:22:57 +00:00
set neovim completion to work in cmdline (command) mode
This commit is contained in:
parent
b78bbf2003
commit
0a225d6599
@ -26,10 +26,10 @@
|
|||||||
|
|
||||||
# Basic completion keybinds
|
# Basic completion keybinds
|
||||||
mapping = {
|
mapping = {
|
||||||
"['<C-n>']" = dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })";
|
"['<C-n>']" = dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert }, { 'i', 'c' })";
|
||||||
"['<C-p>']" = dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Insert })";
|
"['<C-p>']" = dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Insert }, { 'i', 'c' })";
|
||||||
"['<Down>']" = dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Select })";
|
"['<Down>']" = dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Select }, { 'i', 'c' })";
|
||||||
"['<Up>']" = dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Select })";
|
"['<Up>']" = dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Select }, { 'i', 'c' })";
|
||||||
"['<C-d>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(-4)";
|
"['<C-d>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(-4)";
|
||||||
"['<C-f>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(4)";
|
"['<C-f>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(4)";
|
||||||
"['<C-e>']" = dsl.rawLua "require('cmp').mapping.abort()";
|
"['<C-e>']" = dsl.rawLua "require('cmp').mapping.abort()";
|
||||||
@ -131,13 +131,41 @@
|
|||||||
lua = ''
|
lua = ''
|
||||||
-- Use buffer source for `/`
|
-- Use buffer source for `/`
|
||||||
require('cmp').setup.cmdline("/", {
|
require('cmp').setup.cmdline("/", {
|
||||||
sources = {
|
mapping = {
|
||||||
{ name = "buffer", keyword_length = 5 },
|
['<C-n>'] = {
|
||||||
|
c = require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert }, { 'i', 'c' })
|
||||||
|
},
|
||||||
|
['<C-p>'] = {
|
||||||
|
c = require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Insert }, { 'i', 'c' })
|
||||||
|
},
|
||||||
|
['<C-y>'] = {
|
||||||
|
c = require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Insert, select = true, }, { 'i', 'c' })
|
||||||
|
},
|
||||||
|
['<C-r>'] = {
|
||||||
|
c = require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, }, { 'i', 'c' })
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
sources = require('cmp').config.sources({
|
||||||
|
{ name = "buffer", keyword_length = 5 },
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Use cmdline & path source for ':'
|
-- Use cmdline & path source for ':'
|
||||||
require('cmp').setup.cmdline(":", {
|
require('cmp').setup.cmdline(":", {
|
||||||
|
mapping = {
|
||||||
|
['<C-n>'] = {
|
||||||
|
c = require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert }, { 'i', 'c' })
|
||||||
|
},
|
||||||
|
['<C-p>'] = {
|
||||||
|
c = require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Insert }, { 'i', 'c' })
|
||||||
|
},
|
||||||
|
['<C-y>'] = {
|
||||||
|
c = require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Insert, select = true, }, { 'i', 'c' })
|
||||||
|
},
|
||||||
|
['<C-r>'] = {
|
||||||
|
c = require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, }, { 'i', 'c' })
|
||||||
|
},
|
||||||
|
},
|
||||||
sources = require('cmp').config.sources({
|
sources = require('cmp').config.sources({
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
}, {
|
}, {
|
||||||
|
Loading…
Reference in New Issue
Block a user