Merge remote-tracking branch 'nieves/main'
This commit is contained in:
@ -14,7 +14,6 @@
|
||||
"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-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" },
|
||||
@ -67,6 +66,7 @@
|
||||
"registers.nvim": { "branch": "main", "commit": "2ab8372bb837f05fae6b43091f10a0b725d113ca" },
|
||||
"rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" },
|
||||
"scss-syntax.vim": { "branch": "master", "commit": "bda22a93d1dcfcb8ee13be1988560d9bb5bd0fef" },
|
||||
"tabular": { "branch": "master", "commit": "339091ac4dd1f17e225fe7d57b48aff55f99b23a" },
|
||||
"telekasten.nvim": { "branch": "main", "commit": "4a5e57eee9c5154ed77423bb7fa6619fdb0784cd" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "47c755d737702df7a39b640c8d9c473a728be1df" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "20d1b30d6925213abece21d35858a16e11d1e9fc" },
|
||||
|
@ -72,6 +72,8 @@ function AsyncBlazeTest() abort
|
||||
call <SID>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
|
||||
|
@ -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
|
||||
]])
|
@ -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",
|
||||
|
@ -41,7 +41,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",
|
||||
@ -56,10 +56,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" },
|
||||
|
@ -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 = {
|
||||
{ "<leader>i", ":ImpSuggest <C-r><C-w><cr>" },
|
||||
},
|
||||
@ -113,10 +112,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",
|
||||
|
@ -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,
|
||||
})
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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 = {
|
||||
{ "<leader>ts", [[<cmd>lua require("neoscopes").select()<CR>]], desc = "NeoScopes" },
|
||||
{ "<leader>tf", ":lua find_files()<CR>", desc = "[T]elescope [F]ind Files" },
|
||||
{ "<leader>tl", ":lua live_grep()<CR>", desc = "[T]elescope [L]ive Grep" },
|
||||
{ "<leader>ts", "<cmd>lua search_cwd()<CR>", desc = "[T]elescope [S]earch Directory" },
|
||||
{ "<leader>tl", "<cmd>lua live_grep()<CR>", desc = "[T]elescope [L]ive Grep" },
|
||||
|
||||
{ "<leader>ff", ":Telescope current_buffer_fuzzy_find<CR>", desc = "[T]elescope [F]uzzy [F]ind" },
|
||||
{ "<leader>tg", ":Telescope git_files<CR>", desc = "[T]elescope [G]it Files" },
|
||||
{ "<leader>t*", ":lua require('telescope.builtin').grep_string{}<CR>", desc = "[T]elescope current [W]ord" },
|
||||
{ "<leader>th", ":lua require('telescope.builtin').help_tags{}<CR>", desc = "[T]elescope [H]elp" },
|
||||
{ "<leader>t*", "<cmd>lua require('telescope.builtin').grep_string{}<CR>", desc = "[T]elescope current [W]ord" },
|
||||
{ "<leader>th", "<cmd>lua require('telescope.builtin').help_tags{}<CR>", desc = "[T]elescope [H]elp" },
|
||||
}
|
||||
|
||||
if use_google() then
|
||||
TableConcat(keys, {
|
||||
{ "<C-P>", [[:lua require('telescope').extensions.codesearch.find_files{}<CR>]], "n" },
|
||||
{ "<C-Space>", [[:lua require('telescope').extensions.codesearch.find_query{}<CR>]] },
|
||||
{ "<leader>cs", [[:lua require('telescope').extensions.codesearch.find_query{}<CR>]] },
|
||||
{ "<leader>cs", [[:lua require('telescope').extensions.codesearch.find_query{}<CR>]], mode = "v" },
|
||||
{ "<C-P>", [[<cmd>lua require('telescope').extensions.codesearch.find_files{}<CR>]], "n" },
|
||||
{ "<C-Space>", [[<cmd>lua require('telescope').extensions.codesearch.find_query{}<CR>]] },
|
||||
{ "<leader>cs", [[<cmd>lua require('telescope').extensions.codesearch.find_query{}<CR>]] },
|
||||
{ "<leader>cs", [[<cmd>lua require('telescope').extensions.codesearch.find_query{}<CR>]], mode = "v" },
|
||||
{
|
||||
"<leader>CS",
|
||||
[[:lua require('telescope').extensions.codesearch.find_query{default_text_expand='<cword>'}<CR>]],
|
||||
[[<cmd>lua require('telescope').extensions.codesearch.find_query{default_text_expand='<cword>'}<CR>]],
|
||||
},
|
||||
})
|
||||
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,
|
||||
|
Reference in New Issue
Block a user