Try to find the better solution for neovim IDE (golang, c, c++, java, lua, html, css, vim script, markdown, javascript)
docker pull alpine:edge
docker run -it -h neovim --env TZ=Asia/Shanghai --name neovim \
--mount source=proj-vol,target=/home/ide/proj \
--mount type=bind,source=/Users/qiwang/proj,target=/home/ide/develop \
alpine:edge
Thanks to go module, It's easy to start with grpc-go
project. Please enjoy the go language server: gopls.
% git clone https://github.com/grpc/grpc-go.git
% cd grpc-go
% go mod tidy
% vi clientconn.go
git
command clones thegrpc-go
project.go mod tidy
add missing and remove unused modules.vi
command will start the gopls language server. Now, you can navigate code, format code, diagnose code, etc.
cmake
, autoconf
, automake
and bear
are general tools for c/c++ Development. So it's build-in packages for nvide
.
ccls build suggest the following commands for alpine. Which means ccls
project needs more packages to build from the source.
% apk add alpine-sdk cmake make clang clang-static clang-dev llvm-dev llvm-static \
&& git clone --depth=1 --recursive https://github.com/MaskRay/ccls \
&& cd ccls \
&& cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release \
&& cmake --build Release --target install
With nvide
in hands, you still need to install the following packages to compile the project. Otherwise, the compiler will complains some library is missing. Note, you need to install the following package with the root privilege for nvide
.
# apk add clang-static llvm-dev llvm-static zlib-dev libxslt-dev
Next, the key point is to generate the compile_commands.json
file for ccls
project. You can use the following command to create the compile_commands.json
file.
% git clone --depth=1 --recursive https://github.com/MaskRay/ccls
% cd ccls
% cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=YES
-- Using local RapidJSON
fatal: No names found, cannot describe anything.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ide/proj/ccls/Release
% ln -s Release/compile_commands.json .
% vi src/main.cc
- Note the
-DCMAKE_EXPORT_COMPILE_COMMANDS=YES
option is used. - You can ignore the fatal error reported by
cmake
. - Also note the
compile_commands.json
file is located in.Release
directory. The link command set the root directory forclangd
.
nvide
uses lua
script to setup the neovim
plugins. In ~/.config/nvim/
directory, there is a complete lua
project (which contains a .git directory). Use the following command to enjoy the lua
language server.
% cd ~/.config/nvim/
% vi init.lua
lua vim.lsp.buf.references()
and lua vim.lsp.buf.implementation()
use quickfix window to show the list. The following is the command to operate the quickfix
window. Refer to How do you use vim's quickfix feature? for detail.
:copen " Open the quickfix window
:ccl " Close it
:cw " Open it if there are "errors", close it otherwise (some people prefer this)
:cn " Go to the next error in the window
:cp " Go to the previous error in the window
:cnf " Go to the first error in the next file
:.cc " Go to error under cursor (if cursor is in quickfix window)
How the terminal works? Who is responsible for terminal rendering? Does GPU-rendering in terminal matter?
- Linux terminals, tty, pty and shell
- Linux terminals, tty, pty and shell - part 2
- How does a Linux terminal work?
- How Zutty works: Rendering a terminal with an OpenGL Compute Shader
- A totally biased comparison of Zutty (to some better-known X terminal emulators)
- A look at terminal emulators, part 1
- A look at terminal emulators, part 2
- High performant 2D renderer in a terminal
- The TTY demystified
- Getting Started with Mosh (Mobile Shell)
- example language server
- nvim-lua/kickstart.nvim
- Add, Delete And Grant Sudo Privileges To Users In Alpine Linux
- Why is GO111MODULE everywhere, and everything about Go Modules
- Understanding go.mod and go.sum
- spellsitter.nvim
- Neovim Tips for a Better Coding Experience
- Neovim - Treesitter Syntax Highlighting
- How to Add SSH Public Key to Server
- How to SSH into a Docker Container
- Running SSH in an Alpine Docker Container
- alpine-ssh
- Alpine ssh server
- How to install OpenSSH server on Alpine Linux
- Docker-SSH 连接 docker 容器
- ssh 启动错误:no hostkeys available— exiting
docker build -t nide:0.1 -f nvim-tmux.dockerfile .
docker run -it -d -h ggg --env TZ=Asia/Shanghai -u ide --name ggg -p 8654:22 nide:0.1 bash
ssh ide@localhost -p 8654 -t "tmux a -t golangide"
tmux new-session -s "IDE" -n "editor" -d "nvim"
tmux attach-session -t "IDE"
server:
docker run -d -p 50001:22 --env TZ=Asia/Shanghai -h nvimIDE --name nvimIDE \
nvim:ide /usr/sbin/sshd -D
client:
ssh ide@localhost -p 50001
- container
- tmux seesion
- Copying to clipboard from tmux and Vim using OSC 52
- tmux in practice
- tmux in practice: integration with the system clipboard
- Getting started with Tmux
- A Quick and Easy Guide to tmux
- Making tmux Pretty and Usable - A Guide to Customizing your tmux.conf
- copy .vimrc.
- copy yank to PAHT and chmod +x for it.
- edit
~/.config/nvim/init.lua
and add the following content. - yank what you want.
-- Here is the content for ~/.config/nvim/init.lua
--
-- source a vimscript file
vim.cmd('source ~/.vimrc')
vim.o.clipboard = 'unnamedplus' -- copy/paste to system clipboard
vim.opt.clipboard = 'unnamedplus' -- copy/paste to system clipboard
docker container exec -u ide -ti neovim ash
See here for the official tmux clipboard document. For tmux, use the following configuration in .tmux.conf
,
set -s set-clipboard on
For neovim, use the following configuration in ~/.config/nvim/init.lua
vim.o.clipboard = 'unnamedplus' -- copy/paste to system clipboard
vim.opt.clipboard = 'unnamedplus' -- copy/paste to system clipboard
when you run :checkhealth
, neovim reports
## Clipboard (optional)
- OK: Clipboard tool found: pbcopy
curl -s https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh | ash
TODO: install lua language server.
$ apk add alpine-sdk curl bash unzip
$ apk add lua5.3
$ wget https://luarocks.org/releases/luarocks-3.8.0.tar.gz
$ tar zxpf luarocks-3.8.0.tar.gz
$ cd luarocks-3.8.0
$ apk add lua5.3-dev
$ ./configure --lua-version=5.3
$ make
$ make install
check the result.
$ luarocks path --help
$ luarocks install --server=https://luarocks.org/dev luaformatter
- Customizing Neovim LSP (nvim-lsp)
- Setup Neovim for Lua Development
- luarocks.org
- luarocks at github.com
- sumneko lua
- Build and Run lua language server
- Color scheme - sonokai
- Neovim 0.5 features and the switch to init.lua
- LSP- go language server
- 学习 Neovim 全配置,逃离 VSCode
- iTerm2
- Go neovim configuration
- Base neovim configuration
- Alacritty yaml
- Telescope example
- clipper
- Yank from container
- 打通 Neovim 与系统剪切板
- How to set up Neovim 0.5 + Modern plugins (LSP, Treesitter, Fuzzy finder, etc)
- Vista.vim
- Package management - packer
- Telescope
- Status line? - lualine
- Key mappings? - which-key.nvim
- LuaSnip
- NvimTree
- nvim-treesitter
- Treesitter - romgrk/nvim-treesitter-context
- LSP - nvim-lspconfig
- LSP - nvim-cmp
- LSP - symbols-outline.nvim
- LSP - lsp-signature
- Debug? - nvim-dap
- Debug? - nvim-dap-ui
$more .profile
export GOPATH=/go
export PATH=$PATH:$GOPATH/bin
export PS1='\u@\h:\w $ '
alias vi=nvim
% brew tap homebrew/cask-fonts
% brew install --cask font-hack-nerd-font
% brew install --cask font-cousine-nerd-font
- apk add neovim neovim-doc (30m)
- apk add git curl tzdata htop (48m)
- apk add go (538m, 50 packages)
- apk add tmux (539m, 52 packages)
- export HOME=/home/ide
- export GOPATH=/go
- mkdir /go
- addgroup develop && adduser -D -h $HOME -s /bin/ash -G develop ide
- chown -R ide:develop $GOPATH
- su - ide
- git clone --depth 1 https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim
- git clone https://github.com/brainfucksec/neovim-lua.git
- cd neovim-lua
- mkdir -p ~/.config/
- cp -r nvim/ ~/.config/
- disable color scheme first, run :PackerSync
- mkdir -p .config/alacritty/
- touch .config/alacritty/alacritty.yml
- apk add g++ "need g++ to compile treesitter"
- apk add ccls "c/c++ language server need npm" (860 MiB in 64 packages)
for vista
- apk add ctags fzf
- apk add ripgrep
- python3 fzf
- apk add tree-sitter nodejs
- apk add make musl-dev g++
- git clone https://github.com/savq/paq-nvim.git "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/paqs/opt/paq-nvim
- go install golang.org/x/tools/gopls@latest
- mkdir -p ~/.config/nvim/lua
- copy init.lua only keep the basics.lua
- git clone https://github.com/optimizacija/neovim-config.git
- cd
- makedir .config
- cd .config
- ln -s ../neovim-config/ nvim