gpt-4-0314· OpenAI
Arena Human Preference 55K
I'm using neovim. in my init.lua, how to run autopep8, then black then isort on my…
- User
I'm using neovim. in my init.lua, how to run autopep8, then black then isort on my python file up on saving
- Assistant
To run autopep8, black, and isort on your Python file upon saving in Neovim using init.lua, you'll need to install the tools, create a script to run the commands, and then set up an autocmd to run the script on save. Follow these steps:
- Install autopep8, black, and isort:
pip install autopep8 black isort- Create a shell script (e.g., "format_python.sh") in a convenient location (e.g., ~/.config/nvim/scripts/):
#!/bin/sh autopep8 -i "$1" black "$1" isort "$1"
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.