mirror of
https://github.com/d0zingcat/dotfiles.git
synced 2026-05-14 23:16:47 +00:00
mig packer to lazy and archive
Signed-off-by: d0zingcat <leewtang@gmail.com>
This commit is contained in:
@@ -22,14 +22,30 @@ if fn.has('nvim') == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
vim.g.mapleader = " " -- Make sure to set `mapleader` before lazy so your mappings are correct
|
||||
vim.g.maplocalleader = "\\" -- Same for `maplocalleader`
|
||||
|
||||
-- Ensure packer installed
|
||||
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
|
||||
cmd('packadd packer.nvim')
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup("plugins")
|
||||
-- -- Ensure packer installed
|
||||
-- local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
||||
-- if fn.empty(fn.glob(install_path)) > 0 then
|
||||
-- fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
|
||||
-- cmd('packadd packer.nvim')
|
||||
-- end
|
||||
--
|
||||
-- reopen last position
|
||||
-- cmd([[ autocmd BufReadPost * normal! g`" ]])
|
||||
|
||||
@@ -133,7 +149,7 @@ set('synmaxcol', 120)
|
||||
|
||||
-- Key mappings
|
||||
-- map Leader key to <space>
|
||||
g.mapleader = [[ ]]
|
||||
-- g.mapleader = [[ ]]
|
||||
|
||||
-- v 模式下复制内容到系统剪切板
|
||||
map('v', '<Leader>cp', '"+yy')
|
||||
@@ -167,7 +183,7 @@ vim.g.copilot_no_maps = 1
|
||||
vim.g.copilot_assume_mapped = 1
|
||||
|
||||
|
||||
require('plugins')
|
||||
-- require('plugins')
|
||||
require('funcs')
|
||||
|
||||
-- Neoformat
|
||||
|
||||
49
nvim/lazy-lock.json
Normal file
49
nvim/lazy-lock.json
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" },
|
||||
"chowcho.nvim": { "branch": "main", "commit": "51ff2608748e9fa4ea79c1c1ae18b60c2cd24276" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" },
|
||||
"comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||
"copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" },
|
||||
"fidget.nvim": { "branch": "legacy", "commit": "2f7c08f45639a64a5c0abcf67321d52c3f499ae6" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "75dc649106827183547d3bedd4602442340d2f7f" },
|
||||
"hlargs.nvim": { "branch": "main", "commit": "30fe1b3de2b7614f061be4fc9c71984a2b87e50a" },
|
||||
"hlsearch.nvim": { "branch": "main", "commit": "fdeb60b890d15d9194e8600042e5232ef8c29b0e" },
|
||||
"hop.nvim": { "branch": "master", "commit": "1a1eceafe54b5081eae4cb91c723abd1d450f34b" },
|
||||
"image_preview.nvim": { "branch": "main", "commit": "8de950078bdecf1916e8dbddfbee451e095b023c" },
|
||||
"incolla.nvim": { "branch": "master", "commit": "a3e5f170e37c8da61906f31fd8d61a475b32bfd5" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "24fa2a97085ca8a7220b5b078916f81e316036fd" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "529e8861d0410389f0163a5e5c2199d4a4ef5bf6" },
|
||||
"lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "f1fd38d61d11f3b1b3e7dc75dc667f79cf2fa58b" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "b124ef3bd4435a6db7ff03ea2f5a23e1e0487552" },
|
||||
"nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "5a87ffe35c4739ffb6b62052572583ad277a20ae" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "b7d50e59b1b2990b3ce8761d4cf595f4b71c87e2" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "f62bfe19e0fbc13ae95649dfb3cf22f4ff85b683" },
|
||||
"nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" },
|
||||
"nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "3557e41418b4a6c5b85d5d64abe94c9c50fa9b14" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" },
|
||||
"nvim-yati": { "branch": "main", "commit": "c4307e6855f17ff89f0132787e2daba27495d254" },
|
||||
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
|
||||
"sentiment.nvim": { "branch": "main", "commit": "ecde8d877881bb78fdb90060c0991e76770dbdbc" },
|
||||
"statuscol.nvim": { "branch": "main", "commit": "483b9a596dfd63d541db1aa51ee6ee9a1441c4cc" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "dfa230be84a044e7f546a6c2b0a403c739732b86" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "e1549807066947818113a7d7ed48f637e49620d3" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "fee58a0473fd92b28c34f8f724e4918b15ba30a3" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "0fae425aaab04a5f97666bd431b96f2f19c36935" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "4f59455d2388e113bd510e85b310d15b9228ca0d" },
|
||||
"vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" },
|
||||
"vim-vsnip-integ": { "branch": "master", "commit": "1914e72cf3de70df7f5dde476cd299aba2440aef" },
|
||||
"vim-wakatime": { "branch": "master", "commit": "3cb40867cb5a3120f9bef76eff88edc7f1dc1a23" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
require('indent_blankline').setup({
|
||||
char = '|',
|
||||
buftype_exclude = { 'terminal' },
|
||||
show_trailing_blankline_indent = false,
|
||||
-- show_current_context = true,
|
||||
use_treesitter = true,
|
||||
})
|
||||
@@ -6,13 +6,12 @@ require('gitsigns').setup({
|
||||
topdelete = { hl = 'GitSignsDelete', text = '⇊', numhl = 'GitSignsDeleteNr', linehl = 'GitSignsDeleteLn' },
|
||||
changedelete = { hl = 'GitSignsChange', text = '~', numhl = 'GitSignsChangeNr', linehl = 'GitSignsChangeLn' },
|
||||
},
|
||||
keymaps = {
|
||||
-- Default keymap options
|
||||
noremap = true,
|
||||
|
||||
['n ]c'] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns.actions\".next_hunk()<CR>'" },
|
||||
['n [c'] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns.actions\".prev_hunk()<CR>'" },
|
||||
},
|
||||
-- keymaps = {
|
||||
-- -- Default keymap options
|
||||
-- noremap = true,
|
||||
-- ['n ]c'] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns.actions\".next_hunk()<CR>'" },
|
||||
-- ['n [c'] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns.actions\".prev_hunk()<CR>'" },
|
||||
-- },
|
||||
word_diff = false,
|
||||
current_line_blame = true,
|
||||
linehl = true,
|
||||
7
nvim/lua/legacy/indent-blankline.lua
Normal file
7
nvim/lua/legacy/indent-blankline.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
require('ibl').setup()
|
||||
-- setup({
|
||||
-- char = '|',
|
||||
-- buftype_exclude = { 'terminal' },
|
||||
-- show_trailing_blankline_indent = false,
|
||||
-- show_current_context = true,
|
||||
-- })
|
||||
@@ -68,9 +68,9 @@ require('nvim-tree').setup({
|
||||
width = 35,
|
||||
side = 'left',
|
||||
},
|
||||
renderer = {
|
||||
highlight_opened_files = '1',
|
||||
},
|
||||
-- renderer = {
|
||||
-- highlight_opened_files = '1',
|
||||
-- },
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {
|
||||
@@ -70,7 +70,6 @@ return require('packer').startup(function(use)
|
||||
end,
|
||||
})
|
||||
use('wakatime/vim-wakatime')
|
||||
--use('psf/black')
|
||||
use({
|
||||
'numToStr/Comment.nvim',
|
||||
config = function()
|
||||
5
nvim/lua/plugins/autoclose.lua
Normal file
5
nvim/lua/plugins/autoclose.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
'm4xshen/autoclose.nvim',
|
||||
event = 'VeryLazy',
|
||||
config = true,
|
||||
}
|
||||
5
nvim/lua/plugins/autopairs.lua
Normal file
5
nvim/lua/plugins/autopairs.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
config = true,
|
||||
}
|
||||
20
nvim/lua/plugins/bufferline.lua
Normal file
20
nvim/lua/plugins/bufferline.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
'akinsho/bufferline.nvim',
|
||||
event = 'VeryLazy',
|
||||
enabled = false,
|
||||
opts = {
|
||||
options = {
|
||||
show_buffer_icons = true,
|
||||
diagnostics = 'nvim_lsp',
|
||||
indicator = {
|
||||
icon = '▎',
|
||||
style = 'icon',
|
||||
},
|
||||
-- show_buffer_close_icons = false,
|
||||
modified_icon = '✥',
|
||||
offsets = {
|
||||
{ filetype = 'NvimTree', text = 'File Explorer', text_align = 'center', highlight = 'Directory' },
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
13
nvim/lua/plugins/chowcho.lua
Normal file
13
nvim/lua/plugins/chowcho.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
'tkmpypy/chowcho.nvim',
|
||||
event = 'VeryLazy',
|
||||
keys = {
|
||||
{
|
||||
'-',
|
||||
mode = { 'n' },
|
||||
function()
|
||||
require('chowcho').run()
|
||||
end,
|
||||
}
|
||||
}
|
||||
}
|
||||
79
nvim/lua/plugins/cmp.lua
Normal file
79
nvim/lua/plugins/cmp.lua
Normal file
@@ -0,0 +1,79 @@
|
||||
return {
|
||||
'hrsh7th/nvim-cmp',
|
||||
event = 'InsertEnter',
|
||||
dependencies = {
|
||||
'hrsh7th/cmp-vsnip',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/vim-vsnip',
|
||||
'hrsh7th/vim-vsnip-integ',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'onsails/lspkind-nvim',
|
||||
'windwp/nvim-autopairs',
|
||||
'hrsh7th/cmp-cmdline',
|
||||
},
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
local types = require('cmp.types')
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
local opts = {
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
vim_item.kind = require('lspkind').presets.default[vim_item.kind] .. ' ' .. vim_item.kind
|
||||
|
||||
-- set a name for each source
|
||||
vim_item.menu = ({
|
||||
buffer = '[Buf]',
|
||||
nvim_lsp = '[LSP]',
|
||||
luasnip = '[Snip]',
|
||||
nvim_lua = '[Lua]',
|
||||
latex_symbols = '[Latex]',
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn['vsnip#anonymous'](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<Tab>'] = cmp.mapping.select_next_item({ behavior = types.cmp.SelectBehavior.Select }),
|
||||
['<S-Tab>'] = function(fallback)
|
||||
local function input(keys, mode)
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(keys, true, true, true), mode or 'i', true)
|
||||
end
|
||||
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
input('<C-p>', 'n')
|
||||
elseif vim.fn['vsnip#jumpable']() == -1 then
|
||||
input('<Plug>(vsnip-jump-prev)')
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
['<C-y>'] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
|
||||
['<CR>'] = function(fallback)
|
||||
fallback()
|
||||
end,
|
||||
['<C-e>'] = function(fallback)
|
||||
fallback()
|
||||
end,
|
||||
}),
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,noselect',
|
||||
},
|
||||
preselect = types.cmp.PreselectMode.None,
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'vsnip' },
|
||||
},
|
||||
}
|
||||
cmp.setup(opts)
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
|
||||
end,
|
||||
}
|
||||
5
nvim/lua/plugins/comment.lua
Normal file
5
nvim/lua/plugins/comment.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
'numToStr/comment.nvim',
|
||||
keys = { 'gcc', { 'gc', mode = 'v' } },
|
||||
config = true,
|
||||
}
|
||||
21
nvim/lua/plugins/copilot.lua
Normal file
21
nvim/lua/plugins/copilot.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
return {
|
||||
'zbirenbaum/copilot.lua',
|
||||
cmd = 'Copilot',
|
||||
event = 'InsertEnter',
|
||||
opts = {
|
||||
-- panel = {
|
||||
-- auto_refresh = true,
|
||||
-- },
|
||||
filetypes = {
|
||||
['*'] = true,
|
||||
},
|
||||
suggestion = {
|
||||
auto_trigger = true,
|
||||
keymap = {
|
||||
accept = '<C-e>',
|
||||
next = '<C-j>',
|
||||
prev = '<C-k>',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
14
nvim/lua/plugins/devicons.lua
Normal file
14
nvim/lua/plugins/devicons.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
event = 'VeryLazy',
|
||||
opts = {
|
||||
override = {
|
||||
zsh = {
|
||||
icon = '',
|
||||
color = '#428850',
|
||||
name = 'Zsh',
|
||||
},
|
||||
},
|
||||
default = true,
|
||||
}
|
||||
}
|
||||
13
nvim/lua/plugins/fidget.lua
Normal file
13
nvim/lua/plugins/fidget.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
'j-hui/fidget.nvim', -- nvim-lsp progress
|
||||
branch = 'legacy',
|
||||
event = 'VeryLazy',
|
||||
opts = {
|
||||
text = {
|
||||
done = '[✓]',
|
||||
},
|
||||
fmt = {
|
||||
stack_upwards = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
4
nvim/lua/plugins/fugitive.lua
Normal file
4
nvim/lua/plugins/fugitive.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
'tpope/vim-fugitive',
|
||||
event = 'VeryLazy',
|
||||
}
|
||||
49
nvim/lua/plugins/gitsigns.lua
Normal file
49
nvim/lua/plugins/gitsigns.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
return {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
event = 'VeryLazy',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = '▌' },
|
||||
change = { text = '▌' },
|
||||
delete = { text = '▌' },
|
||||
topdelete = { text = '▌' },
|
||||
changedelete = { text = '▌' },
|
||||
},
|
||||
word_diff = false,
|
||||
current_line_blame = true,
|
||||
linehl = true,
|
||||
numhl = true,
|
||||
sign_priority = 6,
|
||||
preview_config = {
|
||||
border = 'rounded',
|
||||
},
|
||||
on_attach = function(bufnr)
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
local gs = package.loaded.gitsigns
|
||||
map('n', '<leader>hs', gs.stage_hunk)
|
||||
map('n', '<leader>hr', gs.reset_hunk)
|
||||
map('v', '<leader>hs', function() gs.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
|
||||
map('v', '<leader>hr', function() gs.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
|
||||
map('n', '<leader>hp', gs.preview_hunk)
|
||||
map('n', '<leader>hd', gs.diffthis)
|
||||
|
||||
map('n', ']c', function()
|
||||
if vim.wo.diff then return ']c' end
|
||||
vim.schedule(function() gs.next_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, { expr = true })
|
||||
|
||||
map('n', '[c', function()
|
||||
if vim.wo.diff then return '[c' end
|
||||
vim.schedule(function() gs.prev_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, { expr = true })
|
||||
end
|
||||
}
|
||||
}
|
||||
5
nvim/lua/plugins/hlargs.lua
Normal file
5
nvim/lua/plugins/hlargs.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
'm-demare/hlargs.nvim',
|
||||
event = 'VeryLazy',
|
||||
config = true,
|
||||
}
|
||||
5
nvim/lua/plugins/hlsearch.lua
Normal file
5
nvim/lua/plugins/hlsearch.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
'glepnir/hlsearch.nvim',
|
||||
event = 'VeryLazy',
|
||||
config = true,
|
||||
}
|
||||
25
nvim/lua/plugins/hop.lua
Normal file
25
nvim/lua/plugins/hop.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
return {
|
||||
'phaazon/hop.nvim',
|
||||
event = 'VeryLazy',
|
||||
config = true,
|
||||
keys = {
|
||||
{
|
||||
's',
|
||||
'<cmd>HopChar2<cr>',
|
||||
},
|
||||
{
|
||||
'<leader>w',
|
||||
'<cmd>HopWordAC<cr>',
|
||||
},
|
||||
{
|
||||
'<leader>k',
|
||||
mode = { 'n', 'v' },
|
||||
'<cmd>HopLineStart<cr>',
|
||||
},
|
||||
{
|
||||
'<leader>j',
|
||||
mode = { 'n', 'v' },
|
||||
'<cmd>HopLineStart<cr>',
|
||||
},
|
||||
},
|
||||
}
|
||||
5
nvim/lua/plugins/image-preview.lua
Normal file
5
nvim/lua/plugins/image-preview.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
'adelarsq/image_preview.nvim',
|
||||
event = 'VeryLazy',
|
||||
config = true,
|
||||
}
|
||||
5
nvim/lua/plugins/incolla.lua
Normal file
5
nvim/lua/plugins/incolla.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
'mattdibi/incolla.nvim',
|
||||
cmd = { 'Incolla' },
|
||||
config = true,
|
||||
}
|
||||
41
nvim/lua/plugins/indentline.lua
Normal file
41
nvim/lua/plugins/indentline.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
local highlight = {
|
||||
"RainbowRed",
|
||||
"RainbowYellow",
|
||||
"RainbowBlue",
|
||||
"RainbowOrange",
|
||||
"RainbowGreen",
|
||||
"RainbowViolet",
|
||||
"RainbowCyan",
|
||||
}
|
||||
|
||||
local hooks = require "ibl.hooks"
|
||||
-- create the highlight groups in the highlight setup hook, so they are reset
|
||||
-- every time the colorscheme changes
|
||||
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||||
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
|
||||
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
|
||||
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
|
||||
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
|
||||
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
|
||||
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
|
||||
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
|
||||
end)
|
||||
|
||||
return {
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
event = 'BufRead',
|
||||
main = 'ibl',
|
||||
opts = {
|
||||
indent = {
|
||||
char = '|',
|
||||
highlight = highlight,
|
||||
},
|
||||
exclude = {
|
||||
buftypes = {
|
||||
'terminal',
|
||||
'NvimTree',
|
||||
'nofile'
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
14
nvim/lua/plugins/lualine.lua
Normal file
14
nvim/lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
'hoob3rt/lualine.nvim',
|
||||
event = 'VeryLazy',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons', opt = true },
|
||||
opts = {
|
||||
options = {
|
||||
disabled_filetypes = { 'NvimTree' },
|
||||
theme = 'auto',
|
||||
section_separators = '',
|
||||
component_separators = '',
|
||||
-- globalstatus = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
1
nvim/lua/plugins/neoconf.lua
Normal file
1
nvim/lua/plugins/neoconf.lua
Normal file
@@ -0,0 +1 @@
|
||||
return { "folke/neoconf.nvim", cmd = "Neoconf" }
|
||||
9
nvim/lua/plugins/neodev.lua
Normal file
9
nvim/lua/plugins/neodev.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
'folke/neodev.nvim',
|
||||
event = 'VeryLazy',
|
||||
dependencies = {
|
||||
'neovim/nvim-lspconfig',
|
||||
},
|
||||
ft = { 'lua' },
|
||||
config = true,
|
||||
}
|
||||
22
nvim/lua/plugins/scrollbar.lua
Normal file
22
nvim/lua/plugins/scrollbar.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
return {
|
||||
'petertriho/nvim-scrollbar',
|
||||
event = 'VeryLazy',
|
||||
opts = function()
|
||||
local colors = require('tokyonight.colors').setup()
|
||||
return {
|
||||
handle = {
|
||||
cursor = false,
|
||||
color = colors.bg_highlight,
|
||||
},
|
||||
marks = {
|
||||
Search = { color = colors.orange },
|
||||
Error = { color = colors.error },
|
||||
Warn = { color = colors.warning },
|
||||
Info = { color = colors.info },
|
||||
Hint = { color = colors.hint },
|
||||
Misc = { color = colors.purple },
|
||||
},
|
||||
excluded_filetypes = { 'NvimTree', 'TelescopePrompt', 'chatgpt' }
|
||||
}
|
||||
end
|
||||
}
|
||||
5
nvim/lua/plugins/sentiment.lua
Normal file
5
nvim/lua/plugins/sentiment.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
'utilyre/sentiment.nvim',
|
||||
event = 'VeryLazy',
|
||||
config = true,
|
||||
}
|
||||
5
nvim/lua/plugins/signature.lua
Normal file
5
nvim/lua/plugins/signature.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
'ray-x/lsp_signature.nvim',
|
||||
event = 'VeryLazy',
|
||||
config = true,
|
||||
}
|
||||
16
nvim/lua/plugins/sillicon.lua
Normal file
16
nvim/lua/plugins/sillicon.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
'krivahtoo/silicon.nvim',
|
||||
event = 'VeryLazy',
|
||||
enabled = false,
|
||||
opts = {
|
||||
font = 'Hack=20',
|
||||
theme = 'Dracula',
|
||||
background = '#fff',
|
||||
pad_horiz = 50,
|
||||
pad_vert = 50,
|
||||
line_number = true,
|
||||
line_pad = 2,
|
||||
line_offset = 1,
|
||||
tab_width = 4,
|
||||
}
|
||||
}
|
||||
27
nvim/lua/plugins/statuscol.lua
Normal file
27
nvim/lua/plugins/statuscol.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
return {
|
||||
'luukvbaal/statuscol.nvim',
|
||||
event = 'VeryLazy',
|
||||
opts = function()
|
||||
local builtin = require('statuscol.builtin')
|
||||
return {
|
||||
relculright = true,
|
||||
segments = {
|
||||
{
|
||||
sign = { name = { '.*' }, maxwidth = 1, auto = true },
|
||||
click = 'v:lua#.ScSa'
|
||||
},
|
||||
{ text = { builtin.lnumfunc }, click = 'v:lua.ScLa', },
|
||||
{ text = { builtin.foldfunc }, click = 'v:lua.ScFa' },
|
||||
{
|
||||
text = { ' ' },
|
||||
condition = { builtin.not_empty, true, builtin.not_empty },
|
||||
click = 'v:lua.ScFa'
|
||||
},
|
||||
{
|
||||
sign = { name = { 'GitSigns' }, maxwidth = 1, colwidth = 1, auto = true },
|
||||
click = 'v:lua.ScSa'
|
||||
},
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
46
nvim/lua/plugins/telescope.lua
Normal file
46
nvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
event = 'VeryLazy',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
opts = {
|
||||
defaults = {
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
width = 0.75,
|
||||
height = 0.5,
|
||||
},
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
['<esc>'] = 'close',
|
||||
['<C-j>'] = 'move_selection_previous',
|
||||
['<C-k>'] = 'move_selection_next',
|
||||
['<C-l>'] = { '<Right>', type = 'command' },
|
||||
['<C-h>'] = { '<Left>', type = 'command' },
|
||||
['<C-f>'] = 'preview_scrolling_down',
|
||||
['<C-b>'] = 'preview_scrolling_up',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<leader>ff',
|
||||
'<cmd>Telescope find_files<cr>',
|
||||
},
|
||||
{
|
||||
'<leader>fg',
|
||||
'<cmd>Telescope live_grep<cr>',
|
||||
},
|
||||
{
|
||||
'<leader>b',
|
||||
'<cmd>Telescope buffers<cr>',
|
||||
},
|
||||
{
|
||||
';',
|
||||
'<cmd>Telescope commands<cr>',
|
||||
}
|
||||
},
|
||||
}
|
||||
14
nvim/lua/plugins/todo-comments.lua
Normal file
14
nvim/lua/plugins/todo-comments.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
'folke/todo-comments.nvim',
|
||||
event = 'VeryLazy',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
},
|
||||
opts = {
|
||||
highlight = {
|
||||
-- bg conflects with linehl of gitsigns
|
||||
keyword = 'fg',
|
||||
after = '',
|
||||
},
|
||||
}
|
||||
}
|
||||
17
nvim/lua/plugins/toggleterm.lua
Normal file
17
nvim/lua/plugins/toggleterm.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
'akinsho/toggleterm.nvim',
|
||||
event = 'VeryLazy',
|
||||
keys = {
|
||||
{ mode = { 'n' }, '<C-t>', ':ToggleTerm<CR>' },
|
||||
},
|
||||
opts = {
|
||||
open_mapping = [[<C-t>]],
|
||||
size = function(term)
|
||||
if term.direction == 'horizontal' then
|
||||
return 15
|
||||
else
|
||||
return vim.o.columns * 0.3
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
11
nvim/lua/plugins/tokyonight.lua
Normal file
11
nvim/lua/plugins/tokyonight.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
'folke/tokyonight.nvim',
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
init = function()
|
||||
require('tokyonight').load()
|
||||
end,
|
||||
opts = {
|
||||
style = 'night',
|
||||
},
|
||||
}
|
||||
99
nvim/lua/plugins/tree.lua
Normal file
99
nvim/lua/plugins/tree.lua
Normal file
@@ -0,0 +1,99 @@
|
||||
return {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
event = 'VeryLazy',
|
||||
dependencies = 'nvim-tree/nvim-web-devicons',
|
||||
init = function()
|
||||
local function open_nvim_tree()
|
||||
require('nvim-tree.api').tree.find_file({ open = true })
|
||||
end
|
||||
|
||||
local function close_nvim_tree()
|
||||
local layout = vim.api.nvim_call_function('winlayout', {})
|
||||
if layout[1] == 'leaf'
|
||||
and vim.api.nvim_buf_get_option(vim.api.nvim_win_get_buf(layout[2]), 'filetype') == 'NvimTree'
|
||||
and layout[3] == nil then
|
||||
vim.cmd('confirm quit')
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd('VimEnter', { callback = open_nvim_tree })
|
||||
vim.api.nvim_create_autocmd('BufEnter', { callback = close_nvim_tree })
|
||||
end,
|
||||
opts = {
|
||||
on_attach = function(bufnr)
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
local api = require('nvim-tree.api')
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
map('n', '<C-v>', api.node.open.vertical)
|
||||
map('n', '<C-s>', api.node.open.horizontal)
|
||||
map('n', 'v', api.node.open.vertical)
|
||||
map('n', 's', api.node.open.horizontal)
|
||||
map('n', '[d', api.node.navigate.diagnostics.prev)
|
||||
map('n', ']d', api.node.navigate.diagnostics.next)
|
||||
-- map('n', 'r', api.fs.rename_sub, { buffer = bufnr })
|
||||
|
||||
map('n', '<C-t>', function() require('toggleterm').toggle() end)
|
||||
map('n', '-', function() require('chowcho').run() end)
|
||||
end,
|
||||
renderer = {
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
icons = {
|
||||
item = '|',
|
||||
edge = '|',
|
||||
corner = '┗',
|
||||
}
|
||||
},
|
||||
highlight_git = true,
|
||||
icons = {
|
||||
git_placement = 'after',
|
||||
glyphs = {
|
||||
symlink = '',
|
||||
git = {
|
||||
deleted = '',
|
||||
ignored = '◌',
|
||||
renamed = '➜',
|
||||
staged = '+',
|
||||
unmerged = '',
|
||||
untracked = '?',
|
||||
-- unstaged = 'ϟ',
|
||||
},
|
||||
folder = {
|
||||
arrow_open = '',
|
||||
arrow_closed = '',
|
||||
default = '',
|
||||
open = '',
|
||||
empty = '',
|
||||
empty_open = '',
|
||||
symlink = '',
|
||||
symlink_open = '',
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
view = {
|
||||
width = 35,
|
||||
side = 'left',
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {
|
||||
error = '',
|
||||
warning = '',
|
||||
info = '',
|
||||
hint = '',
|
||||
},
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
},
|
||||
hijack_netrw = true,
|
||||
update_cwd = true,
|
||||
reload_on_bufenter = true,
|
||||
}
|
||||
}
|
||||
71
nvim/lua/plugins/treesitter.lua
Normal file
71
nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,71 @@
|
||||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
event = 'VeryLazy',
|
||||
dependencies = {
|
||||
'nvim-treesitter/playground',
|
||||
'nvim-treesitter/nvim-treesitter-refactor',
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
'RRethy/nvim-treesitter-endwise',
|
||||
-- 'andymass/vim-matchup', -- extend % key
|
||||
'yioneko/nvim-yati',
|
||||
},
|
||||
init = function()
|
||||
local ncmd = vim.api.nvim_command
|
||||
ncmd('set foldmethod=expr')
|
||||
ncmd('set foldexpr=nvim_treesitter#foldexpr()')
|
||||
end,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
'c', 'lua', 'rust', 'go', 'python',
|
||||
'zig', 'markdown', 'solidity', 'jsonnet', 'vim', 'graphql'
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
playground = {
|
||||
enable = true,
|
||||
},
|
||||
query_linter = {
|
||||
enable = true,
|
||||
use_virtual_text = true,
|
||||
lint_events = { 'BufWrite', 'CursorHold' },
|
||||
},
|
||||
-- nvim-treesitter/nvim-treesitter-refactor
|
||||
refactor = {
|
||||
highlight_definitions = { enable = true },
|
||||
smart_rename = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
smart_rename = 'gnr',
|
||||
},
|
||||
},
|
||||
},
|
||||
indent = { enable = false },
|
||||
autopairs = { enable = true },
|
||||
rainbow = { enable = true },
|
||||
autotag = { enable = true },
|
||||
context_commentstring = { enable = true },
|
||||
-- RRethy/nvim-treesitter-endwise
|
||||
endwise = {
|
||||
enable = true,
|
||||
},
|
||||
-- andymass/vim-matchup
|
||||
-- matchup = {
|
||||
-- enable = true,
|
||||
-- },
|
||||
-- nvim-treesitter/nvim-treesitter-textobjects
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
},
|
||||
},
|
||||
-- yioneko/nvim-yati
|
||||
yati = { enable = true },
|
||||
},
|
||||
config = function(_, opts)
|
||||
require('nvim-treesitter.configs').setup(opts)
|
||||
end,
|
||||
}
|
||||
4
nvim/lua/plugins/wakatime.lua
Normal file
4
nvim/lua/plugins/wakatime.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
'wakatime/vim-wakatime',
|
||||
event = 'InsertEnter',
|
||||
}
|
||||
1
nvim/lua/plugins/whichkey.lua
Normal file
1
nvim/lua/plugins/whichkey.lua
Normal file
@@ -0,0 +1 @@
|
||||
return {"folke/which-key.nvim"}
|
||||
Reference in New Issue
Block a user