Fix completions and allow buffer
This commit is contained in:
parent
dfbeafc46c
commit
fb837f026b
2 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,9 @@
|
||||||
local cmp = require 'cmp'
|
local cmp = require 'cmp'
|
||||||
|
|
||||||
|
local has_words_before = function()
|
||||||
|
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
|
||||||
|
end
|
||||||
|
|
||||||
cmp.setup {
|
cmp.setup {
|
||||||
completion = {
|
completion = {
|
||||||
|
@ -34,7 +38,7 @@ cmp.setup {
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
-- { name = 'buffer' },
|
{ name = 'buffer' },
|
||||||
-- { name = 'spell' },
|
-- { name = 'spell' },
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp' },
|
||||||
-- { name = 'path' },
|
-- { name = 'path' },
|
||||||
|
|
|
@ -33,6 +33,7 @@ Plug 'flazz/vim-colorschemes'
|
||||||
" Completions <3
|
" Completions <3
|
||||||
Plug 'hrsh7th/nvim-cmp', { 'branch': 'main' }
|
Plug 'hrsh7th/nvim-cmp', { 'branch': 'main' }
|
||||||
Plug 'hrsh7th/cmp-nvim-lsp', { 'branch': 'main' }
|
Plug 'hrsh7th/cmp-nvim-lsp', { 'branch': 'main' }
|
||||||
|
Plug 'hrsh7th/cmp-buffer', { 'branch': 'main' }
|
||||||
|
|
||||||
" Rust support
|
" Rust support
|
||||||
Plug 'simrat39/rust-tools.nvim'
|
Plug 'simrat39/rust-tools.nvim'
|
||||||
|
|
Loading…
Reference in a new issue