|
1 |
| -# vim-infer-debugger |
2 |
| -A VIM plugin to insert a breakpoint debugger based on your current file extension |
| 1 | +vim-infer-debugger |
| 2 | +================== |
| 3 | + |
| 4 | +A VIM plugin to insert a breakpoint debugger based on your current file |
| 5 | +extension |
3 | 6 |
|
4 | 7 | `vim-infer-debugger` works by taking a set of defined file extensions and their
|
5 |
| -corresponding debuggers, and then selecting the correct debugger based on the file |
6 |
| -you're in. It comes with a set of defaults (currently centered around Ruby/Rails and Elixir/Phoenix development): |
| 8 | +corresponding debuggers, and then selecting the correct debugger based on the |
| 9 | +file you're in. It comes with a set of defaults: |
7 | 10 |
|
8 |
| -``` |
9 |
| - let g:debugger_array = [['\.rb', 'require "pry"; binding.pry'], |
10 |
| - \['\.ex$', 'require IEx; IEx.pry'], |
11 |
| - \['\.exs', 'require IEx; IEx.pry'], |
12 |
| - \['\.erb', '<% require "pry"; binding.pry %>'], |
13 |
| - \['\.eex', '<%= require IEx; IEx.pry %>'], |
14 |
| - \['\.coffee$', 'debugger'], |
| 11 | +```VIM |
| 12 | + let g:debugger_array = [['\.rb', 'require "pry"; binding.pry'], |
| 13 | + \['\.ex$', 'require IEx; IEx.pry'], |
| 14 | + \['\.exs', 'require IEx; IEx.pry'], |
| 15 | + \['\.erb', '<% require "pry"; binding.pry %>'], |
| 16 | + \['\.eex', '<%= require IEx; IEx.pry %>'], |
| 17 | + \['\.coffee$', 'debugger'], |
15 | 18 | \['\.json\.jbuilder', 'require "pry"; binding.pry'],
|
16 |
| - \['\.js$', 'debugger;'], |
17 |
| - \['\.jsx$', 'debugger;']] |
| 19 | + \['\.js$', 'debugger;'], |
| 20 | + \['\.jsx$', 'debugger;'] |
| 21 | + \['\.rs$', 'println!("{:?}", )']] |
18 | 22 | ```
|
19 |
| -In order to define your own debuggers, just overwrite `g:debugger_array` in your `.vimrc` |
20 |
| -Please note that when defining the regex for the file extension, it is best to wrap it |
21 |
| -in single quotes. Also note that by setting `g:debugger_array` in your `.vimrc`, you overwrite |
22 |
| -the entire array. So if you want to only change one of the default entries, you will have to supply |
23 |
| -the rest of them as well. |
| 23 | +In order to define your own debuggers, just overwrite `g:debugger_array` in |
| 24 | +your `.vimrc` Please note that when defining the regex for the file extension, |
| 25 | +it is best to wrap it in single quotes. Also note that by setting |
| 26 | +`g:debugger_array` in your `.vimrc`, you overwrite the entire array. So if you |
| 27 | +want to only change one of the default entries, you will have to supply the |
| 28 | +rest of them as well. |
24 | 29 |
|
25 | 30 | `vim-infer-debugger` defines two key bindings by default:
|
26 | 31 |
|
27 |
| -``` |
| 32 | +```VIM |
28 | 33 | nmap <Leader>P :call Debugging("O")<cr>
|
29 | 34 | nmap <Leader>p :call Debugging("o")<cr>
|
30 | 35 | ```
|
31 | 36 |
|
32 |
| -Following VIM convention that capital letters insert above your cursor, and lowercase |
33 |
| -insert below, the debugging statement will be pasted above or below your cursor accordingly. |
| 37 | +Following VIM convention that capital letters insert above your cursor, and |
| 38 | +lowercase insert below, the debugging statement will be pasted above or below |
| 39 | +your cursor accordingly. |
| 40 | + |
| 41 | +I recommend using [vim-plug](https://github.com/junegunn/vim-plug) to install, |
| 42 | +just add `Plug 'mcasper/vim-infer-debugger'` to your `.vimrc`, run `PlugInstall`, |
| 43 | +and you're on your way. |
34 | 44 |
|
35 |
| -If you have any debugging statements that you think should be the default for a certain file extension, |
36 |
| -feel free to open a pull request or issue! |
| 45 | +If you have any debugging statements that you think should be the default for a |
| 46 | +certain file extension, feel free to open a pull request or issue! |
0 commit comments