https://github.com/hoschi/yode-nvim Skip to content Sign up * Why GitHub? + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} hoschi / yode-nvim Public * Notifications * Fork 1 * Star 156 * Yode plugin for NeoVim MIT License 156 stars 1 fork Star Notifications * Code * Issues 3 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. develop Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 2 branches 0 tags Code Latest commit @hoschi hoschi #5 initialise setup to prevent errors ... 0964c63 Feb 12, 2022 #5 initialise setup to prevent errors 0964c63 Git stats * 109 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time doc play around Aug 14, 2021 lua/yode-nvim remove fixmes Feb 8, 2022 media better Readme Feb 11, 2022 plugin #5 initialise setup to prevent errors Feb 12, 2022 testData YodeRunInFile command to execute arbitrary commands in file buffer of... Dec 12, 2021 .editorconfig init repo Jul 31, 2021 .eslintrc still POC conversion, install eslint and get Neomake to work Aug 19, 2021 .eslintrc-editor still POC conversion, install eslint and get Neomake to work Aug 19, 2021 .gitignore still POC conversion, install eslint and get Neomake to work Aug 19, 2021 .gitmodules implement grouping logic for tokens Dec 3, 2021 .luacheckrc setup luacheck Feb 1, 2022 .npmrc still POC conversion, install eslint and get Neomake to work Aug 19, 2021 .nvmrc still POC conversion, install eslint and get Neomake to work Aug 19, 2021 .prettierrc.json init repo Jul 31, 2021 LICENSE Initial commit Jul 31, 2021 Makefile add layout dir to formatter Feb 1, 2022 Readme.md add hint for window movement Feb 12, 2022 local.vimrc better Readme Feb 11, 2022 package-lock.json clone current window into floating one Oct 10, 2021 package.json clone current window into floating one Oct 10, 2021 stylua.toml play around Aug 14, 2021 View code [ ] Yode-Nvim Introduction Video GIFs Features & Commands Installation Interim Help Contribution Development Readme.md Yode-Nvim | HackerNews | reddit | Yode plugin for NeoVim Focus on the important parts of the code. Hide the rest, literally. With Yode-Nvim you can go deeper than the file level, picking out the lines that are important for the current task. Whether you want to focus on important parts of a large file, or collect small parts of many files, you can see everything at a glance. Zoom from the focused part back into the file to briefly expand your context or adjust your focus. Everything happens in the editor, the rest of the tool chain still works, this makes Yode-Nvim work for any programming language, framework, etc. For the past six months, I've been using this MVP in its various stages in development for Yode-Nvim itself. Currently I am working on fixing minor bugs and integrating more plugins. Introduction Video Yode Introduction Video For a more in-depth introduction to the idea of Yode, check out the video of the proof of concept! GIFs Neomake error linting with correct error placement: yode-nvim-gifs-neomake.mp4 Watch on Youtube instead Code formatter changes file buffer and seditor: yode-nvim-gifs-formatting.mp4 Watch on Youtube instead Gread to restore file with git: yode-nvim-gifs-gread.mp4 Watch on Youtube instead Features & Commands * YodeCreateSeditorFloating focus on a code part and make it floating, stay at the current (main) view * YodeCreateSeditorReplace focus on a code part and replace it with the current buffer * YodeBufferDelete delete the current buffer and jump back to file, if it is a seditor * YodeGoToAlternateBuffer Yode-Nvim creates buffer local mappings for these commands, see lua/yode-nvim/createSeditor.lua for all mappings * YodeCloneCurrentIntoFloat clone seditor into float * YodeFloatToMainWindow is the opposite * YodeFormatWrite formats and writes a buffer, no matter which type * YodeRunInFile can run a command in the current file or the file buffer of the current seditor * changes from outside are tried to be applied as good as possible. If this does not work so well, seditors can change the size * in general there are different layouts for the floating windows, but at the moment there is only one * jump between windows by using w or have a deeper look at window movement * see the next section for more details Installation You need at least Neovim 0.6. Add Plenary and Yode-Nvim to your config, e.g. with vim-plug: Plug 'nvim-lua/plenary.nvim' Plug 'hoschi/yode-nvim' Important is that this repo is cloned with submodules, which happens automatically when you use vim-plug. The minimal setup is this: lua require('yode-nvim').setup({}) Check out the help section for a more sophisticated configuration. Interim Help TODO move this to Vim help syntax ./doc/yode-nvim.txt. kdheepak/ panvimdoc: Write documentation in pandoc markdown. Generate documentation in vimdoc. * install + use your favorite plugin manager, important is to include the git submodules + clone with submodules: git clone --recurse-submodules git@github.com:hoschi/yode-nvim.git * log is written to cache dir of stdpaths + the default level is 'warn', but can be configured. Level can also be overwritten with an environment variable, see the Development section for more info. + TODO link here how to echo this dir + e.g. ~/myuser/.cache/nvim/yode-nvim.log * example setup: lua require('yode-nvim').setup({}) map yc :YodeCreateSeditorFloating map yr :YodeCreateSeditorReplace nmap bd :YodeBufferDelete imap bd :YodeBufferDelete " these commands fall back to overwritten keys when cursor is in split window map r :YodeLayoutShiftWinDown map R :YodeLayoutShiftWinUp map J :YodeLayoutShiftWinBottom map K :YodeLayoutShiftWinTop " at the moment this is needed to have no gap for floating windows set showtabline=2 * compatible plugins with current change detection logic + tpope/vim-fugitive: fugitive.vim: A Git wrapper so awesome, it should be illegal o Gread works by using one or two change events * YodeRunInFile works only with synchronous commands, e.g. Gread. Not with async commands like FormatWrite * adapted plugins + mhartington/formatter.nvim o uses nvim_buf_set_lines for one change/add event, but is async o adapted version to install + neomake/neomake: Asynchronous linting and make framework for Neovim/Vim o uses API methods of api.lua to be aware of file vs seditor buffers o adapted version to install * overlapping/nested seditors are not supported at the moment + see TODO statements in onSeditorBufferLines + other parts of code as well, probably not documented Contribution Integration with the LSP client to be able to use all the features in seditors as well is definitely one of my top priorities. Contributions that improve the collaboration with the rest of the NeoVim universe would help a lot. The integration of Neomake and Formatter.nvim can be taken as examples. Other plugins may be easier to integrate, check this ticket: Collection of tips to get Yode-Nvim working with other plugins Development * Lamda module help * start Neovim with DEBUG_YODE='debug' nvim to set log level + TODO link to modes + "trace" shows state changes as well * see log file: + tail -f ~/.cache/nvim/yode-nvim.log | grep -v "^\[" + last part removes the file name lines * format files + install stylua + make format * lint files + install luacheck + make lint * see local.vimrc for enhancements + rename to .local.vimrc to use it + install nvim plugin for it + start Neovim with YODE=true DEBUG_YODE='debug' nvim to enable special parts for testing * install local Lua + install Hererocks + setup environment with hererocks env -l5.1 -rlatest + source environment with source env/bin/activate + install packages you want to use in REPL, e.g. luarocks install inspect * REPL + source environment as showed above + cd lua to go into the same path Neovim saves Lua files + start a REPL with lua + require installed luarocks packages, e.g. inspect = require ('inspect') + require local deps by copy/paste from source, e.g. R = require('yode-nvim.deps.lamda.dist.lamda') + require source code, e.g. h = require('yode-nvim.helper') + play with the code which works, everything using vim.XYZ will fail * test JS development + npm ci to install dependencies + now you can setup Neomake for the JS files in testData/ * run tests: + running tests requires plenary.nvim to be checked out in the parent directory of this repository + run all tests: make test + run single test: nvim --headless -c "PlenaryBustedDirectory lua/yode-nvim/tests/e2e/seditor_to_file_editor_sync_spec.lua {minimal_init = 'lua/yode-nvim/tests/minimal.vim'}" + more infos, see Plenary docs here + run all tests on file changes nodemon -e lua,vim --exec 'make test' + run single test on file changes nodemon -e lua,vim --exec "nvim --headless -c \"PlenaryBustedDirectory lua/yode-nvim/ tests/e2e/basic_mosaic_layout_spec.lua {minimal_init = 'lua/ yode-nvim/tests/minimal.vim'}\" " + run single test file and log DEBUG_YODE='trace' nvim --headless -c "PlenaryBustedDirectory lua/yode-nvim/tests/e2e /recover_seditor_with_undo_spec.lua {minimal_init = 'lua/ yode-nvim/tests/minimal.vim'}" About Yode plugin for NeoVim Resources Readme License MIT License Stars 156 stars Watchers 3 watching Forks 1 fork Releases No releases published Packages 0 No packages published Contributors 2 * @hoschi hoschi Stefan Gojan * @David-Kunz David-Kunz Dr. David A. Kunz Languages * Lua 96.5% * Vim Script 2.3% * JavaScript 1.1% * Makefile 0.1% * (c) 2022 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.