From 1673881b9edff742c87267039f14950d188ad00b Mon Sep 17 00:00:00 2001 From: QQ <1770362456@qq.com> Date: Sat, 21 Jan 2023 21:48:17 +0800 Subject: [PATCH] update --- README.md | 74 +++++++++++++++++++++++++++++++++++++++++++++++++- lua/coc.lua | 19 +++++++------ lua/keymap.lua | 2 -- lua/plug.lua | 4 +-- 4 files changed, 84 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index a3e67b1..8bb3c16 100644 --- a/README.md +++ b/README.md @@ -1 +1,73 @@ -# nvim +# 打造自己nvim +## 文件夹结构 +. +├── coc-settings.json -- coc的设置文件 +├── init.lua -- nvim读取的配置文件 +├── lazy-lock.json -- 插件管理工具的json包 +├── lua +│   ├── coc.lua -- coc的配置 +│   ├── keymap.lua -- 改建位的配置 +│   ├── options.lua -- 设置 +│   └── plug.lua -- 插件设置 +└── README.md + +leader键位的设置为空格 + +## coc的配置 +```lua +vim.cmd([[ + let g:coc_global_extensions = [ + \ 'coc-clangd', -- clangd补全 + \ 'coc-lua', -- lua补全 + \ 'coc-python', -- python补全 + \ 'coc-json', -- json补全 + \ + \ 'coc-translator', -- 翻译插件 + \ 'coc-yank', -- 剪切板 + \ 'coc-pairs', -- 括号补全 + \ 'coc-explorer', -- 文件管理 + \ 'coc-list', -- + \ ] +]]) +``` +## 键位设置 +**复制系列:** +```lua +-- 从系统寄存器 +y = "+y +p = "+p +d = "+d +``` +**搜索替换系列:** +```lua +? = :set hlsearch? +/ = :set hlsearch/ + = :nohlsearch + +rp = :%s/ +``` + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lua/coc.lua b/lua/coc.lua index b1b31f3..891fa9a 100644 --- a/lua/coc.lua +++ b/lua/coc.lua @@ -1,14 +1,15 @@ vim.cmd([[ let g:coc_global_extensions = [ - \ 'coc-clangd', - \ 'coc-lua', - \ 'coc-python', - \ 'coc-json', - \ - \ 'coc-translator', - \ 'coc-yank', - \ 'coc-pairs', - \ 'coc-explorer', + \ 'coc-clangd', -- clangd补 + \ 'coc-lua', -- lua补全 + \ 'coc-python', -- python补 + \ 'coc-json', -- json补全 + \ + \ 'coc-translator', -- 翻译插件 + \ 'coc-yank', -- 剪切板 + \ 'coc-pairs', -- 括号补全 + \ 'coc-explorer', -- 文件管理 + \ 'coc-list', \ ] ]]) diff --git a/lua/keymap.lua b/lua/keymap.lua index 7d61df8..3ecbd0d 100644 --- a/lua/keymap.lua +++ b/lua/keymap.lua @@ -16,8 +16,6 @@ map('n', 'Q', ':q!', {noremap = true}) map('n', '?', ':set hlsearch?', {noremap = true}) map('n', '/', ':set hlsearch/', {noremap = true}) -map('n', '', '5j', {noremap = true}) -map('n', '', '5k', {noremap = true}) map('n', '', ':tabn', {noremap = true}) map('n', '', ':tabp', {noremap = true}) diff --git a/lua/plug.lua b/lua/plug.lua index c14fcae..e3c21ce 100644 --- a/lua/plug.lua +++ b/lua/plug.lua @@ -1,3 +1,4 @@ +-- lazy插件自动安装插件 local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then vim.fn.system({ @@ -34,9 +35,6 @@ require("lazy").setup({ 'lilydjwg/colorizer', --markdown - 'dhruvasagar/vim-table-mode', - 'mzlogin/vim-markdown-toc', - 'dkarter/bullets.vim', -- git 'kdheepak/lazygit.nvim',