From cf6647658df69960362b969252bd1f6af90076b6 Mon Sep 17 00:00:00 2001
From: Oliver Davies <oliver@oliverdavies.uk>
Date: Thu, 13 Jan 2022 00:22:02 +0000
Subject: [PATCH] feat(nvim): add refactoring.nvim plugin

---
 roles/neovim/files/after/plugin/refactoring.lua    | 7 +++++++
 roles/neovim/files/lua/opdavies/plugins.lua        | 1 +
 roles/neovim/files/lua/opdavies/telescope/init.lua | 2 ++
 3 files changed, 10 insertions(+)
 create mode 100644 roles/neovim/files/after/plugin/refactoring.lua

diff --git a/roles/neovim/files/after/plugin/refactoring.lua b/roles/neovim/files/after/plugin/refactoring.lua
new file mode 100644
index 00000000..feb5ac33
--- /dev/null
+++ b/roles/neovim/files/after/plugin/refactoring.lua
@@ -0,0 +1,7 @@
+local status_ok, refactoring = pcall(require, "refactoring")
+if not status_ok then
+  return
+end
+
+-- TODO: add keymaps - https://github.com/ThePrimeagen/refactoring.nvim#configuration-for-refactoring-operations
+refactoring.setup {}
diff --git a/roles/neovim/files/lua/opdavies/plugins.lua b/roles/neovim/files/lua/opdavies/plugins.lua
index 68887f8a..f1805af5 100644
--- a/roles/neovim/files/lua/opdavies/plugins.lua
+++ b/roles/neovim/files/lua/opdavies/plugins.lua
@@ -32,6 +32,7 @@ return packer.startup(function()
   use "nvim-lua/plenary.nvim"
   use "nvim-lua/popup.nvim"
   use "sheerun/vim-polyglot"
+  use "theprimeagen/refactoring.nvim"
   use "tpope/vim-surround"
   use "vim-test/vim-test"
   use "voldikss/vim-floaterm"
diff --git a/roles/neovim/files/lua/opdavies/telescope/init.lua b/roles/neovim/files/lua/opdavies/telescope/init.lua
index 5d325291..95409358 100644
--- a/roles/neovim/files/lua/opdavies/telescope/init.lua
+++ b/roles/neovim/files/lua/opdavies/telescope/init.lua
@@ -36,6 +36,8 @@ telescope.setup {
 }
 
 telescope.load_extension "fzf"
+telescope.load_extension "refactoring"
+
 local map = vim.api.nvim_set_keymap
 
 local options = {