Notes on Ubuntu (Linux) computing

Brief notes on installation, setup and other tasks in the Ubuntu world

Posts Tagged ‘vim plugin

Install vim-template vim plugin

leave a comment »

The vim-template plugin allows for the use of templates for different file types: *.html, *.py and so on. Following the installation instructions (see above link), we use pathogen to install the plugin:

cd ~/.vim/bundle
git clone git://github.com/aperezdc/vim-template.git

Use of plugin

Now, you can make use of the templates when starting vim. For example, a python template is loaded by recognition of the *.py filename:

vim test.py

Or, if you have new buffer, type the following for the template to be loaded inside vim:

:Template py

The available templates can be seen here. Using the pathogen installation described above, these templates are located (on your machine) at ~/.vim/bundle/vim-template/templates/.

Customization

If you want to customize certain fields, like email and username, you can add the following to your .vimrc file:

" Customize the settings for vim-template plugin                                
let g:email = "desiredemail@gmail.com"
let g:user = "Desired Name"                                         
let g:license = "Desired License"

If you want to customize the templates, there is a search order for templates (see here) allowing you to write your own template-files and store them in the local directory.

Advertisements

Written by Chris S

November 7, 2013 at 7:28 pm

Posted in computing, Java, LaTeX, Python, R

Tagged with , , , ,

Install Tagbar vim plugin

leave a comment »

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

:TagbarToggle

Testing with *.py and *.tex files indicate the basics are working.

Written by Chris S

April 12, 2013 at 8:21 pm

Install NERD tree vim plugin

with one comment

In the previous post I installed the vim package manager pathogen. Now we take advantage of this tool to install nerdtree for browsing local directories inside vim.

Install with

cd ~/.vim/bundle
git clone https://github.com/scrooloose/nerdtree.git

Nest, start a vim session and type

:help NERD_tree.txt

To toggle the directory listing between visible and hidden states use

:NERDTreeToggle

Written by Chris S

April 12, 2013 at 5:34 pm

Install pathogen.vim

with 6 comments

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:

vim ~/.vimrc

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.

More Information

[1] Pathogen github site
[2] logicalfriday.com post

Written by Chris S

April 11, 2013 at 11:33 pm