Coder Social home page Coder Social logo

vim-ide's Introduction

Contents

This project aims to use Vim as a powerful and complete Python IDE. In order to do that, we curated a list of awesome plugins available in the community and provided an automatic installation procedure for this set.

Installation

Requirements for Ubuntu distros (Tested on Windows Subsystem for Linux)

Ubuntu 20.04

The following packages are excluded from Ubuntu 20.04. We do not seem to need them.

  • libgnome2-dev libgnomeui-dev libbonoboui2-dev
  • This will also install python2 (python-dev)
sudo apt install libncurses5-dev \
libgtk2.0-dev libatk1.0-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev \
python3-dev git ctags

Ubuntu 18.04

sudo apt install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev \
python3-dev git ctags

Installation process

git clone https://github.com/rapphil/vim-python-ide.git && \
cd vim-python-ide && ./install.sh

It seems that plugin rope is causing some errors, just comment it out in ~/.vimrc in line 5

 " Plug 'python-rope/ropevim' 

Here we also disable open NerdTree while open vim in line 45

" autocmd VimEnter * NERDTree

Add the following to the last line of ~/.vimrc to allow to save and run code

autocmd vimEnter *.py nmap <F9> <Esc>:w<CR>:!clear;python %<CR>                 
autocmd vimEnter *.cpp map <F9> :w <CR> :!clear ; g++ --std=c++17 %; if [ -f a.out ]; then time ./a.out; rm a.out; fi <CR>

Add vim-ros (Optional)

Make sure you have ROS installed, and Python3 could find it.

cd ~/.vim/plugged
git clone https://github.com/ARG-NCTU/vim-ros

Add or uncomment to ~/.vimrc

Plug 'ARG-NCTU/vim-ros'

Basic Usages in Vim

Check the Cheat Sheet.

Buffer vs. Window

  • Window: we will have the file tree, code editor, and file structure (showing classes/functions/...)
  • Buffer: while we open multiple files to edit
  • Move around between windows: Ctl ww
  • Move around between tabs: Tab or Shift Tab

Key bindings

Action Mode key binding
Toogle Nerdtree Normal crtl + n
Toogle Tagbar Normal f8
Run Python. Normal f9
Switch Focus Normal crtl + ww
Expand snippet Insert tab
-------------------------- ------------------ -----------------
Look for file Normal crtl + p
Goto definition Normal crtl + ]
Show docstring Normal K
Extract method Normal/Visual crlt + c r m
Auto complete Insert crtl + space

Run Python in normal mode

:!clear; python %

Features

Please check the available features and the plugins that enable them.

Syntax Highlighting

Syntax highlighting for several languages, besides Python.

Powered by:

Color Themes

Several popular color schemes:

  • Monokai
  • Gruvbox
  • Much more

Powered by:

Project Navigation

Easily navigate your project using:

  • File tree explore (Nerdtree)
  1. Ctl n to toggle the tree explorer
  2. Use Ctl ww to switch windows
  3. To close all:
:qa or :wqa
  1. ~/.vimrc has set to toggle file tree by Ctl + n

  • Fuzzy finder based on the file names
  1. Ctl + p, and search for your file to open and hit Enter. This will open it in "buffer"
  2. You could switch between buffers by Tab or Shift + Tab
  3. It appears that you could start it in your project folder

  • File structure (classes, functions, methods).
  1. You could press to show the file structure.
  2. Use Ctl ww to set focus on window Tagbar. You could move the function/class for a quick navigation

Powered by:

Powerfull Full Text search

  • Full text search based on both exact match and fuzzy finder capabilities
  • Extremely fast.

Powered by:

Real time linting

Lint source files in real time an check for errors and warnings.

Powered by:

Code navigation

  • Go to function definitions
  • Check parameters and docstrings easily.

Powered by:

Code refactoring

Extract methods, variables and rename functions easily.

Powered by:

Code completion

Use hints and dialog boxes to speed your development using code completion.

Powered by:

Snippets

Snippets save time while you type and creates standardization for your code.

Powered by:

Git Integration

Perform git operations and highlight changes in the repo.

Powered by:

Commands

Command Description Command
Look for string :Rg <string>
git status :Gstatus
git diff :Gdiff

vim-ide's People

Contributors

ezrafollower avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.