{"id":13761128,"url":"https://github.com/jiaoshijie/undotree","last_synced_at":"2025-05-10T12:31:02.963Z","repository":{"id":53260808,"uuid":"469660196","full_name":"jiaoshijie/undotree","owner":"jiaoshijie","description":"neovim undotree written in lua","archived":false,"fork":false,"pushed_at":"2024-02-09T15:01:46.000Z","size":181,"stargazers_count":166,"open_issues_count":5,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-03T13:06:04.885Z","etag":null,"topics":["neovim-plugin","neovim-plugin-lua","nvim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jiaoshijie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-14T09:18:39.000Z","updated_at":"2024-08-03T13:06:08.038Z","dependencies_parsed_at":"2022-08-27T06:20:42.024Z","dependency_job_id":"a912db9c-d47e-4c33-b740-788c942c4085","html_url":"https://github.com/jiaoshijie/undotree","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiaoshijie%2Fundotree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiaoshijie%2Fundotree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiaoshijie%2Fundotree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiaoshijie%2Fundotree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiaoshijie","download_url":"https://codeload.github.com/jiaoshijie/undotree/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224957961,"owners_count":17398494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neovim-plugin","neovim-plugin-lua","nvim-plugin"],"created_at":"2024-08-03T13:01:39.557Z","updated_at":"2024-11-16T18:32:06.163Z","avatar_url":"https://github.com/jiaoshijie.png","language":"Lua","funding_links":[],"categories":["Other Standard Feature Enhancement","Lua"],"sub_categories":["Undo"],"readme":"# undotree\n\nA neovim undotree plugin written in lua.\n\n**Screenshot**\n\n![preview](https://user-images.githubusercontent.com/43605101/232043141-f4318a13-8a85-41ee-bbb5-6f86511b32fe.png)\n\nDiff previewer window shows the difference between the current node and the node under the cursor.\n\n### Requirements\n\n- nvim 0.7.0 or above\n\n### Download and Install\n\nUsing Vim's built-in package manager:\n\n```sh\nmkdir -p ~/.config/nvim/pack/github/start/\ncd ~/.config/nvim/pack/github/start/\ngit clone https://github.com/nvim-lua/plenary.nvim.git\ngit clone https://github.com/jiaoshijie/undotree.git\n```\n\nUsing [vim-plug](https://github.com/junegunn/vim-plug)\n\n```\nPlug 'nvim-lua/plenary.nvim'\nPlug 'jiaoshijie/undotree'\n```\n\nUsing [packer.nvim](https://github.com/wbthomason/packer.nvim)\n\n```lua\nuse {\n  \"jiaoshijie/undotree\",\n  requires = {\n    \"nvim-lua/plenary.nvim\",\n  },\n}\n```\n\nUsing [lazy.nvim](https://github.com/folke/lazy.nvim)\n\n```lua\n{\n  \"jiaoshijie/undotree\",\n  dependencies = \"nvim-lua/plenary.nvim\",\n  config = true,\n  keys = { -- load the plugin only when using it's keybinding:\n    { \"\u003cleader\u003eu\", \"\u003ccmd\u003elua require('undotree').toggle()\u003ccr\u003e\" },\n  },\n}\n```\n\n### Usage\n\nBasic setup\n\n```lua\nrequire('undotree').setup()\n```\n\nIf using [packer.nvim](https://github.com/wbthomason/packer.nvim) undotree can be setup directly in the plugin spec:\n\n```lua\nuse {\n  \"jiaoshijie/undotree\",\n  config = function()\n    require('undotree').setup()\n  end,\n  requires = {\n    \"nvim-lua/plenary.nvim\",\n  },\n}\n```\n\nConfiguration can be passed to the setup function. Here is an example with the default settings:\n\n```lua\nlocal undotree = require('undotree')\n\nundotree.setup({\n  float_diff = true,  -- using float window previews diff, set this `true` will disable layout option\n  layout = \"left_bottom\", -- \"left_bottom\", \"left_left_bottom\"\n  position = \"left\", -- \"right\", \"bottom\"\n  ignore_filetype = { 'undotree', 'undotreeDiff', 'qf', 'TelescopePrompt', 'spectre_panel', 'tsplayground' },\n  window = {\n    winblend = 30,\n  },\n  keymaps = {\n    ['j'] = \"move_next\",\n    ['k'] = \"move_prev\",\n    ['gj'] = \"move2parent\",\n    ['J'] = \"move_change_next\",\n    ['K'] = \"move_change_prev\",\n    ['\u003ccr\u003e'] = \"action_enter\",\n    ['p'] = \"enter_diffbuf\",\n    ['q'] = \"quit\",\n  },\n})\n```\n\nYou can directly use `:lua require('undotree').toggle()` for toggling undotree panel, or set the following keymaps for convenient using.\n\n```lua\nvim.keymap.set('n', '\u003cleader\u003eu', require('undotree').toggle, { noremap = true, silent = true })\n\n-- or\nvim.keymap.set('n', '\u003cleader\u003euo', require('undotree').open, { noremap = true, silent = true })\nvim.keymap.set('n', '\u003cleader\u003euc', require('undotree').close, { noremap = true, silent = true })\n```\n\n2. Some Mappings\n\n| Mappings         | Action                                               |\n| ----             | ----                                                 |\n| \u003ckbd\u003ej\u003c/kbd\u003e     | jump to next undo node                               |\n| \u003ckbd\u003egj\u003c/kbd\u003e    | jump to the parent node of the node under the cursor |\n| \u003ckbd\u003ek\u003c/kbd\u003e     | jump to prev undo node                               |\n| \u003ckbd\u003eJ\u003c/kbd\u003e     | jump to next undo node and undo to this state        |\n| \u003ckbd\u003eK\u003c/kbd\u003e     | jump to prev undo node and undo to this state        |\n| \u003ckbd\u003eq\u003c/kbd\u003e     | quit undotree                                        |\n| \u003ckbd\u003ep\u003c/kbd\u003e     | jump into the undotree diff window                   |\n| \u003ckbd\u003eEnter\u003c/kbd\u003e | undo to this state                                   |\n\n\n### License\n\n**MIT**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiaoshijie%2Fundotree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiaoshijie%2Fundotree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiaoshijie%2Fundotree/lists"}