Skip to content

jvdmeulen/json-fold.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

json-fold.nvim

A plugin for Neovim that can fold and unfold JSON-objects and JSON-arrays as close to the cursor as possible.

Code voor Lazy

{
    "jvdmeulen/json-fold.nvim",
    config = function()
        require('json-fold').setup()

        -- keybinding for the min (un-)fold actions
        vim.api.nvim_set_keymap('n', '<leader>jc', ':JsonFoldFromCursor<CR>', { noremap = true, silent = true })
        vim.api.nvim_set_keymap('n', '<leader>jd', ':JsonUnfoldFromCursor<CR>', { noremap = true, silent = true })

        -- keybinding for the max (un-)fold actions
        vim.api.nvim_set_keymap('n', '<leader>jC', ':JsonMaxFoldFromCursor<CR>', { noremap = true, silent = true })
        vim.api.nvim_set_keymap('n', '<leader>jD', ':JsonMaxUnfoldFromCursor<CR>', { noremap = true, silent = true })
 end
}

After the setup there are two commands you can assign

  • :JsonFoldFromCursor
  • :JsonUnfoldFromCursor
  • :JsonMaxFoldFromCursor
  • :JsonMaxFoldFromCursor

A little preview

For debugging purposes there is a optional debug flag you can enable

require('json-fold').setup({
    debug = true
})

About

A plugin for Neovim that can fold and unfold JSON-objects and JSON-arrays as close to the cursor as possible.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages