tabdrop
This commit is contained in:
@ -1,45 +1,3 @@
|
|||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" },
|
"lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }
|
||||||
"ai.nvim": { "branch": "main", "commit": "ab6b6f54612500f48d4d34fcf81529946b9338f3" },
|
|
||||||
"buganizer-utils.nvim": { "branch": "main", "commit": "a4af5239a71dd1b6fc2b1b9656f45065865b90e6" },
|
|
||||||
"buganizer.nvim": { "branch": "main", "commit": "a5366f694b6cd964edc03259c62790c00b288167" },
|
|
||||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
|
||||||
"cmp-nvim-ciderlsp": { "branch": "main", "commit": "4c6c520889f87d68ea6d7c976176499ef8143e1d" },
|
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
|
||||||
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
|
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
|
||||||
"conform.nvim": { "branch": "master", "commit": "40d4e98fcc3e6f485f0e8924c63734bc7e305967" },
|
|
||||||
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
|
|
||||||
"gcert.nvim": { "branch": "main", "commit": "8ce97fc599181cb57657c8da0bde07e215c05ff2" },
|
|
||||||
"google-comments": { "branch": "main", "commit": "ad50cd3c71a7553c92a966dba6a03232a81e3812" },
|
|
||||||
"googlepaths.nvim": { "branch": "main", "commit": "53439c17178049096809b4fb963e75440b86ad78" },
|
|
||||||
"hg.nvim": { "branch": "main", "commit": "12ee0a788309734f1f312060b9f984a97157acf3" },
|
|
||||||
"lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" },
|
|
||||||
"libp.nvim": { "branch": "main", "commit": "636b1748e92f66022c1763f32b2ded6b8606eda5" },
|
|
||||||
"lspkind.nvim": { "branch": "master", "commit": "59c3f419af48a2ffb2320cea85e44e5a95f71664" },
|
|
||||||
"lspsaga.nvim": { "branch": "main", "commit": "343b71768c741432bab47d201624e92126a38686" },
|
|
||||||
"luasnip-google.nvim": { "branch": "main", "commit": "86df31e12350c15e207fcbc255d951144bb6d0b5" },
|
|
||||||
"mini.nvim": { "branch": "main", "commit": "f1dd64cf2ac1b348bd440e59446abf680c7188d6" },
|
|
||||||
"mini.trailspace": { "branch": "main", "commit": "f43e2dff55a07e0a84c01ba4b25ed976a12eea44" },
|
|
||||||
"neocitc": { "branch": "main", "commit": "3cf22fa7cda398aee6d0c44ef96b56dade7204af" },
|
|
||||||
"nvgoog": { "branch": "main", "commit": "d10e84b1e6ac6dc7a58536f844162adf35a272c8" },
|
|
||||||
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
|
||||||
"nvim-figtree": { "branch": "main", "commit": "7e5692fc7d42d0ae87cd37b15fe5a4a70771b3b5" },
|
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "7c4d0f77b8323ff679010706292e5caa4a13d8e6" },
|
|
||||||
"nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" },
|
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "86728435273b63fe71fa64a66c2a6d49e94613a2" },
|
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" },
|
|
||||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
|
||||||
"telescope-citc.nvim": { "branch": "main", "commit": "61df86dc218198a730e27bafd33535dac8539dcf" },
|
|
||||||
"telescope-codesearch.nvim": { "branch": "main", "commit": "4c6ad26b1b0a7db6f5de8f0a619a105f93bf63f3" },
|
|
||||||
"telescope-fig.nvim": { "branch": "main", "commit": "6ce47b13e7d38584934df5b20f80cbfa825df20a" },
|
|
||||||
"telescope-recent-files": { "branch": "main", "commit": "6893cda11625254cc7dc2ea76e0a100c7deeb028" },
|
|
||||||
"telescope.nvim": { "branch": "master", "commit": "df534c3042572fb958586facd02841e10186707c" },
|
|
||||||
"toggleterm.nvim": { "branch": "main", "commit": "fee58a0473fd92b28c34f8f724e4918b15ba30a3" },
|
|
||||||
"trouble.nvim": { "branch": "main", "commit": "254145ffd528b98eb20be894338e2d5c93fa02c2" },
|
|
||||||
"vcscommand.vim": { "branch": "master", "commit": "2fb32681361f37533455d20aaa7fc6eb11b0fa4b" },
|
|
||||||
"vim-imp": { "branch": "main", "commit": "fe9be485854ba602059f0d8af4fa4ab0a74d61ac" },
|
|
||||||
"vim-signify": { "branch": "master", "commit": "8670143f9e12ed1cd3c9b2c54f345cdd9a4baac3" },
|
|
||||||
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" }
|
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
local use_google = require("utils").use_google
|
||||||
|
|
||||||
|
if use_google() then
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
||||||
if args.bang then
|
if args.bang then
|
||||||
-- FormatDisable! will disable formatting just for this buffer
|
-- FormatDisable! will disable formatting just for this buffer
|
||||||
@ -20,16 +26,10 @@ return {
|
|||||||
{
|
{
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
event = { "BufWritePre" },
|
event = { "BufWritePre" },
|
||||||
cmd = { "ConformInfo" },
|
cmd = { "ConformInfo", "Format", "FormatDisable", "FormatEnable" },
|
||||||
keys = {
|
keys = {
|
||||||
{
|
-- stylua: ignore
|
||||||
"<leader>fmt",
|
{ "<leader>fmt", function() require("conform").format({ async = true, lsp_fallback = true }) end, mode = "", desc = "Format buffer", },
|
||||||
function()
|
|
||||||
require("conform").format({ async = true, lsp_fallback = true })
|
|
||||||
end,
|
|
||||||
mode = "",
|
|
||||||
desc = "Format buffer",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
@ -55,7 +55,7 @@ return {
|
|||||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
return { timeout_ms = 500, lsp_fallback = true }
|
return { timeout_ms = 500, lsp_format = "fallback" }
|
||||||
end,
|
end,
|
||||||
formatters = {
|
formatters = {
|
||||||
gdformat = {
|
gdformat = {
|
||||||
|
@ -47,7 +47,8 @@ return {
|
|||||||
glug("googlepaths"),
|
glug("googlepaths"),
|
||||||
-- Set up syntax, indent, and core settings for various filetypes
|
-- Set up syntax, indent, and core settings for various filetypes
|
||||||
superlazy(glug("ft-cpp", { event = "BufRead,BufNewFile *.[ch],*.cc,*.cpp" })),
|
superlazy(glug("ft-cpp", { event = "BufRead,BufNewFile *.[ch],*.cc,*.cpp" })),
|
||||||
superlazy(glug("ft-go", { event = "BufRead,BufNewFile *.go" })),
|
-- superlazy(glug("ft-go", { event = "BufRead,BufNewFile *.go" })),
|
||||||
|
superlazy(glug("ft-gcl", { event = "BufRead,BufNewFile *.gcl" })),
|
||||||
superlazy(glug("ft-java", { event = "BufRead,BufNewFile *.java" })),
|
superlazy(glug("ft-java", { event = "BufRead,BufNewFile *.java" })),
|
||||||
superlazy(glug("ft-javascript", { event = "BufRead,BufNewFile *.js,*.jsx" })),
|
superlazy(glug("ft-javascript", { event = "BufRead,BufNewFile *.js,*.jsx" })),
|
||||||
superlazy(glug("ft-kotlin", { event = "BufRead,BufNewFile *.kt,*.kts" })),
|
superlazy(glug("ft-kotlin", { event = "BufRead,BufNewFile *.kt,*.kts" })),
|
||||||
|
@ -4,221 +4,225 @@ local TableConcat = require("utils").TableConcat
|
|||||||
local scopes = require("neoscopes")
|
local scopes = require("neoscopes")
|
||||||
|
|
||||||
_G.find_files = function(search_dirs)
|
_G.find_files = function(search_dirs)
|
||||||
require("telescope.builtin").find_files({
|
require("telescope.builtin").find_files({
|
||||||
search_dirs = search_dirs,
|
search_dirs = search_dirs,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
-- Helper functions to fetch the current scope and set `search_dirs`
|
-- Helper functions to fetch the current scope and set `search_dirs`
|
||||||
_G.find_dotfiles = function()
|
_G.find_dotfiles = function()
|
||||||
require("telescope.builtin").git_files({
|
require("telescope.builtin").git_files({
|
||||||
cwd = vim.fn.expand("$HOME/dotfiles"),
|
cwd = vim.fn.expand("$HOME/dotfiles"),
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.search_cwd = function()
|
_G.search_cwd = function()
|
||||||
local builtin = require("telescope.builtin")
|
local builtin = require("telescope.builtin")
|
||||||
local utils = require("telescope.utils")
|
local utils = require("telescope.utils")
|
||||||
builtin.find_files({ cwd = utils.buffer_dir() })
|
builtin.find_files({ cwd = utils.buffer_dir() })
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.live_grep = function(search_dirs)
|
_G.live_grep = function(search_dirs)
|
||||||
require("telescope.builtin").live_grep({
|
require("telescope.builtin").live_grep({
|
||||||
search_dirs = search_dirs,
|
search_dirs = search_dirs,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
local function exe(cmd)
|
local function exe(cmd)
|
||||||
return vim.split(vim.fn.system(cmd), "\n")
|
return vim.split(vim.fn.system(cmd), "\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_visual_selection()
|
local function get_visual_selection()
|
||||||
-- Yank current visual selection into the 'v' register
|
-- Yank current visual selection into the 'v' register
|
||||||
--
|
--
|
||||||
-- Note that this makes no effort to preserve this register
|
-- Note that this makes no effort to preserve this register
|
||||||
vim.cmd('noau normal! "vy"')
|
vim.cmd('noau normal! "vy"')
|
||||||
|
|
||||||
return vim.fn.getreg("v")
|
return vim.fn.getreg("v")
|
||||||
end
|
end
|
||||||
|
|
||||||
function fig_modified()
|
function fig_modified()
|
||||||
return exe("hg pstatus -ma -n --no-status --template= | sort")
|
return exe("hg pstatus -ma -n --no-status --template= | sort")
|
||||||
end
|
|
||||||
function fig_all_modified()
|
|
||||||
return exe("hg status -ma -n --rev p4base --no-status --template= | sort")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- stylua: ignore
|
function fig_all_modified()
|
||||||
|
return exe("hg status -ma -n --rev p4base --no-status --template= | sort")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- stylua: ignore
|
||||||
local keys = {
|
local keys = {
|
||||||
{ "<leader>e", ":lua search_cwd()<CR>", desc = "Find Files in Buffer Directory" },
|
{ "<leader>e", ":lua search_cwd()<CR>", desc = "Find Files in Buffer Directory" },
|
||||||
{ "<leader>ts.", ":lua live_grep({vim.fn.getcwd()})<CR>", desc = "Search in CWD" },
|
{ "<leader>ts.", ":lua live_grep({vim.fn.getcwd()})<CR>", desc = "Search in CWD" },
|
||||||
{ "<leader>ts", ':lua live_grep({vim.fn.expand("%%")})<CR>', desc = "Search in Buffer Directory" },
|
{ "<leader>ts", ':lua live_grep({vim.fn.expand("%%")})<CR>', desc = "Search in Buffer Directory" },
|
||||||
{ "<leader>t.", ":lua find_dotfiles()<CR>", desc = "Find Dotfiles" },
|
{ "<leader>t.", ":lua find_dotfiles()<CR>", desc = "Find Dotfiles" },
|
||||||
{ "<leader>tc", ":Telescope textcase<CR>", desc = "Text case" },
|
{ "<leader>tc", ":Telescope textcase<CR>", desc = "Text case" },
|
||||||
{ "<leader>tC", ":CritiqueUnresolvedCommentsTelescope<CR>", desc = "Critique unresolved comments" },
|
{ "<leader>tC", ":CritiqueUnresolvedCommentsTelescope<CR>", desc = "Critique unresolved comments" },
|
||||||
{ "<leader>tca", ":CritiqueCommentsTelescope<CR>", desc = "Critique all comments" },
|
{ "<leader>tca", ":CritiqueCommentsTelescope<CR>", desc = "Critique all comments" },
|
||||||
{ "<leader>tg", ":Telescope git_files<CR>", desc = "Git Files" },
|
{ "<leader>tg", ":Telescope git_files<CR>", desc = "Git Files" },
|
||||||
{ "<leader>th", ":lua require('telescope.builtin').help_tags{}<CR>", desc = "[T]elescope [H]elp" },
|
{ "<leader>th", ":lua require('telescope.builtin').help_tags{}<CR>", desc = "[T]elescope [H]elp" },
|
||||||
{ "<leader>tk", ":Telescope keymaps<CR>", desc = "Keymaps" },
|
{ "<leader>tk", ":Telescope keymaps<CR>", desc = "Keymaps" },
|
||||||
{ "<leader>tn", ":Telescope notify<CR>", desc = "Notifications" },
|
{ "<leader>tn", ":Telescope notify<CR>", desc = "Notifications" },
|
||||||
{ "<leader>tr", ":Telescope resume<CR>", desc = "Telescope Resume" },
|
{ "<leader>tr", ":Telescope resume<CR>", desc = "Telescope Resume" },
|
||||||
--
|
--
|
||||||
-- { "<leader>tdc", ":Telescope dap commands" },
|
-- { "<leader>tdc", ":Telescope dap commands" },
|
||||||
-- { "<leader>tdc", ":Telescope dap configurations" },
|
-- { "<leader>tdc", ":Telescope dap configurations" },
|
||||||
}
|
}
|
||||||
|
|
||||||
if use_google() then
|
if use_google() then
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
TableConcat(keys, {
|
TableConcat(keys, {
|
||||||
{ "<leader>tm", ":lua find_files(fig_modified())<CR>" },
|
{ "<leader>tm", ":lua find_files(fig_modified())<CR>" },
|
||||||
{ "<leader>tM", ":lua find_files(fig_all_modified())<CR>" },
|
{ "<leader>tM", ":lua find_files(fig_all_modified())<CR>" },
|
||||||
{ "<leader>tf", ":lua live_grep(fig_modified())<CR>", desc = "Search in modified Fig files." },
|
{ "<leader>tf", ":lua live_grep(fig_modified())<CR>", desc = "Search in modified Fig files." },
|
||||||
{ "<leader>tF", ":lua live_grep(fig_all_modified())<CR>", desc = "Search in *all* modified Fig files." },
|
{ "<leader>tF", ":lua live_grep(fig_all_modified())<CR>", desc = "Search in *all* modified Fig files." },
|
||||||
{ "<C-P>", require("telescope").extensions.codesearch.find_files },
|
{ "<C-P>", require("telescope").extensions.codesearch.find_files },
|
||||||
{ "<leader>cs", require("telescope").extensions.codesearch.find_query },
|
{ "<leader>cs", require("telescope").extensions.codesearch.find_query },
|
||||||
{ "<leader>cs", require("telescope").extensions.codesearch.find_query, mode = "v" },
|
{ "<leader>cs", require("telescope").extensions.codesearch.find_query, mode = "v" },
|
||||||
{ "<leader>CS", [[<cmd>lua require('telescope').extensions.codesearch.find_query{default_text_expand='<cword>'}<CR>]], },
|
{ "<leader>CS", [[<cmd>lua require('telescope').extensions.codesearch.find_query{default_text_expand='<cword>'}<CR>]], },
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"aznhe21/actions-preview.nvim",
|
"aznhe21/actions-preview.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("actions-preview").setup({
|
require("actions-preview").setup({
|
||||||
telescope = {
|
telescope = {
|
||||||
sorting_strategy = "ascending",
|
sorting_strategy = "ascending",
|
||||||
layout_strategy = "vertical",
|
layout_strategy = "vertical",
|
||||||
layout_config = {
|
layout_config = {
|
||||||
width = 0.8,
|
width = 0.8,
|
||||||
height = 0.9,
|
height = 0.9,
|
||||||
prompt_position = "top",
|
prompt_position = "top",
|
||||||
preview_cutoff = 20,
|
preview_cutoff = 20,
|
||||||
preview_height = function(_, _, max_lines)
|
preview_height = function(_, _, max_lines)
|
||||||
return max_lines - 15
|
return max_lines - 15
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
{ "?", "<cmd>lua require('actions-preview').code_actions()<cr>" },
|
{ "?", "<cmd>lua require('actions-preview').code_actions()<cr>" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"smartpde/telescope-recent-files",
|
"smartpde/telescope-recent-files",
|
||||||
config = function()
|
config = function()
|
||||||
require("telescope").load_extension("recent_files")
|
require("telescope").load_extension("recent_files")
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>to", [[<cmd>lua require('telescope').extensions.recent_files.pick()<CR>]] },
|
{ "<leader>to", [[<cmd>lua require('telescope').extensions.recent_files.pick()<CR>]] },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"piersolenski/telescope-import.nvim",
|
"piersolenski/telescope-import.nvim",
|
||||||
dependencies = "nvim-telescope/telescope.nvim",
|
dependencies = "nvim-telescope/telescope.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("telescope").load_extension("import")
|
require("telescope").load_extension("import")
|
||||||
end,
|
end,
|
||||||
keys = function()
|
keys = function()
|
||||||
if not use_google() then
|
if not use_google() then
|
||||||
return {
|
return {
|
||||||
{ "<leader>i", ":Telescope import<CR>" },
|
{ "<leader>i", ":Telescope import<CR>" },
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
"smartpde/telescope-recent-files",
|
"smartpde/telescope-recent-files",
|
||||||
"rcarriga/nvim-dap-ui",
|
"rcarriga/nvim-dap-ui",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("telescope").setup({
|
require("telescope").setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
-- The vertical layout strategy is good to handle long paths like those in
|
-- 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.
|
-- google3 repos because you have nearly the full screen to display a file path.
|
||||||
-- The caveat is that the preview area is smaller.
|
-- The caveat is that the preview area is smaller.
|
||||||
layout_strategy = "vertical",
|
layout_strategy = "vertical",
|
||||||
-- Common paths in google3 repos are collapsed following the example of Cider
|
-- 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
|
-- 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.
|
-- telescope-codesearch because it can be reused by other telescope pickers.
|
||||||
path_display = function(opts, path)
|
path_display = function(opts, path)
|
||||||
-- Do common substitutions
|
-- Do common substitutions
|
||||||
path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1)
|
path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1)
|
||||||
path = path:gsub("^google3/java/com/google/", "//j/c/g/", 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/javatests/com/google/", "//jt/c/g/", 1)
|
||||||
path = path:gsub("^google3/third_party/", "//3p/", 1)
|
path = path:gsub("^google3/third_party/", "//3p/", 1)
|
||||||
path = path:gsub("^google3/", "//", 1)
|
path = path:gsub("^google3/", "//", 1)
|
||||||
|
|
||||||
-- Do truncation. This allows us to combine our custom display formatter
|
-- Do truncation. This allows us to combine our custom display formatter
|
||||||
-- with the built-in truncation.
|
-- with the built-in truncation.
|
||||||
-- `truncate` handler in transform_path memoizes computed truncation length in opts.__length.
|
-- `truncate` handler in transform_path memoizes computed truncation length in opts.__length.
|
||||||
-- Here we are manually propagating this value between new_opts and opts.
|
-- Here we are manually propagating this value between new_opts and opts.
|
||||||
-- We can make this cleaner and more complicated using metatables :)
|
-- We can make this cleaner and more complicated using metatables :)
|
||||||
local new_opts = {
|
local new_opts = {
|
||||||
path_display = {
|
path_display = {
|
||||||
truncate = true,
|
truncate = true,
|
||||||
},
|
},
|
||||||
__length = opts.__length,
|
__length = opts.__length,
|
||||||
}
|
}
|
||||||
path = require("telescope.utils").transform_path(new_opts, path)
|
path = require("telescope.utils").transform_path(new_opts, path)
|
||||||
opts.__length = new_opts.__length
|
opts.__length = new_opts.__length
|
||||||
return path
|
return path
|
||||||
end,
|
end,
|
||||||
mappings = {
|
mappings = {
|
||||||
n = {
|
n = {
|
||||||
["<C-c>"] = require("telescope.actions").close,
|
["<C-c>"] = require("telescope.actions").close,
|
||||||
["<Esc>"] = require("telescope.actions").close,
|
["<Esc>"] = require("telescope.actions").close,
|
||||||
},
|
},
|
||||||
i = {
|
i = {
|
||||||
["<C-c>"] = require("telescope.actions").close,
|
["<cr>"] = function(bufnr)
|
||||||
["<S-Down>"] = function()
|
require("telescope.actions.set").edit(bufnr, "tab drop")
|
||||||
require("telescope.actions").cycle_history_next()
|
end,
|
||||||
end,
|
["<C-c>"] = require("telescope.actions").close,
|
||||||
["<S-Up>"] = function()
|
["<S-Down>"] = function()
|
||||||
require("telescope.actions").cycle_history_prev()
|
require("telescope.actions").cycle_history_next()
|
||||||
end,
|
end,
|
||||||
},
|
["<S-Up>"] = function()
|
||||||
},
|
require("telescope.actions").cycle_history_prev()
|
||||||
},
|
end,
|
||||||
extensions = {
|
},
|
||||||
codesearch = {
|
},
|
||||||
experimental = true, -- enable results from google3/experimental
|
},
|
||||||
},
|
extensions = {
|
||||||
recent_files = {
|
codesearch = {
|
||||||
-- This function rewrites all file paths to the current workspace.
|
experimental = true, -- enable results from google3/experimental
|
||||||
-- For example, if w2 is the current workspace, then
|
},
|
||||||
-- /google/.../w1/google3/my_file.cc becomes /google/.../w2/google3/my_file.cc,
|
recent_files = {
|
||||||
transform_file_path = function(path)
|
-- This function rewrites all file paths to the current workspace.
|
||||||
local neocitc = require("neocitc")
|
-- For example, if w2 is the current workspace, then
|
||||||
local path_func = neocitc.path_in_current_workspace_or_head
|
-- /google/.../w1/google3/my_file.cc becomes /google/.../w2/google3/my_file.cc,
|
||||||
or neocitc.path_in_current_workspace
|
transform_file_path = function(path)
|
||||||
return path_func(path)
|
local neocitc = require("neocitc")
|
||||||
end,
|
local path_func = neocitc.path_in_current_workspace_or_head
|
||||||
-- This is a useful option to speed up Telescope by avoiding the check
|
or neocitc.path_in_current_workspace
|
||||||
-- for file existence.
|
return path_func(path)
|
||||||
stat_files = false,
|
end,
|
||||||
-- Ignore common patterns that can show up from other google plugins
|
-- This is a useful option to speed up Telescope by avoiding the check
|
||||||
ignore_patterns = {
|
-- for file existence.
|
||||||
"/%.git/COMMIT_EDITING$",
|
stat_files = false,
|
||||||
"/%.git/COMMIT_EDITMSG$",
|
-- Ignore common patterns that can show up from other google plugins
|
||||||
"/%.git/MERGE_MSG$",
|
ignore_patterns = {
|
||||||
"^/tmp/%.pipertmp-",
|
"/%.git/COMMIT_EDITING$",
|
||||||
"/Related_Files$",
|
"/%.git/COMMIT_EDITMSG$",
|
||||||
"^term:",
|
"/%.git/MERGE_MSG$",
|
||||||
";#toggleterm#",
|
"^/tmp/%.pipertmp-",
|
||||||
},
|
"/Related_Files$",
|
||||||
},
|
"^term:",
|
||||||
persisted = {},
|
";#toggleterm#",
|
||||||
import = {
|
},
|
||||||
-- Add imports to the top of the file keeping the cursor in place
|
},
|
||||||
insert_at_top = true,
|
persisted = {},
|
||||||
},
|
import = {
|
||||||
},
|
-- Add imports to the top of the file keeping the cursor in place
|
||||||
})
|
insert_at_top = true,
|
||||||
end,
|
},
|
||||||
keys = keys,
|
},
|
||||||
},
|
})
|
||||||
|
end,
|
||||||
|
keys = keys,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user