GitHub

DJ.vim is a vim plugin for making development process of django projects eassier in vim. It can run management commands, run server, etc. from the vim integrated terminal.

Features

  • Automatically detect virtual environment / create a default environment if not present.
  • Run server inside the integrated terminal in vim.
  • Run management commands such as migrations, starting apps, projects, django shell, etc.

Setup

Inside of the Lua setup for Packer add the plugin as follows:

use 'mr-destructive/dj.vim'

For custom keymappings use the below format:

nnoremap yourkeys :lua require("django").FUNCTION_NAME

Default keymaps

  • pr -> Create_Project()
  • rs -> Run_Server()
  • sh -> Start_Shell()
  • mm -> Makemigrations()
  • mg -> Migrate()
  • ap -> Start_App()
  • su -> CreateSuperUser()
  • tm -> StartTerminal()
  • cs -> RunCustomCommand()

Read the original on github.com ↗