Neovim

了解 vim text object概念 installation brew install neovim brew install font-hack-nerd-font # 检索 brew install ripgrep fzf # lsp format brew install efm-langserver lazy-nvim tokyonight lualine barbecue bufferline indent_blankline gitsigns.nvim alpha-nvim nvim-telescope https://github.com/nvim-treesitter/nvim-treesitter https://github.com/nvim-treesitter/nvim-treesitter-textobjects https://github.com/neovim/nvim-lspconfig https://github.com/williamboman/mason.nvim https://github.com/hrsh7th/nvim-cmp lsp-format 参考 lazyvim kickstart nvim 整理中 my lazyvim config plugin use https://github.com/junegunn/vim-plug, install this first: sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' mkdir ~/.config/nvim/ nvim ~/.config/nvim/init.vim cat << EOF > ~/.config/nvim/init.vim call plug#begin('~/.vim/plugged') call plug#end() EOF write Plug 'fatih/vim-go' between call run :PlugInstall vim config is .vimrc language support use coc.nvim ...

December 27, 2021 · 1 min · Peter

Vim

复制内容到剪贴板 +可以把内容复制到剪贴板寄存器,就能在其他应用中贴。 :reg [register_name] 查看指定寄存器的内容 "+yy // 复制当前行到剪切板 "+p // 将剪切板内容粘贴到光标后面 "ayy // 复制当前行到寄存器 a "ap // 将寄存器 a 中的内容粘贴到光标后面 Vim 有 12 个粘贴板依次编号为:0、1、2、…、9、a、"、+,其中 + 号为系统粘贴板,” 为临时粘贴板。系统剪切板中的内容可在其他程序中使用。上面的复制指令都可以配合剪切板进行操作。“nyw 复制当前单词到 n 号剪切板(双引号开始) “np 粘贴 n 号剪切板内容到当前位置后 “+Y 复制当前行到系统剪切板”+nY 复制当前行往下 n 行到系统剪切板”+p 粘贴系统剪切板内容到当前位置后 标记,mark 一下 mc标记一个位置c,当在本页其他地方完成代码之后,有时因为不是用的 vim 的G或g位移操作,所以两个点号不一定能回来,但是如果在离开前就 mark 了它,`c 一下就能会到 c 标记的地方,这里用其他字母也行,只要自己能记住,我从别的地方学的是 e - end,c - current,s - start,比如代码开头的 import 内容或者常量不对调整,则标记一个 s,当前的代码工作地方标记为 c,这样可以在开头和当前不断跳转。 replace Search and replace :%s/foo/bar/g, Find each occurrence of ‘foo’ (in all lines), and replace it with ‘bar’. 插件 Youcompleteme 文章 ...

December 20, 2021 · 3 min · Peter