Skip to content

Instantly share code, notes, and snippets.

@amirphl
Last active May 19, 2023 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amirphl/219ebfc7395f937e347be9dd30107668 to your computer and use it in GitHub Desktop.
Save amirphl/219ebfc7395f937e347be9dd30107668 to your computer and use it in GitHub Desktop.
make vim a good editor for Golang and Scala

To switch back between Golang and Scala: init.vim and init.lua

Golang

I followd the guide provided by this guy (https://octetz.com/docs/2019/2019-04-24-vim-as-a-go-ide/) and faced some problems:

  • The vim.plug should be copied inside ~/.config/nvim/autoload/ not ~/.var/app/io.neovim.nvim/data/nvim/site/autoload/.
  • The command :GoInstallBinaries installs the binaries like gopls (in my case) inside $HOME/go/bin. Therefore, $HOME/go/bin must be appended to the $PATH variable.
if [ -d "$HOME/go/bin" ] ; then
  PATH="$PATH:$HOME/go/bin"
fi
  • gcc was not installed by default in my distribution (Ubuntu 20.04) while it was necessary for installation of some binaries.
    • To install gcc:
    apt install build-essential
    
    To verify installation:
    gcc --version
    
  • :GoInstallBinaries didn't install gocode, gocode-gomod, gogetdoc, golint, gometalinter.
    • To install golint:
    apt install golint
    

Additional Notes

  • Remove nvim using apt-get.
  • Install nvim using app image.
  • Move nvim app image to /use/bin/nvim.
  • Point vim to nvim (alias in .bashrc).
  • ~/.config/nvim: nvim dir
  • ~/.config/nvim/autoload/plug.vim: for loading plugins
  • coc: language server (nvim has also LSP itself)
  • init.vim: LSP key bindings, etc.
  • ~/.vim: Pluggins are installed here.
  • init.lua vs init.vim

References

Scala

Java

CPP

TODO

PackerInstall, PlugInstall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment