fix(keybinds): created much nicer keybinds (like vscode) completion
This commit is contained in:
parent
2559cfdbd9
commit
57222dd239
2 changed files with 37 additions and 14 deletions
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"FTerm.nvim": { "branch": "master", "commit": "d1320892cc2ebab472935242d9d992a2c9570180" },
|
||||
"blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" },
|
||||
"conform.nvim": { "branch": "master", "commit": "5420c4b5ea0aeb99c09cfbd4fd0b70d257b44f25" },
|
||||
"conform.nvim": { "branch": "master", "commit": "8314f4c9e205e7f30b62147069729f9a1227d8bf" },
|
||||
"cord.nvim": { "branch": "master", "commit": "7483e9ce335d22a9e52f83804134d621094b5fe7" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "aef7f5cec0a40dbe7f3304214850c472e2264b10" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "9f9c67795d0795a6e8612f5a899ca64a074a1076" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "4cfe411526a7a99c18281135e8b4765ae6330d15" },
|
||||
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
|
|
@ -15,12 +15,12 @@
|
|||
"nvim-eslint": { "branch": "main", "commit": "491deac6d89a5c51013fa71b63c3cc093db15dde" },
|
||||
"nvim-highlight-colors": { "branch": "main", "commit": "e0c4a58ec8c3ca7c92d3ee4eb3bc1dd0f7be317e" },
|
||||
"nvim-jdtls": { "branch": "master", "commit": "f73731b543f5971e0da9665eb1d7ceffe1fde71f" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "8973916a3d015d65a8c4614e141f4270a713cf33" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "ac04ec3c2af08e9821b4eb64ede86072b9b213bf" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "6788013bb9cb784e606ada44206b0e755e4323d7" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"remote-nvim.nvim": { "branch": "main", "commit": "9992c2fb8bf4f11aca2c8be8db286b506f92efcb" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "4d0f5e0e7f69071e315515c385fab2a4eff07b3d" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,28 +12,51 @@ return {
|
|||
opts = {
|
||||
keymap = {
|
||||
preset = "none",
|
||||
['<Tab>'] = { 'select_next', 'fallback' },
|
||||
['<S-Tab>'] = { 'select_prev', 'fallback' },
|
||||
["<CR>"] = { 'select_and_accept', 'fallback' },
|
||||
['<C-e>'] = { 'hide', 'fallback' }
|
||||
["<Tab>"] = {
|
||||
function(cmp)
|
||||
local cursor_pos = vim.api.nvim_win_get_cursor(0)
|
||||
local col = cursor_pos[2]
|
||||
local current_line = vim.api.nvim_get_current_line()
|
||||
|
||||
if cmp.is_menu_visible() then
|
||||
cmp.select_next()
|
||||
return
|
||||
end
|
||||
|
||||
if current_line:sub(col, col) == "." then
|
||||
if not cmp.is_menu_visible() then
|
||||
cmp.show()
|
||||
return
|
||||
end
|
||||
end
|
||||
return "\t"
|
||||
end,
|
||||
},
|
||||
["<S-Tab>"] = { "select_prev", "fallback" },
|
||||
["<CR>"] = { "select_and_accept", "fallback" },
|
||||
["<C-e>"] = { "hide", "fallback" },
|
||||
},
|
||||
|
||||
completion = {
|
||||
trigger = {
|
||||
show_on_x_blocked_trigger_characters = { "." },
|
||||
},
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
treesitter_highlighting = true
|
||||
treesitter_highlighting = true,
|
||||
},
|
||||
menu = { auto_show = true },
|
||||
ghost_text = { enabled = true }
|
||||
ghost_text = { enabled = true },
|
||||
},
|
||||
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
min_keyword_length = 0,
|
||||
},
|
||||
|
||||
signature = { enabled = true },
|
||||
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||
}
|
||||
}
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue