feat(plugins): configure blink.cmp to enable conditionally

pull/128/head
flin16 2025-06-04 19:34:57 -05:00
parent 0d5bd8fe34
commit 27663b8ed6
4 changed files with 42 additions and 22 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ foo.*
data data
lua/plugins/.example.lua.swp lua/plugins/.example.lua.swp
lua/plugins/.example.lua.swp lua/plugins/.example.lua.swp
blink-disabled

View File

@ -54,17 +54,23 @@ keyset("n", "<leader>rn", "<Plug>(coc-rename)", { desc = "Coc: Rename" })
keyset("v", "\\r", "<Plug>(coc-codeaction-refactor-selected)", { desc = "Coc: Refactor Selected" }) keyset("v", "\\r", "<Plug>(coc-codeaction-refactor-selected)", { desc = "Coc: Refactor Selected" })
keyset("n", "\\cl", "<Plug>(coc-codelens-action)", { desc = "Coc: CodeLens Action" }) keyset("n", "\\cl", "<Plug>(coc-codelens-action)", { desc = "Coc: CodeLens Action" })
-- Resolve Coc conflicting keymaps
keyset("i", "<C-e>", "<End>", { desc = "Goto end" })
-- Now configure shortcuts for MacOS -- Now configure shortcuts for MacOS
-- if vim.g.neovide then -- if vim.g.neovide then
map_all_mode("<D-s>", '<Cmd>w<CR>') -- Save map_all_mode("<D-s>", "<Cmd>w<CR>") -- Save
map_all_mode("<D-w>", function() map_all_mode("<D-w>", function()
local success, _ = pcall(function() vim.cmd('tabclose') end) local success, _ = pcall(function()
vim.cmd("tabclose")
end)
if not success then if not success then
vim.notify("Cannot close the last tab page", vim.log.levels.WARN) vim.notify("Cannot close the last tab page", vim.log.levels.WARN)
end end
end, { desc = "Close current tab" }) end, { desc = "Close current tab" })
map_all_mode("<D-z>", function() vim.cmd("undo") end) map_all_mode("<D-z>", function()
vim.cmd("undo")
end)
keyset("i", "<D-v>", '<C-O>"+P') keyset("i", "<D-v>", '<C-O>"+P')
keyset("c", "<D-v>", "<C-R>+") keyset("c", "<D-v>", "<C-R>+")
keyset("n", "<D-v>", '"+p', { desc = "Paste from clipboard" }) keyset("n", "<D-v>", '"+p', { desc = "Paste from clipboard" })

View File

@ -3,7 +3,7 @@
-- Add any additional options here -- Add any additional options here
vim.o.clipboard = "" vim.o.clipboard = ""
vim.o.guifont = "Monaco:h16" vim.o.guifont = "Monaco:h16"
vim.cmd('set wrap') vim.cmd("set wrap")
local dap = require("dap") local dap = require("dap")
dap.adapters.python = { dap.adapters.python = {

View File

@ -11,11 +11,11 @@ return {
{ {
"LazyVim/LazyVim", "LazyVim/LazyVim",
opts = { opts = {
kind_filter = { tex = true } kind_filter = { tex = true },
} },
}, },
{ {
'tomasr/molokai', -- colorscheme "tomasr/molokai", -- colorscheme
config = function() config = function()
vim.cmd.colorscheme("molokai") vim.cmd.colorscheme("molokai")
end, end,
@ -49,14 +49,15 @@ return {
"-file-line-error", -- file line error messages "-file-line-error", -- file line error messages
}, },
} }
-- TODO: This seems not used -- Ensuring custom matchers are used
vim.g.vimtex_toc_custom_matchers = { vim.g.vimtex_toc_custom_matchers = {
{ title = "Theorem", re = [[\v^\s*\\begin\{theorem\}]] }, { title = "Theorem", re = [[\v^\s*\\begin\{theorem\}]] },
{ title = "Lemma", re = [[\v^\s*\\begin\{lemma\}]] }, { title = "Lemma", re = [[\v^\s*\\begin\{lemma\}]] },
{ title = "Corollary", re = [[\v^\s*\\begin\{corollary\}]] }, { title = "Corollary", re = [[\v^\s*\\begin\{corollary\}]] },
{ title = "Definition", re = [[\v^\s*\\begin\{definition\}]] }, { title = "Definition", re = [[\v^\s*\\begin\{definition\}]] },
} }
end vim.g.vimtex_toc_matchers = vim.g.vimtex_toc_custom_matchers
end,
}, },
{ {
"mfussenegger/nvim-lint", "mfussenegger/nvim-lint",
@ -68,8 +69,8 @@ return {
}, },
config = function() config = function()
local lint = require("lint") local lint = require("lint")
lint.linters.ruff.args = { "--ignore=E401", } lint.linters.ruff.args = { "--ignore=E401" }
end end,
}, },
{ {
"stevearc/conform.nvim", "stevearc/conform.nvim",
@ -80,16 +81,15 @@ return {
lua = { "/opt/homebrew/bin/lua" }, lua = { "/opt/homebrew/bin/lua" },
tex = { "latexindent" }, tex = { "latexindent" },
}, },
} },
}, },
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
opts = { opts = {
servers = { servers = {
pyright = { pyright = {},
},
}, },
} },
}, },
{ {
"neoclide/coc.nvim", "neoclide/coc.nvim",
@ -139,10 +139,10 @@ return {
explorer = { explorer = {
ignored = true, ignored = true,
exclude = excluded_list, exclude = excluded_list,
} },
}, },
}, },
} },
}, },
{ {
"mbbill/undotree", "mbbill/undotree",
@ -174,7 +174,7 @@ return {
{ {
"<leader>du", "<leader>du",
function() function()
require("dapui").toggle {} require("dapui").toggle({})
end, end,
desc = "Dap UI", desc = "Dap UI",
}, },
@ -189,8 +189,8 @@ return {
}, },
opts = {}, opts = {},
config = function(_, opts) config = function(_, opts)
local dap = require "dap" local dap = require("dap")
local dapui = require "dapui" local dapui = require("dapui")
dapui.setup(opts) dapui.setup(opts)
dap.listeners.after.event_initialized["dapui_config"] = function() dap.listeners.after.event_initialized["dapui_config"] = function()
dap.repl.open() dap.repl.open()
@ -258,7 +258,7 @@ return {
}, },
{ {
-- Make sure to set this up properly if you have lazy=true -- Make sure to set this up properly if you have lazy=true
'MeanderingProgrammer/render-markdown.nvim', "MeanderingProgrammer/render-markdown.nvim",
opts = { opts = {
file_types = { "markdown", "Avante" }, file_types = { "markdown", "Avante" },
}, },
@ -268,7 +268,20 @@ return {
}, },
{ {
"flin16/vim-overleaf", "flin16/vim-overleaf",
} },
{
"Saghen/blink.cmp",
opts = {
enabled = function()
-- Enable when there is no file ~/.config/nvim-options/blink-disabled
local path = vim.fn.stdpath("config") .. "/blink-disabled"
return not vim.loop.fs_stat(path)
end,
},
},
{
"giuxtaposition/blink-cmp-copilot",
},
} }
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim -- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
-- --