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

8
nvim/.gitignore vendored Normal file
View File

@@ -0,0 +1,8 @@
tt.*
.tests
doc/tags
debug
.repro
foo.*
*.log
data

15
nvim/.neoconf.json Normal file
View File

@@ -0,0 +1,15 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
}
}

201
nvim/LICENSE Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

4
nvim/README.md Normal file
View File

@@ -0,0 +1,4 @@
# 💤 LazyVim
A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
Refer to the [documentation](https://lazyvim.github.io/installation) to get started.

View File

@@ -1 +1,2 @@
require('config')
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")

View File

@@ -1,57 +0,0 @@
{
"autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" },
"avante.nvim": { "branch": "main", "commit": "d543d0ed53a870265af07a003fed893bd751f81c" },
"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" },
"codeium.vim": { "branch": "main", "commit": "7a01ffb1e6538fe634f294908a50a7b680039284" },
"comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"dir-telescope.nvim": { "branch": "main", "commit": "805405b9f98dc3470f8676773dc0e6151a9158ed" },
"dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" },
"fidget.nvim": { "branch": "legacy", "commit": "2f7c08f45639a64a5c0abcf67321d52c3f499ae6" },
"gitsigns.nvim": { "branch": "main", "commit": "def49e48c6329527e344d0c99a0d2cd9fdf6bb84" },
"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": "bc620783663ab09d16bff9fdecc07da65b2a1528" },
"lsp-setup.nvim": { "branch": "main", "commit": "6e4e977512ce426d8b52c27f3b6e6aefc73e1452" },
"lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" },
"lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" },
"mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" },
"neoconf.nvim": { "branch": "main", "commit": "60f6dd6aa1006fa5c3ff4b7bf01586dcecbe9187" },
"neodev.nvim": { "branch": "main", "commit": "02893eeb9d6e8503817bd52385e111cba9a90500" },
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
"nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" },
"nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" },
"nvim-lspconfig": { "branch": "master", "commit": "5c33bf1f708ac8cb839469e1a03d45987fec305c" },
"nvim-scrollbar": { "branch": "main", "commit": "d09f14aa16c9f2748e77008f9da7b1f76e4e7b85" },
"nvim-tree.lua": { "branch": "master", "commit": "2086e564c4d23fea714e8a6d63b881e551af2f41" },
"nvim-treesitter": { "branch": "master", "commit": "4bbd2e72f877ce6835c8ccc1b588ed465446c6ab" },
"nvim-treesitter-context": { "branch": "master", "commit": "5efba33af0f39942e426340da7bc15d7dec16474" },
"nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" },
"nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" },
"nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" },
"nvim-yati": { "branch": "main", "commit": "df3dc06076c6fe20a1dcd8643e712af5c252d042" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"render-markdown.nvim": { "branch": "main", "commit": "e919a428cee007e4fc8f86fd0ddb311a723346c7" },
"sentiment.nvim": { "branch": "main", "commit": "ecde8d877881bb78fdb90060c0991e76770dbdbc" },
"statuscol.nvim": { "branch": "main", "commit": "d6f7f5437c5404d958b88bb73e0721b1c0e09223" },
"telescope.nvim": { "branch": "master", "commit": "c392f1b78eaaf870ca584bd698e78076ed301b26" },
"todo-comments.nvim": { "branch": "main", "commit": "51e10f838e84b4756c16311d0b1ef0972c6482d2" },
"toggleterm.nvim": { "branch": "main", "commit": "fee58a0473fd92b28c34f8f724e4918b15ba30a3" },
"tokyonight.nvim": { "branch": "main", "commit": "81c867c5f638597a82c82094dcb90ed42444dabc" },
"vim-fugitive": { "branch": "master", "commit": "64d6cafb9dcbacce18c26d7daf617ebb96b273f3" },
"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": "0099511294f16b81c696004fa6a403b0ae61f7a0" }
}

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 }

3
nvim/stylua.toml Normal file
View File

@@ -0,0 +1,3 @@
indent_type = "Spaces"
indent_width = 2
column_width = 120