generated from ellisonleao/nvim-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a7a9d6
commit 1459282
Showing
4 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,38 @@ | ||
# Comment-REPL.nvim | ||
|
||
 | ||
 | ||
 | ||
|
||
A Neovim plugin for executing REPLs directly in your buffers and showing results as comments. | ||
Execute code directly from your buffer and print the output as a comment. | ||
|
||
## How does it work | ||
|
||
[Screenshot](doc/screenshot.png) | ||
|
||
## Installation | ||
|
||
Using lazy.nvim: | ||
|
||
```lua | ||
{ | ||
'atinylittleshell/comment-repl.nvim', | ||
opts = {}, | ||
} | ||
``` | ||
|
||
## Configuration | ||
|
||
See [config.lua](lua/comment-repl/config.lua) for config schema and default values. | ||
|
||
## Commands | ||
|
||
`:CommentREPLExecute` - Execute the code cell at the cursor and print the output as a comment. | ||
|
||
`:CommentREPLLog` - View logs from Comment-REPL.nvim. | ||
|
||
```lua | ||
-- By default the plugin will not enable any key bindings. | ||
-- Your can define your own keybind behavior like below. | ||
vim.keymap.set('n', '<leader>ce', '<cmd>CommentREPLExecute<CR>') | ||
vim.keymap.set('n', '<leader>cl', '<cmd>CommentREPLLog<CR>') | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
i = 30 | ||
print(i) | ||
def fibonacci_below(n): | ||
a, b = 0, 1 | ||
while a < n: | ||
print(a, end=" ") | ||
a, b = b, a + b | ||
|
||
|
||
fibonacci_below(5) | ||
|
||
|
||
""" | ||
30 | ||
0 1 1 2 3 | ||
""" | ||
|
||
# %% | ||
j = {"hello", "world"} | ||
print(j) | ||
# The marker above separates the code below into a different cell | ||
|
||
fibonacci_below(10) | ||
|
||
|
||
""" | ||
{'world', 'hello'} | ||
0 1 1 2 3 5 8 | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters