Skip to content

Seamless integration with Django commands and Shell within Neovim

License

Notifications You must be signed in to change notification settings

shtayeb/django-shell.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


django-shell

Seamless integration with Django commands and Shell within Neovim
About · Developing

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.

nvim-django-shell-demo-small.mp4

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

  • Show django commands <leader>tc

Development

clone the repo

git clone https://github.com/shtayeb/django-shell.nvim.git

include the plugin locally using lazy.nvim

{
	dir = "path/to/django-shell.nvim",
	opts = {},
}

run current test file

:PlenaryBustedFile %

Todo:

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)

About

Seamless integration with Django commands and Shell within Neovim

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages