Formatting
This commit is contained in:
parent
20b9e02adb
commit
1fe23703f4
@ -1,13 +1,13 @@
|
|||||||
local has_words_before = function()
|
local has_words_before = function()
|
||||||
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
|
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local feedkey = function(key, mode)
|
local feedkey = function(key, mode)
|
||||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
|
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
local lsp_symbols = {
|
local lsp_symbols = {
|
||||||
@ -41,9 +41,9 @@ local lsp_symbols = {
|
|||||||
local status, cmp = pcall(require, "cmp")
|
local status, cmp = pcall(require, "cmp")
|
||||||
if (not status) then return end
|
if (not status) then return end
|
||||||
|
|
||||||
cmp.setup{
|
cmp.setup {
|
||||||
completion = {
|
completion = {
|
||||||
completeopt = 'menuone,noinsert,noselect',
|
completeopt = 'menuone,noinsert,noselect',
|
||||||
},
|
},
|
||||||
formatting = {
|
formatting = {
|
||||||
format = function(entry, vim_item)
|
format = function(entry, vim_item)
|
||||||
@ -66,7 +66,7 @@ cmp.setup{
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = {
|
mapping = {
|
||||||
["<cr>"] = cmp.mapping.confirm({select = false, behavior = cmp.ConfirmBehavior.Replace}),
|
["<cr>"] = cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace }),
|
||||||
-- ["<Tab>"] = cmp.mapping.confirm({select = true, behavior = cmp.ConfirmBehavior.Insert}),
|
-- ["<Tab>"] = cmp.mapping.confirm({select = true, behavior = cmp.ConfirmBehavior.Insert}),
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
@ -123,8 +123,7 @@ cmp.setup.cmdline('/', {
|
|||||||
cmp.setup.cmdline(':', {
|
cmp.setup.cmdline(':', {
|
||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = 'path' }
|
{ name = 'path' },
|
||||||
}, {
|
|
||||||
{ name = 'cmdline' }
|
{ name = 'cmdline' }
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -97,7 +97,9 @@ return packer.startup(function(use)
|
|||||||
}
|
}
|
||||||
|
|
||||||
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
|
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
|
||||||
use { "nvim-telescope/telescope-file-browser.nvim" }
|
use {
|
||||||
|
"nvim-telescope/telescope-file-browser.nvim"
|
||||||
|
}
|
||||||
|
|
||||||
use {
|
use {
|
||||||
'lervag/vimtex',
|
'lervag/vimtex',
|
||||||
|
Loading…
Reference in New Issue
Block a user