diff --git a/config/nvim/lua/custom/plugins/init.lua b/config/nvim/lua/custom/plugins/init.lua index d696ed7..d38d34e 100644 --- a/config/nvim/lua/custom/plugins/init.lua +++ b/config/nvim/lua/custom/plugins/init.lua @@ -164,37 +164,57 @@ return { }, opts = {}, }, + { + 'vhyrro/luarocks.nvim', + priority = 1000, + config = true, + }, { 'rest-nvim/rest.nvim', - dependencies = { 'nvim-lua/plenary.nvim' }, + dependencies = { 'luarocks.nvim' }, ft = { 'http', 'rest', }, - opts = { - result_split_horizontal = false, - result_split_in_place = false, - skip_ssl_verification = false, - encode_url = true, - highlight = { - enabled = true, - timeout = 15, - }, - result = { - show_url = true, - show_curl_command = true, - show_http_info = true, - show_headers = true, - formatters = { - json = 'jq', - html = false, - }, - jump_to_request = true, - env_file = '.env', + config = function() + require('rest-nvim').setup { + client = 'curl', custom_dynamic_variables = {}, - yank_dry_run = true, - }, - }, + encode_url = true, + env_file = '.env', + skip_ssl_verification = false, + highlight = { + enable = true, + timeout = 15, + }, + result = { + behavior = { + decode_url = true, + formatters = { + json = 'jq', + html = false, + }, + show_info = { + curl_command = true, + headers = true, + http_info = true, + url = true, + }, + statistics = { + enable = true, + stats = { + { 'total_time', title = 'Time taken:' }, + { 'size_download_t', title = 'Download size:' }, + }, + }, + }, + split = { + horizontal = false, + in_place = false, + }, + }, + } + end, keys = function() local status_ok, which_key = pcall(require, 'which-key') if status_ok then @@ -203,13 +223,13 @@ return { } end return { - { 'tr', 'RestNvim', desc = 'Run the request under cursor' }, + { 'tr', 'Rest run', desc = 'Run the request under cursor' }, { 'tp', 'RestNvimPreview', desc = 'Preview the curl command for the request under cursor', }, - { 'tl', 'RestNvimLast', desc = 'Re-run the last request' }, + { 'tl', 'Rest run last', desc = 'Re-run the last request' }, } end, },