update
This commit is contained in:
parent
95cd3fcde0
commit
5e4d3df8ba
@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
"snippets.ultisnips.pythonPrompt": false,
|
"snippets.ultisnips.pythonPrompt": false,
|
||||||
"coc.preferences.extensionUpdateCheck": "daily"
|
"coc.preferences.extensionUpdateCheck": "daily",
|
||||||
|
"explorer.toggle": true,
|
||||||
|
"explorer.icon.enableNerdfont": true
|
||||||
}
|
}
|
||||||
|
@ -3,12 +3,14 @@
|
|||||||
"coc.nvim": { "branch": "release", "commit": "95b43f67147391cf2c69e550bd001b742781d226" },
|
"coc.nvim": { "branch": "release", "commit": "95b43f67147391cf2c69e550bd001b742781d226" },
|
||||||
"colorizer": { "branch": "master", "commit": "72790a003d5a706c287486a1a81e3a6b32158b54" },
|
"colorizer": { "branch": "master", "commit": "72790a003d5a706c287486a1a81e3a6b32158b54" },
|
||||||
"gruvbox": { "branch": "master", "commit": "bf2885a95efdad7bd5e4794dd0213917770d79b7" },
|
"gruvbox": { "branch": "master", "commit": "bf2885a95efdad7bd5e4794dd0213917770d79b7" },
|
||||||
|
"lazygit.nvim": { "branch": "main", "commit": "32bffdebe273e571588f25c8a708ca7297928617" },
|
||||||
"nerdcommenter": { "branch": "master", "commit": "98cc4a2d64ca67cccbf5b5cf47c682ebadaaff58" },
|
"nerdcommenter": { "branch": "master", "commit": "98cc4a2d64ca67cccbf5b5cf47c682ebadaaff58" },
|
||||||
"vim-airline": { "branch": "master", "commit": "1d9ae3f972e76a1d36384da7a2890f6402d07d6c" },
|
"vim-airline": { "branch": "master", "commit": "1d9ae3f972e76a1d36384da7a2890f6402d07d6c" },
|
||||||
"vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" },
|
"vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" },
|
||||||
"vim-instant-markdown": { "branch": "master", "commit": "383aa2900f855eddc42ffbe9d636c54e2f2939d5" },
|
"vim-easymotion": { "branch": "master", "commit": "b3cfab2a6302b3b39f53d9fd2cd997e1127d7878" },
|
||||||
"vim-markdown-toc": { "branch": "master", "commit": "7ec05df27b4922830ace2246de36ac7e53bea1db" },
|
"vim-markdown-toc": { "branch": "master", "commit": "7ec05df27b4922830ace2246de36ac7e53bea1db" },
|
||||||
"vim-surround": { "branch": "master", "commit": "6c5e229e85e3248b9db27a2e6276583c586bf3dd" },
|
"vim-surround": { "branch": "master", "commit": "6c5e229e85e3248b9db27a2e6276583c586bf3dd" },
|
||||||
"vim-table-mode": { "branch": "master", "commit": "9555a3e6e5bcf285ec181b7fc983eea90500feb4" },
|
"vim-table-mode": { "branch": "master", "commit": "9555a3e6e5bcf285ec181b7fc983eea90500feb4" },
|
||||||
|
"vim-which-key": { "branch": "master", "commit": "c0eb7a63e80ed0dc2c91eb8c879b7396a795f775" },
|
||||||
"wildfire.vim": { "branch": "master", "commit": "b371e2b1d938ae0e164146136051de164ecb9aa5" }
|
"wildfire.vim": { "branch": "master", "commit": "b371e2b1d938ae0e164146136051de164ecb9aa5" }
|
||||||
}
|
}
|
22
lua/coc.lua
22
lua/coc.lua
@ -3,11 +3,12 @@ vim.cmd([[
|
|||||||
\ 'coc-clangd',
|
\ 'coc-clangd',
|
||||||
\ 'coc-lua',
|
\ 'coc-lua',
|
||||||
\ 'coc-python',
|
\ 'coc-python',
|
||||||
|
\ 'coc-json',
|
||||||
\
|
\
|
||||||
\ 'coc-explorer',
|
|
||||||
\ 'coc-translator',
|
\ 'coc-translator',
|
||||||
\ 'coc-yank',
|
\ 'coc-yank',
|
||||||
\ 'coc-pairs',
|
\ 'coc-pairs',
|
||||||
|
\ 'coc-explorer',
|
||||||
\ ]
|
\ ]
|
||||||
]])
|
]])
|
||||||
|
|
||||||
@ -32,23 +33,4 @@ map("i", "<S-TAB>", [[ coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>" ]], opts)
|
|||||||
-- <C-g>u breaks current undo, please make your own choice
|
-- <C-g>u breaks current undo, please make your own choice
|
||||||
map("i", "<cr>", [[ coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>" ]], opts)
|
map("i", "<cr>", [[ coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>" ]], opts)
|
||||||
|
|
||||||
-- Use `[g` and `]g` to navigate diagnostics
|
|
||||||
-- Use `:CocDiagnostics` to get all diagnostics of current buffer in location list
|
|
||||||
map("n", "[g", "<Plug>(coc-diagnostic-prev)", {silent = true})
|
|
||||||
map("n", "]g", "<Plug>(coc-diagnostic-next)", {silent = true})
|
|
||||||
|
|
||||||
-- GoTo code navigation
|
|
||||||
map("n", "gd", "<Plug>(coc-definition)", {silent = true})
|
|
||||||
map("n", "gy", "<Plug>(coc-type-definition)", {silent = true})
|
|
||||||
map("n", "gi", "<Plug>(coc-implementation)", {silent = true})
|
|
||||||
map("n", "gr", "<Plug>(coc-references)", {silent = true})
|
|
||||||
|
|
||||||
-- Symbol renaming
|
|
||||||
map("n", "<leader>rn", "<Plug>(coc-rename)", {silent = true})
|
|
||||||
|
|
||||||
-- Formatting selected code
|
|
||||||
map("x", "<leader>i", "<Plug>(coc-format-selected)", {silent = true})
|
|
||||||
map("n", "<leader>i", "<Plug>(coc-format-selected)", {silent = true})
|
|
||||||
|
|
||||||
map("n", "tt", ":CocCommand explorer<CR>", {silent = true})
|
|
||||||
|
|
||||||
|
@ -3,6 +3,10 @@ local map = vim.api.nvim_set_keymap
|
|||||||
map('n', '<leader>y', '"+y', {noremap = true})
|
map('n', '<leader>y', '"+y', {noremap = true})
|
||||||
map('n', '<leader>p', '"+p', {noremap = true})
|
map('n', '<leader>p', '"+p', {noremap = true})
|
||||||
map('n', '<leader>d', '"+d', {noremap = true})
|
map('n', '<leader>d', '"+d', {noremap = true})
|
||||||
|
map('v', '<leader>y', '"+y', {noremap = true})
|
||||||
|
map('v', '<leader>p', '"+p', {noremap = true})
|
||||||
|
map('v', '<leader>d', '"+d', {noremap = true})
|
||||||
|
map('n', '<leader>rp',':%s/',{noremap = true})
|
||||||
|
|
||||||
map('n', 'L', '$', {noremap = true})
|
map('n', 'L', '$', {noremap = true})
|
||||||
map('n', 'H', '^', {noremap = true})
|
map('n', 'H', '^', {noremap = true})
|
||||||
@ -11,16 +15,19 @@ map('n', '<', '<<', {noremap = true})
|
|||||||
map('n', 'Q', ':q!<CR>', {noremap = true})
|
map('n', 'Q', ':q!<CR>', {noremap = true})
|
||||||
map('n', '?', 'set hlsearch<CR>?', {noremap = true})
|
map('n', '?', 'set hlsearch<CR>?', {noremap = true})
|
||||||
map('n', '/', 'set hlsearch<CR>/', {noremap = true})
|
map('n', '/', 'set hlsearch<CR>/', {noremap = true})
|
||||||
map('n', '<c-s-j>', '5j', {noremap = true})
|
|
||||||
map('n', '<c-s-k>', '5k', {noremap = true})
|
map('n', '<A-j>', '5j', {noremap = true})
|
||||||
|
map('n', '<A-k>', '5k', {noremap = true})
|
||||||
|
map('n', '<A-l>', ':tabn<CR>', {noremap = true})
|
||||||
|
map('n', '<A-h>', ':tabp<CR>', {noremap = true})
|
||||||
|
|
||||||
|
|
||||||
map('n', '<c-n>', ':nohlsearch<CR>', {noremap = true})
|
map('n', '<c-j>', '<c-w>j', {noremap = true})
|
||||||
map('n', '<c-j>', '<c-w>j', {noremap = true})
|
map('n', '<c-h>', '<c-w>h', {noremap = true})
|
||||||
map('n', '<c-h>', '<c-w>h', {noremap = true})
|
map('n', '<c-k>', '<c-w>k', {noremap = true})
|
||||||
map('n', '<c-k>', '<c-w>k', {noremap = true})
|
map('n', '<c-l>', '<c-w>l', {noremap = true})
|
||||||
map('n', '<c-l>', '<c-w>l', {noremap = true})
|
|
||||||
map('n', '<c-c>', ':wq<CR>', {noremap = true})
|
map('n', '<c-c>', ':wq<CR>', {noremap = true})
|
||||||
|
map('n', '<c-n>', ':nohlsearch<CR>', {noremap = true})
|
||||||
|
|
||||||
|
|
||||||
map('n', '<leader><leader>y', 'ggyG', {noremap = true})
|
map('n', '<leader><leader>y', 'ggyG', {noremap = true})
|
||||||
@ -32,6 +39,43 @@ map('n', '<down>', ':res +5<CR>', {noremap = true})
|
|||||||
map('n', '<left>', ':vertical resize -5<CR>', {noremap = true})
|
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})
|
||||||
|
|
||||||
|
-- easymotion
|
||||||
|
map('v', '<leader>f', '<Plug>(easymotion-bd-f)', {})
|
||||||
|
map('n', '<leader>f', '<Plug>(easymotion-overwin-f)', {})
|
||||||
|
map('n', 's', '<Plug>(easymotion-overwin-f2)',{})
|
||||||
|
|
||||||
|
-- lazygit
|
||||||
|
map('n', '<leader>g', ':w<CR>:LazyGit<CR>', {})
|
||||||
|
|
||||||
|
-- coc.nvim
|
||||||
|
map("n", "[g", "<Plug>(coc-diagnostic-prev)", {silent = true})
|
||||||
|
map("n", "]g", "<Plug>(coc-diagnostic-next)", {silent = true})
|
||||||
|
map("n", "gd", "<Plug>(coc-definition)", {silent = true})
|
||||||
|
map("n", "gy", "<Plug>(coc-type-definition)", {silent = true})
|
||||||
|
map("n", "gi", "<Plug>(coc-implementation)", {silent = true})
|
||||||
|
map("n", "gr", "<Plug>(coc-references)", {silent = true})
|
||||||
|
map("n", "<leader>rn", "<Plug>(coc-rename)", {silent = true})
|
||||||
|
map("x", "<leader>i", "<Plug>(coc-format-selected)", {silent = true})
|
||||||
|
map("n", "<leader>i", "<Plug>(coc-format-selected)", {silent = true})
|
||||||
|
map("n", "<c-n>", ":CocCommand explorer<CR>", {silent = true})
|
||||||
|
|
||||||
|
--EasyAlign
|
||||||
|
map("v", "ga", ":EasyAlign<CR>", {silent = true})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ vim.g.bg = dark
|
|||||||
vim.cmd([[colorscheme gruvbox]])
|
vim.cmd([[colorscheme gruvbox]])
|
||||||
|
|
||||||
-- 输入法自动根据模式自动切换
|
-- 输入法自动根据模式自动切换
|
||||||
vim.cmd([[
|
vim.cmd([[ au InsertLeave * :silent !fcitx5-remote -c ]])
|
||||||
au InsertLeave * :silent !fcitx5-remote -c
|
|
||||||
]])
|
-- 文件判断
|
||||||
|
vim.cmd([[ filetype plugin on ]])
|
||||||
|
21
lua/plug.lua
21
lua/plug.lua
@ -1,15 +1,14 @@
|
|||||||
local lazypath = '~/.config/nvim/lua/lazy/lazy.lua'
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
vim.fn.system({
|
vim.fn.system({
|
||||||
"git",
|
"git",
|
||||||
"clone",
|
"clone",
|
||||||
"--depin=1",
|
"--filter=blob:none",
|
||||||
"https://github.com/newbieQQ/lazy.nvim.git",
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
lazypath,
|
lazypath,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
@ -24,6 +23,9 @@ require("lazy").setup({
|
|||||||
'yaocccc/vim-surround',
|
'yaocccc/vim-surround',
|
||||||
'gcmt/wildfire.vim',
|
'gcmt/wildfire.vim',
|
||||||
|
|
||||||
|
-- easymotion
|
||||||
|
'easymotion/vim-easymotion',
|
||||||
|
|
||||||
-- 格式整理
|
-- 格式整理
|
||||||
'junegunn/vim-easy-align',
|
'junegunn/vim-easy-align',
|
||||||
'scrooloose/nerdcommenter',
|
'scrooloose/nerdcommenter',
|
||||||
@ -32,10 +34,15 @@ require("lazy").setup({
|
|||||||
'lilydjwg/colorizer',
|
'lilydjwg/colorizer',
|
||||||
|
|
||||||
--markdown
|
--markdown
|
||||||
'suan/vim-instant-markdown',
|
|
||||||
'dhruvasagar/vim-table-mode',
|
'dhruvasagar/vim-table-mode',
|
||||||
'mzlogin/vim-markdown-toc',
|
'mzlogin/vim-markdown-toc',
|
||||||
'dkarter/bullets.vim'
|
'dkarter/bullets.vim',
|
||||||
|
|
||||||
|
-- lazygit
|
||||||
|
'kdheepak/lazygit.nvim',
|
||||||
|
|
||||||
|
-- which key
|
||||||
|
'liuchengxu/vim-which-key',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user