feat: add rest client plugin

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

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