Fix completions and allow buffer

This commit is contained in:
Nicole Tietz-Sokolskaya 2022-10-18 14:25:03 -04:00
parent dfbeafc46c
commit fb837f026b
2 changed files with 6 additions and 1 deletions

View file

@ -1,5 +1,9 @@
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 {
completion = {
@ -34,7 +38,7 @@ cmp.setup {
end, { "i", "s" }),
},
sources = {
-- { name = 'buffer' },
{ name = 'buffer' },
-- { name = 'spell' },
{ name = 'nvim_lsp' },
-- { name = 'path' },

View file

@ -33,6 +33,7 @@ Plug 'flazz/vim-colorschemes'
" Completions <3
Plug 'hrsh7th/nvim-cmp', { 'branch': 'main' }
Plug 'hrsh7th/cmp-nvim-lsp', { 'branch': 'main' }
Plug 'hrsh7th/cmp-buffer', { 'branch': 'main' }
" Rust support
Plug 'simrat39/rust-tools.nvim'