diff --git a/.gitignore b/.gitignore index 621c6dd..0291586 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ foo.* data lua/plugins/.example.lua.swp lua/plugins/.example.lua.swp +blink-disabled diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index b60f011..a7abb87 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -54,17 +54,23 @@ keyset("n", "rn", "(coc-rename)", { desc = "Coc: Rename" }) keyset("v", "\\r", "(coc-codeaction-refactor-selected)", { desc = "Coc: Refactor Selected" }) keyset("n", "\\cl", "(coc-codelens-action)", { desc = "Coc: CodeLens Action" }) +-- Resolve Coc conflicting keymaps +keyset("i", "", "", { desc = "Goto end" }) -- Now configure shortcuts for MacOS -- if vim.g.neovide then -map_all_mode("", 'w') -- Save +map_all_mode("", "w") -- Save map_all_mode("", function() - local success, _ = pcall(function() vim.cmd('tabclose') end) + local success, _ = pcall(function() + vim.cmd("tabclose") + end) if not success then vim.notify("Cannot close the last tab page", vim.log.levels.WARN) end end, { desc = "Close current tab" }) -map_all_mode("", function() vim.cmd("undo") end) +map_all_mode("", function() + vim.cmd("undo") +end) keyset("i", "", '"+P') keyset("c", "", "+") keyset("n", "", '"+p', { desc = "Paste from clipboard" }) diff --git a/lua/config/options.lua b/lua/config/options.lua index cc90da1..8cc9302 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -3,7 +3,7 @@ -- Add any additional options here vim.o.clipboard = "" vim.o.guifont = "Monaco:h16" -vim.cmd('set wrap') +vim.cmd("set wrap") local dap = require("dap") dap.adapters.python = { diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua index 1bd237a..b766aa5 100644 --- a/lua/plugins/example.lua +++ b/lua/plugins/example.lua @@ -11,11 +11,11 @@ return { { "LazyVim/LazyVim", opts = { - kind_filter = { tex = true } - } + kind_filter = { tex = true }, + }, }, { - 'tomasr/molokai', -- colorscheme + "tomasr/molokai", -- colorscheme config = function() vim.cmd.colorscheme("molokai") end, @@ -49,14 +49,15 @@ return { "-file-line-error", -- file line error messages }, } - -- TODO: This seems not used + -- Ensuring custom matchers are used vim.g.vimtex_toc_custom_matchers = { { title = "Theorem", re = [[\v^\s*\\begin\{theorem\}]] }, { title = "Lemma", re = [[\v^\s*\\begin\{lemma\}]] }, { title = "Corollary", re = [[\v^\s*\\begin\{corollary\}]] }, { title = "Definition", re = [[\v^\s*\\begin\{definition\}]] }, } - end + vim.g.vimtex_toc_matchers = vim.g.vimtex_toc_custom_matchers + end, }, { "mfussenegger/nvim-lint", @@ -68,8 +69,8 @@ return { }, config = function() local lint = require("lint") - lint.linters.ruff.args = { "--ignore=E401", } - end + lint.linters.ruff.args = { "--ignore=E401" } + end, }, { "stevearc/conform.nvim", @@ -80,16 +81,15 @@ return { lua = { "/opt/homebrew/bin/lua" }, tex = { "latexindent" }, }, - } + }, }, { "neovim/nvim-lspconfig", opts = { servers = { - pyright = { - }, + pyright = {}, }, - } + }, }, { "neoclide/coc.nvim", @@ -139,10 +139,10 @@ return { explorer = { ignored = true, exclude = excluded_list, - } + }, }, }, - } + }, }, { "mbbill/undotree", @@ -174,7 +174,7 @@ return { { "du", function() - require("dapui").toggle {} + require("dapui").toggle({}) end, desc = "Dap UI", }, @@ -189,8 +189,8 @@ return { }, opts = {}, config = function(_, opts) - local dap = require "dap" - local dapui = require "dapui" + local dap = require("dap") + local dapui = require("dapui") dapui.setup(opts) dap.listeners.after.event_initialized["dapui_config"] = function() dap.repl.open() @@ -258,7 +258,7 @@ return { }, { -- Make sure to set this up properly if you have lazy=true - 'MeanderingProgrammer/render-markdown.nvim', + "MeanderingProgrammer/render-markdown.nvim", opts = { file_types = { "markdown", "Avante" }, }, @@ -268,7 +268,20 @@ return { }, { "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 --