From 0d68d51ed1580f198a80da50273a1de9e8b64c90 Mon Sep 17 00:00:00 2001
From: Oliver Davies <oliver@oliverdavies.uk>
Date: Sun, 2 Jan 2022 10:26:14 +0000
Subject: [PATCH] feat(nvim): add a mapping for wrapping text

---
 nvim/.config/nvim/lua/opdavies/options.lua | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/nvim/.config/nvim/lua/opdavies/options.lua b/nvim/.config/nvim/lua/opdavies/options.lua
index 7758b68a..6acc43a1 100644
--- a/nvim/.config/nvim/lua/opdavies/options.lua
+++ b/nvim/.config/nvim/lua/opdavies/options.lua
@@ -29,6 +29,10 @@ local function set_key_mappings()
 
   map('n', '<Leader>so', ':luafile ~/.config/nvim/init.lua<Cr>', options)
 
+  -- Format paragraphs to an 80 character line length.
+  map('n', '<Leader>g', 'gqap', options)
+  map('x', '<Leader>g', 'gqa', options)
+
   -- Make the current file executable
   map('n', '<Leader>x', ':!chmod +x %<Cr>', options)
 
@@ -91,6 +95,7 @@ local function set_vim_o()
     syntax = 'on',
     tabstop = 2,
     termguicolors = true,
+    textwidth = 0,
     updatetime = 1000,
     wrap = true,
   }