-
-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(completion): add
nvim-cmp-buffer-lines
(#1056)
* feat(completion): add `nvim-cmp-buffer-lines` * Update lua/astrocommunity/completion/nvim-cmp-buffer-lines/README.md Co-authored-by: Uzair Aftab <[email protected]> * fix readme wording * add note to readme --------- Co-authored-by: Uzair Aftab <[email protected]>
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
lua/astrocommunity/completion/nvim-cmp-buffer-lines/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
27
lua/astrocommunity/completion/nvim-cmp-buffer-lines/init.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |