.config/nvim: add augroup, formatting
parent
48086ee69a
commit
37cda19eda
|
@ -70,6 +70,7 @@ opt.writebackup = false
|
||||||
opt.backup = false
|
opt.backup = false
|
||||||
|
|
||||||
-- command line editing
|
-- command line editing
|
||||||
|
opt.wildmode = "longest:full,full"
|
||||||
opt.wildignorecase = true
|
opt.wildignorecase = true
|
||||||
|
|
||||||
-- various
|
-- various
|
||||||
|
@ -89,7 +90,7 @@ keymap_set("n", "<leader>f", ":find ")
|
||||||
keymap_set("n", "<leader>b", ":buffer ")
|
keymap_set("n", "<leader>b", ":buffer ")
|
||||||
keymap_set("n", "<leader>h", ":help ")
|
keymap_set("n", "<leader>h", ":help ")
|
||||||
keymap_set("n", "<leader>g", ":vimgrep /")
|
keymap_set("n", "<leader>g", ":vimgrep /")
|
||||||
keymap_set("n", "<leader>s", "<cmd>:set spell!<cr>")
|
keymap_set("n", "<leader>s", "<cmd>set spell!<cr>")
|
||||||
keymap_set("n", "<leader>m", "<cmd>make<cr>")
|
keymap_set("n", "<leader>m", "<cmd>make<cr>")
|
||||||
keymap_set("n", "<leader>d", "<cmd>bdelete<cr>")
|
keymap_set("n", "<leader>d", "<cmd>bdelete<cr>")
|
||||||
keymap_set("n", "]b", "<cmd>bnext<cr>")
|
keymap_set("n", "]b", "<cmd>bnext<cr>")
|
||||||
|
@ -110,17 +111,18 @@ keymap_set("n", "<c-h>", "<c-w>h")
|
||||||
keymap_set("n", "<c-j>", "<c-w>j")
|
keymap_set("n", "<c-j>", "<c-w>j")
|
||||||
keymap_set("n", "<c-k>", "<c-w>k")
|
keymap_set("n", "<c-k>", "<c-w>k")
|
||||||
keymap_set("n", "<c-l>", "<c-w>l")
|
keymap_set("n", "<c-l>", "<c-w>l")
|
||||||
keymap_set("n", "<leader>.", "<cmd>edit.<cr>")
|
keymap_set("n", "<leader>.", "<cmd>edit .<cr>")
|
||||||
|
|
||||||
|
|
||||||
-- buffer autocomplete ---------------------------------------------------------
|
-- buffer autocomplete ---------------------------------------------------------
|
||||||
|
|
||||||
|
local bufautocomplete_augroup = api.nvim_create_augroup("Buffer autocompletion", {}),
|
||||||
api.nvim_create_autocmd("InsertCharPre", {
|
api.nvim_create_autocmd("InsertCharPre", {
|
||||||
group = api.nvim_create_augroup("Buffer autocompletion", {}),
|
group = bufautocomplete_augroup,
|
||||||
desc = "Buffer autocomplete on InsertCharPre",
|
pattern = "*",
|
||||||
callback = function ()
|
callback = function ()
|
||||||
if fn.pumvisible() == 0 and v.char:find("%w") then
|
if fn.pumvisible() == 0 and v.char:find("%w") then
|
||||||
api.nvim_input("<c-n>")
|
api.nvim_input("<c-n>")
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
|
desc = "Buffer autocomplete on InsertCharPre",
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue