Skip to content

Commit

Permalink
feat(completion): add nvim-cmp-buffer-lines (#1056)
Browse files Browse the repository at this point in the history
* feat(completion): add `nvim-cmp-buffer-lines`

* Update lua/astrocommunity/completion/nvim-cmp-buffer-lines/README.md

Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com>

* fix readme wording

* add note to readme

---------

Co-authored-by: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com>
  • Loading branch information
Axlefublr and Uzaaft committed Jun 20, 2024
1 parent 67268b2 commit 07ddd3d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/astrocommunity/completion/nvim-cmp-buffer-lines/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# nvim-cmp-buffer-lines

nvim-cmp source for buffer lines

**Repository:** <https://github.com/amarakon/nvim-cmp-buffer-lines>

_Replaces_ the `<C-x><C-l>` whole line complete, instead of being included in the usual completion menu.
27 changes: 27 additions & 0 deletions lua/astrocommunity/completion/nvim-cmp-buffer-lines/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---@type LazySpec
return {
"hrsh7th/nvim-cmp",
dependencies = {
{ "amarakon/nvim-cmp-buffer-lines" },
},
opts = function(_, opts)
local cmp = require "cmp"
return require("astrocore").extend_tbl(opts, {
mapping = {
["<C-x><C-l>"] = cmp.mapping.complete { -- this could've been a more ergonomic hotkey, but it would be a reach to try to make up one, that would fit everyone.
config = {
sources = {
{
name = "buffer-lines",
priority = 50,
option = {
leading_whitespace = false,
},
},
},
},
},
},
})
end,
}

0 comments on commit 07ddd3d

Please sign in to comment.