Archive for April 2013
The jedi plugin will allow nice autocomplete features when developing Python code. First we install the python package using pip
sudo pip install jedi
cd ~/.vim/bundle git clone https://github.com/davidhalter/jedi-vim.git
To take advantage of new powers, try these basic commands
- cntrl-space — autocomplete partially type function/class and see args
- shift-k — use pydoc to find function/class documentation
Install pip (a python package manager) on Ubuntu 12.04 using the command
sudo apt-get install python-pip
Install packagename with the command
sudo pip install packagename
The vim plugin Tagbar provides a listing of classes, functions, etc when coding in vim.
Tagbar requires Vim 7.0 and Exuberant ctags 5.5. We install the later in Ubuntu 12.04 with the command
sudo apt-get install exuberant-ctags
Next, install tagbar with pathogen
cd ~/.vim/bundle git clone git://github.com/majutsushi/tagbar
Toggle the code browser between visible and hidden using
Testing with *.py and *.tex files indicate the basics are working.
cd ~/.vim/bundle git clone https://github.com/scrooloose/nerdtree.git
Nest, start a vim session and type
To toggle the directory listing between visible and hidden states use
I am moving to vim as my main editor. To customize the environment, there are many plugins that make vim more powerful and easier to use. To start, I will install the plugin manager called pathogen. I will follow the install method detailed there and you should check the site for updates before proceeding.
mkdir -p ~/.vim/autoload ~/.vim/bundle; curl -Sso ~/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
If the above doesn’t work because you don’t have curl installed, that is easy to remedy
sudo apt-get install curl
If you are new to vim and do not have a .vimrc file, create one with vim:
and paste the following lines in a minimal .vimrc file
" Pathogen execute pathogen#infect() call pathogen#helptags() " generate helptags for everything in 'runtimepath' syntax on filetype plugin indent on
Otherwise, make sure these lines are added to your .vimrc file.