diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 50e0f92..53cdd44 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -109,6 +109,15 @@ require("lazy").setup({ -- {{{ LSP config local lsp = require('lsp-zero').preset({}) + local typst_lsp = require'lspconfig'.typst_lsp + if typst_lsp ~= nil then + typst_lsp.setup{ + settings = { + exportPdf = "never" -- Choose onType, onSave or never. + } + } + end + lsp.on_attach(function(client, bufnr) -- see :help lsp-zero-keybindings -- to learn the available actions @@ -145,19 +154,40 @@ require("lazy").setup({ -- }}} end }, + { + "ray-x/lsp_signature.nvim", + event = "VeryLazy", + opts = { + hint_prefix = "", + floating_window = false, + }, + config = function(_, opts) require'lsp_signature'.setup(opts) end + }, { 'nvim-telescope/telescope.nvim', - tag = '0.1.2', + tag = '0.1.8', dependencies = { 'nvim-lua/plenary.nvim' }, config = function () local builtin = require('telescope.builtin') - vim.keymap.set('n', 'ff', function() - builtin.find_files({ follow = true, hidden = true }) - end, {}) + + local function buffers_autopick() + builtin.buffers({ + on_complete = { + function(picker) + -- if we have exactly one match, select it + if picker.manager.linked_states.size == 1 then + require("telescope.actions").select_default(picker.prompt_bufnr) + end + end, + } + }) + end + + vim.keymap.set('n', 'ff', builtin.find_files, {}) vim.keymap.set('n', 'fg', builtin.git_files, {}) - vim.keymap.set('n', 'fo', builtin.buffers, {}) + vim.keymap.set('n', 'o', buffers_autopick, {}) vim.keymap.set('n', 'st', builtin.live_grep, {}) - vim.keymap.set('n', 'ss', builtin.lsp_dynamic_workspace_symbols, {}) + vim.keymap.set('n', 'ss', builtin.treesitter, {}) end }, { @@ -213,6 +243,7 @@ require("lazy").setup({ }, { 'numToStr/Comment.nvim', + enabled = false, -- nvim 10 supports comments built-in lazy = false, config = function () require("Comment").setup({ @@ -262,6 +293,30 @@ require("lazy").setup({ 'RRethy/vim-illuminate', event = "User EnableIDE", }, + { + 'kaarmu/typst.vim' + }, + { 'echasnovski/mini.ai', version = '*', opts = {} }, + { 'tpope/vim-surround' }, + { + 'echasnovski/mini.hipatterns', + version = '*', + config = function () + local hipatterns = require('mini.hipatterns') + hipatterns.setup({ + highlighters = { + -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE' + fixme = { pattern = '%f[%w]()FIXME()%f[%W]', group = 'MiniHipatternsFixme' }, + hack = { pattern = '%f[%w]()HACK()%f[%W]', group = 'MiniHipatternsHack' }, + todo = { pattern = '%f[%w]()TODO()%f[%W]', group = 'MiniHipatternsTodo' }, + note = { pattern = '%f[%w]()NOTE()%f[%W]', group = 'MiniHipatternsNote' }, + + -- Highlight hex color strings (`#rrggbb`) using that color + hex_color = hipatterns.gen_highlighter.hex_color(), + }, + }) + end, + }, }) -- }}} -- {{{ Keymap @@ -283,9 +338,14 @@ vim.keymap.set('n', 'c', ':confirm bdelete') -- copy to system clipboard vim.keymap.set({"n", "v"}, "y", [["+y]]) +vim.keymap.set({"n", "v"}, "p", [["+p]]) +vim.keymap.set({"n", "v"}, "P", [["+P]]) vim.keymap.set("n", "Y", [["+Y]]) vim.keymap.set("n", "fv", "Ex") +vim.keymap.set('n', 'p', function() + vim.cmd([[call system("nvr " . expand("%:p") . " && nvr --remote-send \":%bd!|e#|" . line(".") . "zRzz\"")]]) +end) -- }}} -- {{{ IDE mode vim.api.nvim_create_user_command("IDE", function () diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index f73269e..6b504c2 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,25 +1,30 @@ { - "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "c4d6298347f7707e9757351b2ee03d0c00da5c20" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, - "copilot.vim": { "branch": "release", "commit": "5b19fb001d7f31c4c7c5556d7a97b243bd29f45f" }, - "gitsigns.nvim": { "branch": "main", "commit": "d8590288417fef2430f85bc8b312fae8b1cf2c40" }, - "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" }, - "lsp-zero.nvim": { "branch": "v2.x", "commit": "f084f4a6a716f55bf9c4026e73027bb24a0325a3" }, - "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "dfdd771b792fbb4bad8e057d72558255695aa1a7" }, - "mason.nvim": { "branch": "main", "commit": "c811fbf09c7642eebb37d6694f1a016a043f6ed3" }, - "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, - "nvim-lspconfig": { "branch": "master", "commit": "a27356f1ef9c11e1f459cc96a3fcac5c265e72d6" }, - "nvim-treesitter": { "branch": "master", "commit": "d94e1ad9575cc211b5726f09b28ca9454aba22fe" }, - "nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" }, - "plenary.nvim": { "branch": "master", "commit": "0dbe561ae023f02c2fb772b879e905055b939ce3" }, + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "copilot.vim": { "branch": "release", "commit": "88d08cf54f623341adde4b18362bffc95174dcd5" }, + "gitsigns.nvim": { "branch": "main", "commit": "47c8e3e571376b24de62408fd0c9d12f0a9fc0a3" }, + "lazy.nvim": { "branch": "main", "commit": "c501b429cf995c645454539b924aaefae45bb9eb" }, + "lsp-zero.nvim": { "branch": "v2.x", "commit": "9a686513eaaa13d737d0fec8956a18268ead8b29" }, + "lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, + "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, + "mini.ai": { "branch": "main", "commit": "a7e90f110e6274262616311b93cef12cd2667a2d" }, + "mini.hipatterns": { "branch": "main", "commit": "427712c754bfdccd8da7073576cd8e2586c0fe93" }, + "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, + "nvim-lspconfig": { "branch": "master", "commit": "bd7c76375a511994c9ca8d69441f134dc10ae3bd" }, + "nvim-treesitter": { "branch": "master", "commit": "c29989f5d735a30b6d2350b54d5cd50be811f8b2" }, + "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, - "telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" }, - "tokyodark.nvim": { "branch": "master", "commit": "4bfb42924274abc5de9f5f4779075b77c6112c85" }, - "vim-fugitive": { "branch": "master", "commit": "572c8510123cbde02e8a1dafcd376c98e1e13f43" }, + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "tokyodark.nvim": { "branch": "master", "commit": "14bc1b3e596878a10647af7c82de7736300f3322" }, + "typst.vim": { "branch": "main", "commit": "d9a7650e76c85f8ba437e056d08dd43b01b8bfd6" }, + "vim-fugitive": { "branch": "master", "commit": "64d6cafb9dcbacce18c26d7daf617ebb96b273f3" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, - "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, + "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, - "vim-tmux-navigator": { "branch": "master", "commit": "addb64a772cb4a3ae1f1363583012b2cada2cd66" } + "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, + "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" } } \ No newline at end of file