switch to lazyvim

Signed-off-by: d0zingcat <lee.w.tang@gmail.com>
This commit is contained in:
d0zingcat
2025-02-22 23:42:29 +08:00
parent 7f38f49f95
commit d4d819083c
61 changed files with 522 additions and 38 deletions

View File

@@ -1,47 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.workspace.library": [
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/neodev.nvim/types/stable",
"/opt/homebrew/Cellar/neovim/0.8.2/share/nvim/runtime/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/barbar.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/clangd_extensions.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/cmp-buffer/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/cmp-vsnip/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/Comment.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/fidget.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/gitsigns.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/hop/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/lsp-colors.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/lsp-setup.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/lsp_lines.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/lsp_signature.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/lualine.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/mason.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/neodev.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/nvim-autopairs/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/nvim-cmp/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/nvim-dap/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/nvim-lspconfig/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/nvim-lsputils/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/nvim-tree.lua/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/nvim-treesitter/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/nvim-web-devicons/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/packer.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/plenary.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/rust-tools.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/telescope-vim-bookmarks.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/telescope.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/todo-comments.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/toggleterm.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/tokyonight.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/trouble.nvim/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/vim-illuminate/lua",
"/Users/d0zingcat/.local/share/nvim/site/pack/packer/start/which-key.nvim/lua",
"/Users/d0zingcat/.dotfiles/nvim/lua",
"${3rd}/luassert/library",
"${3rd}/luv/library"
]
}

View File

@@ -0,0 +1,8 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
--
-- Add any additional autocmds here
-- with `vim.api.nvim_create_autocmd`
--
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell")

View File

@@ -1,27 +0,0 @@
vim.api.nvim_create_augroup('Init', { clear = true })
-- highlight yanked text briefly
vim.api.nvim_create_autocmd('TextYankPost', {
group = 'Init',
callback = function()
vim.highlight.on_yank({
higroup = 'IncSearch',
timeout = 250,
on_visual = true,
})
end,
})
-- reopen last position
vim.api.nvim_create_autocmd('BufReadPost', {
group = 'Init',
callback = function()
local previous_pos = vim.api.nvim_buf_get_mark(0, '"')[1]
local last_line = vim.api.nvim_buf_line_count(0)
if previous_pos >= 1 and previous_pos <= last_line and vim.bo.filetype ~= 'commit' then
vim.cmd('normal! g`"')
end
end,
})
vim.cmd([[iabbrev pdb import pdb; pdb.set_trace()<ESC>]])
vim.cmd([[iabbrev ipdb import ipdb; ipdb.set_trace()<ESC>]])

View File

@@ -1,10 +0,0 @@
function GetPath()
vim.fn.setreg('+', vim.fn.getreg('%'))
end
function OpenFinder()
local current_path = vim.fn.expand('%:p:h')
vim.cmd('!open ' .. current_path)
end
vim.api.nvim_set_keymap('n', '<leader>of', ':lua OpenFinder()<CR>', { noremap = true, silent = true })

View File

@@ -1,21 +0,0 @@
local cmd = vim.cmd
local ncmd = vim.api.nvim_command
ncmd('filetype plugin indent on')
cmd([[ autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 textwidth=120 ]])
cmd([[ autocmd FileType go setlocal tabstop=4 shiftwidth=4 softtabstop=4 textwidth=120 noexpandtab ]])
cmd([[ autocmd FileType json,jsonnet setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab ]])
cmd([[ autocmd FileType yaml setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=0 expandtab ]])
cmd([[ autocmd FileType gotmpl setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=0 expandtab ]])
cmd([[ autocmd FileType php setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=120 ]])
cmd([[ autocmd FileType html,htmldjango,xhtml,haml setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=0 ]])
cmd([[ autocmd FileType ruby setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=120 ]])
cmd([[ autocmd FileType less,sass,scss,css setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=120 ]])
cmd(
[[ autocmd FileType javascript,javascript.jsx,javascriptreact,typescript,typescriptreact setlocal tabstop=2 shiftwidth=2 softtabstop=2 expandtab ]]
)
cmd([[ autocmd FileType NvimTree setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=0 ]])
cmd([[ autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=0]])
cmd([[ autocmd BufNewFile,BufRead *.proto setfiletype proto ]])
cmd([[ autocmd FileType proto setlocal shiftwidth=2 expandtab ]])

View File

@@ -1,191 +0,0 @@
require('config.prelude')
require('config.cmd')
require('config.lazy')
require('config.filetype')
require('config.keymap')
require('config.extension')
--
-- local cmd = vim.cmd
-- local o_s = vim.o
-- local map_key = vim.api.nvim_set_keymap
-- local g = vim.g
-- local api = vim.api
-- local fn = vim.fn
-- local ncmd = vim.api.nvim_command
-- local o, wo, bo = vim.o, vim.wo, vim.bo
--
-- local buffer = { o, bo }
-- local window = { o, wo }
--
--
-- local utils = require('utils')
-- local map = utils.map
-- local set = utils.set
--
-- --vim.lsp.set_log_level('debug')
-- -- Preset
-- -- Prerequisites Must have neovim installed
--
--
-- -- -- 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`" ]])
--
-- -- Shcemas and colors
-- -- cmd([[ colorscheme tokyonight ]])
-- --set('background', 'dark') -- 主题背景 dark-深色; light-浅色
--
-- -- CMDs
-- -- cmd [[syntax enable]]
-- -- cmd [[syntax on]] -- 开启文件类型侦测
-- -- in makefiles, don't expand tabs to spaces, since actual tab characters are
-- -- needed, and have indentation at 8 chars to be sure that all indents are tabs
-- -- (despite the mappings later):
--
-- -- auto compile packer
-- -- cmd([[
-- -- augroup packer_user_config
-- -- autocmd!
-- -- autocmd BufWritePost plugins.lua source <afile> | PackerCompile
-- -- augroup end
-- -- ]])
-- -- autocmd BufRead,BufNewFile *.bean,*.beancount set filetype=beancount
--
-- -- cmd [[command ShowBlank set listchars=eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣]]
--
-- -- Settings
-- -- max timeout for common command
-- set('timeoutlen', 1000)
-- -- set number, cusor or line/column
-- set('nu', true, window)
-- set('rnu', true, window)
-- set('cul', true, window)
-- set('cuc', true, window)
--
-- -- tab 缩进
-- -- set("tabstop", 4) -- 设置Tab长度为4空格
-- -- set("shiftwidth", 4) -- 设置自动缩进长度为4空格
-- -- set("autoindent", true) -- 继承前一行的缩进方式,适用于多行注释
-- -- set("colorcolumn", "80") -- 设置长度提示79
-- -- set('noswapfile', true) -- 不设置swap文件
--
-- set('showmatch', true) -- 显示括号匹配
-- set('mouse', 'a') -- set scroll mode
-- set('langmenu', 'zh_CN.UTF-8')
-- set('helplang', 'cn')
-- set('encoding', 'utf-8')
-- set('fencs', 'utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936')
-- set('hidden', true)
-- set('wildmenu', true)
-- set('hlsearch', true)
-- set('matchtime', 1)
-- set('updatetime', 100)
-- set('smarttab', true)
-- set('expandtab', true)
-- set('laststatus', 2)
-- set('showcmd', true)
-- set('ruler', true)
-- set('history', 300)
-- set('backup', false)
-- set('swapfile', false)
-- set('foldenable', false)
-- set('autoread', true)
-- set('autowrite', true)
-- set('mouse', 'a')
-- set('incsearch', true) -- 开启实时搜索
-- set('ignorecase', true) -- 搜索时大小写不敏感
--
-- set('number', true, window)
-- -- set('relativenumber', true, window)
-- set('cursorline', true, window)
-- set('cursorcolumn', true, window)
-- set('signcolumn', 'auto:2')
--
-- -- set("textwidth", 120, buffer)
-- set('smartindent', true, buffer)
-- set('autoindent', true, buffer)
-- set('cindent', true, buffer)
-- set('shiftwidth', 4, buffer)
-- set('softtabstop', 4, buffer)
-- set('tabstop', 4, buffer)
-- set('synmaxcol', 120)
--
-- -- set autowrite
-- -- set("backspace", "indent,eol,start")
--
-- -- Key mappings
-- -- map Leader key to <space>
-- -- g.mapleader = [[ ]]
--
-- -- v 模式下复制内容到系统剪切板
-- map('v', '<Leader>cp', '"+yy')
-- -- n 模式下复制一行到系统剪切板
-- map('n', '<Leader>cp', '"+yy')
-- -- n 模式下粘贴系统剪切板的内容
-- map('n', '<Leader>v', '"+p')
-- -- reload vimrc
-- -- map('n', '<leader>rv', ':source $MYVIMRC<CR>')
--
-- -- insert mode mapping
-- --map('i', '<c-b>', '<c-o>b')
-- --map('i', '<c-f>', '<c-o>l')
-- --map('i', '<c-j>', '<c-o>j')
-- --map('i', '<c-k>', '<c-o>k')
--
-- -- map('n', '<F1>', '<nop>')
-- -- map('i', '<F1>', '<nop>')
--
-- --map('i', '<c-k>', '<up>')
-- --map('i', '<c-j>', '<down>')
-- --map('i', '<c-h>', '<left>')
-- --map('i', '<c-l>', '<right>')
--
-- -- map('n', '<leader>e', '1<c-w>w')
-- -- map('n', '<leader>p', ':wincmd p<CR>')
--
-- map('i', '<C-e>', 'copilot#Accept()', { expr = true })
-- vim.g.copilot_no_tab_map = 1
-- vim.g.copilot_no_maps = 1
-- vim.g.copilot_assume_mapped = 1
--
--
-- -- require('plugins')
--
-- -- Neoformat
-- if not fn.executable('luafmt') then
-- cmd([[ :!npm install -g lua-fmt]])
-- end
--
-- -- barbar
-- local opts = { noremap = true, silent = true }
-- map('n', '=', ':BufferPick<CR>', opts)
--
-- -- choosewin
-- map('n', '-', '<Plug>(choosewin)', { noremap = false })
--
-- -- sort go imports
-- -- vim.api.nvim_create_autocmd('BufWritePre', {
-- -- pattern = '*.go',
-- -- callback = function()
-- -- vim.lsp.buf.code_action({ context = { only = { 'source.organizeImports' } }, apply = true })
-- -- end
-- -- })
--
-- -- Some configurations not able to migrate
-- -- api.nvim_exec(
-- -- [[
-- -- " set nocompatible
-- -- "function! NearestMethodOrFunction() abort
-- -- " return get(b:, 'vista_nearest_method_or_function', '')
-- -- "endfunction
-- -- "
-- -- "set statusline+=%{NearestMethodOrFunction()}
-- -- ]],
-- -- false
-- -- )

View File

@@ -1,19 +0,0 @@
local map = vim.keymap.set
-- Key bindings
map('', '<c-a>', 'ggVG$"+y')
map('v', '<c-c>', '"+y')
map('v', '<tab>', '>gv')
map('v', '<s-tab>', '<gv')
map('i', '<c-\'>', '<Right>')
map('i', '<c-;>', '<Left>')
map('i', '<c-b>', '<c-o>b')
map('i', '<c-f>', '<c-o>l')
map('i', '<c-h>', '<c-o>h')
map('i', '<c-l>', '<c-o>l')
map('i', '<c-j>', '<c-o>j')
map('i', '<c-k>', '<c-o>k')
map('c', '<c-h>', '<Left>')
map('c', '<c-l>', '<Right>')
map('c', '<c-b>', '<Left>')
map('c', '<c-f>', '<Right>')

View File

@@ -0,0 +1,3 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here

View File

@@ -1,29 +1,53 @@
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,
})
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
{ import = 'plugins' },
-- { import = 'plugins.lsp' },
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = {
enabled = true, -- check for plugin updates periodically
notify = false, -- notify on update
}, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
ui = {
border = 'rounded',
icons = {
task = '',
}
},
-- change_detection = {
-- notify = false,
-- }
},
})

View File

@@ -0,0 +1,3 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here

View File

@@ -1,52 +0,0 @@
if vim.fn.has('nvim') == 0 then
return
end
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.o.termguicolors = true
vim.g.mapleader = ' ' -- Make sure to set `mapleader` before lazy so your mappings are correct
vim.g.maplocalleader = '\\' -- Same for `maplocalleader`
vim.o.encoding = 'utf-8'
vim.o.fileencoding = 'utf-8'
vim.o.fencs = 'utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936'
vim.o.hidden = true
vim.o.wildmenu = true
vim.o.hlsearch = true
vim.o.incsearch = true
vim.o.matchtime = 1
vim.o.showmatch = true
vim.o.updatetime = 100
vim.o.ignorecase = true
vim.o.smarttab = true
vim.o.expandtab = true
vim.o.laststatus = 2
vim.o.showcmd = true
vim.o.ruler = true
vim.o.history = 300
vim.o.backup = false
vim.o.swapfile = false
vim.o.foldenable = false
vim.o.autoread = true
vim.o.autowrite = true
vim.o.mouse = 'a'
vim.o.number = true
vim.o.cursorline = true
vim.o.relativenumber = true
vim.o.cursorcolumn = true
vim.o.signcolumn = 'auto:1'
-- vim.o.cmdheight = 0
vim.opt.list = true
vim.opt.listchars:append('eol:↴')
vim.opt.fillchars:append { diff = '' }
vim.o.textwidth = 120
vim.o.smartindent = true
vim.o.autoindent = true
vim.o.cindent = true
vim.o.shiftwidth = 4
vim.o.softtabstop = 4
vim.o.tabstop = 4

View File

@@ -1,5 +0,0 @@
return {
'm4xshen/autoclose.nvim',
event = 'VeryLazy',
config = true,
}

View File

@@ -1,5 +0,0 @@
return {
'windwp/nvim-autopairs',
event = 'InsertEnter',
config = true,
}

View File

@@ -1,23 +0,0 @@
return {
"yetone/avante.nvim",
event = "VeryLazy",
-- build = "make", -- This is Optional, only if you want to use tiktoken_core to calculate tokens count
opts = {
-- provider = "claude",
provider = "openai",
},
dependencies = {
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
"stevearc/dressing.nvim",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
--- The below is optional, make sure to setup it properly if you have lazy=true
{
'MeanderingProgrammer/render-markdown.nvim',
opts = {
file_types = { "markdown", "Avante" },
},
ft = { "markdown", "Avante" },
},
},
}

View File

@@ -1,20 +0,0 @@
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' },
},
},
}
}

View File

@@ -1,13 +0,0 @@
return {
'tkmpypy/chowcho.nvim',
event = 'VeryLazy',
keys = {
{
'-',
mode = { 'n' },
function()
require('chowcho').run()
end,
}
}
}

View File

@@ -1,79 +0,0 @@
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,
}

View File

@@ -1,13 +0,0 @@
return {
'Exafunction/codeium.vim',
event = 'BufEnter',
config = function()
-- Change '<C-g>' here to any keycode you like.
vim.keymap.set('i', '<C-e>', function() return vim.fn['codeium#Accept']() end, { expr = true, silent = true })
vim.keymap.set('i', '<c-j>', function() return vim.fn['codeium#CycleCompletions'](1) end,
{ expr = true, silent = true })
vim.keymap.set('i', '<c-k>', function() return vim.fn['codeium#CycleCompletions'](-1) end,
{ expr = true, silent = true })
vim.keymap.set('i', '<c-x>', function() return vim.fn['codeium#Clear']() end, { expr = true, silent = true })
end
}

View File

@@ -1,5 +0,0 @@
return {
'numToStr/comment.nvim',
keys = { 'gcc', { 'gc', mode = 'v' } },
config = true,
}

View File

@@ -1,14 +0,0 @@
return {
'nvim-tree/nvim-web-devicons',
event = 'VeryLazy',
opts = {
override = {
zsh = {
icon = '',
color = '#428850',
name = 'Zsh',
},
},
default = true,
}
}

View File

@@ -1,11 +0,0 @@
return {
'princejoogie/dir-telescope.nvim',
event = 'VeryLazy',
dependencies = {
'nvim-telescope/telescope.nvim',
},
config = function()
require('dir-telescope').setup()
require('telescope').load_extension('dir')
end,
}

View File

@@ -0,0 +1,197 @@
-- since this is just an example spec, don't actually load anything here and return an empty spec
-- stylua: ignore
if true then return {} end
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
--
-- In your plugin files, you can:
-- * add extra plugins
-- * disable/enabled LazyVim plugins
-- * override the configuration of LazyVim plugins
return {
-- add gruvbox
{ "ellisonleao/gruvbox.nvim" },
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox",
},
},
-- change trouble config
{
"folke/trouble.nvim",
-- opts will be merged with the parent spec
opts = { use_diagnostic_signs = true },
},
-- disable trouble
{ "folke/trouble.nvim", enabled = false },
-- override nvim-cmp and add cmp-emoji
{
"hrsh7th/nvim-cmp",
dependencies = { "hrsh7th/cmp-emoji" },
---@param opts cmp.ConfigSchema
opts = function(_, opts)
table.insert(opts.sources, { name = "emoji" })
end,
},
-- change some telescope options and a keymap to browse plugin files
{
"nvim-telescope/telescope.nvim",
keys = {
-- add a keymap to browse plugin files
-- stylua: ignore
{
"<leader>fp",
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
desc = "Find Plugin File",
},
},
-- change some options
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
},
},
-- add pyright to lspconfig
{
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- pyright will be automatically installed with mason and loaded with lspconfig
pyright = {},
},
},
},
-- add tsserver and setup with typescript.nvim instead of lspconfig
{
"neovim/nvim-lspconfig",
dependencies = {
"jose-elias-alvarez/typescript.nvim",
init = function()
require("lazyvim.util").lsp.on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
end)
end,
},
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- tsserver will be automatically installed with mason and loaded with lspconfig
tsserver = {},
},
-- you can do any additional lsp server setup here
-- return true if you don't want this server to be setup with lspconfig
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
setup = {
-- example to setup with typescript.nvim
tsserver = function(_, opts)
require("typescript").setup({ server = opts })
return true
end,
-- Specify * to use this function as a fallback for any server
-- ["*"] = function(server, opts) end,
},
},
},
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
{ import = "lazyvim.plugins.extras.lang.typescript" },
-- add more treesitter parsers
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"html",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
},
},
},
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
-- would overwrite `ensure_installed` with the new value.
-- If you'd rather extend the default config, use the code below instead:
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add tsx and treesitter
vim.list_extend(opts.ensure_installed, {
"tsx",
"typescript",
})
end,
},
-- the opts function can also be used to change the default opts:
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function(_, opts)
table.insert(opts.sections.lualine_x, {
function()
return "😄"
end,
})
end,
},
-- or you can return new options to override all the defaults
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function()
return {
--[[add your custom lualine config here]]
}
end,
},
-- use mini.starter instead of alpha
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
{ import = "lazyvim.plugins.extras.lang.json" },
-- add any tools you want to have installed below
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
},
}

View File

@@ -1,13 +0,0 @@
return {
'j-hui/fidget.nvim', -- nvim-lsp progress
branch = 'legacy',
event = 'VeryLazy',
opts = {
text = {
done = '[✓]',
},
fmt = {
stack_upwards = false,
},
},
}

View File

@@ -1,4 +0,0 @@
return {
'tpope/vim-fugitive',
event = 'VeryLazy',
}

View File

@@ -1,49 +0,0 @@
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
}
}

View File

@@ -1,5 +0,0 @@
return {
'm-demare/hlargs.nvim',
event = 'VeryLazy',
config = true,
}

View File

@@ -1,5 +0,0 @@
return {
'glepnir/hlsearch.nvim',
event = 'VeryLazy',
config = true,
}

View File

@@ -1,25 +0,0 @@
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>',
},
},
}

View File

@@ -1,5 +0,0 @@
return {
'adelarsq/image_preview.nvim',
event = 'VeryLazy',
config = true,
}

View File

@@ -1,5 +0,0 @@
return {
'mattdibi/incolla.nvim',
cmd = { 'Incolla' },
config = true,
}

View File

@@ -1,43 +0,0 @@
-- 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,
},
whitespace = {
},
exclude = {
buftypes = {
'terminal',
'NvimTree',
'nofile'
}
},
}
}

View File

@@ -1,151 +0,0 @@
return {
'junnplus/lsp-setup.nvim',
dependencies = {
'neovim/nvim-lspconfig',
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
'folke/neodev.nvim'
},
init = function()
vim.lsp.set_log_level('debug')
require('vim.lsp.log').set_format_func(vim.inspect)
local rounded = { border = 'rounded' }
vim.diagnostic.config({ float = rounded })
local with_rounded = function(handler)
return vim.lsp.with(handler, rounded)
end
vim.lsp.handlers['textDocument/hover'] = with_rounded(vim.lsp.handlers.hover)
vim.lsp.handlers['textDocument/signatureHelp'] = with_rounded(vim.lsp.handlers.signature_help)
end,
opts = {
mappings = {
gd = function() require('telescope.builtin').lsp_definitions() end,
gi = function() require('telescope.builtin').lsp_implementations() end,
gr = function() require('telescope.builtin').lsp_references() end,
['<space>f'] = vim.lsp.buf.format,
},
inlay_hints = {
enabled = true,
debug = true,
},
servers = {
eslint = {},
pylsp = {
settings = {
pylsp = {
-- PylspInstall python-lsp-black
-- PylspInstall pyls-isort
configurationSources = { 'flake8' },
plugins = {
pycodestyle = {
enabled = false,
},
mccabe = {
enabled = false,
},
pyflakes = {
enabled = false,
},
flake8 = {
enabled = true,
},
black = {
enabled = true,
}
}
}
}
},
yamlls = {
settings = {
yaml = {
keyOrdering = false
}
}
},
crystalline = {},
terraformls = {},
jsonls = {},
bashls = {},
tsserver = {
settings = {
typescript = {
inlayHints = {
includeInlayParameterNameHints = 'all',
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayVariableTypeHintsWhenTypeMatchesName = false,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
}
},
}
},
dockerls = {},
-- jsonnet_ls = {},
helm_ls = {},
gopls = {
settings = {
gopls = {
gofumpt = true,
-- staticcheck = true,
usePlaceholders = true,
codelenses = {
gc_details = true,
},
hints = {
rangeVariableTypes = true,
parameterNames = true,
constantValues = true,
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
functionTypeParameters = true,
},
},
},
},
-- bufls = {},
-- html = {},
lua_ls = {
settings = {
Lua = {
workspace = {
checkThirdParty = false,
},
hint = {
enable = true,
arrayIndex = 'Disable',
},
}
}
},
['rust_analyzer@nightly'] = {
settings = {
['rust-analyzer'] = {
diagnostics = {
disabled = { 'unresolved-proc-macro' },
},
cargo = {
loadOutDirsFromCheck = true,
},
procMacro = {
enable = true,
},
inlayHints = {
closureReturnTypeHints = {
enable = true
},
},
cache = {
warmup = false,
}
},
},
}
}
},
}

View File

@@ -1,5 +0,0 @@
return {
'ray-x/lsp_signature.nvim',
event = 'VeryLazy',
config = true,
}

View File

@@ -1,14 +0,0 @@
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,
},
},
}

View File

@@ -1 +0,0 @@
return { "folke/neoconf.nvim", cmd = "Neoconf" }

View File

@@ -1,9 +0,0 @@
return {
'folke/neodev.nvim',
event = 'VeryLazy',
dependencies = {
'neovim/nvim-lspconfig',
},
ft = { 'lua' },
config = true,
}

View File

@@ -1,22 +0,0 @@
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
}

View File

@@ -1,5 +0,0 @@
return {
'utilyre/sentiment.nvim',
event = 'VeryLazy',
config = true,
}

View File

@@ -1,5 +0,0 @@
return {
'ray-x/lsp_signature.nvim',
event = 'VeryLazy',
config = true,
}

View File

@@ -1,16 +0,0 @@
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,
}
}

View File

@@ -1,27 +0,0 @@
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
}

View File

@@ -1,47 +0,0 @@
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-k>'] = 'move_selection_previous',
['<C-j>'] = '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>',
}
},
file_ignore_patterns = { '^vendor/', '^.git/' },
}

View File

@@ -1,14 +0,0 @@
return {
'folke/todo-comments.nvim',
event = 'VeryLazy',
dependencies = {
'nvim-lua/plenary.nvim',
},
opts = {
highlight = {
-- bg conflects with linehl of gitsigns
keyword = 'fg',
after = '',
},
}
}

View File

@@ -1,17 +0,0 @@
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,
},
}

View File

@@ -1,11 +0,0 @@
return {
'folke/tokyonight.nvim',
lazy = false,
priority = 1000,
init = function()
require('tokyonight').load()
end,
opts = {
style = 'night',
},
}

View File

@@ -1,100 +0,0 @@
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 = {
filters = { dotfiles = false, custom = { '^.git$' } },
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,
}
}

View File

@@ -1,71 +0,0 @@
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,
}

View File

@@ -1,4 +0,0 @@
return {
'wakatime/vim-wakatime',
event = 'InsertEnter',
}

View File

@@ -1 +0,0 @@
return {"folke/which-key.nvim"}

View File

@@ -1,52 +0,0 @@
local cmd = vim.cmd
local o_s = vim.o
local map_key = vim.api.nvim_set_keymap
local ncmd = vim.api.nvim_command
local o = vim.o
local function opt(o, v, scopes)
scopes = scopes or { o_s }
for _, s in ipairs(scopes) do
s[o] = v
end
end
local function autocmd(group, cmds, clear)
clear = clear == nil and false or clear
if type(cmds) == 'string' then
cmds = { cmds }
end
cmd('augroup ' .. group)
if clear then
cmd([[au!]])
end
for _, c in ipairs(cmds) do
cmd('autocmd ' .. c)
end
cmd([[augroup END]])
end
local function map(modes, lhs, rhs, opts)
opts = opts or {}
opts.noremap = opts.noremap == nil and true or opts.noremap
if type(modes) == 'string' then
modes = { modes }
end
for _, mode in ipairs(modes) do
if type(rhs) == "string" then
map_key(mode, lhs, rhs, opts)
else
vim.keymap.set(mode, lhs, rhs, opts)
end
end
end
local function set(opt, v, scopes)
scopes = scopes or { o }
for _, s in ipairs(scopes) do
s[opt] = v
end
end
return { opt = opt, autocmd = autocmd, map = map, set = set, ncmd = ncmd }