From 2cee68f31d04da7d08fb26e02bf884527b974c82 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 18 Aug 2022 00:07:27 +0100 Subject: [PATCH] feat(nvim): add HTTP client plugin I went to GitHub to find a HTTP client plugin that I could use to replace Postman, and found https://github.com/rest-nvim/rest.nvim. It seems to work well. Thanks @NTBBloodbath! --- roles/neovim/files/after/plugin/nvim-rest.lua | 17 +++++++++++++++++ roles/neovim/files/lua/opdavies/plugins.lua | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 roles/neovim/files/after/plugin/nvim-rest.lua diff --git a/roles/neovim/files/after/plugin/nvim-rest.lua b/roles/neovim/files/after/plugin/nvim-rest.lua new file mode 100644 index 0000000..1bc5b33 --- /dev/null +++ b/roles/neovim/files/after/plugin/nvim-rest.lua @@ -0,0 +1,17 @@ +local status_ok, rest_nvim = pcall(require, "rest-nvim") +if not status_ok then + return +end + +local nmap = require("opdavies.keymap").nmap + +-- Run the request. +nmap { "rr", "require('rest-nvim').run()" } + +-- Preview the request. +nmap { "rp", "require('rest-nvim').run(true)" } + +-- Re-run the last request. +nmap { "rl", "require('rest-nvim').last()" } + +rest_nvim.setup() diff --git a/roles/neovim/files/lua/opdavies/plugins.lua b/roles/neovim/files/lua/opdavies/plugins.lua index c4748a3..2a01d51 100644 --- a/roles/neovim/files/lua/opdavies/plugins.lua +++ b/roles/neovim/files/lua/opdavies/plugins.lua @@ -121,6 +121,9 @@ return packer.startup(function() use "kristijanhusak/vim-dadbod-completion" use "kristijanhusak/vim-dadbod-ui" + -- HTTP client + use "rest-nvim/rest.nvim" + -- Text objects use "kana/vim-textobj-indent" use "kana/vim-textobj-user"