Skip to content

Commit

Permalink
feat: adding a RestLog command
Browse files Browse the repository at this point in the history
  • Loading branch information
teto committed Jul 12, 2023
1 parent c349020 commit f1597ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/rest-nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ COMMANDS *rest-nvim-usage-commands*
Same as `RestNvim` but it returns the cURL command without executing the
request. Intended for debugging purposes.

- `:RestLog`
Shows `rest.nvim` logs (export DEBUG_PLENARY=debug for more logs).

- `:RestSelectEnv path/to/env`
Set the path to an env file.

Expand Down
6 changes: 6 additions & 0 deletions plugin/rest-nvim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ nnoremap <Plug>RestNvimLast :lua require('rest-nvim').last()<CR>

command! -nargs=? -complete=file RestSelectEnv :lua require('rest-nvim').select_env(<f-args>)<cr>

lua << EOF
vim.api.nvim_create_user_command('RestLog', function()
vim.cmd(string.format('tabnew %s', vim.fn.stdpath('cache')..'/rest.nvim.log'))
end, { desc = 'Opens the rest.nvim log.', })
EOF

let s:save_cpo = &cpo
set cpo&vim

Expand Down

0 comments on commit f1597ab

Please sign in to comment.