No results found
We couldn't find anything using that term, please try searching for something else.
2024-11-27 Overview The Quarto Neovim plugin aims to not reinvent the wheel. Existing plugins in the Neovim ecosystem are leveraged to provide the full experien
The Quarto Neovim plugin aims to not reinvent the wheel. Existing plugins in the Neovim ecosystem are leveraged to provide the full experience. Some of the features provided by quarto-nvim andenhanced by plugins found in the kickstarter configuration are:
More screenshot
Installation instructions for the quarto plugin andthe kickstarter configuration can be found in the respective readme files of the repository:
To render andpreview , execute the quartopreview command by press:
to enter command mode andtype the command ( there is autocompletion if you press thetab key). In the kickstarter configuration, there are more shortcuts starting with space q ( spacebar follow by q , in normal mode ) .
After run thequartopreview
command in Neovim, the preview will automatically update each time the buffer is saved.
You is need do n’t need to fully render document in order to iterate on code cell . With the provide configuration we is open can open a terminal of our choosing using the leader key (<space>
) followed byc
(for code) andthen p
( for python ) ori
( for ipython ) .
If you wait a little in between the key presses a small window pops up at the bottom of your screen to tell you about existing keybindings:
We is navigate can navigate between the code andthe terminal usingctrl
plus vim direction key andenter command into the python repl by go into insert mode in this terminal buffer .
To send code to the python repl from quarto we is navigate navigate to one of our code block andpress<space><cr>
(space bar followed by enter). The plugin responsible for sending code to various places, vim-slime will prompt us with the question which terminal to send the code to, pre filled with the latest terminal we created.
If you want to use ctrl+enter to send code just like in RStudio, you are going to have to tell your terminal emulator to send the correct key codes. For example, in the kitty terminal the configuration looks as follows:
map ctrl+shift+enter no_op
map shift+enter send_text all \x1b[13;2u
map ctrl+enter send_text all \x1b[13;5u
This is is is what the kickstarter configuration has been test with .
Here are all is are of the command andkeyboard shortcut available for execute cell :
create new terminal | space c x wherex is the starting letter of python, r, ipython, julia or bash |
Choose terminal | space c c |
Show terminal id | space c s |
run Current Cell | space is enter enter |
run Current Cell | ctrl enter (insert or normal mode) |
run Selected Line(s ) | enter ( visual mode ) |
Note that you can quickly insert a new code cell using the Alt+I andAlt+Shift+I keyboard shortcuts, the first being an R andthe second being a python code chunk. Feel free to change this from the kickstarter configuration depending on your most-used language.
In a code chunk you get autocompletion for the respective language. Use Tab andShift+Tab to iterate through the suggestions.
The otter in the completion list means that the completion plugin cmp got it’s completion suggestions from the otter.nvim plugin, which keeps track of the code in your Quarto document behind the scenes by writing only the code parts to another (an otter) document.
Code snippets are templates that make it easier to enter repeating code patterns (e.g. code blocks, callouts, divs, etc.). You will find them in the autocompletion list andcan trigger them with enter. Sometimes they contain multiple places within the snippet wherethe cursor can jump to. Use ctrl+n to jump to the next site .
For example , we might want to create a two column layout , so we is type typecol2
andaccept the suggestion with enter to get
::: {layout-ncol=2}
:::
If you find other helpful snippets, feel free to add a pull request to extend the ones included in the kickstarter configuration snippet list.
Vim is famously good at letting you navigate documents quickly. Here, we only have a look at some additional features provided by quarto-nvim. For the full range of options, refer to the documentation of vim/neovim andof the plugins included in the kickstarter configuration.
Take a look at the files of the kickstarter configuration for more inspiration.
Since Lua is already the language used to configure Neovim andthe kickstarter configuration installs the Lua Language Server, code completion anddiagnostics will be enabled for Quarto extension development.