README.md

February 28, 2019 ยท View on GitHub

WebVim is a Vim based distribution targeting JavaScript and Web development.

It targets :

  • JavaScript development (ES5, ES6, node.js)
  • HTML5
  • CSS3 and SCSS

And contains the features you expect from a modern code editor :

  • syntax highlighting
  • syntax and error checking
  • autocompletion
  • multi cursor
  • git support
  • code format
  • support coding conventions (editorconfig)
  • hardcore mode (for real Vim users)
  • Emmet support
  • jsdoc generation (coming soon)
  • debugging (coming soon)
  • grunt/gulp support (coming soon)
  • all the awesomeness from Vim

The WebVim idea is to provide you a vim distribution: something that comes prepackaged, preconfigured, built on a kernel to serve a goal. WebVim is to vim what Debian is to Linux, a vim distribution for the web.

Install

Only tested on Linux

Dependencies (the long story)

On Ubuntu (from 15.04)

  1. A modern version of Vim
apt-get install vim vim-runtime vim-gui-common

or compile a recent version with xterm_clipboard and ruby or python support.

  1. Some tools to compile YouCompleteMe
apt-get install build-essential cmake python-dev exuberant-ctags
  1. Node.js and npm
curl -sL https://deb.nodesource.com/setup_0.12 | bash -
apt-get install -y nodejs
  1. Some npm packages
npm install -g eslint csslint jshint jsonlint handlebars

Dependencies (the short story)

Please report me what you did to make it work on your OS

Fedora 23/24

sudo dnf install cmake python-devel npm vim
npm install -g npm eslint csslint jshint jsonlint handlebars

Install it:

git clone https://github.com/krampstudio/webvim.git ~/.vim
ln -s ~/.vim/.vimrc ~/.vimrc
ln -s ~/.vim/.tern-project ~/.tern-project
vim

The plugins install can take some times, especially since there's a compilation made by YouCompleteMe. If you've the feeling the install has frozen, you can finish the install after by entering the command :PlugInstall.

Hardcore mode

The hardcore mode remap some keys to force you use Vim in a productive way:

  • no arrow keys for moving instead use the common Vim movement commands.
  • in insert mode, use jk to switch back to normal mode instead of <esc>

Restricting commands is the best way to make your fingers learn. After one or two days, you should be more productive and have learned lots of Vim commands.

You can disable the hardcore mode by setting the value of g:hardcoreMode to 0 in .vimrc. You can also change the mappings.

Usage

Vim

WebVim is only a Vim distribution with plugins and configuration, so all common Vim commands and basic mapping are available. You must know how to use Vim before using this IDE. If you're not comfortable with Vim enough I suggest you to take the interactive Vim tutorial (run vimtutor in a terminal), and keep a common usage cheat sheet close to you until your fingers get all the mappings in memory.

WebVim

CommandModeContext
Plugins
Install Plugins:PlugInstalln
Update Plugins:PlugUpdaten
Config
Edit .vimrc<leader>evn
Reload .vimrc<leader>svn
File Tree (NERDTree)
Toggle Tree<c-n>n
Open a node in a new tabtTree Node
Change RootCTree Node
Tree menumTree Node
Add a fileaTree Menu
Delete a filedTree Menu
Move a filemTree Menu
Copy a filecTree Menu
Search in files (grep)gTree Menu
Next match in grep:cnGrep > Quickfix
Move to left tab<s-left>n
Move to right tab<s-right>n
Change window (ie. tree to tab)<c-w><c-w>
Help?Tree
Documentation:help NERDTree
Comment
Toggle comments<c-/>nv
Comments<leader>ccnv
Sexy Comments<leader>csnv
UnComments<leader>cunv
Yank and Comments<leader>cynv
Documentation:help NERDCommenter
Align
Start interactive alignmentEasyAlignvselection
Align next paragraph on =<leader>a=n
Align next paragraph on :<leader>a:n
Align next paragraph on delimiter x<leader>axn
Right align selection on =<leader>a=v
Right align selection on :<leader>a:v
Right align selection on x<leader>axv
Documentation:help :EasyAlign
Format
Format the file<c-f>njs,json,html,css
Format the selection<c-f>njs,json,html,css
Multiple Cursor
Start multiple cursor<c-m>vVisual Block
Multiple cursor insertimultiple cursor
Multiple cursor removexmultiple cursor
Leave multiple cursor<esc>multiple cursor
Paste
cycle backward through your history of yanks<leader>pnvafter paste p
cycle forward through your history of yanks<leader>Pnvafter paste p
AutoCompletion
Select next proposal in menu<tab>icomplete menu
Select previous proposal in menu<shift><tab>icomplete menu
Syntax checking
Checkers infos:SyntasticInfon
Check:SyntasticCheckn
Toggle check:SyntasticToggleModen
Error window:Errorsn
Jump next error:lnextn
Jump previous error:lprevn
JavaScript
Get type<leader>gtnunder cursor
Get documentation<leader>gdnunder cursor
Go to<leader>gonunder cursor
Jump to definition<leader>gfnunder cursor
Go to references<leader>grnunder cursor
Rename<leader>rnunder cursor
Jump to the source of a requiregfnnode.js, cursor
Edit the main file of a CJS module:Nedit modulennode.js
Edit a file of a CJS module:Nedit module/foo.jsnnode.js
Edit projects main (from package.json):Neditnnode.js
Git
git diff:Gdiffn
git status:Gstatusn
git commit:Gcommitn
git blame:Gblamen
git mv:Gmoven
git rm:Gremoven
Open the current file in Github:Gbrowsen
Spell Check
Enable checkingset spelln
move to the next misspelled word]sn
move to the previous misspelled word[sn
add a word to the dictionaryzgn
undo the addition of a word to the dictionaryzugn
view spelling suggestions for a misspelled wordz=n
Search
clear highlights<c-l>n
Editing
Move line up<leader>-nv
Move line down<leader>_nv
Wrap in single quote<leader>'nv
Wrap in double quote<leader>"nv
Emmet
Expand abbreviation<c-k>,ihtml,css,scss
Next sections to come soon

Modes :

  • n normal
  • i insert
  • v visual

Commands :

  • :command a Vim command
  • :set something can also be replaced by :setlocal something to apply it to the current buffer only
  • <c-m>a or a a keyboard command
    • <c-/> means CTRL and /` (this is the Vim notation)
    • <s-left> means Shift and left arrow
    • <c-a>b means CTRL and a, then b
    • <leader> is mapped to ,
    • <localleader> is mapped to \

Plugins

WebVim is only a distribution that contains plugins. The plugin authors have made the hard work.

Plugin authors rocks!

Plugin

  • vim-plug Minimalist Vim Plugin Manager

User interface

Manage your project

Code writing

Code reading

History

  • 1.3.0 Fixed dependencies, tern via YCM, Emmet, new theme, nerdtree grep, use local linters
  • 1.2.0 Fix #28, support new esint config files, update installe
  • 1.1.0 Add user config, autocmd file, fix easyalign mapping, update Nerdtree config, better mouse support in insert mode
  • 1.0.0 Becomes webvim with an install process, a better configuration system, better plugins neighborhood
  • 0.1.0 A basic dotvim repository with my own Vim configuration

Contributing

Every contribution is more than welcomed. You can:

  • report issues
  • Fix, improve the configuration, add new features. The best is to fork and submit a pull request
  • Test and adapt to other OS
  • Fix my English mistakes
  • Update the documentation
  • Create a better logo
  • Offer me a coffee

Donate using Liberapay

License

The content of this repository is licensed under the GPLv3