Django shell inside Neovim

Published: 1 week ago - Updated: 1 week ago

1 minute - 153 Words

article 'Django shell inside Neovim' banner

Summary

seamless integration with django commands and Shell within Neovim.

About

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.

Features

  • 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.

https://github.com/user-attachments/assets/f50e4c30-04b7-40ad-b532-abc1753e932d

Install

If you are using Lazy nvim

{
	"shtayeb/django-shell.nvim",
	opts = {},
	dependencies = { "nvim-telescope/telescope.nvim" }
}

Keymaps

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

Add Comment

Conversations (0)

Sign up for our newsletter

Stay up to date with the latest news and articles.