Use vim as an ide for javascript development?

1.8k views Asked by At

I'm looking on trying out VIM for an IDE of some sort, I've installed vimrc for the most part it looks pretty decent.

What I'm missing is linting configuration for syntax errors and what not, some sort of intellisense (which I think vim-javascript does).

From what I've read, vim-pathogen is the way to install vim specific plugins.

I've followed the documentation in vim-javascript on how to install using pathogen. I notice after installing that I see text colors differently but I still don't get autocomplete of any sort.

I tried adding the configurations to my .vimrc file but I don't think I'm doing it right.

Here's what it looks like:

set runtimepath+=~/.vim_runtime

 execute pathogen#infect()
 source ~/.vim_runtime/vimrcs/basic.vim
 source ~/.vim_runtime/vimrcs/filetypes.vim
 source ~/.vim_runtime/vimrcs/plugins_config.vim
 source ~/.vim_runtime/vimrcs/extended.vim
 let g:javascript_plugin_jsdoc = 1
 let g:javascript_plugin_ngdoc = 1
 let g:javascript_plugin_flow = 1
 set foldmethod=syntax

 try
 source ~/.vim_runtime/my_configs.vim
 catch
 endtry
1

There are 1 answers

2
romainl On BEST ANSWER

First mistake: considering Vim as an IDE.

Second mistake: using someone else's setup.

Third mistake: thinking you can get away without learning Vim.

Anyway…

  • There's no such thing as ~/.vim_runtime. Your user-level runtime directory is ~/.vim.

  • Pathogen is not a way to "install" plugins. It's a way to "enable" plugins. There are many plugins for installing plugins (which doesn't really make any sense), and you can simply install them manually, which is a lot easier than random bloggers would like you to think.

  • "Syntax errors and what not" is done via :help make. Read it (and the related sections) instead of installing pointess plugins.

  • "some sort of intellisense" is already built-in; it's called "omni-completion" and you can read about it in :help ins-completion. That plugin only provides an alternative syntax script (for syntax highlighting, mostly), an alternative indent script, and an alternative omni-completion script.

  • Vim doesn't do autocompletion. It's totally unnecessary but if you really want it you can get it via some third-party plugins. You can find them in the "script" section of http://www.vim.org.

  • That crappy over-engineered setup will get you nowhere. Remove it from your system and start again from scratch instead of abandoning control to random semi-ignorant gittards. The only thing you can achieve with distributions like these is never learning your tools properly.