This .vimrc has extremely compacted lines of config to make vim work for python
Warning
If you have an existing ~/.vimrc backup it first mv ~/.vimrc ~/.vimrc_backup
curl -LsSf https://gist.githubusercontent.com/rochacbruno/88d7b7b02a16c6971c4bbdda7023f3a1/raw/bafb1ad84ebc06ab8536ef0b8c9a94333167773d/.vimrc -o ~/.vimrc- Space + B List buffers
- Space + Tab Previous File
- Space + R Run Script
- Space + K Help for Keyword
- Control + X + O Trigger auto completion
- Buffer List Space + B
- then type number of the buffer
1or part of the filenamescripand then enter
- then type number of the buffer
- Switch to previously edited buffer Space + Tab
- Run file Space + R
- Open help for WORD under cursor Space + K
- Syntax Check
:w(use Control + L to clean messages)
- Auto Complete with preview
- Assume
|is the cursor position - Start typing and object and dot
sys.|and press Control + X + O - Popup with auto completion shows
- Arrows to navigate
- OR use Control + N and Control + P
- Control + O to accept selection
- Control + E to cancel selection
- Assume
- Vim9 with +python3
- packages: vim-nox, gvim or compile your own vim with Python suppport
- Check:
vim --version | grep pythonIF you see+pythonor+python3that's ok
you may need to changepython3completetopythoncompleteon the script.
- Python3 or uv
- Shift–K → Python help for word under cursor
- Space + K → Vertical Python help for word under cursor
- Space + R → Run file
- Ctrl–X Ctrl–O → Omnifunc completion (Python-aware)
- Ctrl–X Ctrl–N → Keyword completion from current file
- Ctrl–X Ctrl–I → Keyword completion from included files
- Ctrl–X Ctrl–K → Dictionary completion
- Ctrl–N → Next match
- Ctrl–P → Previous match
- Ctrl–O → Accept match
- Ctrl–L → Clear error message when saving with failure
- Ctrl-w z → Close the preview window