My vim configuration for daily dev and writing on Ubuntu
[update 2021.3.25]
In the recent typescript/javascript project, I've updated a bunch of plugins and configration to have a better experiece to read and write code.
TypeScript support plugins:
Please the following config into ~/.vimrc.bundle.local file:
Bundle 'leafgarland/typescript-vim' " TypeScript syntax
Bundle 'maxmellon/vim-jsx-pretty' " JS and JSX syntax
Bundle 'jparise/vim-graphql' " GraphQL syntax
Install them with command in vim: BundleInstall
code completions
recently the Coc.nvim as a swiss-army knife of a vim plugin improve the development expreience in vim so much better, you can code link in VSCode.
put following into ~/.vimrc.bundle.local file:
'neoclide/coc.nvim' , { 'branch' : 'release' }
Install them with BundleInstall.
Now run
:CocInstall coc-tsserver
to install the tssserver extension.
and some other usefull extension
:CocInstall coc-eslint coc-json coc-prettier coc-css coc-angular
Now you can already see the language server errors highlighted in the gutter and cursoring over the errors will display the related error/warning message.
Enjoy coding in vim
[original post]
Project development VIM configuration
The easiest solution I used for my daliy development is to install this all-in-one package to have a full customized vim. It includes a bunch of plugins to be good enough for the developers. I can use it to develop the Python projects without further customization.
It is using Vundle to manage the vim plugins, it contains some features plugins like file navigation plugin NERDTree, file find plugin ctrlp, integrated multiple lanaguage syntax, highlight and flake checking, etc. It works very well with Python, you can use the amazing autocomplete feature.
Writing VIM configuration
After writing the plain document with the above built-in plugins in my VIM, I do want to have a distraction-free writing environment in Vim. After some research, I found reach my ambition is rather complicated than I anticipated. Eventually after hours' experimentation, I finally combined some attractive plugins to work as I expected:
goyo is the best plugin I used for full-screen writing as a distraction-free environment to help your to keep focusing on what you are writing.
goyo works pretty well on both of the console vim and GVim. Usually I only use the console vim to edit all the code and document in English, but thing will get a little tricky when I edit Chinese article in console vim, because of the default Chinese font rendering is not perfect on Linux, and we can't configure the customized font within console vim.
but font can be re-config in GVim, so after tryings, I found it's perfect to use GVim only when I edit Chinese document.
limelight works like the AIWriter, make you hyper focus on your current writing paragraph.
You need to make sure 256-color terminal:
export TERM=xterm-256color
vim-pencil provides powerful features for wirters to focus narrowly on the writings. you can switch between the soft line wrap(one paragraph per line) and hard line breaks(break each lines less than 80 charactors or other value your customized).
Other useful plugins
vim-ctrlspace provides a comprehensive solution to manage the tabs/buffers/files/sessions/bookmarks in Vim.
[vim-markdown]