Update
This commit is contained in:
7
lua/config/autocmds.lua
Normal file
7
lua/config/autocmds.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
-- 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
|
||||
|
||||
if vim.g.neovide then
|
||||
vim.cmd([[ cd $HOME ]])
|
||||
end
|
||||
11
lua/config/keymaps.lua
Normal file
11
lua/config/keymaps.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
-- 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
|
||||
|
||||
local map = LazyVim.safe_keymap_set
|
||||
|
||||
map({ "i" }, "jk", "<Esc>")
|
||||
|
||||
-- movement
|
||||
map({ "n", "v", "o" }, "H", "^", { desc = "Use 'H' as '^'" })
|
||||
map({ "n", "v", "o" }, "L", "$", { desc = "Use 'L' as '$'" })
|
||||
52
lua/config/lazy.lua
Normal file
52
lua/config/lazy.lua
Normal file
@@ -0,0 +1,52 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
-- bootstrap lazy.nvim
|
||||
-- stylua: ignore
|
||||
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
|
||||
end
|
||||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
-- import any extras modules here
|
||||
-- { import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
-- { import = "lazyvim.plugins.extras.lang.json" },
|
||||
-- { import = "lazyvim.plugins.extras.ui.mini-animate" },
|
||||
-- import/override with your plugins
|
||||
{ import = "plugins" },
|
||||
{ import = "plugins.ui" },
|
||||
{ import = "plugins.lang" },
|
||||
{ import = "plugins.default" },
|
||||
},
|
||||
|
||||
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 for plugins that support semver
|
||||
},
|
||||
|
||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
||||
checker = { enabled = true }, -- automatically check for plugin updates
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
-- "netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
33
lua/config/options.lua
Normal file
33
lua/config/options.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
-- 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
|
||||
|
||||
vim.opt.timeoutlen = 150
|
||||
vim.opt.spell = true
|
||||
vim.opt.spelllang = { "en", "cjk" }
|
||||
vim.opt.spelloptions = "camel"
|
||||
vim.opt.backup = false
|
||||
vim.g.maplocalleader = "\\"
|
||||
vim.g.autoformat = false
|
||||
|
||||
vim.g.node_host_prog = "/opt/homebrew/bin/neovim-node-host"
|
||||
local indent = 2
|
||||
-- vim.opt.expandtab = true -- Use spaces instead of tabs
|
||||
vim.opt.softtabstop = indent -- Number of spaces that a <Tab> counts for while performing editing operations
|
||||
vim.opt.tabstop = indent -- Number of spaces tabs count for
|
||||
vim.opt.shiftwidth = indent -- Size of an indent
|
||||
|
||||
if vim.g.neovide then
|
||||
vim.o.guifont = "Maple Mono:h16"
|
||||
vim.g.neovide_scale_factor = 1.0
|
||||
vim.g.neovide_floating_corner_radius = 20.0
|
||||
vim.g.neovide_line_height = 1.5
|
||||
-- vim.g.transparency = 0.8
|
||||
-- vim.g.neovide_transparency = 0.9
|
||||
-- Allow clipboard copy paste in neovim
|
||||
vim.g.neovide_input_use_logo = 1
|
||||
vim.api.nvim_set_keymap("", "<D-v>", "+p<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("!", "<D-v>", "<C-R>+", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("t", "<D-v>", "<C-R>+", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("v", "<D-v>", "<C-R>+", { noremap = true, silent = true })
|
||||
end
|
||||
67
lua/plugins/coderunner.lua
Normal file
67
lua/plugins/coderunner.lua
Normal file
@@ -0,0 +1,67 @@
|
||||
return {
|
||||
{
|
||||
"CRAG666/code_runner.nvim",
|
||||
ft = { "lua", "python", "c", "cpp" },
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
keys = {
|
||||
{ "<leader>rr", "<cmd>RunCode<cr>", desc = "Run Code" },
|
||||
-- { "<leader>rf", "<cmd>RunFile<cr>", desc = "Run File" },
|
||||
-- { "<leader>rp", "<cmd>RunProject<cr>", desc = "Run Project" },
|
||||
{ "<leader>rd", "<cmd>RunClose<cr>", desc = "Run Close" },
|
||||
},
|
||||
opts = {
|
||||
-- choose default mode (valid term, tab, float, toggle, buf)
|
||||
mode = "term",
|
||||
-- Focus on runner window(only works on toggle, term and tab mode)
|
||||
focus = false,
|
||||
-- startinsert (see ':h inserting-ex')
|
||||
startinsert = false,
|
||||
term = {
|
||||
-- Position to open the terminal, this option is ignored if mode is tab
|
||||
position = "bot",
|
||||
-- window size, this option is ignored if tab is true
|
||||
size = 8,
|
||||
},
|
||||
float = {
|
||||
-- Key that close the code_runner floating window
|
||||
close_key = "<ESC>",
|
||||
-- Window border (see ':h nvim_open_win')
|
||||
border = "none",
|
||||
|
||||
-- Num from `0 - 1` for measurements
|
||||
height = 0.8,
|
||||
width = 0.8,
|
||||
x = 0.5,
|
||||
y = 0.5,
|
||||
|
||||
-- Highlight group for floating window/border (see ':h winhl')
|
||||
border_hl = "FloatBorder",
|
||||
float_hl = "Normal",
|
||||
|
||||
-- Transparency (see ':h winblend')
|
||||
blend = 0,
|
||||
},
|
||||
filetype_path = "", -- No default path defined
|
||||
filetype = {
|
||||
javascript = "node",
|
||||
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
|
||||
c = "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
|
||||
cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
|
||||
python = "python -u",
|
||||
sh = "bash",
|
||||
rust = "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
|
||||
},
|
||||
project_path = "", -- No default path defined
|
||||
project = {},
|
||||
},
|
||||
-- config = {
|
||||
-- filetype = {
|
||||
-- python = "python3 -u",
|
||||
-- },
|
||||
-- mode = "term",
|
||||
-- float = {
|
||||
-- close_key = "q",
|
||||
-- },
|
||||
-- },
|
||||
},
|
||||
}
|
||||
28
lua/plugins/competitest.lua
Normal file
28
lua/plugins/competitest.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
return {
|
||||
{
|
||||
"xeluxee/competitest.nvim",
|
||||
dependencies = "MunifTanjim/nui.nvim",
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ "<localleader>rt", "<cmd>CompetiTest receive testcases<CR>", "Receive testcases" },
|
||||
{ "<localleader>rp", "<cmd>CompetiTest receive problem<CR>", "Receive problem" },
|
||||
{ "<localleader>rc", "<cmd>CompetiTest receive contest<CR>", "Receive contest" },
|
||||
{ "<localleader>c", "<cmd>CompetiTest run<CR>", "Run code" },
|
||||
},
|
||||
config = function()
|
||||
require("competitest").setup({
|
||||
received_problems_path = "$(HOME)/compcode/$(JUDGE)/$(CONTEST)/$(PROBLEM).$(FEXT)c",
|
||||
received_contests_directory = "$(HOME)/compcode/$(JUDGE)/$(CONTEST)",
|
||||
template_file = {
|
||||
cpp = "~/compcode/templates/template.cpp",
|
||||
},
|
||||
compile_command = {
|
||||
cpp = { exec = "clang++", args = { "$(FNAME)", "-o", "$(FNOEXT)", "-lm" } },
|
||||
},
|
||||
run_command = {
|
||||
cpp = { exec = "./$(FNOEXT)" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
20
lua/plugins/default/blink.lua
Normal file
20
lua/plugins/default/blink.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
version = "*",
|
||||
opts = {
|
||||
-- sources = {
|
||||
-- compat = { "avante_commands", "avante_mentions", "avante_files" },
|
||||
-- },
|
||||
keymap = {
|
||||
["<C-j>"] = { "select_next", "fallback" },
|
||||
["<C-k>"] = { "select_prev", "fallback" },
|
||||
},
|
||||
completion = {
|
||||
menu = { border = "single" },
|
||||
documentation = { window = { border = "single" } },
|
||||
},
|
||||
signature = { window = { border = "single" } },
|
||||
},
|
||||
},
|
||||
}
|
||||
11
lua/plugins/default/conform.lua
Normal file
11
lua/plugins/default/conform.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
["json"] = { "jq" },
|
||||
["jsonc"] = { "jq" },
|
||||
["tex"] = { "latexindent" },
|
||||
["toml"] = { "taplo "},
|
||||
}
|
||||
}
|
||||
}
|
||||
15
lua/plugins/default/copilot.lua
Normal file
15
lua/plugins/default/copilot.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
-- {
|
||||
-- "zbirenbaum/copilot.lua",
|
||||
-- opts = {
|
||||
-- copilot_model = "claude-3.7-sonnet",
|
||||
-- suggestion = {
|
||||
-- keymap = {
|
||||
-- accept = "<D-l>",
|
||||
-- next = "<D-]>",
|
||||
-- prev = "<D-[>",
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
}
|
||||
24
lua/plugins/default/lspconfig.lua
Normal file
24
lua/plugins/default/lspconfig.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
optional = true,
|
||||
opts = {
|
||||
servers = {
|
||||
texlab = {
|
||||
keys = {
|
||||
{ "<Leader>K", "<plug>(vimtex-doc-package)", desc = "Vimtex Docs", silent = true },
|
||||
},
|
||||
settings = {
|
||||
texlab = {
|
||||
inlayHints = {
|
||||
labelDefinitions = false,
|
||||
labelReferences = false,
|
||||
},
|
||||
diagnostics = { ignoredPatterns = { "^Overfull", "^Underfull" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
70
lua/plugins/default/luasnip.lua
Normal file
70
lua/plugins/default/luasnip.lua
Normal file
@@ -0,0 +1,70 @@
|
||||
return {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
config = function()
|
||||
require("luasnip").config.set_config({
|
||||
enable_autosnippets = true,
|
||||
store_selection_keys = "`",
|
||||
})
|
||||
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/LuaSnip" })
|
||||
local auto_expand = require("luasnip").expand_auto
|
||||
require("luasnip").expand_auto = function(...)
|
||||
vim.o.undolevels = vim.o.undolevels
|
||||
auto_expand(...)
|
||||
end
|
||||
-- local types = require("luasnip.util.types")
|
||||
-- require("luasnip").config.setup({
|
||||
-- ext_opts = {
|
||||
-- [types.choiceNode] = {
|
||||
-- active = {
|
||||
-- virt_text = { { "●", "GruvboxOrange" } },
|
||||
-- },
|
||||
-- },
|
||||
-- [types.insertNode] = {
|
||||
-- active = {
|
||||
-- virt_text = { { "●", "GruvboxBlue" } },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
end,
|
||||
keys = function()
|
||||
return {
|
||||
{
|
||||
"fj",
|
||||
function()
|
||||
return require("luasnip").expand_or_locally_jumpable() and "<Plug>luasnip-jump-next"
|
||||
-- or "<c-\\><c-n>:call searchpair('[([{<|]', '', '[)\\]}>|]', 'W')<cr>a"
|
||||
end,
|
||||
expr = true,
|
||||
silent = true,
|
||||
mode = "i",
|
||||
},
|
||||
{
|
||||
"fj",
|
||||
function()
|
||||
return require("luasnip").jump(1)
|
||||
end,
|
||||
mode = "s",
|
||||
},
|
||||
{
|
||||
"fk",
|
||||
function()
|
||||
require("luasnip").jump(-1)
|
||||
end,
|
||||
mode = { "i", "s" },
|
||||
},
|
||||
{
|
||||
"<c-h>",
|
||||
"<Plug>luasnip-next-choice",
|
||||
mode = { "i", "s" },
|
||||
},
|
||||
{
|
||||
"<c-p>",
|
||||
"<Plug>luasnip-prev-choice",
|
||||
mode = { "i", "s" },
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
22
lua/plugins/default/neotree.lua
Normal file
22
lua/plugins/default/neotree.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
return {
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
lazy = true,
|
||||
opts = {
|
||||
filesystem = {
|
||||
window = {
|
||||
mappings = {
|
||||
["o"] = "system_open",
|
||||
},
|
||||
},
|
||||
commands = {
|
||||
system_open = function(state)
|
||||
local node = state.tree:get_node()
|
||||
local path = node:get_id()
|
||||
vim.api.nvim_command("silent !open -g " .. path)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
59
lua/plugins/default/tree-sitter.lua
Normal file
59
lua/plugins/default/tree-sitter.lua
Normal file
@@ -0,0 +1,59 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function()
|
||||
return {
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = { "latex" },
|
||||
additional_vim_regex_highlighting = { "latex", "markdown" },
|
||||
},
|
||||
indent = { enable = true, disable = { "python" } },
|
||||
context_commentstring = { enable = true, enable_autocmd = false },
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"cpp",
|
||||
"html",
|
||||
"json",
|
||||
"lua",
|
||||
"luap",
|
||||
"markdown",
|
||||
"make",
|
||||
"markdown_inline",
|
||||
"scala",
|
||||
"python",
|
||||
"query",
|
||||
"toml",
|
||||
"regex",
|
||||
"vim",
|
||||
"yaml",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<cr>",
|
||||
node_incremental = "<cr>",
|
||||
scope_incremental = "\\",
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
rainbow = {
|
||||
enable = true,
|
||||
-- list of languages you want to disable the plugin for
|
||||
disable = { "jsx", "cpp" },
|
||||
-- Which query to use for finding delimiters
|
||||
query = "rainbow-parens",
|
||||
-- Highlight the entire buffer all at once
|
||||
},
|
||||
|
||||
keys = function()
|
||||
return {
|
||||
{ "<cr>", desc = "Increment selection" },
|
||||
{ "<bs>", desc = "Decrement selection", mode = "x" },
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
61
lua/plugins/default/treesitter.lua
Normal file
61
lua/plugins/default/treesitter.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function()
|
||||
return {
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = { "latex" },
|
||||
-- additional_vim_regex_highlighting = { "markdown" },
|
||||
},
|
||||
-- ignore_install = { "latex" },
|
||||
indent = { enable = true, disable = { "python" } },
|
||||
context_commentstring = { enable = true, enable_autocmd = false },
|
||||
ensure_installed = {
|
||||
"latex",
|
||||
"bash",
|
||||
"c",
|
||||
"cpp",
|
||||
"html",
|
||||
"json",
|
||||
"lua",
|
||||
"luap",
|
||||
"markdown",
|
||||
"make",
|
||||
"markdown_inline",
|
||||
"scala",
|
||||
"python",
|
||||
"query",
|
||||
"toml",
|
||||
"regex",
|
||||
"vim",
|
||||
"yaml",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<cr>",
|
||||
node_incremental = "<cr>",
|
||||
scope_incremental = "\\",
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
rainbow = {
|
||||
enable = true,
|
||||
-- list of languages you want to disable the plugin for
|
||||
disable = { "jsx", "cpp" },
|
||||
-- Which query to use for finding delimiters
|
||||
query = "rainbow-parens",
|
||||
-- Highlight the entire buffer all at once
|
||||
},
|
||||
|
||||
keys = function()
|
||||
return {
|
||||
{ "<cr>", desc = "Increment selection" },
|
||||
{ "<bs>", desc = "Decrement selection", mode = "x" },
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
6
lua/plugins/disabled.lua
Normal file
6
lua/plugins/disabled.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
{
|
||||
"rafamadriz/friendly-snippets",
|
||||
enabled = false,
|
||||
},
|
||||
}
|
||||
89
lua/plugins/lang/avante.lua
Normal file
89
lua/plugins/lang/avante.lua
Normal file
@@ -0,0 +1,89 @@
|
||||
return {
|
||||
{
|
||||
"yetone/avante.nvim",
|
||||
event = "VeryLazy",
|
||||
enabled = false,
|
||||
version = false, -- Never set this value to "*"! Never!
|
||||
opts = {
|
||||
-- add any opts here
|
||||
-- for example
|
||||
-- provider = "copilot",
|
||||
-- copilot = { model = "claude-3.5-sonnet" },
|
||||
-- hints = { enabled = false },
|
||||
-- file_selector = {
|
||||
-- provider = "snack",
|
||||
-- provider_opts = {},
|
||||
-- },
|
||||
-- openai = {
|
||||
-- endpoint = "https://api.openai.com/v1",
|
||||
-- model = "gpt-4o", -- your desired model (or use gpt-4o, etc.)
|
||||
-- timeout = 30000, -- Timeout in milliseconds, increase this for reasoning models
|
||||
-- temperature = 0,
|
||||
-- max_tokens = 8192, -- Increase this to include reasoning tokens (for reasoning models)
|
||||
-- --reasoning_effort = "medium", -- low|medium|high, only used for reasoning models
|
||||
-- },
|
||||
},
|
||||
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
|
||||
build = "make",
|
||||
-- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"stevearc/dressing.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
--- The below dependencies are optional,
|
||||
-- "echasnovski/mini.pick", -- for file_selector provider mini.pick
|
||||
-- "nvim-telescope/telescope.nvim", -- for file_selector provider telescope
|
||||
-- "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
|
||||
-- "ibhagwan/fzf-lua", -- for file_selector provider fzf
|
||||
-- "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
|
||||
"zbirenbaum/copilot.lua", -- for providers='copilot'
|
||||
{
|
||||
-- support for image pasting
|
||||
"HakonHarnes/img-clip.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- recommended settings
|
||||
default = {
|
||||
embed_image_as_base64 = false,
|
||||
prompt_for_file_name = false,
|
||||
drag_and_drop = {
|
||||
insert_mode = true,
|
||||
},
|
||||
-- required for Windows users
|
||||
use_absolute_path = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
-- Make sure to set this up properly if you have lazy=true
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
opts = {
|
||||
file_types = { "markdown", "Avante" },
|
||||
},
|
||||
ft = { "markdown", "Avante" },
|
||||
},
|
||||
{
|
||||
"saghen/blink.compat",
|
||||
lazy = true,
|
||||
opts = {},
|
||||
config = function()
|
||||
-- monkeypatch cmp.ConfirmBehavior for Avante
|
||||
require("cmp").ConfirmBehavior = {
|
||||
Insert = "insert",
|
||||
Replace = "replace",
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
lazy = true,
|
||||
opts = {
|
||||
sources = {
|
||||
compat = { "avante_commands", "avante_mentions", "avante_files" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
30
lua/plugins/lang/clangd.lua
Normal file
30
lua/plugins/lang/clangd.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
lazy = true,
|
||||
ft = { "c", "cpp" },
|
||||
opts = {
|
||||
servers = {
|
||||
clangd = {
|
||||
cmd = {
|
||||
"clangd",
|
||||
"--background-index",
|
||||
"--clang-tidy",
|
||||
"--cross-file-rename",
|
||||
"--clang-tidy-checks=performance-*,cppcoreguidelines-*,clang-analyzer-*,bugprone-*",
|
||||
"-j=12",
|
||||
"--all-scopes-completion",
|
||||
"--header-insertion=iwyu",
|
||||
"--query-driver=/usr/bin/clang,/usr/bin/clang++",
|
||||
"--fallback-style=llvm",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"Civitasv/cmake-tools.nvim",
|
||||
lazy = true,
|
||||
ft = { "c", "cpp" },
|
||||
},
|
||||
}
|
||||
43
lua/plugins/lang/latex.lua
Normal file
43
lua/plugins/lang/latex.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
return {
|
||||
{
|
||||
"lervag/vimtex",
|
||||
lazy = false, -- lazy-loading will disable inverse search
|
||||
init = function()
|
||||
vim.g.vimtex_syntax_conceal_disable = 1
|
||||
vim.g.vimtex_mappings_disable = { ["n"] = { "K" } } -- disable `K` as it conflicts with LSP hover
|
||||
vim.g.vimtex_view_method = "sioyek"
|
||||
-- vim.g.vimtex_view_general_viewer = "open -a UPDF"
|
||||
vim.g.vimtex_view_skim_sync = 1
|
||||
vim.g.vimtex_compiler_silent = 1
|
||||
vim.g.vimtex_compiler_method = "latexmk"
|
||||
vim.g.vimtex_compiler_latexmk = {
|
||||
aux_dir = "./aux",
|
||||
out_dir = "",
|
||||
callback = 1,
|
||||
continuous = 1,
|
||||
executable = "latexmk",
|
||||
hooks = {},
|
||||
options = {
|
||||
-- "-c",
|
||||
"-verbose",
|
||||
"-file-line-error",
|
||||
"-synctex=1",
|
||||
"-interaction=nonstopmode",
|
||||
"--shell-escape",
|
||||
},
|
||||
}
|
||||
vim.g.vimtex_quickfix_ignore_filters = {
|
||||
"Underfull",
|
||||
"Overfull",
|
||||
"specifier changed to",
|
||||
"Token not allowed in a PDF string",
|
||||
"LaTeX Warning: Float too large for page",
|
||||
"contains only floats",
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
"evesdropper/luasnip-latex-snippets.nvim",
|
||||
enabled = false,
|
||||
},
|
||||
}
|
||||
13
lua/plugins/lang/markdown.lua
Normal file
13
lua/plugins/lang/markdown.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
linters = {
|
||||
markdownlint = {
|
||||
-- Disable line length check
|
||||
args = { "--disable", "MD013", "--" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
16
lua/plugins/lang/python.lua
Normal file
16
lua/plugins/lang/python.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
{
|
||||
"kmontocam/nvim-conda",
|
||||
ft = "python",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
keys = {
|
||||
{ "<leader>cv", "<cmd>CondaActivate<cr>", desc = "Conda environment" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
ft = "python",
|
||||
dependencies = { "nvim-neotest/neotest-python" },
|
||||
opts = { adapters = { "neotest-python" } },
|
||||
},
|
||||
}
|
||||
38
lua/plugins/leetcode.lua
Normal file
38
lua/plugins/leetcode.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
return {
|
||||
-- {
|
||||
-- "kawre/leetcode.nvim",
|
||||
-- build = ":TSUpdate html",
|
||||
-- dependencies = {
|
||||
-- "nvim-telescope/telescope.nvim",
|
||||
-- "nvim-lua/plenary.nvim", -- required by telescope
|
||||
-- "MunifTanjim/nui.nvim",
|
||||
--
|
||||
-- -- optional
|
||||
-- "nvim-treesitter/nvim-treesitter",
|
||||
-- "rcarriga/nvim-notify",
|
||||
-- "nvim-tree/nvim-web-devicons",
|
||||
-- },
|
||||
-- lazy = false,
|
||||
-- keys = {
|
||||
-- { "<localleader>kt", "<cmd>Leet test<CR>", desc = "Leet test" },
|
||||
-- { "<localleader>ks", "<cmd>Leet submit<CR>", desc = "Leet submit" },
|
||||
-- { "<localleader>kl", "<cmd>Leet lang<CR>", desc = "Leet lang" },
|
||||
-- { "<localleader>kp", "<cmd>Leet list<CR>", desc = "List problem" },
|
||||
-- },
|
||||
-- opts = {
|
||||
-- -- configuration goes here
|
||||
-- ---@type string
|
||||
-- arg = "leetcode.nvim",
|
||||
--
|
||||
-- ---@type lc.lang
|
||||
-- lang = "cpp",
|
||||
-- ---@type lc.storage
|
||||
-- storage = {
|
||||
-- home = vim.fn.stdpath("data") .. "/leetcode",
|
||||
-- cache = vim.fn.stdpath("cache") .. "/leetcode",
|
||||
-- },
|
||||
-- ---@type boolean
|
||||
-- logging = false,
|
||||
-- },
|
||||
-- },
|
||||
}
|
||||
4
lua/plugins/mason-workaround.lua
Normal file
4
lua/plugins/mason-workaround.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
{ "mason-org/mason.nvim", version = "^1.0.0" },
|
||||
{ "mason-org/mason-lspconfig.nvim", version = "^1.0.0" },
|
||||
}
|
||||
19
lua/plugins/ui/colorscheme.lua
Normal file
19
lua/plugins/ui/colorscheme.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
-- Lazy
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
opts = {
|
||||
flavour = "mocha",
|
||||
-- transparent_background = true,
|
||||
},
|
||||
},
|
||||
-- somewhere in your config:
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "catppuccin",
|
||||
},
|
||||
},
|
||||
}
|
||||
21
lua/plugins/ui/transparent.lua
Normal file
21
lua/plugins/ui/transparent.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
return {
|
||||
-- {
|
||||
-- "xiyaowong/nvim-transparent",
|
||||
-- opts = {
|
||||
-- extra_groups = {
|
||||
-- "BufferLineTabClose",
|
||||
-- "BufferlineBufferSelected",
|
||||
-- "BufferLineFill",
|
||||
-- "BufferLineBackground",
|
||||
-- "BufferLineSeparator",
|
||||
-- "BufferLineIndicatorSelected",
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- {
|
||||
-- "rcarriga/nvim-notify",
|
||||
-- opts = {
|
||||
-- background_colour = "#000000",
|
||||
-- },
|
||||
-- },
|
||||
}
|
||||
31
lua/plugins/yazi.lua
Normal file
31
lua/plugins/yazi.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
---@type LazySpec
|
||||
return {
|
||||
{
|
||||
"mikavilpas/yazi.nvim",
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
-- 👇 in this section, choose your own keymappings!
|
||||
{
|
||||
-- Open in the current working directory
|
||||
"<leader>fM",
|
||||
"<cmd>Yazi cwd<cr>",
|
||||
desc = "Open the file manager in nvim's working directory",
|
||||
},
|
||||
{
|
||||
-- NOTE: this requires a version of yazi that includes
|
||||
-- https://github.com/sxyazi/yazi/pull/1305 from 2024-07-18
|
||||
"<leader>fm",
|
||||
"<cmd>Yazi toggle<cr>",
|
||||
desc = "Resume the last yazi session",
|
||||
},
|
||||
},
|
||||
---@type YaziConfig
|
||||
opts = {
|
||||
-- if you want to open yazi instead of netrw, see below for more info
|
||||
open_for_directories = false,
|
||||
keymaps = {
|
||||
show_help = "<f1>",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
0
lua/util/empty_evilline.lua
Normal file
0
lua/util/empty_evilline.lua
Normal file
3
lua/util/init.lua
Normal file
3
lua/util/init.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
local M = {}
|
||||
|
||||
return M
|
||||
104
lua/util/latex.lua
Normal file
104
lua/util/latex.lua
Normal file
@@ -0,0 +1,104 @@
|
||||
local M = {}
|
||||
|
||||
local MATH_NODES = {
|
||||
displayed_equation = true,
|
||||
inline_formula = true,
|
||||
math_environment = true,
|
||||
}
|
||||
|
||||
local ts_utils = require("nvim-treesitter.ts_utils")
|
||||
|
||||
M.in_env_md = function(env)
|
||||
local node = ts_utils.get_node_at_cursor()
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
while node do
|
||||
if node:type() == "generic_environment" then
|
||||
local begin = node:child(0)
|
||||
local name = begin:field("name")
|
||||
if name[1] and vim.treesitter.get_node_text(name[1], bufnr, nil) == "{" .. env .. "}" then
|
||||
return true
|
||||
end
|
||||
end
|
||||
node = node:parent()
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
M.in_env = function(env)
|
||||
local pos = vim.fn["vimtex#env#is_inside"](env)
|
||||
return pos[1] ~= 0 or pos[2] ~= 0
|
||||
end
|
||||
|
||||
M.in_mathzone = function()
|
||||
local ft = vim.bo.filetype
|
||||
if ft == "tex" then
|
||||
return vim.api.nvim_eval("vimtex#syntax#in_mathzone()") == 1
|
||||
elseif ft == "markdown" then
|
||||
return M.in_mathzone_md()
|
||||
end
|
||||
end
|
||||
|
||||
M.in_text = function()
|
||||
return not M.in_mathzone()
|
||||
end
|
||||
|
||||
M.in_item = function()
|
||||
return M.in_env("itemize") or M.in_env("enumerate")
|
||||
end
|
||||
M.in_bib = function()
|
||||
return M.in_env("thebibliography")
|
||||
end
|
||||
M.in_tikz = function()
|
||||
return M.in_env("tikzpicture")
|
||||
end
|
||||
M.in_quantikz = function()
|
||||
return M.in_env("quantikz")
|
||||
end
|
||||
M.in_algo = function()
|
||||
return M.in_env("algorithmic")
|
||||
end
|
||||
|
||||
-- For markdown
|
||||
M.in_mathzone_md = function()
|
||||
local node = ts_utils.get_node_at_cursor()
|
||||
while node do
|
||||
if MATH_NODES[node:type()] then
|
||||
return true
|
||||
end
|
||||
node = node:parent()
|
||||
end
|
||||
return false
|
||||
end
|
||||
M.in_text_md = function()
|
||||
return not M.in_mathzone_md()
|
||||
end
|
||||
|
||||
-- M.clean = function()
|
||||
-- local current_dir = vim.fn.expand("%:p:h")
|
||||
-- local file_types = { "aux", "log", "out", "fls", "fdb_latexmk", "bcf", "run.xml", "toc", "DS_Store", "bak*", "dvi" }
|
||||
-- for _, file_type in ipairs(file_types) do
|
||||
-- local command = "rm " .. current_dir .. "/*." .. file_type
|
||||
-- vim.api.nvim_call_function("system", { command })
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- M.format = function()
|
||||
-- local current_file = vim.fn.expand("%:p")
|
||||
-- local latexindent = "latexindent -g /dev/null " .. current_file .. " -wd -l ~/Documents/Latex/latexindent.yaml"
|
||||
-- local build = "pdflatex " .. current_file
|
||||
-- vim.api.nvim_call_function("system", { build })
|
||||
-- vim.cmd("w")
|
||||
-- M.clean()
|
||||
-- vim.api.nvim_call_function("system", { latexindent })
|
||||
-- vim.cmd("e")
|
||||
-- vim.cmd("normal! zz")
|
||||
-- -- vim.cmd("TexlabForward")
|
||||
-- end
|
||||
--
|
||||
-- M.sympy_calc = function()
|
||||
-- local selected_text = vim.fn.getreg("v")
|
||||
-- print(selected_text)
|
||||
-- vim.api.nvim_out_write(selected_text)
|
||||
-- end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user