Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.
/ golangIDE Public archive

A neovim based golang IDE in the docker environment. Based on alpine.

License

Notifications You must be signed in to change notification settings

ericwq/golangIDE

Repository files navigation

Deprecated

gccIDE is merged to nvide.

golangIDE

A neovim based golang IDE, based on alpine linux, go language server enabled, syntax highlight IDE. Just pull docker image from hub.docker.com and run it.

Update

  • 2021.12.7 v0.6.9 update to go 1.17.4.

Features

For a full list of integrated softwares, please run % apk info in golangIDE.

  • neovim - Vim-fork focused on extensibility and agility.
  • golang - The Go programming language.
  • bash - The GNU Bourne Again shell.
  • git - Distributed version control system
  • htop - Interactive process viewer.
  • gopls - The go language server.
  • vim-go - Go development plugin for Vim.
  • coc.nvim - Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
    • coc-go - Go language server extension using gopls for coc.nvim.
    • coc-json - Json language extension for coc.nvim.
    • coc-snippets - Snippets solution for coc.nvim.
    • coc-pairs - Basic auto pairs extension of coc.nvim.
    • coc-markdownlint - markdownlint extension for coc.nvim.
  • protoc - protocol buffer compiler.
  • fzf - 🌸 A command-line fuzzy finder.
  • junegunn/fzf.vim - fzf ❤️ vim.
  • ripgrep - ripgrep recursively searches directories for a regex pattern while respecting your gitignore.
  • crusoexia/vim-monokai - Refined Monokai color scheme for vim, inspired by Sublime Text.
  • ekalinin/Dockerfile.vim - Vim syntax file & snippets for Docker's Dockerfile.
  • itchyny/lightline.vim - A light and configurable statusline/tabline plugin for Vim.
  • preservim/nerdtree- A tree explorer plugin for vim.
  • preservim/tagbar - Vim plugin that displays tags in a window, ordered by scope.

Please suggest any software which deserved to be integrated into this IDE.

Quick guide

% docker pull ericwq057/golangide:latest

% docker run -it -d -h golangide  --env TZ=Asia/Shanghai  --name golang \
  --mount source=proj-vol,target=/home/ide/proj \
  --mount type=bind,source=YOUR-SHARED-DIRECTORY,target=/home/ide/develop \
  golangide:latest

$ docker exec -u ide -it golang bash
  • YOUR-SHARED-DIRECTORY is you local source code directory shared with native OS. E.g. "/Users/qiwang/dev".
  • You may need to create a docker volume proj-vol first:
% docker volume create proj-vol
  • proj-vol is also your source code directory, which you don't need to access from native OS. It's faster comparing with shared one.
  • Check % ls /usr/share/zoneinfo to get the TZ value for your location.

vim-go commands and coc.nvim commands

See vim-go.vim for vim-go commands. Here , is the leader key.

  • for GoTest command, the configuration sets the ,+t hot key to run test.
  • for GoRun command, the configuration sets the ,+r hot key to run the application.
  • for more commands hot key, see vim-go.vim file.

coc.nvim uses the following hot key to perform code navigation. See coc.nvim for all coc.nvim commands.

" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)

about Rg and GoDecls

In neovim, type ,+space to activate Rg, to perform file content search. You can change the Hot-keys in others.vim.

" ripgrep configuration
nnoremap <silent> <Leader><Space> :Rg<CR>

Use ctrl+g to search golang type and function for current package. You can change the Hot-keys in vim-go.vim.

" Open :GoDeclsDir with ctrl-g
nmap <C-g> :GoDeclsDir<cr>
imap <C-g> <esc>:<C-u>GoDeclsDir<cr>

Fn Key definition

NERDTree is ON by default, use F5 to close it. Tagbar is OFF by default, use F8 to open it. Use F4 to activate fzf, to perform file name search. Use F10 to open the spell check. Use F7 to issue GoSameIdsToggle command. Use F9 to issue NERDTreeFind command. You can change the Hot-keys in others.vim.

nmap <F4> :FZF<CR>
nmap <F5> :NERDTreeToggle<CR>
nmap <F6> :nohlsearch<CR>
autocmd FileType go nmap <F7> :GoSameIdsToggle<CR>
nmap <F8> :TagbarToggle<CR>
nmap <F9> :NERDTreeFind <CR>
nnoremap <silent> <F10> :set spell!<cr>

Reference

Status

  • Working on detail guide.
  • The golangIDE is verified by grpc/grpc-go project.

About

A neovim based golang IDE in the docker environment. Based on alpine.

Resources

License

Stars

Watchers

Forks

Packages

No packages published