- Notifications
You must be signed in to change notification settings - Fork12
A launch point for your nvim configuration for Python
License
chrisgrieser/nvim-kickstart-python
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A launch point for your nvim config for python.
Similar tokickstart.nvim, butspecifically for python.
- Motivation
- Philosophy & Features
- Recommendation
- Download
- Syntax Highlighting
- Additional plugins of interest
- Recommended Citation
- Credits
While there are quite a few great nvim distros and nvim starter configs outthere, one thing I somewhat missed was a base config for specific languages. Irecently started to learn python and was missing a minimal example what thestate-of-the-art nvim setup specifically for python is.
After figuring most of it out, I decided to publish this config for others touse. It is intended as a launch point for python devs switching to nvim, or as areference for nvim users who want to start doing python development.
- This is not a nvim distro, this is aminimal nvim config specifically forpython. It's intended as a starting point for creating your own config.
- Requirement: nvim 0.10.
- ~15 plugins, ~350 lines, everything in one single file.
- Includes detailed comments explaining what the config does.
- The config can be fully bootstrapped: all plugins and tools are automaticallyinstalled on startup.
- Uses the current state-of-the-art of the nvim plugin ecosystem.
- Includes some common tooling for python development:
- LSP (Completion, Typing):
pyright - Linting (Diagnostics):
ruff - Debugger:
debugpy - Embedded REPL:
ipython(if not installed, falls back topython3)
- LSP (Completion, Typing):
- In addition, this config includes editing utilities specifically for python,like for example docstrings creation, selecting virtual environments, orauto-converting f-strings.
Go through thekickstart-python.lua, it is commented indetail.
You can copypaste the config into you currentinit.lua to use it as a startingpoint for your regular config, or you can copypaste parts of it into yourexisting config.
kickstart-python requires at least nvim 0.10.
Download thekickstart-python.lua file and run Neovimwith it:
# download the configcurl --remote-name"https://raw.githubusercontent.com/chrisgrieser/nvim-kickstart-python/main/kickstart-python.lua"# start neovim with the config, opening a file `foobar.py`# (any existing config you are using remains untouched)nvim -u kickstart-python.lua foobar.py
The config automatically installs all the plugins and tooling needed.
Is provided by thenvim-treesitterplugin and/or thesemshi plugin. The latterrequirespynvim (python3 -m pip install pynvim) to be installed.
Both provide better highlighting, Treesitter is considered the more "modern"approach. Treesitter covers some casessemshi does not and vice versa. Have alook at the comparison to decide for yourself whichone to use. The config uses Treesitter as the more modern approach.
These plugins are not included in the config, but they are worth mentioning, assome people might be interested in them:
- nvim-various-textobjs:various indentation-based text objects
- NotebookNavigator:Jupyter Notebook emulation
- magma.nvim: Jupyter Notebook integration
- ropify.nvim:
ropifyintegration - nvim-conda:
condaenvironment selector - nvim-lspimport: Automaticallyresolves imports for
pyright. - jupytext.nvim: ConvertJupyter Notebooks to code and back.
- py-requirements.nvim:Helps manage python requirements.
- venv-selector: switchvirtual environments
- python-import
You can cite this software project as:
Grieser, C. (2023). nvim-kickstart-python [Computer software]. https://github.com/chrisgrieser/nvim-kickstart-python
kickstart.nvim as an example howto do this.
In my day job, I am a sociologist studying the social mechanisms underlying thedigital economy. For my PhD project, I investigate the governance of the appeconomy and how software ecosystems manage the tension between innovation andcompatibility. If you are interested in this subject, feel free to get in touch.
About
A launch point for your nvim configuration for Python
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors5
Uh oh!
There was an error while loading.Please reload this page.
