Skip to content

sfarkya/nvim-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvim-python

Dockerized dev environment using neovim and language server protocol.

  • LSP provider pyls
  • Fast completion using HansPinckaers' speed hacks
  • View documentation on hover or documentation as separate vim buffer
  • Documentation template generation by pydocstring (using doq) - numpy format default
  • Debugger support for python: run/debug python code within nvim
    • Toggle breakpoints
    • step into, step over
    • virtual text updates values of variables in comments
  • Treesitter based
    • semantic highlighting
    • code folding
    • smart rename
  • Linting: various providers incl. pylint, flake8, mccabe (code complexity), mypy (typing)
  • Various deep learning packages
  • Rope based python code refactoring via Jedi: quick rename
  • Various convenience plugins
    • Fast motion using easymotion
    • Fuzzy list searching using fzf
    • tags support for searching
    • See tree of changes undotree
    • Directory browser using nerdtree
    • Code outline using Vista
  • Disabled by default: Multiple choices for completions (Jedi, ALE)
  • Rope based python code refactoring: extract methods, variables, constants
  • Tabnine based completions
  • Multi-select
  • Snippets

Build:

git clone <this repo>
cd <this repo>
docker build -t <img name> .
docker run -ti --rm <img name>

Launch

Launch neovim using nvim

(Optional) Install plugins: :PlugInstall inside nvim

TMUX

Does not seem to work well with TMUX currently --- works fine with ctrl+A mapping instead of default ctrl+B

Keybindings

TODO

Colorscheme

TODO

Screenshots

By default, <leader> is \ (e.g., <leader>k is \k)

Completion:

completion

Signature help while filling in function args:

signature

Documentation on hover: Press K

documentation_hover

Documentation in a buffer: Press <leader>k

documentation_buf

Rename variable: <leader>rn when cursor on variable (a_bp in this example)

rename1 rename2 rename3

Add docstring template: <leader>- for current line

docstring

Code fixing: long line corrected by yapf

longline yapf

Ignore type error in import using # type: ignore annotation

typeignore

Linter catches poor naming convention:

linter_catch_poor_name

Code outline press <leader>t

outline

Directory browser <leader>e

browser

Toggle breakpoint: <leader>db for current line Start debug: <leader>dc and press 1

breakpoints

Debugger stops are breakpoints (and exceptions/errors usually): (Note comments show values of vars)

debug1

Continue debugged with <leader>dc (Note comments show values of vars)

debug2

Open REPL if you want to interact with debugger using <leader>dro

repl_open

Switch to the new REPL split per usual, enter insert mode to use it:

repl_interact repl_interact2

Hit continue again to finish the run <leader>dc - see terminal split (bottom most split) has the output

dbg_finish

Close REPL and terminal splits

dbg_close

Debugger keymaps in init.vim:

debugger_keymaps

Jedi keymaps in init.vim (and defaults):

jedi_keymaps

Mappings for FZF: <leader>o to find by filename and <leader>f to find by tag:

util_map1 fzf_open fzf_tags

Easymotion trigger is s followed by one character

easymotion1 easymotion2

More util mappings: Search buffers: <leader>bu; undo tree <leader>u

util2 bufs bufs

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 50.4%
  • Dockerfile 28.6%
  • Shell 21.0%