{"id":16139530,"url":"https://github.com/bergercookie/vim-debugstring","last_synced_at":"2025-03-18T16:31:11.892Z","repository":{"id":41132205,"uuid":"115666063","full_name":"bergercookie/vim-debugstring","owner":"bergercookie","description":"Debug  printf()-style at the speed of light","archived":false,"fork":false,"pushed_at":"2021-07-09T18:33:42.000Z","size":5348,"stargazers_count":36,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T22:02:51.769Z","etag":null,"topics":["vim","vim-debugstring","vim-plugins"],"latest_commit_sha":null,"homepage":"","language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bergercookie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["bergercookie"]}},"created_at":"2017-12-28T23:01:14.000Z","updated_at":"2024-11-25T06:52:15.000Z","dependencies_parsed_at":"2022-09-07T20:21:23.776Z","dependency_job_id":null,"html_url":"https://github.com/bergercookie/vim-debugstring","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bergercookie%2Fvim-debugstring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bergercookie%2Fvim-debugstring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bergercookie%2Fvim-debugstring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bergercookie%2Fvim-debugstring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bergercookie","download_url":"https://codeload.github.com/bergercookie/vim-debugstring/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244259922,"owners_count":20424637,"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":["vim","vim-debugstring","vim-plugins"],"created_at":"2024-10-09T23:49:16.201Z","updated_at":"2025-03-18T16:31:11.539Z","avatar_url":"https://github.com/bergercookie.png","language":"Vim script","readme":"# vim-debugstring\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://travis-ci.org/bergercookie/vim-debugstring\" alt=\"Build Status\"\u003e\n  \u003cimg src=\"https://travis-ci.org/bergercookie/vim-debugstring.svg?branch=master\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n```\n     _      _                     _        _\n    | |    | |                   | |      (_)\n  __| | ___| |__  _   _  __ _ ___| |_ _ __ _ _ __   __ _\n / _` |/ _ \\ '_ \\| | | |/ _` / __| __| '__| | '_ \\ / _` |\n| (_| |  __/ |_) | |_| | (_| \\__ \\ |_| |  | | | | | (_| |\n \\__,_|\\___|_.__/ \\__,_|\\__, |___/\\__|_|  |_|_| |_|\\__, |\n                         __/ |                      __/ |\n                        |___/                      |___/\n\n```\n\n## Purpose\n\n`debugstring` aims to automate standard debugging operations (e.g., segfaults).\nIt does that by facilitating the ubiquitous\n[printf()-debugging](https://everything2.com/title/printf%28%29%20debugging)\ni.e., scatter logging statements around the various code snippets that you want\nto test.\n\n\n## Demos\n\n[Presentation at Vim-London](https://www.youtube.com/watch?v=cJIoH5r2zSk)\n\n### Finding a segfault\n\n![demo_gif](misc/find-segfault.gif)\n\n### Control flow\n\n![demo_gif2](misc/control-flow.gif)\n\n### Expression evaluation\n\n![demo_gif3](misc/expression.gif)\n\n## Features\n\n- The form and syntax of the logging statements target the language at hand\n(e.g., use `printf()` in C/C++ but `puts()` in Ruby)\n- Support for debugging variable expressions e.g., the values of variables or\n    arbitrary expressions at certain parts of your code\n- Support for \u003ccexpr\u003e: Place your cursor over the variable you want to print and\n    press `\u003cleader\u003eDS`. It will create a debugging string for that variable\n- Support for [vim-repeat](https://github.com/tpope/vim-repeat). No\n    need for repeat the same mapping, or rewrite the lengthy expression that you\n    want to monitor, just use the `.` character\n\n\nCurrently the following languages are supported. First column corresponds to the\nstandard debugging string while the second to the case of debugging for a\nspecific variable.\n\nLang         | Debug String       | Debug Variable\n---          | ---                | ---\nArduino      | :heavy_check_mark: | :heavy_check_mark:\nAwk          | :x:                | :x:\nC            | :heavy_check_mark: | :heavy_check_mark:\nC#           | :heavy_check_mark: | :heavy_check_mark:\nC++          | :heavy_check_mark: | :heavy_check_mark:\nCMake        | :heavy_check_mark: | :heavy_check_mark:\nD            | :x:                | :x:\nDockerfile   | :heavy_check_mark: | :heavy_check_mark:\nFish-Shell   | :heavy_check_mark: | :heavy_check_mark:\nFortran      | :heavy_check_mark: | :heavy_check_mark:\nGo           | :heavy_check_mark: | :heavy_check_mark:\nHaskell      | :heavy_check_mark: | :heavy_check_mark:\nJava         | :heavy_check_mark: | :heavy_check_mark:\nJavascript   | :heavy_check_mark: | :heavy_check_mark:\nJulia        | :x:                | :x:\nLua          | :heavy_check_mark: | :heavy_check_mark:\nMakefile     | :heavy_check_mark: | :heavy_check_mark:\nMatlab       | :x:                | :x:\nPHP          | :heavy_check_mark: | :heavy_check_mark:\nPerl         | :x:                | :x:\nPython       | :heavy_check_mark: | :heavy_check_mark:\nR            | :heavy_check_mark: | :heavy_check_mark:\nRuby         | :heavy_check_mark: | :heavy_check_mark:\nRust         | :heavy_check_mark: | :heavy_check_mark:\nScala        | :x:                | :x:\nShell        | :heavy_check_mark: | :heavy_check_mark:\nSwift        | :x:                | :x:\nTypescript   | :heavy_check_mark: | :heavy_check_mark:\nVim          | :heavy_check_mark: | :heavy_check_mark:\nVisual Basic | :x:                | :x:\nZsh          | :heavy_check_mark: | :heavy_check_mark:\n\nFor a more detailed description of `debugstring` check\n[doc/debugstring.txt](https://github.com/bergercookie/vim-debugstring/blob/master/doc/debugstring.txt)\n\n## Usage\n\nUse the mappings of your choice to place unique logging directives during\ndebugging times.\n\n```vim\nnnoremap \u003cyour-key-combination\u003e \u003cPlug\u003eDumpDebugString\nnnoremap \u003ca-second-key-combination\u003e \u003cPlug\u003eDumpDebugStringExpr\nnnoremap \u003ca-third-key-combination\u003e \u003cPlug\u003eDumpDebugStringCexpr\n```\n\nDefault mappings are: `\u003cLeader\u003eds`, `\u003cLeader\u003edS`, `\u003cLeader\u003eDS` respectively.\n\nAn example of using it in a C++ file is given below:\n\n```c++\n// Debug String\nstd::cout \u003c\u003c \"[a.c:4] DEBUGGING STRING ==\u003e \" \u003c\u003c 0 \u003c\u003c std::endl;\n\n// Debug Variable\nstd::cout \u003c\u003c \"[a.c:4] a_variable: \" \u003c\u003c a_variable \u003c\u003c std::endl;\n```\n\n### Remarks - Debugging\n\n* Make sure that `filetype plugin` is enabled. A line like `filetype plugin on` in\n    your `.vimrc` should do the job.\n\n\n## Installation\n\n| Plugin manager | How to install |\n| :------------- | :------------- |\n| [Dein][1] | `call dein#add('bergercookie/vim-debugstring')` |\n| [minpac][2] | `call minpac#add('bergercookie/vim-debugstring')` |\n| [Pathogen][3] | `git clone https://github.com/bergercookie/vim-debugstring.git ~/.vim/bundle/vim-debugstring` |\n| [Plug][4] | `Plug 'bergercookie/vim-debugstring'` |\n| [Vundle][5] | `Plugin 'bergercookie/vim-debugstring'` |\n| manual | copy all of the files into your `.vim` directory (or `~/.config/nvim` if you're using neovim)|\n\n[1]: https://github.com/Shougo/dein.vim\n[2]: https://github.com/k-takata/minpac\n[3]: https://github.com/tpope/vim-pathogen\n[4]: https://github.com/junegunn/vim-plug\n[5]: https://github.com/VundleVim/Vundle.vim\n\n### Dependencies\n\n`debugstring` depends on the following vim plugins:\n\n- vim-repeat [OPTIONAL]\n\n## Contributing\n\nIn case you want to contribute on a certain feature/fix, don't hesitate to\ndiscuss about it in the Github issues or to implement it and make a PR.\n\n## License\n\nCurrent plugin is distributed under the same terms as Vim itself. See the\n[LICENSE](https://github.com/bergercookie/vim-debugstring/blob/master/LICENSE)\nfile\n\n## Self Promotion\n\nIn case you like the plugin, you might as well [star it on\nGithub](https://github.com/bergercookie/vim-debugstring) or [rate it on\nvim.org](https://vim8.org/scripts/script.php?script_id=5634) Also feel\nfree to check my [other\nplugins](https://github.com/bergercookie?tab=repositories)\n\n## Notes on Development\n\nThis mostly comprises a list of stuff I want to keep track of when developing\nthis or other vim plugins\n\n* Use [vimdoc](https://github.com/google/vimdoc) to generate documentation from\n    the `vim` docstring (instead of manually updating the .txt file). See the\n    misc/build_doc for more on how this is done.\n* Use [vader](https://github.com/junegunn/vader.vim) for unittesting. Use\n    `test/run-tests.sh` to run them:\n\n    ```\n    vim -Nu test/vimrc\n    :set rtp+=vader.vim/plugin\n    :set rtp+=vim-repeat/autoload\n\n    :Vader test/*\n    ```\n## TODO\n\n- [ ] Method to delete all the debugging strings in current buffer / all \"touched\" buffers - see far.vim\n- [x] Method to print name and contents of a variable\n- ~[ ]Make the counter buffer-specific~ Nope, we already have the filename \u0026\n    line for file-specific text\n- [ ] Escape double single quotes vimscript variable printing\n- [x] Append to current line if that is empty\n- [x] Support repeat.vim\n- [x] Use an assertion module - vader\n- [x] Use vader.vim for TDD\n- [x] Extend vader support for rest of languages\n- [x] Use travis for CI\n- [x] Bug with changing the filename of the current file\n- [x] Make vim-repeat dependency optional\n- [x] Turn supported languages into a table - what do we support in which\n    language\n- [x] Make vim-repeat dependency optional\n","funding_links":["https://github.com/sponsors/bergercookie"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbergercookie%2Fvim-debugstring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbergercookie%2Fvim-debugstring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbergercookie%2Fvim-debugstring/lists"}