Seamless integration with Django commands and Shell within Neovim
About
·
Developing
Seamless integration with Django commands and shell within Neovim. This plugin leverages the power of Telescope to offer an intuitive interface for executing Django commands and running Django shell code directly from your Neovim editor.
-
Django Commands
Easily list, view help, and see examples for Django commands directly in a Telescope prompt.
-
Django Shell
Execute Django code and view the results in a new vertical buffer for better readability and debugging.
nvim-django-shell-demo-small.mp4
If you are using Lazy nvim
{
"shtayeb/django-shell.nvim",
opts = {},
dependencies = { "nvim-telescope/telescope.nvim" }
}Create a .py file for testing. write the code to be executed in that file and:
vim.keymap.set("n", "<space>tc", "<cmd>DjangoCommands<CR>")
vim.keymap.set("n", "<space>tr", "<cmd>DjangoShellExec<CR>")
vim.keymap.set("n", "<space>tx", "<cmd>DjangoShellReset<CR>")Default Keymaps
-
Run django code in the current buffer
<leader>tr -
Show django commands
<leader>tc
clone the repo
git clone https://github.com/shtayeb/django-shell.nvim.gitinclude the plugin locally using lazy.nvim
{
dir = "path/to/django-shell.nvim",
opts = {},
}run current test file
:PlenaryBustedFile %Django Shell
Run django code and return the result in a new vertical/horizontal buffer
- [] config var for customisability
- [] config var to display the sql query as well
- [] args to switch to shell_plus
- [] create two temporary win and buf only for plugin usage (LOW)
- [] get highlighted code and run it (LOW)
Django Commands
List, show help and examples for django commands in telescope prompt.
- [] Run the command, accept args and return the result (LOW)