Coder Social home page Coder Social logo

vim's Introduction

Introduction

My vimrc.
Most used languages: C/C++, Golang, Python2/Python3, Java/Scala, Shell, Lua, Rust, PHP

Plugins

Install

Install with vim-plug.

cd ~ && /bin/rm -rf .vim && git clone https://github.com/niumeng07/vim.git .vim --recursive
vim +PlugInstall 
wget https://github.com/google/google-java-format/releases/download/google-java-format-1.9/google-java-format-1.9-all-third_party.jar ~/.vim/third_party/format
or download latest version from https://github.com/google/google-java-format/releases/

third-party

  1. go support
vim +GoInstallBinaries
npm i -g neovim
go get -u github.com/stamblerre/gocode
  1. support for ag
brew install the_silver_searcher
# For Ubuntu, apt-get install the_silver_searcher
# For CentOS, yum install the_silver_searcher
  1. third_party of coc.
# curl -sL install-node.now.sh/lts | sh
brew install node

yarn is necessary if install coc from source.

alias vim="PATH=$HOME/.vim/third_party/yarn/bin:$PATH vim"
$HOME/.vim/third_party/yarn/bin/yarn add coc-json coc-snippets

If coc can't find package.json, delete ~/.config/coc/extensions/node_modules/* and reinstall coc-plugins.

vim -c "PlugUpdate"
vim -c "CocInstall coc-explorer coc-floaterm coc-git coc-pairs coc-prettier coc-lists coc-marketplace|q"
vim -c "CocInstall coc-vetur coc-rls coc-solargraph coc-calc coc-translator coc-yank|q"
vim -c "CocInstall coc-phpls coc-vimlsp coc-go coc-html|q"  # langserver
vim -c "CocInstall coc-java coc-json coc-xml coc-yaml coc-css coc-emmet coc-tslint coc-tsserver|q"
vim -c "CocInstall coc-dictionary coc-word coc-snippets coc-tag coc-ultisnips coc-gocode|q"  # completion
# vim -c "CocInstall coc-omni|q" # will block vim on completion
# vim -c "CocInstall coc-tabnine|q" # Too much cpu used.
# vim -c "CocInstall coc-ccls coc-sh|q"  # Use language server instead.
# vim -c "CocInstall coc-syntax|q"  # get words from syntax for completion, use coc-dictionary/coc-word instead.
# vim -c "CocInstall coc-highlight|q" # call Node, too much CPU used.
vim -c 'CocUpdateSync|q'

Install coc dependencies:

./coursier bootstrap \
  --java-opt -Xss4m \
  --java-opt -Xms100m \
  --java-opt -Dmetals.client=coc.nvim \
  org.scalameta:metals_2.12:0.9.9 \
  -r bintray:scalacenter/releases \
  -r sonatype:snapshots \
  -o /usr/local/bin/metals-vim -f

coc-java cashe: Version 57 of JDT Lang Sever works fine https://download.eclipse.org/jdtls/milestones/0.57.0/

Quick hack for those who are facing this issue Replace all directories/files in ~/.config/coc/extensions/coc-java-data/server with directories/files from above extracted JDT lang server tar.

Try build coc if errors found following coc updates.

cd ~/.vim/plugged/coc.nvim && $HOME/.vim/third_party/yarn/bin/yarn install --frozen-lockfile && cd -

Or config in plugin configs.

Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'yarn install --frozen-lockfile'}
  1. Python support
# vim -c "CocInstall coc-python" # Too much CPU used.
vim -c "CocInstall coc-pyright"
  1. C++ support build ccls from source.
git clone https://github.com/MaskRay/ccls --recursive
cd ccls
brew info llvm
cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/local/Cellar/llvm/<Your Version>/lib/cmake
cmake --build Release
cd Release
make -j
sudo make install
  1. hack nerd font
brew install homebrew/cask-fonts/font-hackgen-nerd --cask
  1. font
brew tap homebrew/cask-fonts
brew install --cask font-hack-nerd-font
  1. floaterm for neovim
sudo pip3 install neovim-remote
  1. Other Language Support
npm i -g sql-language-server
npm i -g bash-language-server
go get github.com/mattn/efm-langserver
# or
# brew install sql-language-server
# brew install bash-language-server
# brew install efm-langserver
sudo pip3 install cmake-language-server
npm install -g dockerfile-language-server-nodejs
sudo pip install 'python-language-server[all]'
sudo pip3 install 'python-language-server[all]'
sudo pip install pynvim
sudo pip3 install pynvim
sudo pip install vim-vint
sudo pip3 install vim-vint

Plugins deprecated

vim's People

Contributors

mllearn avatar niumeng07 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

genvia nonunu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.