├── LICENSE.md ├── README.md ├── configs ├── docs ├── img └── index.md ├── img ├── fzf.gif ├── nerdtree.gif ├── ripgrep.gif ├── tagbar.gif └── vim.png ├── install.sh ├── mkdocs.yml └── plugins /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Raphael Philipe Mendes da Silva 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Contents 2 | 3 | This project aims to use Vim as a powerful and complete Python IDE. In order 4 | to do that, we curated a list of awesome plugins available in the community and 5 | provided an automatic installation procedure for this set. 6 | 7 | 8 | 9 | ## Installation 10 | 11 | 12 | ### Requirements for Ubuntu distros (Tested on Windows Subsystem for Linux) 13 | 14 | ```bash 15 | sudo apt install libncurses5-dev libgnome2-dev libgnomeui-dev \ 16 | libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \ 17 | libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev \ 18 | python3-dev git ctags 19 | ``` 20 | 21 | ### Requirements for Fedora distros 22 | 23 | ```bash 24 | sudo dnf install -y ctags git python python-devel \ 25 | python3 python3-devel tcl-devel 26 | ``` 27 | 28 | ### Installation process 29 | 30 | ```bash 31 | git clone https://github.com/rapphil/vim-python-ide.git && \ 32 | cd vim-python-ide && ./install.sh 33 | ``` 34 | 35 | ## Features 36 | 37 | Please check the available features and the plugins that enable them. 38 | 39 | ### Syntax Highlighting 40 | 41 | Syntax highlighting for several languages, besides Python. 42 | 43 | Powered by: 44 | 45 | * [vim-polyglot](https://github.com/sheerun/vim-polyglot) 46 | 47 | ### Color Themes 48 | 49 | Several popular color schemes: 50 | 51 | * Monokai 52 | * Gruvbox 53 | * Much more 54 | 55 | Powered by: 56 | 57 | * [vim-colorschemes](https://github.com/flazz/vim-colorschemes) 58 | 59 | 60 | ### Project Navigation 61 | 62 | Easily navigate your project using: 63 | 64 | * File tree explore (Nerdtree) 65 | 66 | * Fuzzy finder based on the file names 67 | 68 | * File structure (classes, functions, methods). 69 | 70 | Powered by: 71 | 72 | * [Nerdtree](https://github.com/scrooloose/nerdtree) 73 | * [Fzf](https://github.com/junegunn/fzf.vim) 74 | * [Tagbar](https://majutsushi.github.io/tagbar/) 75 | 76 | ### Powerfull Full Text search 77 | 78 | * Full text search based on both exact match and fuzzy finder capabilities 79 | * Extremely fast. 80 | 81 | 82 | Powered by: 83 | 84 | * [Ripgrep](https://github.com/BurntSushi/ripgrep) 85 | * [Fzf](https://github.com/junegunn/fzf.vim) 86 | 87 | ### Real time linting 88 | 89 | Lint source files in real time an check for errors and warnings. 90 | 91 | Powered by: 92 | 93 | * [Ale](https://github.com/w0rp/ale) 94 | 95 | ### Code navigation 96 | 97 | * Go to function definitions 98 | * Check parameters and docstrings easily. 99 | 100 | Powered by: 101 | 102 | * [vim-gutentags](https://github.com/ludovicchabant/vim-gutentags) 103 | * [jedi-vim](https://github.com/davidhalter/jedi-vim) 104 | 105 | ### Code refactoring 106 | 107 | Extract methods, variables and rename functions easily. 108 | 109 | Powered by: 110 | 111 | * [jedi-vim](https://github.com/davidhalter/jedi-vim) 112 | * [rope-vim](https://github.com/python-rope/ropevim) 113 | 114 | ### Code completion 115 | 116 | Use hints and dialog boxes to speed your development using code completion. 117 | 118 | Powered by: 119 | 120 | * [jedi-vim](https://github.com/davidhalter/jedi-vim) 121 | 122 | ### Snippets 123 | 124 | Snippets save time while you type and creates standardization for your code. 125 | 126 | Powered by: 127 | 128 | * [vim-snippets](https://github.com/honza/vim-snippets) 129 | * [ultisnips](https://github.com/SirVer/ultisnips) 130 | 131 | ### Git Integration 132 | 133 | Perform git operations and highlight changes in the repo. 134 | 135 | Powered by: 136 | 137 | * [vim-fugitive](https://github.com/tpope/vim-fugitive) 138 | * [vim-gitgutter](https://github.com/airblade/vim-gitgutter) 139 | 140 | ## Key bindings 141 | 142 | | Action | Mode | key binding | 143 | |--------------------------|------------------|-----------------| 144 | | Toogle Nerdtree | Normal | `crtl + n` | 145 | | toogle Tagbar | Normal | `f8` | 146 | | Look for file | Normal | `crtl + p` | 147 | | Goto definition | Normal | `crtl + ]` | 148 | | Show docstring | Normal | `K` | 149 | | Extract method | Normal/Visual | `crlt + c r m` | 150 | | Auto complete | Insert | `crtl + space` | 151 | | Expand snippet | Insert |`tab` | 152 | 153 | ## Commands 154 | 155 | | Command Description | Command | 156 | |--------------------------------|----------------| 157 | | Look for string | `:Rg ` | 158 | | git status | `:Gstatus` | 159 | | git diff | `:Gdiff` | 160 | -------------------------------------------------------------------------------- /configs: -------------------------------------------------------------------------------- 1 | " 2 | " Theme options 3 | set t_Co=256 4 | colorscheme Monokai 5 | set background=dark " Setting dark mode 6 | """ Hilight search and set numbers 7 | set hlsearch 8 | highlight Search guibg=#af005f ctermbg=125 9 | """" clear highlight with after a search 10 | nnoremap :noh 11 | set number 12 | 13 | set cc=80 14 | 15 | " Airline configuration 16 | let g:airline#extensions#tabline#enabled = 1 17 | let g:airline#extensions#tabline#formatter = 'default' 18 | 19 | " Nerdtree configuration 20 | map :NERDTreeToggle 21 | let NERDTreeIgnore=['\.pyc$', '\~$'] 22 | autocmd VimEnter * NERDTree 23 | autocmd VimEnter * wincmd p 24 | let g:NERDTreeDirArrowExpandable = '▸' 25 | let g:NERDTreeDirArrowCollapsible = '▾' 26 | 27 | " Switching between buffers 28 | " Set commands to switching between buffers 29 | :nnoremap :bnext! 30 | :nnoremap :bprevious! 31 | :nnoremap :bpspbnbd 32 | 33 | " File searchs 34 | map :Files 35 | 36 | " Ale Configuration 37 | """" Better formatting fo worp/ale 38 | let g:ale_echo_msg_error_str = 'E' 39 | let g:ale_echo_msg_warning_str = 'W' 40 | let g:ale_echo_msg_format = '[%linter%] %s [%severity%] [%...code...%]' 41 | """" Enable completion where available. 42 | let g:ale_completion_enabled = 1 43 | """ Customize linters that are turned on 44 | let g:ale_linters = { 45 | \ 'python': ['flake8'], 46 | \} 47 | let g:ale_set_highlights = 0 48 | 49 | " Fix keys 50 | set backspace=2 51 | 52 | let g:UltiSnipsExpandTrigger='' 53 | let g:UltiSnipsListSnippets='' 54 | let g:UltiSnipsJumpForwardTrigger='' 55 | let g:UltiSnipsJumpBackwardTrigger='' 56 | 57 | nmap :TagbarToggle 58 | 59 | -------------------------------------------------------------------------------- /docs/img: -------------------------------------------------------------------------------- 1 | ../img -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | ../README.md -------------------------------------------------------------------------------- /img/fzf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapphil/vim-python-ide/a83b92aeb3b322a4e69974f2ee76ee3634899b1f/img/fzf.gif -------------------------------------------------------------------------------- /img/nerdtree.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapphil/vim-python-ide/a83b92aeb3b322a4e69974f2ee76ee3634899b1f/img/nerdtree.gif -------------------------------------------------------------------------------- /img/ripgrep.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapphil/vim-python-ide/a83b92aeb3b322a4e69974f2ee76ee3634899b1f/img/ripgrep.gif -------------------------------------------------------------------------------- /img/tagbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapphil/vim-python-ide/a83b92aeb3b322a4e69974f2ee76ee3634899b1f/img/tagbar.gif -------------------------------------------------------------------------------- /img/vim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rapphil/vim-python-ide/a83b92aeb3b322a4e69974f2ee76ee3634899b1f/img/vim.png -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VIM_VERSION="v8.2.0007" 4 | CURDIR=${PWD} 5 | CPUS=$(grep -c ^processor /proc/cpuinfo) 6 | 7 | read -p "Please backup your .vimrc file and .vim directory before starting. Press [Enter] to continue." 8 | 9 | git clone --branch $VIM_VERSION https://github.com/vim/vim.git /tmp/vim-build/ 10 | cd /tmp/vim-build 11 | 12 | ./configure --prefix=${HOME}/tools/vim --with-features=huge --enable-multibyte --enable-pythoninterp=yes --enable-python3interp=yes 13 | 14 | make -j $CPUS && make install 15 | 16 | pip2 install --user rope jedi ropevim flake8 17 | 18 | UPDATE_PATH='export PATH=${HOME}/tools/vim/bin:$PATH' 19 | 20 | export PATH=${HOME}/tools/vim/bin:$PATH 21 | 22 | if grep -qF "$UPDATE_PATH" ${HOME}/.bashrc; then 23 | echo "Not updating bashrc" 24 | else 25 | echo "$UPDATE_PATH" >> ${HOME}/.bashrc 26 | fi 27 | 28 | curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ 29 | https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim 30 | 31 | vim -u ${CURDIR}/plugins +PlugInstall! +qall! 32 | 33 | cat ${CURDIR}/plugins ${CURDIR}/configs > ${HOME}/.vimrc 34 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: Vim as a Python IDE 2 | site_author: "Raphael Philipe Mendes da Silva" 3 | site_description: "Small side project to provide an out-of-box Python IDE based on Vim and a set of community plugins" 4 | repo_url: "https://github.com/rapphil/vim-python-ide" 5 | 6 | google_analytics: ["UA-131814198-1", "auto"] 7 | theme: 8 | name: 'material' 9 | palette: 10 | primary: "blue-grey" 11 | feature: 12 | tabs: true 13 | -------------------------------------------------------------------------------- /plugins: -------------------------------------------------------------------------------- 1 | " Specify a directory for plugins 2 | " " - For Neovim: ~/.local/share/nvim/plugged 3 | " " - Avoid using standard Vim directory names like 'plugin' 4 | call plug#begin('~/.vim/plugged') 5 | Plug 'python-rope/ropevim' 6 | Plug 'davidhalter/jedi-vim' 7 | Plug 'SirVer/ultisnips', { 'commit': 'a909dee82b6eaaa3ae001e27c3e95c58d487d242'} 8 | Plug 'honza/vim-snippets' 9 | Plug 'tpope/vim-fugitive' 10 | Plug 'w0rp/ale' 11 | Plug 'sheerun/vim-polyglot' 12 | Plug 'ludovicchabant/vim-gutentags' 13 | Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } 14 | Plug 'junegunn/fzf.vim' 15 | Plug 'scrooloose/nerdtree' 16 | Plug 'vim-airline/vim-airline' 17 | Plug 'vim-airline/vim-airline-themes' 18 | Plug 'flazz/vim-colorschemes' 19 | Plug 'airblade/vim-gitgutter' 20 | Plug 'majutsushi/tagbar' 21 | " Initialize plugin system 22 | call plug#end() 23 | " 24 | --------------------------------------------------------------------------------