summaryrefslogtreecommitdiffstats
path: root/dotfiles/vim.lua
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2022-05-02 11:27:30 +0200
committerMinijackson <minijackson@riseup.net>2022-05-02 11:27:30 +0200
commitad50838b8a68a390aea5c70443e1665359dd8e89 (patch)
tree8f54ae0a1294fc123b53ef066f11c3a9acf7aa43 /dotfiles/vim.lua
parent3fc34e9528dbc0471b029ba7c46e734d14cec7c8 (diff)
downloadnixos-config-reborn-ad50838b8a68a390aea5c70443e1665359dd8e89.tar.gz
nixos-config-reborn-ad50838b8a68a390aea5c70443e1665359dd8e89.zip
vim: fix yof mapping
Diffstat (limited to 'dotfiles/vim.lua')
-rw-r--r--dotfiles/vim.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/dotfiles/vim.lua b/dotfiles/vim.lua
index 2010723..5c46e43 100644
--- a/dotfiles/vim.lua
+++ b/dotfiles/vim.lua
@@ -78,12 +78,13 @@ local mapopts = { noremap = true, silent = true }
78vim.fn["camelcasemotion#CreateMotionMappings"] "<LocalLeader>" 78vim.fn["camelcasemotion#CreateMotionMappings"] "<LocalLeader>"
79 79
80vim.keymap.set("n", "yof", function() 80vim.keymap.set("n", "yof", function()
81 if vim.bo.formatoptions:match "a" then 81 if vim.opt_local.formatoptions:get().a then
82 vim.bo.formatoptions = vim.bo.format:gsub("a", "") 82 vim.opt_local.formatoptions:remove "a"
83 print(":setlocal formatoptions-=a")
83 else 84 else
84 vim.bo.formatoptions = vim.bo.format .. "a" 85 vim.opt_local.formatoptions:append "a"
86 print(":setlocal formatoptions+=a")
85 end 87 end
86 print(":setlocal formatoptions=" .. vim.bo.formatoptions)
87end, mapopts) 88end, mapopts)
88 89
89-- Plugins 90-- Plugins