feat: add rest client plugin

main
Ian Mancini 2 years ago
parent 5c99574dc6
commit 8674bba88e

@ -1,315 +1,321 @@
---@diagnostic disable: undefined-global ---@diagnostic disable: undefined-global
return require("packer").startup(function() return require("packer").startup(function()
use("wbthomason/packer.nvim") use("wbthomason/packer.nvim")
use("antoinemadec/FixCursorHold.nvim") use("antoinemadec/FixCursorHold.nvim")
-- Project management -- Project management
use({ use({
"ahmedkhalf/project.nvim", "ahmedkhalf/project.nvim",
config = [[require('plugins.project-nvim')]], config = [[require('plugins.project-nvim')]],
}) })
-- GUI -- GUI
use("stevearc/dressing.nvim") use("stevearc/dressing.nvim")
-- Fuzzy finder -- Fuzzy finder
use({ use({
{ {
"nvim-telescope/telescope-fzf-native.nvim", "nvim-telescope/telescope-fzf-native.nvim",
run = "make", run = "make",
}, },
"nvim-telescope/telescope-file-browser.nvim", "nvim-telescope/telescope-file-browser.nvim",
"nvim-telescope/telescope-ui-select.nvim", "nvim-telescope/telescope-ui-select.nvim",
{ {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
requires = { "nvim-lua/plenary.nvim" }, requires = { "nvim-lua/plenary.nvim" },
config = [[require('plugins.telescope-nvim')]], config = [[require('plugins.telescope-nvim')]],
}, },
}) })
-- File explorer -- File explorer
use({ use({
"kevinhwang91/rnvimr", "kevinhwang91/rnvimr",
config = [[require('plugins.rnvimr')]], config = [[require('plugins.rnvimr')]],
}) })
use({ use({
"kyazdani42/nvim-tree.lua", "kyazdani42/nvim-tree.lua",
config = [[require('plugins.nvim-tree')]], config = [[require('plugins.nvim-tree')]],
}) })
-- Refactor -- Refactor
use({ use({
"ThePrimeagen/refactoring.nvim", "ThePrimeagen/refactoring.nvim",
requires = { requires = {
{ "nvim-lua/plenary.nvim" }, { "nvim-lua/plenary.nvim" },
{ "nvim-treesitter/nvim-treesitter" }, { "nvim-treesitter/nvim-treesitter" },
}, },
config = [[ require('refactoring').setup({}) ]], config = [[ require('refactoring').setup({}) ]],
}) })
-- Tooling -- Tooling
use({ use({
"WhoIsSethDaniel/mason-tool-installer.nvim", "WhoIsSethDaniel/mason-tool-installer.nvim",
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
config = [[ require('plugins.tooling') ]], config = [[ require('plugins.tooling') ]],
}, },
}) })
-- LSP -- LSP
use({ use({
"folke/lsp-colors.nvim", -- Color groups "folke/lsp-colors.nvim", -- Color groups
{ {
-- Installer -- Installer
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
require = "williamboman/mason.nvim", require = "williamboman/mason.nvim",
}, },
"folke/neodev.nvim", -- Lua "folke/neodev.nvim", -- Lua
"jose-elias-alvarez/typescript.nvim", -- Typsecript "jose-elias-alvarez/typescript.nvim", -- Typsecript
"jose-elias-alvarez/null-ls.nvim", -- Tooling "jose-elias-alvarez/null-ls.nvim", -- Tooling
"stevearc/aerial.nvim", -- Outline "stevearc/aerial.nvim", -- Outline
"b0o/schemastore.nvim", -- JSON schemas "b0o/schemastore.nvim", -- JSON schemas
"folke/trouble.nvim", -- Diagnostics "folke/trouble.nvim", -- Diagnostics
"kosayoda/nvim-lightbulb", -- Lightbulb "kosayoda/nvim-lightbulb", -- Lightbulb
"j-hui/fidget.nvim", -- LSP Status indicator "j-hui/fidget.nvim", -- LSP Status indicator
{ {
"neovim/nvim-lspconfig", -- Config "neovim/nvim-lspconfig", -- Config
config = [[require('plugins.lsp')]], config = [[require('plugins.lsp')]],
}, },
}) })
-- Buffer line -- Buffer line
-- use { -- use {
-- 'akinsho/bufferline.nvim', -- 'akinsho/bufferline.nvim',
-- tag = "v2.*", -- tag = "v2.*",
-- requires = 'kyazdani42/nvim-web-devicons', -- requires = 'kyazdani42/nvim-web-devicons',
-- config = function() require("bufferline").setup {} end -- config = function() require("bufferline").setup {} end
-- } -- }
-- Completion -- Completion
use({ use({
"onsails/lspkind-nvim", -- Pretty icons "onsails/lspkind-nvim", -- Pretty icons
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline", "hrsh7th/cmp-cmdline",
"hrsh7th/cmp-omni", "hrsh7th/cmp-omni",
"petertriho/cmp-git", "petertriho/cmp-git",
"hrsh7th/cmp-nvim-lsp-signature-help", "hrsh7th/cmp-nvim-lsp-signature-help",
{ {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
config = [[require('plugins.nvim-cmp')]], config = [[require('plugins.nvim-cmp')]],
}, },
}) })
-- Snippets -- Snippets
use("L3MON4D3/LuaSnip") use("L3MON4D3/LuaSnip")
use("saadparwaiz1/cmp_luasnip") use("saadparwaiz1/cmp_luasnip")
use("rafamadriz/friendly-snippets") use("rafamadriz/friendly-snippets")
-- Comments -- Comments
use({ use({
"numToStr/Comment.nvim", "numToStr/Comment.nvim",
config = function() config = function()
require("Comment").setup() require("Comment").setup()
end, end,
}) })
-- Autopairs -- Autopairs
use({ use({
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
config = function() config = function()
require("nvim-autopairs").setup() require("nvim-autopairs").setup()
end, end,
}) })
-- Tree-sitter -- Tree-sitter
use({ use({
"JoosepAlviste/nvim-ts-context-commentstring", "JoosepAlviste/nvim-ts-context-commentstring",
"windwp/nvim-ts-autotag", -- XML-like auto tags "windwp/nvim-ts-autotag", -- XML-like auto tags
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
run = ":TSUpdate", run = ":TSUpdate",
config = [[require('plugins.nvim-treesitter')]], config = [[require('plugins.nvim-treesitter')]],
}, },
{ {
"nvim-orgmode/orgmode", "nvim-orgmode/orgmode",
config = [[require('plugins.orgmode-nvim')]], config = [[require('plugins.orgmode-nvim')]],
}, },
}) })
-- Note taking -- Note taking
use({ use({
"jakewvincent/mkdnflow.nvim", "jakewvincent/mkdnflow.nvim",
"ekickx/clipboard-image.nvim", "ekickx/clipboard-image.nvim",
{ {
"mickael-menu/zk-nvim", "mickael-menu/zk-nvim",
config = [[require('plugins.notes')]], config = [[require('plugins.notes')]],
}, },
}) })
-- Terminal -- Terminal
use({ use({
"akinsho/toggleterm.nvim", "akinsho/toggleterm.nvim",
tag = "v2.*", tag = "v2.*",
config = [[require('plugins.term')]], config = [[require('plugins.term')]],
}) })
-- Git -- Git
use({ use({
{ {
"lewis6991/gitsigns.nvim", "lewis6991/gitsigns.nvim",
requires = "nvim-lua/plenary.nvim", requires = "nvim-lua/plenary.nvim",
}, },
"tpope/vim-fugitive", "tpope/vim-fugitive",
"TimUntersberger/neogit", "TimUntersberger/neogit",
"f-person/git-blame.nvim", "f-person/git-blame.nvim",
{ {
"sindrets/diffview.nvim", "sindrets/diffview.nvim",
requires = "nvim-lua/plenary.nvim", requires = "nvim-lua/plenary.nvim",
}, },
{ {
"pwntester/octo.nvim", "pwntester/octo.nvim",
requires = { requires = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
"kyazdani42/nvim-web-devicons", "kyazdani42/nvim-web-devicons",
}, },
config = [[require('plugins.git')]], config = [[require('plugins.git')]],
}, },
}) })
-- Indent lines -- Indent lines
use({ use({
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
config = [[require('plugins.indent-blankline-nvim')]], config = [[require('plugins.indent-blankline-nvim')]],
}) })
-- Handy stuff -- Handy stuff
use({ use({
"echasnovski/mini.nvim", "echasnovski/mini.nvim",
branch = "stable", branch = "stable",
config = function() config = function()
require("mini.jump").setup({}) require("mini.jump").setup({})
require("mini.bufremove").setup({}) require("mini.bufremove").setup({})
end, end,
}) })
use({ use({
"ggandor/leap.nvim", "ggandor/leap.nvim",
requires = { requires = {
"tpope/vim-repeat", "tpope/vim-repeat",
}, },
config = function() config = function()
require("leap").set_default_keymaps() require("leap").set_default_keymaps()
end, end,
}) })
use({ use({
"ygm2/rooter.nvim", "ygm2/rooter.nvim",
config = function() config = function()
vim.g.outermost_root = false vim.g.outermost_root = false
end, end,
}) })
use({ "dhruvasagar/vim-table-mode" }) use({ "dhruvasagar/vim-table-mode" })
use({ "tpope/vim-eunuch" }) use({ "tpope/vim-eunuch" })
use({ use({
"folke/which-key.nvim", "folke/which-key.nvim",
config = [[require('plugins.which-key')]], config = [[require('plugins.which-key')]],
}) })
use({ use({
"folke/zen-mode.nvim", "folke/zen-mode.nvim",
config = [[require('plugins.zen-mode-nvim')]], config = [[require('plugins.zen-mode-nvim')]],
}) })
use({ use({
"folke/twilight.nvim", "folke/twilight.nvim",
config = [[require('plugins.twilight-nvim')]], config = [[require('plugins.twilight-nvim')]],
}) })
use({ use({
"folke/todo-comments.nvim", "folke/todo-comments.nvim",
requires = "nvim-lua/plenary.nvim", requires = "nvim-lua/plenary.nvim",
config = function() config = function()
require("todo-comments").setup() require("todo-comments").setup()
end, end,
}) })
-- Statusline -- Statusline
-- use { -- use {
-- 'ojroques/nvim-hardline', -- 'ojroques/nvim-hardline',
-- config = [[require('plugins.hardline')]] -- config = [[require('plugins.hardline')]]
-- } -- }
use({ use({
"b0o/incline.nvim", "b0o/incline.nvim",
{ {
"hoob3rt/lualine.nvim", "hoob3rt/lualine.nvim",
requires = { requires = {
"kyazdani42/nvim-web-devicons", "kyazdani42/nvim-web-devicons",
opt = true, opt = true,
}, },
config = [[require('plugins.lualine')]], config = [[require('plugins.lualine')]],
}, },
}) })
-- Folding -- Folding
-- use({ -- use({
-- "kevinhwang91/nvim-ufo", -- "kevinhwang91/nvim-ufo",
-- requires = "kevinhwang91/promise-async", -- requires = "kevinhwang91/promise-async",
-- config = [[require('plugins.nvim-ufo')]], -- config = [[require('plugins.nvim-ufo')]],
-- }) -- })
-- Color highlighting -- Color highlighting
use({ use({
"norcalli/nvim-colorizer.lua", "norcalli/nvim-colorizer.lua",
config = function() config = function()
require("colorizer").setup() require("colorizer").setup()
end, end,
}) })
-- Colorschemes -- Colorschemes
use({ use({
"Th3Whit3Wolf/onebuddy", "Th3Whit3Wolf/onebuddy",
requires = { "tjdevries/colorbuddy.vim" }, requires = { "tjdevries/colorbuddy.vim" },
}) })
use({ "RRethy/nvim-base16" }) use({ "RRethy/nvim-base16" })
use({ "NTBBloodbath/doom-one.nvim" }) use({ "NTBBloodbath/doom-one.nvim" })
use({ "folke/tokyonight.nvim" }) use({ "folke/tokyonight.nvim" })
use({ "marko-cerovac/material.nvim" }) use({ "marko-cerovac/material.nvim" })
use({ use({
"kyazdani42/nvim-web-devicons", "kyazdani42/nvim-web-devicons",
config = [[require('plugins.nvim-web-devicons')]], config = [[require('plugins.nvim-web-devicons')]],
}) })
-- package.json -- package.json
use("vuki656/package-info.nvim") use("vuki656/package-info.nvim")
-- Blade -- Blade
use({ "Eduruiz/vim-blade" }) use({ "Eduruiz/vim-blade" })
-- DAP -- DAP
use("mfussenegger/nvim-dap") use("mfussenegger/nvim-dap")
use("Pocco81/dap-buddy.nvim") use("Pocco81/dap-buddy.nvim")
use("rcarriga/nvim-dap-ui") use("rcarriga/nvim-dap-ui")
-- Test runner -- Test runner
use({ use({
"haydenmeade/neotest-jest", "haydenmeade/neotest-jest",
"nvim-neotest/neotest-go", "nvim-neotest/neotest-go",
"nvim-neotest/neotest-python", "nvim-neotest/neotest-python",
{ {
"nvim-neotest/neotest", "nvim-neotest/neotest",
requires = { requires = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim", "antoinemadec/FixCursorHold.nvim",
}, },
config = [[require('plugins.testing')]], config = [[require('plugins.testing')]],
}, },
}) })
-- REST
use({
"rest-nvim/rest.nvim",
config = [[require('plugins.rest')]],
})
end) end)

@ -0,0 +1,60 @@
require("rest-nvim").setup({
-- Open request results in a horizontal split
result_split_horizontal = false,
-- Keep the http file buffer above|left when split horizontal|vertical
result_split_in_place = false,
-- Skip SSL verification, useful for unknown certificates
skip_ssl_verification = false,
-- Encode URL before making request
encode_url = true,
-- Highlight request on run
highlight = {
enabled = true,
timeout = 150,
},
result = {
-- toggle showing URL, HTTP info, headers at top the of result window
show_url = true,
show_http_info = true,
show_headers = true,
-- executables or functions for formatting response body [optional]
-- set them to false if you want to disable them
formatters = {
json = "jq",
html = function(body)
return vim.fn.system({ "tidy", "-i", "-q", "-" }, body)
end,
},
},
-- Jump to request line on run
jump_to_request = false,
env_file = ".env",
custom_dynamic_variables = {},
yank_dry_run = true,
})
local wk = require("which-key")
local augroup = vim.api.nvim_create_augroup("RestNvim", {})
vim.api.nvim_clear_autocmds({ group = augroup })
vim.api.nvim_create_autocmd("BufEnter", {
group = augroup,
pattern = { "*.http" },
callback = function(bufnr)
wk.register({
r = {
"<Plug>RestNvim",
"Run the request under the cursor",
},
p = {
"<Plug>RestNvimPreview",
"Preview the request cURL command",
},
l = { "<Plug>RestNvimLast", "Re-run the last request" },
}, {
mode = "n",
bufnr = bufnr,
prefix = "<localleader>",
})
end,
})
Loading…
Cancel
Save