Vim, Javascript and Tern
howto vim, js & tern
Tags:
GNU/Linux
Vim
JS
Vim, Javascript and Tern
- Install https://github.com/tpope/vim-pathogen
- Add “execute pathogen#infect()” in your ~/.vimrc
- cd ~/.vim/bundle
- git clone https://github.com/ternjs/tern_for_vim.git
- In ~/.vimrc add “let g:tern_map_keys=1”
- Open js file in vim and then use following mapping to explore Shortcut
| Shortcut |
Command |
Description |
| td |
:TernDoc |
Documentation under cursor |
| tb |
:TernDocBrowse |
Browse documentation |
| tt |
:TernType |
Type hints |
| td |
:TernDef |
Jump to definition (yes, ‘td’ is duplicated) |
| tpd |
:TernDefPreview |
Jump to definition inside preview |
| tsd |
:TernDefSplit |
Definition in new split |
| ttd |
:TernDefTab |
Definition in new tab |
| tr |
:TernRefs |
All references under cursor |
| tR |
:TernRename |
Rename variable |
- Note default Leader is ‘\’
- On Debian Gnu/Linux one needs to add vim-python
apt-get install vim-python-jedi
apt-get install vim-nox
Tags:
GNU/Linux
Vim
JS
Updated on: 2016-02-03