Vim plugin for XO
49
stars
5
commits
Vim Script
primary language
Jan 29, 2024
updated
$ git clone --depth=1 https://github.com/xojs/vim-xo ~/.vim/bundle/vim-xo
Plugin 'xojs/vim-xo' to ~/.vimrc:PluginInstall or $ vim +PluginInstall +qallNeoBundle 'xojs/vim-xo' to ~/.vimrc:source ~/.vimrcPlug 'xojs/vim-xo' to ~/.vimrc:PlugInstall or $ vim +PlugInstall +qallThis plugin automatically registers XO as a syntax checker with Syntastic.
To activate XO, put the following in your .vimrc file:
let g:syntastic_javascript_checkers = ['xo']
let g:syntastic_typescript_checkers = ['xo']
See the Syntastic docs for more.
Formatting with vim-autoformat will just work (since this plugin uses npx xo).
You do not need to install xo globally (and if it is installed globally, then please remove it as global installation is deprecated).
Once you install vim-autoformat, you will need to add the following to your ~/.vimrc:
+" vim-autoformatter
+" https://github.com/vim-autoformat/vim-autoformat
+let g:autoformat_autoindent = 0
+let g:autoformat_retab = 0
+let g:autoformat_remove_trailing_spaces = 0
+let g:formatters_javascript = [ 'xo_javascript' ]
+let g:formatters_typescript = [ 'xo_typescript' ]
If you'd like your code to be formatted on save (instead of typing :Autoformat in vim buffer), then also add this line to your ~/.vimrc:
+au BufWrite * :Autoformat
See vim-autoformat's "How to use" section for more information.
MIT © Sindre Sorhus
3 commits
2 commits
Vim Script
100.0%
Vim plugin for XO
49
stars
5
commits
Vim Script
primary language
Jan 29, 2024
updated
$ git clone --depth=1 https://github.com/xojs/vim-xo ~/.vim/bundle/vim-xo
Plugin 'xojs/vim-xo' to ~/.vimrc:PluginInstall or $ vim +PluginInstall +qallNeoBundle 'xojs/vim-xo' to ~/.vimrc:source ~/.vimrcPlug 'xojs/vim-xo' to ~/.vimrc:PlugInstall or $ vim +PlugInstall +qallThis plugin automatically registers XO as a syntax checker with Syntastic.
To activate XO, put the following in your .vimrc file:
let g:syntastic_javascript_checkers = ['xo']
let g:syntastic_typescript_checkers = ['xo']
See the Syntastic docs for more.
Formatting with vim-autoformat will just work (since this plugin uses npx xo).
You do not need to install xo globally (and if it is installed globally, then please remove it as global installation is deprecated).
Once you install vim-autoformat, you will need to add the following to your ~/.vimrc:
+" vim-autoformatter
+" https://github.com/vim-autoformat/vim-autoformat
+let g:autoformat_autoindent = 0
+let g:autoformat_retab = 0
+let g:autoformat_remove_trailing_spaces = 0
+let g:formatters_javascript = [ 'xo_javascript' ]
+let g:formatters_typescript = [ 'xo_typescript' ]
If you'd like your code to be formatted on save (instead of typing :Autoformat in vim buffer), then also add this line to your ~/.vimrc:
+au BufWrite * :Autoformat
See vim-autoformat's "How to use" section for more information.
MIT © Sindre Sorhus
3 commits
2 commits
Vim Script
100.0%