Skip to content

Devtools.nvim - The swiss army knife for developers. (Parse / Escape JSON, decode JWT Token, base64 encode / decode)

Notifications You must be signed in to change notification settings

muhfaris/devtools.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

DevTools Neovim Plugin

Demo

Get My Public IP Escape JSON
asciicast asciicast
Parse JSON Decode JWT Token
asciicast image

Overview

The plugin muhfaris/devtools.nvim is in active development. The purpose of this plugin is to be swiss army knife for developers.

Features

  • Configurable key mappings
  • Eased automatic word wrapping and custom file type
  • Parse and escape JSON
  • Fetch my public IP address
  • Encode and decode base64
  • Decode JWT token

Installation

Install the devtools plugin using your favorite plugin manager:

" Using lazy.nvim
return {
  "muhfaris/devtools.nvim",
  opts =  {}
}

Usage

Customize key mappings

Using lazy.nvim

return {
  "muhfaris/devtools.nvim",
  opts = function()
    local actions = require "devtools.actions"
    return {
      mappings = {
        v = {
          ["<Leader>jp"] = {
            func = actions.call "json.parse",
            desc = "Parse json string from selection visual text",
          },
        },
        n = {
          ["<Leader>mip"] = {
            func = actions.call "net.my_ip",
            desc = "Get my public IP address",
          },
        },
      },
    }
  end,
}

Custom automatic word wrapping

return {
  "muhfaris/devtools.nvim",
  opts = function()
    return {
      word_wrap= {
        markdown = {
          wrap = true,
          textwidth = 30,
          linebreak = true,
        },
      },
    }
  end,
}

Custom automatic word wrapping with custom file type

return {
  "muhfaris/devtools.nvim",
  opts = function()
    return {
      word_wrap = {
        markdown = {
          wrap = true,
          textwidth = 30,
          linebreak = true,
        },
        tpl = {
          wrap = true,
          textwidth = 30,
          linebreak = true,
          pattern = "*.tpl,*.tmpl",
        },
      },
    }
  end,
}

Default Key Mappings

Mode Key Actions Name Description
v <Leader><Leader>djp json.parse Parse escaped json string into json object
v <Leader><Leader>dje json.escape Parse json object into escaped json string
v <Leader><Leader>dbe encode.v_base64_encode Encode base64 string from selection text
v <Leader><Leader>dbd encode.v_base64_decode Decode base64 string from selection text
n <Leader><Leader>dip net.my_ip Get my public IP address
n <Leader><Leader>djwt jwt.decode_token Decode JWT token

Available Commands

  • json.parse
  • json.escape
  • encode.base64_encode (for command only :DevTools encode.base64_encode)
  • encode.base64_decode (for command only :DevTools encode.base64_decode)
  • net.my_ip
  • jwt.decode

image

Contributing

Contributions are welcome! Feel free to submit issues, feature requests, or pull requests here.

License

This plugin is licensed under the MIT License. See the LICENSE file for details.

About

Devtools.nvim - The swiss army knife for developers. (Parse / Escape JSON, decode JWT Token, base64 encode / decode)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages