简体   繁体   English

使用vim作为javascript开发的工具吗?

[英]Use vim as an ide for javascript development?

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. 我正在尝试为某种IDE尝试使用VIM,在大多数情况下,我已经安装了vimrc ,看起来很不错。

What I'm missing is linting configuration for syntax errors and what not, some sort of intellisense (which I think vim-javascript does). 我所缺少的是为语法错误添加配置,而不是配置某种intellisense(我认为vim-javascript可以做到)。

From what I've read, vim-pathogen is the way to install vim specific plugins. 根据我的阅读, vim-pathogen是安装vim特定插件的方法。

I've followed the documentation in vim-javascript on how to install using pathogen. 我已遵循vim-javascript中的文档说明如何使用病原体进行安装。 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. 我尝试将配置添加到我的.vimrc文件,但是我认为我做的不正确。

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

First mistake: considering Vim as an IDE. 第一个错误:将Vim视为IDE。

Second mistake: using someone else's setup. 第二个错误:使用其他人的设置。

Third mistake: thinking you can get away without learning Vim. 第三个错误:认为无需学习Vim就可以脱身。

Anyway… 无论如何…

  • There's no such thing as ~/.vim_runtime . 没有~/.vim_runtime这样的东西。 Your user-level runtime directory is ~/.vim . 用户级别的运行时目录为~/.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 . 通过:help make可以完成“语法错误和其他错误”。 Read it (and the related sections) instead of installing pointess plugins. 阅读它(以及相关章节),而不是安装Pointess插件。

  • "some sort of intellisense" is already built-in; “某种智能感知”已经内置; it's called "omni-completion" and you can read about it in :help ins-completion . 它称为“ omni-completion”,您可以在: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. Vim不会自动补全。 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 . 您可以在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. 从系统中删除它,然后从头开始,而不是放弃对随机的半无知的蛋igno的控制。 The only thing you can achieve with distributions like these is never learning your tools properly. 使用此类发行版唯一可以实现的目标就是永远不会正确学习工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM