From e067e757bf02c297cac2cc364092bf9b674c8eec Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Tue, 17 Oct 2023 20:50:38 +0000 Subject: [PATCH 1/2] stuff --- config/.config/nvim/lazy-lock.json | 101 +++++++++++------------ vim/.vim/lua/config/google.lua | 2 + vim/.vim/lua/plugins/base.lua | 1 + vim/.vim/lua/plugins/cmp.lua | 6 +- vim/.vim/lua/plugins/google.lua | 8 +- vim/.vim/lua/plugins/mason.lua | 3 +- vim/.vim/lua/plugins/nvim-treesitter.lua | 1 + vim/.vim/lua/plugins/telescope.lua | 101 ++++++++++++----------- 8 files changed, 117 insertions(+), 106 deletions(-) diff --git a/config/.config/nvim/lazy-lock.json b/config/.config/nvim/lazy-lock.json index 2babf70..517eece 100644 --- a/config/.config/nvim/lazy-lock.json +++ b/config/.config/nvim/lazy-lock.json @@ -1,12 +1,12 @@ { "LuaSnip": { "branch": "master", "commit": "c7984d1cca3d8615e4daefc196597872a0b8d590" }, "aerial.nvim": { "branch": "master", "commit": "fb1f08c9f90e8b0c04b2f2c5d95d06288a14c5b2" }, - "ai.nvim": { "branch": "main", "commit": "d7391d4782b90ad3501f6f716f2b308092981787" }, - "asyncrun.vim": { "branch": "master", "commit": "7191d0c30dd105e5d7f897b9a6ee19cabe734466" }, - "auto-session": { "branch": "main", "commit": "7afbb149f87be279778689596c781882014f7eef" }, - "bufferline.nvim": { "branch": "main", "commit": "d24378edc14a675c820a303b4512af3bbc5761e9" }, + "ai.nvim": { "branch": "main", "commit": "604713b1a223a6ca9e04a4d0dbbd4b0670c46fd1" }, + "asyncrun.vim": { "branch": "master", "commit": "61cc3081963a12048e00e89f8cedc8bd1cb83b8c" }, + "auto-session": { "branch": "main", "commit": "3eb26b949e1b90798e84926848551046e2eb0721" }, + "bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" }, "calendar-vim": { "branch": "master", "commit": "a7e73e02c92566bf427b2a1d6a61a8f23542cc21" }, - "catppuccin": { "branch": "main", "commit": "a84ee1848bfac4601771805396552bdbaa0a0e91" }, + "catppuccin": { "branch": "main", "commit": "dcef0a062de380885193fb0f919217d58b979753" }, "ciderlsp-nvim": { "branch": "main", "commit": "45ee3634c6d4224c6981825da5bde39804addc71" }, "cmp-async-path": { "branch": "main", "commit": "d8229a93d7b71f22c66ca35ac9e6c6cd850ec61d" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, @@ -17,86 +17,83 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f0f53f704c08ea501f9d222b23491b0d354644b0" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, - "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, - "cmp-spell": { "branch": "master", "commit": "60584cb75e5e8bba5a0c9e4c3ab0791e0698bffa" }, - "cmp-treesitter": { "branch": "master", "commit": "389eadd48c27aa6dc0e6b992644704f026802a2e" }, + "cmp-spell": { "branch": "master", "commit": "32a0867efa59b43edbb2db67b0871cfad90c9b66" }, + "cmp-treesitter": { "branch": "master", "commit": "b8bc760dfcc624edd5454f0982b63786a822eed9" }, "cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" }, - "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "conflict-marker.vim": { "branch": "master", "commit": "11a4d42244755505b66b15cd4496a150432eb5e3" }, "crates.nvim": { "branch": "main", "commit": "1dffccc0a95f656ebe00cacb4de282473430c5a1" }, - "formatter.nvim": { "branch": "master", "commit": "9bf2e7e294b00bac87c6123c889828ee08dc9b46" }, - "friendly-snippets": { "branch": "main", "commit": "ea84a710262cb2c286d439070bad37d36fd3db25" }, - "fzf": { "branch": "master", "commit": "3c09c77269d848f5e7dd8f350a90e8d7ed760845" }, - "fzf.vim": { "branch": "master", "commit": "e0d131d95364edf940a70127fcb5748b86e6955e" }, - "git-conflict.nvim": { "branch": "main", "commit": "8d962d83cae924a314965f738ed1e05a4000d682" }, - "gitsigns.nvim": { "branch": "main", "commit": "adcf2c7f2f495f5df148683764bf7cba6a70f34c" }, - "go.nvim": { "branch": "master", "commit": "6550ddf5ce491d17af009c397aceb25310566eaa" }, - "guihua.lua": { "branch": "master", "commit": "ab8b1f09603cc268770efd057115035dc6cfa83d" }, + "formatter.nvim": { "branch": "master", "commit": "34dcdfa0c75df667743b2a50dd99c84a557376f0" }, + "friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" }, + "fzf": { "branch": "master", "commit": "d51b71ee8039df8f51bd348b43c68ee462d4a496" }, + "fzf.vim": { "branch": "master", "commit": "d1016dbd7cec2d2a3bb5863776c84b4034e4b85e" }, + "git-conflict.nvim": { "branch": "main", "commit": "4e0191c9a0ae05d7fbdcdc7f15cd358f56d23bfb" }, + "gitsigns.nvim": { "branch": "main", "commit": "5a9a6ac29a7805c4783cda21b80a1e361964b3f2" }, + "go.nvim": { "branch": "master", "commit": "d73ea5bc00f0d7b726b0ddfc29cea17a544459ba" }, + "guihua.lua": { "branch": "master", "commit": "5ad8dba19ce9b9fd8965598984dfdc9c119f97e4" }, "hg": { "branch": "main", "commit": "1c4bdf80174ec840ba76c4dc7032c4313db62199" }, "java-syntax.vim": { "branch": "master", "commit": "9a3d76a8c6cd7765ba93a7bdd9280594167e3f1b" }, "kotlin-vim": { "branch": "master", "commit": "53fe045906df8eeb07cb77b078fc93acda6c90b8" }, - "lazy.nvim": { "branch": "main", "commit": "25beed5e2e935ebc00d7e3eed1dc502df3c40e39" }, + "lazy.nvim": { "branch": "main", "commit": "daab5fe2807c55867d5f7cfb6ef0944783361be2" }, "leap.nvim": { "branch": "main", "commit": "5efe985cf68fac3b6a6dfe7a75fbfaca8db2af9c" }, "libp.nvim": { "branch": "main", "commit": "636b1748e92f66022c1763f32b2ded6b8606eda5" }, "litee-calltree.nvim": { "branch": "main", "commit": "e2dffec35740032258fee3a3c7f30123226f2271" }, "litee.nvim": { "branch": "main", "commit": "bf366a1414fd0f9401631ac8884f2f9fa4bf18d2" }, - "lsp-lens.nvim": { "branch": "main", "commit": "13d25ad8bd55aa34cc0aa3082e78a4157c401346" }, + "lsp-lens.nvim": { "branch": "main", "commit": "296e0d33dddba1a1de9b69143f189cb994111c5a" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, - "lsp-zero.nvim": { "branch": "v2.x", "commit": "3638944692d07497f4ae313ba7b68718969ccb27" }, - "lsp_lines.nvim": { "branch": "main", "commit": "f53af96d4789eef39a082dbcce078d2bfc384ece" }, + "lsp-zero.nvim": { "branch": "v2.x", "commit": "589c0a9465b38f69d20c058a7b31788068afa48c" }, + "lsp_lines.nvim": { "branch": "main", "commit": "9e3f99fbbd28aaec80dc0158c43be8cca8dd5017" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, - "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, + "lualine.nvim": { "branch": "master", "commit": "1a3f6bba410aff5a51bf8c84287aaa3a8ba30d0d" }, "luasnip-google.nvim": { "branch": "main", "commit": "5fd7feb144de0ecea837618c9c9e1bbecc0e3243" }, - "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "828a538ac8419f586c010996aefa5df6eb7c250b" }, - "mason.nvim": { "branch": "main", "commit": "5ad3e113b0c3fde3caba8630599373046f6197e8" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "e7b64c11035aa924f87385b72145e0ccf68a7e0a" }, + "mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" }, "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, "neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" }, - "neoscopes": { "branch": "main", "commit": "88ca15efcc20b267789d74ca483cc8bac85b3083" }, - "nerdcommenter": { "branch": "master", "commit": "ab2ae4d502a26bc591db78a8548823ddd04bbc9c" }, - "nui.nvim": { "branch": "main", "commit": "d146966a423e60699b084eeb28489fe3b6427599" }, - "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, - "nvim-cmp-buffer-lines": { "branch": "master", "commit": "2036e6fbb40c770eb82f1940a0ce0b2988f8ef32" }, - "nvim-lightbulb": { "branch": "master", "commit": "6166029a136afd56cf23384fc31e8ba203a6e102" }, - "nvim-lint": { "branch": "master", "commit": "4744fc04c3a869c9eaa137fec13d992aea7da7ee" }, - "nvim-lspconfig": { "branch": "master", "commit": "447443a2404adc323ad2efc7c0a346a904ce694c" }, - "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, - "nvim-osc52": { "branch": "main", "commit": "3e96035d62290183fe7a11418db2b254fcfcaee3" }, + "neoscopes": { "branch": "main", "commit": "d3f92e9360da7b7ab4eb6c5811d5ebaf7135239f" }, + "nerdcommenter": { "branch": "master", "commit": "d2e21d417f6c788b11ae3b90d7ac478930dead36" }, + "nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" }, + "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, + "nvim-cmp-buffer-lines": { "branch": "master", "commit": "924ccc04dc5c919b6baa05d45818025baa82699a" }, + "nvim-lightbulb": { "branch": "master", "commit": "8f00b89dd1b1dbde16872bee5fbcee2e58c9b8e9" }, + "nvim-lint": { "branch": "master", "commit": "c232cbfbe759b448a8c4a3eca5bde17de8c5ca00" }, + "nvim-lspconfig": { "branch": "master", "commit": "e49b1e90c1781ce372013de3fa93a91ea29fc34a" }, + "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" }, "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, - "nvim-surround": { "branch": "main", "commit": "211eaad7c6d01ef4ac02cba9052b3082ec232101" }, - "nvim-treesitter": { "branch": "master", "commit": "9fa6806b88905d52b5ca36094909630919b432cc" }, - "nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" }, - "nvim_figtree": { "branch": "main", "commit": "9bc3025f46e34732382da1019e256a9d8bec1e55" }, - "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, - "refactoring.nvim": { "branch": "master", "commit": "7894b10078a1a70c9b26028f4373bf209968e9bc" }, - "registers.nvim": { "branch": "main", "commit": "2ab8372bb837f05fae6b43091f10a0b725d113ca" }, + "nvim-surround": { "branch": "main", "commit": "0d6882635817a2677749a330127d12ac30a4f3c8" }, + "nvim-treesitter": { "branch": "master", "commit": "9c4fc86b67c1d68141cef57846d24cbee9b74fb0" }, + "nvim-web-devicons": { "branch": "master", "commit": "3af745113ea537f58c4b1573b64a429fefad9e07" }, + "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, + "refactoring.nvim": { "branch": "master", "commit": "bebfcfcc4b604d3647fcce2f4aeb02a95d139c49" }, + "registers.nvim": { "branch": "main", "commit": "7a16c6e6fe96f3c9c8bb55b95047d745dd34ca4d" }, "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, "scss-syntax.vim": { "branch": "master", "commit": "bda22a93d1dcfcb8ee13be1988560d9bb5bd0fef" }, - "telekasten.nvim": { "branch": "main", "commit": "4a5e57eee9c5154ed77423bb7fa6619fdb0784cd" }, - "telescope.nvim": { "branch": "master", "commit": "47c755d737702df7a39b640c8d9c473a728be1df" }, + "tabular": { "branch": "master", "commit": "339091ac4dd1f17e225fe7d57b48aff55f99b23a" }, + "telekasten.nvim": { "branch": "main", "commit": "3fd50c62c1ed2f973ce8639c1218445e4e91a962" }, + "telescope.nvim": { "branch": "master", "commit": "74ce793a60759e3db0d265174f137fb627430355" }, "telescope_citc": { "branch": "main", "commit": "d6421d5bfe058915ece0daec55e488f8ea05f207" }, "telescope_codesearch": { "branch": "main", "commit": "a26077ad3c68cf897ae1c31da903d6516ebb9c92" }, - "telescope_fig": { "branch": "main", "commit": "90150e1aa368b49a5125689b3a6da573a99e2bda" }, + "telescope_fig": { "branch": "main", "commit": "f6122fe82417ebeaddb9343cfd5584f62a4b8df8" }, "time-ago.vim": { "branch": "master", "commit": "be978d5c790cfcc41f524205f28783b9937fd0ee" }, - "trouble.nvim": { "branch": "main", "commit": "20d1b30d6925213abece21d35858a16e11d1e9fc" }, + "trouble.nvim": { "branch": "main", "commit": "02219b557d4726a789be58c5d6bd6e139c46a9fe" }, "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, "vcscommand.vim": { "branch": "master", "commit": "2fb32681361f37533455d20aaa7fc6eb11b0fa4b" }, "vim-bazel": { "branch": "master", "commit": "31b0d5e4f51da1aeb56d65bf505a744e6de405de" }, "vim-better-whitespace": { "branch": "master", "commit": "1b22dc57a2751c7afbc6025a7da39b7c22db635d" }, "vim-dirdiff": { "branch": "master", "commit": "84bc8999fde4b3c2d8b228b560278ab30c7ea4c9" }, - "vim-floaterm": { "branch": "master", "commit": "bcaeabf89a92a924031d471395054d84bd88ce2f" }, + "vim-floaterm": { "branch": "master", "commit": "6e81602e9d7ff7dc1c96c66fedc38fca1262d57c" }, "vim-imp": { "branch": "main", "commit": "394e926ce62010443731f3923031e5afa1279f3e" }, "vim-maktaba": { "branch": "master", "commit": "fe95bb10f6bb250943a44632107f6a3d76ce5f28" }, - "vim-matchup": { "branch": "master", "commit": "17cc05867cb3314761e4baa20115a27120f8e82c" }, + "vim-matchup": { "branch": "master", "commit": "6dbe108230c7dbbf00555b7d4d9f6a891837ef07" }, "vim-ripgrep": { "branch": "master", "commit": "2bb2425387b449a0cd65a54ceb85e123d7a320b8" }, "vim-searchindex": { "branch": "master", "commit": "b0788c8213210b3bd23b62847dd5a9ebbe4ad648" }, "vim-signify": { "branch": "master", "commit": "7d538b77a5a8806e344b057f8846f6d0c035efa9" }, "vim-tmux": { "branch": "master", "commit": "cfe76281efc29890548cf9eedd42ad51c7a1faf0" }, "vim-tmux-focus-events": { "branch": "master", "commit": "b1330e04ffb95ede8e02b2f7df1f238190c67056" }, - "vim-tmux-navigator": { "branch": "master", "commit": "cdd66d6a37d991bba7997d593586fc51a5b37aa8" }, + "vim-tmux-navigator": { "branch": "master", "commit": "7db70e08ea03b3e4d91f63713d76134512e28d7e" }, "vim-tmux-syntax": { "branch": "master", "commit": "1b6a6a5beb96fa232c8d35d305f77496b12678a9" }, - "vim-tmux-yank": { "branch": "master", "commit": "8432fd440f61ddead070093be06b3dd6b0b5790e" }, "vim-windowswap": { "branch": "master", "commit": "15db3f697aa1fa696d99fcdc920c90cd2cec855e" }, "vimux": { "branch": "master", "commit": "616fcb4799674a7a809b14ca2dc155bb6ba25788" }, - "which-key.nvim": { "branch": "main", "commit": "38b990f6eabf62014018b4aae70a97d7a6c2eb88" } -} \ No newline at end of file + "which-key.nvim": { "branch": "main", "commit": "3a5383161996b36698139f2a425d83ca05b13f83" } +} diff --git a/vim/.vim/lua/config/google.lua b/vim/.vim/lua/config/google.lua index dd0c831..65b8834 100644 --- a/vim/.vim/lua/config/google.lua +++ b/vim/.vim/lua/config/google.lua @@ -72,6 +72,8 @@ function AsyncBlazeTest() abort call AsyncBlaze("blaze test", blaze#GetTargets()) endfunction +autocmd bufreadpre *.sh setlocal textwidth=80 + augroup autoformat_settings autocmd FileType borg,gcl,patchpanel AutoFormatBuffer gclfmt autocmd FileType bzl AutoFormatBuffer buildifier diff --git a/vim/.vim/lua/plugins/base.lua b/vim/.vim/lua/plugins/base.lua index cd71ba1..01b610a 100644 --- a/vim/.vim/lua/plugins/base.lua +++ b/vim/.vim/lua/plugins/base.lua @@ -6,6 +6,7 @@ return { "nvim-tree/nvim-web-devicons", lazy = false, }, + "godlygeek/tabular", "ldelossa/litee.nvim", "cakebaker/scss-syntax.vim", "ldelossa/litee-calltree.nvim", diff --git a/vim/.vim/lua/plugins/cmp.lua b/vim/.vim/lua/plugins/cmp.lua index 320a4cc..e83423a 100644 --- a/vim/.vim/lua/plugins/cmp.lua +++ b/vim/.vim/lua/plugins/cmp.lua @@ -39,7 +39,7 @@ return { "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp-document-symbol", "hrsh7th/cmp-nvim-lsp-signature-help", - "hrsh7th/cmp-nvim-lua", + -- "hrsh7th/cmp-nvim-lua", "FelipeLema/cmp-async-path", "lukas-reineke/cmp-under-comparator", "ray-x/cmp-treesitter", @@ -54,10 +54,10 @@ return { { name = "nvim_lsp", priority = 8 }, { name = "treesitter", priority = 7 }, { name = "nvim_lsp_signature_help" }, - { name = "luasnip" }, + -- { name = "luasnip" }, { name = "calc" }, { name = "crates" }, - { name = "nvim_lua" }, + -- { name = "nvim_lua" }, { name = "emoji" }, { name = "async_path" }, { name = "spell" }, diff --git a/vim/.vim/lua/plugins/google.lua b/vim/.vim/lua/plugins/google.lua index a789044..2315799 100644 --- a/vim/.vim/lua/plugins/google.lua +++ b/vim/.vim/lua/plugins/google.lua @@ -113,10 +113,10 @@ return { "hrsh7th/nvim-cmp", }, }, - { - name = "nvim_figtree", - url = "sso://googler@user/jackcogdill/nvim-figtree", - }, + -- { + -- name = "nvim_figtree", + -- url = "sso://googler@user/jackcogdill/nvim-figtree", + -- }, { name = "telescope_codesearch", url = "sso://googler@user/vintharas/telescope-codesearch.nvim", diff --git a/vim/.vim/lua/plugins/mason.lua b/vim/.vim/lua/plugins/mason.lua index f8a4a56..a91a725 100644 --- a/vim/.vim/lua/plugins/mason.lua +++ b/vim/.vim/lua/plugins/mason.lua @@ -8,7 +8,7 @@ return { local use_google = require("utils").use_google local lsps = { - "lua_ls", + "lua-language-server", "rust_analyzer", } @@ -21,6 +21,7 @@ return { require("mason").setup() require("mason-lspconfig").setup({ + automatic_installation = true, ensure_installed = lsps, }) diff --git a/vim/.vim/lua/plugins/nvim-treesitter.lua b/vim/.vim/lua/plugins/nvim-treesitter.lua index 373297d..abd6934 100644 --- a/vim/.vim/lua/plugins/nvim-treesitter.lua +++ b/vim/.vim/lua/plugins/nvim-treesitter.lua @@ -10,6 +10,7 @@ return { -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, + disable = {"lua"}, highlight = { -- `false` will disable the whole extension enable = true, diff --git a/vim/.vim/lua/plugins/telescope.lua b/vim/.vim/lua/plugins/telescope.lua index 2ad9b70..8bf89ee 100644 --- a/vim/.vim/lua/plugins/telescope.lua +++ b/vim/.vim/lua/plugins/telescope.lua @@ -8,32 +8,48 @@ _G.find_files = function() search_dirs = scopes.get_current_dirs(), }) end + +_G.search_cwd = function() + local builtin = require("telescope.builtin") + local utils = require("telescope.utils") + builtin.find_files({ cwd = utils.buffer_dir() }) +end + _G.live_grep = function() require("telescope.builtin").live_grep({ search_dirs = scopes.get_current_dirs(), }) end +local function get_visual_selection() + -- Yank current visual selection into the 'v' register + -- + -- Note that this makes no effort to preserve this register + vim.cmd('noau normal! "vy"') + + return vim.fn.getreg("v") +end + local keys = { { "ts", [[lua require("neoscopes").select()]], desc = "NeoScopes" }, - { "tf", ":lua find_files()", desc = "[T]elescope [F]ind Files" }, - { "tl", ":lua live_grep()", desc = "[T]elescope [L]ive Grep" }, + { "ts", "lua search_cwd()", desc = "[T]elescope [S]earch Directory" }, + { "tl", "lua live_grep()", desc = "[T]elescope [L]ive Grep" }, { "ff", ":Telescope current_buffer_fuzzy_find", desc = "[T]elescope [F]uzzy [F]ind" }, { "tg", ":Telescope git_files", desc = "[T]elescope [G]it Files" }, - { "t*", ":lua require('telescope.builtin').grep_string{}", desc = "[T]elescope current [W]ord" }, - { "th", ":lua require('telescope.builtin').help_tags{}", desc = "[T]elescope [H]elp" }, + { "t*", "lua require('telescope.builtin').grep_string{}", desc = "[T]elescope current [W]ord" }, + { "th", "lua require('telescope.builtin').help_tags{}", desc = "[T]elescope [H]elp" }, } if use_google() then TableConcat(keys, { - { "", [[:lua require('telescope').extensions.codesearch.find_files{}]], "n" }, - { "", [[:lua require('telescope').extensions.codesearch.find_query{}]] }, - { "cs", [[:lua require('telescope').extensions.codesearch.find_query{}]] }, - { "cs", [[:lua require('telescope').extensions.codesearch.find_query{}]], mode = "v" }, + { "", [[lua require('telescope').extensions.codesearch.find_files{}]], "n" }, + { "", [[lua require('telescope').extensions.codesearch.find_query{}]] }, + { "cs", [[lua require('telescope').extensions.codesearch.find_query{}]] }, + { "cs", [[lua require('telescope').extensions.codesearch.find_query{}]], mode = "v" }, { "CS", - [[:lua require('telescope').extensions.codesearch.find_query{default_text_expand=''}]], + [[lua require('telescope').extensions.codesearch.find_query{default_text_expand=''}]], }, }) end @@ -43,44 +59,37 @@ return { dependencies = {}, config = function() require("telescope").setup({ - defaults = { - -- The vertical layout strategy is good to handle long paths like those in - -- google3 repos because you have nearly the full screen to display a file path. - -- The caveat is that the preview area is smaller. - layout_strategy = "vertical", - -- Common paths in google3 repos are collapsed following the example of Cider - -- It is nice to keep this as a user config rather than part of - -- telescope-codesearch because it can be reused by other telescope pickers. - path_display = function(opts, path) - -- Do common substitutions - path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1) - path = path:gsub("^google3/java/com/google/", "g3/j/c/g/", 1) - path = path:gsub("^google3/javatests/com/google/", "g3/jt/c/g/", 1) - path = path:gsub("^google3/third_party/", "g3/3rdp/", 1) - path = path:gsub("^google3/", "g3/", 1) + experimental = true, + -- The vertical layout strategy is good to handle long paths like those in + -- google3 repos because you have nearly the full screen to display a file path. + -- The caveat is that the preview area is smaller. + layout_strategy = "vertical", + -- Common paths in google3 repos are collapsed following the example of Cider + -- It is nice to keep this as a user config rather than part of + -- telescope-codesearch because it can be reused by other telescope pickers. + path_display = function(opts, path) + -- Do common substitutions + path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1) + path = path:gsub("^google3/java/com/google/", "//j/c/g/", 1) + path = path:gsub("^google3/javatests/com/google/", "//jt/c/g/", 1) + path = path:gsub("^google3/third_party/", "//3p/", 1) + path = path:gsub("^google3/", "//", 1) - -- Do truncation. This allows us to combine our custom display formatter - -- with the built-in truncation. - -- `truncate` handler in transform_path memoizes computed truncation length in opts.__length. - -- Here we are manually propagating this value between new_opts and opts. - -- We can make this cleaner and more complicated using metatables :) - local new_opts = { - path_display = { - truncate = true, - }, - __length = opts.__length, - } - path = require("telescope.utils").transform_path(new_opts, path) - opts.__length = new_opts.__length - return path - end, - }, - extensions = { - -- this block is optional, and if omitted, defaults will be used - codesearch = { - experimental = true, -- enable results from google3/experimental - }, - }, + -- Do truncation. This allows us to combine our custom display formatter + -- with the built-in truncation. + -- `truncate` handler in transform_path memoizes computed truncation length in opts.__length. + -- Here we are manually propagating this value between new_opts and opts. + -- We can make this cleaner and more complicated using metatables :) + local new_opts = { + path_display = { + truncate = true, + }, + __length = opts.__length, + } + path = require("telescope.utils").transform_path(new_opts, path) + opts.__length = new_opts.__length + return path + end, }) end, keys = keys, From bf84697a59403390b4b50d52fcdab8b7fc121fae Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Tue, 17 Oct 2023 21:08:17 +0000 Subject: [PATCH 2/2] imp stuff --- vim/.vim/lua/config/imp-google.lua | 11 ----------- vim/.vim/lua/plugins/google.lua | 3 +-- 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 vim/.vim/lua/config/imp-google.lua diff --git a/vim/.vim/lua/config/imp-google.lua b/vim/.vim/lua/config/imp-google.lua deleted file mode 100644 index 035eac2..0000000 --- a/vim/.vim/lua/config/imp-google.lua +++ /dev/null @@ -1,11 +0,0 @@ -vim.cmd([[ -Glaive imp Suggest[default]=buffer,csearch,prompt Pick[default]=fzf -]]) - --- To search for imports in the file's parent directory before using Code Search across all of google3, install ripgrep and try -vim.cmd([[ -Glaive imp Suggest[gcl]=buffer,ripgrep,csearch,prompt -\ Location[gcl]=parent Location[borg]=parent -\ Suggest[borg]=buffer,ripgrep,csearch,prompt -\ Suggest[aidl]=buffer,ripgrep,csearch,prompt -]]) diff --git a/vim/.vim/lua/plugins/google.lua b/vim/.vim/lua/plugins/google.lua index 2315799..fb03bd2 100644 --- a/vim/.vim/lua/plugins/google.lua +++ b/vim/.vim/lua/plugins/google.lua @@ -81,14 +81,13 @@ return { { name = "imp-google", dir = "/usr/share/vim/google/imp-google", - dependencies = { "vim-imp", "glaive" }, + dependencies = { "flwyd/vim-imp", "glaive" }, config = function() require("config.imp-google") end, }, { "flwyd/vim-imp", - dependencies = { "imp-google" }, keys = { { "i", ":ImpSuggest " }, },