Sign inSign up

pivert/python-nvim-ide

By pivert

•Updated over 4 years ago

Neovim, solarized, airline, with coc plugins including pyright, docker, ansible, vue

Image
0

2.9K

pivert/python-nvim-ide repository overview

⁠Depreciation warning

This image has been renamed to pivert/ansible-neovim-pyright to better reflect the "big" things included. Please check: https://hub.docker.com/repository/docker/pivert/ansible-neovim-pyright⁠

⁠Python - Neovim Development Environment

Welcome to packaged Nvim IDE with latest stable nvim, python, ansible, npm, and nodejs 14 Ansible collection is huge, in order to use it, run the /untaransiblecollection.sh to decompress it.

This documentation might be outdated. Please refer to the up to date documentation : https://gitlab.com/pivert/python-nvim-ide⁠

⁠Colors & Fonts

  • Terminal should use a Solarized Dark color scheme.
  • Use Powerline patched fonts such as Nerd Fonts⁠

⁠Start the container

Create an alias or run it directly. An example of alias with ssh-agent pass- through and ansible hosts mount (remove the volume mount of what you don't need):

docker run -it --rm \
-v "$(pwd)":/workdir \
-v ~/.ssh:/user/.ssh \
-v /etc/passwd:/etc/passwdhost:ro -v /etc/group:/etc/grouphost:ro \
-v /etc/ansible/hosts:/etc/ansible/hosts \
-v $(readlink -f $SSH_AUTH_SOCK):/ssh-agent -e SSH_AUTH_SOCK=/ssh-agent \
--name pynvim${BASHPID:+-$BASHPID} --hostname "$( hostname -s )-pynvim${BASHPID:+-$BASHPID}" \
-e IDTO="$(id)" \
-e GIT_EMAIL='[email protected]' -e GIT_NAME='MyName' \
pivert/python-nvim-ide:latest

⁠Command details

  • The 2 first mounts (passwd & group) are required to map local UIDs/GIDs into the container
  • The 3rd -v maps the workdir for persistence and access your current folder. Feel free to change the '$(pwd)' part.
  • Name the container in order to :
    • Have a meaning name when 'docker container ls'
    • Prevent starting a second one on the same host
  • Set the hostname so you can easily distinguish the terminal from others (-pynvim)
  • Set IDTO to the output of the id command

⁠Features:

  • Syntax for Python, Ansible, Dockerfile, vimrc, YAML & JSON
  • Installed software: git tmux neovim(latest) nodejs(latest) npm curl wget htop...
  • Latest Ansible is installed, but check the /untaransiblecollection.sh script to decompress the collection (500MB)
  • Default neovim from bullseyes slim image with plugins:
    • Python, Dockerfile & Bash basic templates for new scripts
    • neoclide/coc.nvim intellisense engine with several plugins:
    • kien/ctrlp.vim Fuzzy finder for vim⁠
    • scrooloose/nerdcommenter Comment/Uncomment tool⁠
    • scrooloose/nerdtree A Tree-like side bar for better navigation
    • tmhedberg/matchit Switch to the begining and the end of a block by pressing %
    • vim-airline/vim-airline A cool status bar
    • vim-airline/vim-airline-themes Airline themes
    • altercation/vim-colors-solarized Solarized colorscheme (default to dark theme)
    • arcticicestudio/nord-vim Nord
    • sheerun/vim-polyglot Better syntax-highlighting for filetypes in vim
    • tpope/vim-fugitive Git integration
    • tpope/vim-surround Surround.vim is all about "surroundings": parentheses, brackets, quotes, XML tags, and more.
    • jiangmiao/auto-pairs Auto-close braces and scopes
    • jpalardy/vim-slime', { 'for': 'python' }
    • hanschen/vim-ipython-cell', { 'for': 'python' } Tmux integration
    • tmhedberg/SimpylFold Python code folding - zo zO zc zC
  • Solarized terminal colors for:
    • tmux
    • bash
    • neovim

⁠Neovim

  • Neovim Documentation⁠
  • use :checkhealth to get status of the editor setup
  • ]g and [g go to next/previous coc diagnostic error/warning
  • Basic buffer commands (read help for more):
    • :bn[ext]/:bp[revious]/:bf[irst]/:bl[ast]/:b2/:bc[lose] : go to buffer next/previous/first/last/second/close current buffer
    • :e[dit] newfile.py : Create a new buffer, add it to the list, and open the newfile.py in it
  • Check installed Plug plugins : PlugStatus
  • Check installed Coc extensions : CocList extensions

⁠SSH

You might want to use ssh with pubkey authentication from the container. You might also want to cache your ssh key password. The first thing is to mount your .ssh folder when running the container. Add -v ~/.ssh:/user/.ssh

Then you have 2 options:

  • run 'eval $(ssh-agent) > /dev/null' then 'ssh-add' in the container.
  • run ssh-add before running the container, then reuse the agent by adding '-f $SSH_AUTH_SOCK):/ssh-agent -e SSH_AUTH_SOCK=/ssh-agent' to your docker run command

⁠Customization

Most customization can be done by mounting updated config file. But you can place an executable init script in the root of the folder named docker-environment-root.sh (executed as root before the su -l)

⁠Further Help

Check online documentation from tmux, nvim, and the plugin you would like to use. Also check SLIME and ipython-cell plugin for Tmux & ipython integrations. An alias has been added to read the relevant config files, README.md and environment:

Just run 'config' command from bash in the container.

Source code & issues: https://gitlab.com/pivert/python-nvim-ide/⁠

Tag summary

Content type

Image

Digest

Size

712.4 MB

Last updated

over 4 years ago

docker pull pivert/python-nvim-ide