Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-debugstring

[![Project status][badge-status]][vimscripts] [![Current release][badge-release]][releases] [![Open issues][badge-issues]][issues]

     _      _                     _        _
    | |    | |                   | |      (_)
  __| | ___| |__  _   _  __ _ ___| |_ _ __ _ _ __   __ _
 / _` |/ _ \ '_ \| | | |/ _` / __| __| '__| | '_ \ / _` |
| (_| |  __/ |_) | |_| | (_| \__ \ |_| |  | | | | | (_| |
 \__,_|\___|_.__/ \__,_|\__, |___/\__|_|  |_|_| |_|\__, |
                         __/ |                      __/ |
                        |___/                      |___/

Purpose

debugstring aims to automate standard debugging operations (e.g., segfaults). It does that by facilitating the ubiquitous printf()-debugging i.e., scatter logging statements around the various code snippets that you want to test.

demo_gif

The form and syntax of the logging statements target the language at hand (e.g., use printf() in C/C++ but puts() in Ruby)

Currently the following languages are supported:

  • C/C++
  • Fortran
  • Haskell
  • Java
  • Javascript
  • PHP
  • Python
  • Ruby
  • Shell
  • Vim

For a more detailed outline of debugstring check doc/debugstring.txt

Usage

Use the mapping of your choice to place unique logging directives during debugging times.

nnoremap <your-key-combination> <Plug>DumpDebugString

Default mapping is: <Leader>ds

Remarks - Debugging

  • Make sure that the filetype plugin is enabled. A line like filetype plugin on in your .vimrc should do the job.

Installation

Using a runtimepath/package manager

I would personally recommend using Pathogen for installing the plugin but any other installation method (e.g., Vundle) should do the job (if not please raise an issue on Github)

git clone https://github.com/bergercookie/vim-debustring.git ~/.vim/bundle/vim-debugstring

# If you're using submodules to handle your vim-dotfiles:
cd $BUNDLE; git submodule add https://github.com/bergercookie/vim-debustring.git

Manual installation

Copy the plugin files to their corresponding directories under ${HOME}/.vim (Linux) or $HOME/vimfiles (Windows).

Contributing

In case you want to contribute on a certain feature/fix, don't hesitate to discuss about it in the Github issues or to implement it and make a PR.

License

Current plugin is distributed under the same terms as Vim itself. See the LICENSE file

Self Promotion

In case you like the plugin, you might as well star it on Github or rate it on vim.org

TODO

  • Method to delete all the debugging strings in all "touched" buffers
  • Method to delete all the debugging strings in current buffer
  • Method to print a name of a variable easily

About

Debug printf()-style at the speed of light

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages