update
This commit is contained in:
parent
9cf805a96e
commit
76f1a2fdee
30
README.md
30
README.md
@ -1 +1,31 @@
|
|||||||
# 从零开始打造属于自己的nvim
|
# 从零开始打造属于自己的nvim
|
||||||
|
## vim-surround插件
|
||||||
|
`"Hello world"`
|
||||||
|
1.使用 `cs”‘` 效果如下:
|
||||||
|
`'Hello world'`
|
||||||
|
2.使用 `cs'<q>` 效果如下:
|
||||||
|
`<q>Hello world</q>`
|
||||||
|
3.使用 `cst"` 效果如下:
|
||||||
|
`"Hello world"`
|
||||||
|
4.使用 `ds”` 效果如下:
|
||||||
|
`Hello world`
|
||||||
|
5.使用 `ys{$xx}"` {$xx}是一个文本对象:
|
||||||
|
例如:
|
||||||
|
`Hello world` 使用 `ysiw“`效果如下:`"Hello" world`
|
||||||
|
`Hello world` 使用 `ys2w“`效果如下:`"Hello world"`
|
||||||
|
## wildfire.vim插件
|
||||||
|
按下回车可以快速选择一个文本对象(段落)
|
||||||
|
```
|
||||||
|
Press <ENTER> in normal mode to
|
||||||
|
select the closest text object.
|
||||||
|
```
|
||||||
|
使用它可以使用i”,i'等快速选择“或者’内的文本({[]})都可以
|
||||||
|
## wildfire 和surround的配合
|
||||||
|
|
||||||
|
可以使用 `ni)`选择多括号内东西
|
||||||
|
|
||||||
|
![官方给的gif](https://raw.githubusercontent.com/gcmt/wildfire.vim/master/_assets/preview.gif)
|
||||||
|
|
||||||
|
## nerdcommenter
|
||||||
|
快速注释插件
|
||||||
|
`<leader>c<space>` 切换注释状态
|
||||||
|
5
init.lua
5
init.lua
@ -4,5 +4,8 @@ require('core.plug')
|
|||||||
require('core.options')
|
require('core.options')
|
||||||
require('core.keymap')
|
require('core.keymap')
|
||||||
require('Plugin.coc')
|
require('Plugin.coc')
|
||||||
require('Plugin.Im-auto-select')
|
require('Plugin.lualine')
|
||||||
|
require('Plugin.surround')
|
||||||
|
require('Plugin.nerdcommenter')
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
"coc.nvim": { "branch": "release", "commit": "e86b15bbcabc2cc1f20a40e7c127a424e7ad3850" },
|
"coc.nvim": { "branch": "release", "commit": "e86b15bbcabc2cc1f20a40e7c127a424e7ad3850" },
|
||||||
"colorizer": { "branch": "master", "commit": "72790a003d5a706c287486a1a81e3a6b32158b54" },
|
"colorizer": { "branch": "master", "commit": "72790a003d5a706c287486a1a81e3a6b32158b54" },
|
||||||
"gruvbox": { "branch": "master", "commit": "bf2885a95efdad7bd5e4794dd0213917770d79b7" },
|
"gruvbox": { "branch": "master", "commit": "bf2885a95efdad7bd5e4794dd0213917770d79b7" },
|
||||||
|
"indentLine": { "branch": "master", "commit": "d15d63bf9c4a74a02470d4bc8ecce53df13e3a75" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "96d759d1cbd8b0bd0ea0a0c2987f99410272f348" },
|
"lazy.nvim": { "branch": "main", "commit": "96d759d1cbd8b0bd0ea0a0c2987f99410272f348" },
|
||||||
"lazygit.nvim": { "branch": "main", "commit": "32bffdebe273e571588f25c8a708ca7297928617" },
|
"lazygit.nvim": { "branch": "main", "commit": "32bffdebe273e571588f25c8a708ca7297928617" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" },
|
"lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" },
|
||||||
"nerdcommenter": { "branch": "master", "commit": "98cc4a2d64ca67cccbf5b5cf47c682ebadaaff58" },
|
"nerdcommenter": { "branch": "master", "commit": "98cc4a2d64ca67cccbf5b5cf47c682ebadaaff58" },
|
||||||
"tabline.nvim": { "branch": "main", "commit": "5d76dc8616b4b7b892229cc05cd0f4cd0200077a" },
|
|
||||||
"vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" },
|
"vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" },
|
||||||
"vim-easymotion": { "branch": "master", "commit": "b3cfab2a6302b3b39f53d9fd2cd997e1127d7878" },
|
"vim-easymotion": { "branch": "master", "commit": "b3cfab2a6302b3b39f53d9fd2cd997e1127d7878" },
|
||||||
"vim-surround": { "branch": "master", "commit": "6c5e229e85e3248b9db27a2e6276583c586bf3dd" },
|
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||||
"wildfire.vim": { "branch": "master", "commit": "b371e2b1d938ae0e164146136051de164ecb9aa5" }
|
"wildfire.vim": { "branch": "master", "commit": "b371e2b1d938ae0e164146136051de164ecb9aa5" }
|
||||||
}
|
}
|
@ -72,24 +72,6 @@ keyset("o", "ic", "<Plug>(coc-classobj-i)", opts)
|
|||||||
keyset("x", "ac", "<Plug>(coc-classobj-a)", opts)
|
keyset("x", "ac", "<Plug>(coc-classobj-a)", opts)
|
||||||
keyset("o", "ac", "<Plug>(coc-classobj-a)", opts)
|
keyset("o", "ac", "<Plug>(coc-classobj-a)", opts)
|
||||||
|
|
||||||
local opts = {silent = true, nowait = true}
|
|
||||||
-- Show all diagnostics
|
|
||||||
keyset("n", "<leader>a", ":<C-u>CocList diagnostics<cr>", opts)
|
|
||||||
-- Manage extensions
|
|
||||||
keyset("n", "<leader>e", ":<C-u>CocList extensions<cr>", opts)
|
|
||||||
-- Show commands
|
|
||||||
keyset("n", "<leader>c", ":<C-u>CocList commands<cr>", opts)
|
|
||||||
-- Find symbol of current document
|
|
||||||
keyset("n", "<leader>o", ":<C-u>CocList outline<cr>", opts)
|
|
||||||
-- Search workleader symbols
|
|
||||||
keyset("n", "<leader>s", ":<C-u>CocList -I symbols<cr>", opts)
|
|
||||||
-- Do default action for next item
|
|
||||||
keyset("n", "<leader>j", ":<C-u>CocNext<cr>", opts)
|
|
||||||
-- Do default action for previous item
|
|
||||||
keyset("n", "<leader>k", ":<C-u>CocPrev<cr>", opts)
|
|
||||||
-- Resume latest coc list
|
|
||||||
keyset("n", "<leader>p", ":<C-u>CocListResume<cr>", opts)
|
|
||||||
|
|
||||||
-- explorer
|
-- explorer
|
||||||
keyset("n", "<c-n>", ":CocCommand explorer<CR>")
|
keyset("n", "<c-n>", ":CocCommand explorer<CR>")
|
||||||
-- translator
|
-- translator
|
||||||
|
0
lua/Plugin/indentLine.lua
Normal file
0
lua/Plugin/indentLine.lua
Normal file
40
lua/Plugin/lualine.lua
Normal file
40
lua/Plugin/lualine.lua
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
require('lualine').setup {
|
||||||
|
options = {
|
||||||
|
icons_enabled = true,
|
||||||
|
theme = 'auto',
|
||||||
|
component_separators = { left = '', right = ''},
|
||||||
|
section_separators = { left = '', right = ''},
|
||||||
|
disabled_filetypes = {
|
||||||
|
statusline = {},
|
||||||
|
winbar = {},
|
||||||
|
},
|
||||||
|
ignore_focus = {},
|
||||||
|
always_divide_middle = true,
|
||||||
|
globalstatus = false,
|
||||||
|
refresh = {
|
||||||
|
statusline = 1000,
|
||||||
|
tabline = 1000,
|
||||||
|
winbar = 1000,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = {'mode'},
|
||||||
|
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||||
|
lualine_c = {'filename'},
|
||||||
|
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
||||||
|
lualine_y = {'progress'},
|
||||||
|
lualine_z = {'location'}
|
||||||
|
},
|
||||||
|
inactive_sections = {
|
||||||
|
lualine_a = {},
|
||||||
|
lualine_b = {},
|
||||||
|
lualine_c = {'filename'},
|
||||||
|
lualine_x = {'location'},
|
||||||
|
lualine_y = {},
|
||||||
|
lualine_z = {}
|
||||||
|
},
|
||||||
|
tabline = {},
|
||||||
|
winbar = {},
|
||||||
|
inactive_winbar = {},
|
||||||
|
extensions = {}
|
||||||
|
}
|
28
lua/Plugin/nerdcommenter.lua
Normal file
28
lua/Plugin/nerdcommenter.lua
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
vim.cmd([[
|
||||||
|
" Create default mappings
|
||||||
|
let g:NERDCreateDefaultMappings = 1
|
||||||
|
|
||||||
|
" Add spaces after comment delimiters by default
|
||||||
|
let g:NERDSpaceDelims = 1
|
||||||
|
|
||||||
|
" Use compact syntax for prettified multi-line comments
|
||||||
|
let g:NERDCompactSexyComs = 1
|
||||||
|
|
||||||
|
" Align line-wise comment delimiters flush left instead of following code indentation
|
||||||
|
let g:NERDDefaultAlign = 'left'
|
||||||
|
|
||||||
|
" Set a language to use its alternate delimiters by default
|
||||||
|
let g:NERDAltDelims_java = 1
|
||||||
|
|
||||||
|
" Add your own custom formats or override the defaults
|
||||||
|
let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } }
|
||||||
|
|
||||||
|
" Allow commenting and inverting empty lines (useful when commenting a region)
|
||||||
|
let g:NERDCommentEmptyLines = 1
|
||||||
|
|
||||||
|
" Enable trimming of trailing whitespace when uncommenting
|
||||||
|
let g:NERDTrimTrailingWhitespace = 1
|
||||||
|
|
||||||
|
" Enable NERDCommenterToggle to check all selected lines is commented or not
|
||||||
|
let g:NERDToggleCheckAllLines = 1
|
||||||
|
]])
|
0
lua/Plugin/surround.lua
Normal file
0
lua/Plugin/surround.lua
Normal file
@ -40,7 +40,8 @@ map('n', '<left>', ':vertical resize -5<CR>', {noremap = true})
|
|||||||
map('n', '<right>', ':vertical resize +5<CR>', {noremap = true})
|
map('n', '<right>', ':vertical resize +5<CR>', {noremap = true})
|
||||||
|
|
||||||
-- 快速注释
|
-- 快速注释
|
||||||
map('n', '<leader>/', '<leader>c<space>', {noremap = true})
|
map('n', '<leader>/', '<leader>c<spaces>', {noremap = false})
|
||||||
|
|
||||||
|
|
||||||
-- easymotion
|
-- easymotion
|
||||||
map('v', '<leader>f', '<Plug>(easymotion-bd-f)', {})
|
map('v', '<leader>f', '<Plug>(easymotion-bd-f)', {})
|
||||||
|
@ -18,13 +18,12 @@ require("lazy").setup({
|
|||||||
-- 主题插件
|
-- 主题插件
|
||||||
'nvim-lualine/lualine.nvim',
|
'nvim-lualine/lualine.nvim',
|
||||||
'morhetz/gruvbox',
|
'morhetz/gruvbox',
|
||||||
'kdheepak/tabline.nvim',
|
|
||||||
|
|
||||||
-- lsp 补全
|
-- lsp 补全
|
||||||
{'neoclide/coc.nvim', branch = 'release'},
|
{'neoclide/coc.nvim', branch = 'release'},
|
||||||
|
|
||||||
-- surround 和 wildfire 配合有神奇的效果
|
-- surround 和 wildfire 配合有神奇的效果
|
||||||
'yaocccc/vim-surround',
|
'tpope/vim-surround',
|
||||||
'gcmt/wildfire.vim',
|
'gcmt/wildfire.vim',
|
||||||
|
|
||||||
-- easymotion
|
-- easymotion
|
||||||
@ -32,7 +31,7 @@ require("lazy").setup({
|
|||||||
|
|
||||||
-- 格式整理
|
-- 格式整理
|
||||||
'junegunn/vim-easy-align',
|
'junegunn/vim-easy-align',
|
||||||
'scrooloose/nerdcommenter',
|
'preservim/nerdcommenter',
|
||||||
|
|
||||||
--颜色识别
|
--颜色识别
|
||||||
'lilydjwg/colorizer',
|
'lilydjwg/colorizer',
|
||||||
@ -49,4 +48,3 @@ require("lazy").setup({
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user