search

Home  >  Q&A  >  body text

vimrc - Hello everyone, I just started using vim. I am a front-end developer who writes html, css, and js. Any recommendations for good syntax highlighting plug-ins?

This kind of vim that comes with it is really too thin.

Please help me introduce a few. Thanks.

ringa_leeringa_lee2773 days ago1048

reply all(5)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-05-16 16:36:52

    First download or compile the latest Gvim 8.0 yourself

    Use vim under Windows, you can
    vim write the web, you can also
    but use the vim that comes with msysGit to write the web, this is the first time

    msysGit contains an incomplete MSYS environment, and the vim that comes with
    msysGit is also an incomplete vim.

    Find a complete vim first, and then discuss plug-in issues

    The following are plug-ins that are helpful for WEB development.
    Refer to the plug-in manager tutorial you are using. Don’t ask me whyPlug Command error

    Plug 'othree/html5.vim'
    
    Plug 'hail2u/vim-css3-syntax'
    Plug 'groenewege/vim-less'
    Plug 'tpope/vim-haml'
    
    Plug 'pangloss/vim-javascript'
    Plug 'kchmck/vim-coffee-script'
    Plug 'leafgarland/typescript-vim'
    
    " 补充一个 Vue 模板的
    Plug 'posva/vim-vue'
    
    " HTML 助手
    Plug 'mattn/emmet-vim'
    
    " JavaScript 补全
    Plug 'ternjs/tern_for_vim'
    
    " 色彩高亮,例子: #66CCFF
    Plug 'gorodinskiy/vim-coloresque'
    

    Personally, I suggest you still use itGitHub Atom 或者 VS Code


    The questioner said in the comments that he doesn’t like gvim because it’s not concise, so I’ll add some pictures

    This is the Gvim you see

    This is my Gvim

    This is vim on my VPS

    The same configuration, without any modification, works across Windows/Linux, GUI/CLI.

    Excuse me, what is the difference between the second picture and the third picture?


    There are two types of Vim: one for others and one for you.

    The tool that suits you best is the one you configure yourself

    I like vim not because it’s cool or because I can show off.
    But because of its high degree of freedom, customizability, and strong scalability

    Sublime Text extension is based on Python Python
    GitHub Atom 扩展基于NodeJS
    而vim,支持+lua, +mzscheme+perl, +python, +python3, +ruby, +tcl,并且自身也有一门语言叫做vimLGitHub Atom extension is based on NodeJS
    And vim supports +lua, +mzscheme , +perl, +python, +python3, +ruby, +tcl , and it also has its own language called vimL
    Simply put, you can write vim plug-ins in any of the above languages.

    For example:
    • luaUse

      extension: https://github.com/Shougo/neo...
    • python/python3Use

      extension: https://github.com/SirVer/ult...
    • rubyUse

      extension: https://github.com/wincent/co...
    • CIt’s no problem to write native extensions using

      : https://github.com/Shougo/vim...
    • GoBackground call

      Engine written: https://github.com/vim-ctrlsp...
    • JSBackend call

      module: https://github.com/ternjs/ter...


    High freedom also comes at a price, that is, the default configuration or even zero configuration is very unfriendly. Ctrl-V为粘贴,而正常情况下Ctrl-VFor example, the default configuration of Gvim for windows will map
    to block selection.

    This is why the threshold for vim is too high.
    • You flip through the Vim documentation and set the parameters you want to set. 🎜
    • You need a certain function, but vim does not have it built-in, so you go to vim-script to find a plug-in.

    • There are too many plugins and the files are too messy, so you learn to use the Plugin Manager and use git to update plugins from GitHub.

    • A certain plug-in does not suit your needs, so you start to learn vimL the language and write the plug-in yourself.

    • A certain plug-in requires support from other languages ​​such as +python+lua, so you start to compile vim yourself.

    • You think your vim is very powerful and can do things other than editing:

      • Manage database

      • Manage git repo

      • Stock Operation

      • Watch the comments during the live broadcast

      • Watch the news

      • On Twitter

      • Play Tetris

      • Watch the video Bad apple!

      • What the hell are these

    • Publish your configuration/plugin package for others to refer to. For example, @liuchengxu’s classmate’s space-vim

    • downstairs

    Once you get started, you don’t need to consider other editors at all.
    Accept all the platforms you know and don’t know! Take in all the grammar you know and don’t know!


    As for Vim’s editing mode:

    Why do all mainstream editors/IDEs that support extensions have vim plug-ins?

    • Sublime Text: https://packagecontrol.io/pac...

    • GitHub Atom: https://atom.io/packages/vim-...

    • Visual Studio: https://marketplace.visualstu...

    • Visual Studio Code: https://marketplace.visualstu...

    • Eclipse: http://eclim.org/

    • PyCharm/IntelliJ IDEA: http://plugins.jetbrains.com/...

    • Xcode: https://github.com/XVimProjec...

    Non-editor: bash, zsh, tmux, Firefox, Chrome There is also vim mode or plug-in


    The last important point:

    Vim is just an editor

    Vim is just an editor

    Vim is just an editor

    For debugging and other things, IDE must be convenient, so I never recommend vim for newbies.
    Newbies who are interested in vim, I am willing to help.

    Vim source code:
    https://github.com/vim/vim

    Gvim for Windows:
    https://github.com/vim/vim-wi...


    Tell me a cold joke: The artifact Sublime Text
    The world is huge, and there are many you have never seen

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-16 16:36:52

    This is the first time I saw someone using VIM to write front-end code. And it is probably for the Win platform. Who is your teacher?

    Front-end code does not need to be written in Vim.

    sublime and atom are both good. Search for yourself.

    reply
    0
  • 迷茫

    迷茫2017-05-16 16:36:52

    Change colorscheme

    a list of commonly used colorschemes -- vim-galore

    Or configure it carefully. If you use Linux or macOS, I would shamelessly recommend: space-vim

    But windows, not tested yet...

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 16:36:52

    http://vimcolors.com/

    Widely used solarized

    reply
    0
  • PHPz

    PHPz2017-05-16 16:36:52

    Writing code in vim is a cool behavior, but it is just cool

    reply
    0
  • Cancelreply