]> git.madduck.net Git - etc/lazyvim.git/blobdiff - .config/lazyvim/lua/config/keymaps.lua

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

<leader>cc to toggle completion
[etc/lazyvim.git] / .config / lazyvim / lua / config / keymaps.lua
index c36aaf89dd42f5b756a3b72db0a2e1c122ef9e70..07e0709f2ed29926e5c321b6f468a5c0b79b7b5f 100644 (file)
@@ -9,3 +9,15 @@ local map = vim.keymap.set
 map("i", ",", "<c-]>,<c-g>u")
 map("i", ".", "<c-]>.<c-g>u")
 map("i", ";", "<c-]>;<c-g>u")
+
+local function toggle_completion()
+  local c = vim.b.completion
+  if c == nil then
+    c = true
+  end
+  c = (c == nil and false or not c)
+  vim.b.completion = c
+  vim.notify("Completion turned " .. (c and "on" or "off"))
+end
+
+map({ "n", "v", "o" }, "<leader>cc", toggle_completion, { desc = "Toggle completion" })