Compare commits

..

13 Commits

Author SHA1 Message Date
036a55effc goose 2025-06-17 21:38:27 +00:00
8345f91cc8 avante 2025-06-17 21:35:41 +00:00
b5e0e2ebf5 idk 2025-06-17 21:33:39 +00:00
1f30ce43c7 google 2025-06-17 21:33:39 +00:00
edf9ae6ada fix conform 2025-06-14 16:30:55 -05:00
28ac8a99b9 fix fzf 2025-05-25 22:37:48 -05:00
8b3bd23fa6 honesly who knows 2025-05-06 18:16:43 +00:00
e4efa6b209 avante 2025-04-11 09:39:33 -05:00
e588888143 bs blink/cmp 2025-04-01 19:08:23 +00:00
d261f8b3bd fix hg revision 2025-04-01 18:36:44 +00:00
5f814e7560 update 2025-03-25 16:04:57 -05:00
f9a40408aa flash 2025-03-21 19:08:30 -05:00
a6eee81db6 fix format 2025-03-17 15:51:27 -05:00
18 changed files with 656 additions and 583 deletions

View File

@ -3,4 +3,4 @@ set nowrap
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set expandtab

View File

@ -1,3 +1,7 @@
set tabstop=2
set softtabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set textwidth=80
set colorcolumn=80

View File

@ -4,5 +4,6 @@ abbr "bq"="blaze query"
abbr "br"="blaze run"
abbr "bt"="blaze test"
abbr "ds_clean"="find ./ -name \".DS_Store\" -depth -exec rm {} \;"
abbr "gdvim"="nvim --listen /tmp/godot.pipe"
abbr "mux"="tmuxinator"
abbr "replace_string"="replace_string --disable_p4 \"%\" \"%\""

View File

@ -0,0 +1,35 @@
local use_google = require("utils").use_google
return {
{
"yetone/avante.nvim",
build = "make",
enable = true,
branch = "working",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"stevearc/dressing.nvim",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
-- Add vintharas/avante-goose.nvim as a dependecy to avante.nvim
-- That'll ensure that you'll load avante-goose when you load avante.
{
"vintharas/avante-goose.nvim",
url = "sso://user/vintharas/avante-goose.nvim",
cond = use_google(),
opts = {
model = "gemini-for-google-2.5-pro", -- Select model from go/goose-models.
},
},
},
opts = {
provider = "goose", -- Select goose as provider
vendors = {}, -- Makes sure there's a vendors table
},
config = function(_, opts)
-- Load provider from the plugin
opts.vendors["goose"] = require("avante-goose").getProvider()
require("avante").setup(opts)
end,
},
}

View File

@ -1,6 +1,20 @@
local use_google = require("utils").use_google
return {
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {},
-- stylua: ignore
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
},
"tikhomirov/vim-glsl",
"sindrets/diffview.nvim",
{ "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" } },

View File

@ -15,51 +15,6 @@ local kind_icons = {
}
return {
{
"milanglacier/minuet-ai.nvim",
config = function()
require("minuet").setup({
provider = "gemini",
provider_options = {
gemini = {
optional = {
generationConfig = {
maxOutputTokens = 256,
},
safetySettings = {
{
-- HARM_CATEGORY_HATE_SPEECH,
-- HARM_CATEGORY_HARASSMENT
-- HARM_CATEGORY_SEXUALLY_EXPLICIT
category = "HARM_CATEGORY_DANGEROUS_CONTENT",
-- BLOCK_NONE
threshold = "BLOCK_ONLY_HIGH",
},
},
},
},
},
-- Your configuration options here
virtualtext = {
auto_trigger_ft = {},
keymap = {
-- accept whole completion
accept = "<A-A>",
-- accept one line
accept_line = "<A-a>",
-- accept n lines (prompts for number)
-- e.g. "A-z 2 CR" will accept 2 lines
accept_n_lines = "<A-z>",
-- Cycle to prev completion item, or manually invoke completion
prev = "<A-[>",
-- Cycle to next completion item, or manually invoke completion
next = "<A-]>",
dismiss = "<A-e>",
},
},
})
end,
},
{
"saghen/blink.compat",
-- use the latest release, via version = '*', if you also use the latest release for blink.cmp
@ -122,11 +77,14 @@ return {
"emoji",
"nerdfont",
"buffer",
"avante",
}
if use_google() then
table.insert(providerToEnable, "nvim_ciderlsp")
table.insert(providerToEnable, "buganizer")
-- table.insert(providerToEnable, "avante")
else
-- table.insert(providerToEnable, "avante")
table.insert(providerToEnable, "minuet")
end
return providerToEnable
@ -147,12 +105,13 @@ return {
max_filesize = "1M",
additional_rg_options = {},
},
score_offset = 20, -- the higher the number, the higher the priority
},
-- https://github.com/moyiz/blink-emoji.nvim
emoji = {
module = "blink-emoji",
name = "Emoji",
score_offset = 15, -- the higher the number, the higher the priority
score_offset = 1, -- the higher the number, the higher the priority
opts = { insert = true }, -- Insert emoji (default) or complete its name
},
buffer = {
@ -167,12 +126,20 @@ return {
nerdfont = {
name = "nerdfont",
module = "blink.compat.source",
score_offset = 1, -- the higher the number, the higher the priority
},
minuet = {
name = "minuet",
module = "minuet.blink",
score_offset = 100, -- Gives minuet higher priority among suggestions
},
-- avante = {
-- module = "blink-cmp-avante",
-- name = "Avante",
-- opts = {
-- -- options for blink-cmp-avante
-- },
-- },
nvim_ciderlsp = {
name = "nvim_ciderlsp",
module = "blink.compat.source",

View File

@ -1,89 +1,89 @@
local use_google = require("utils").use_google
vim.g.disable_autoformat = false
vim.api.nvim_create_user_command("FormatDisable", function(args)
if args.bang then
-- FormatDisable! will disable formatting just for this buffer
vim.b.disable_autoformat = true
else
vim.g.disable_autoformat = true
end
end, {
desc = "Disable autoformat-on-save",
bang = true,
})
vim.api.nvim_create_user_command("FormatEnable", function()
vim.b.disable_autoformat = false
vim.g.disable_autoformat = false
end, {
desc = "Re-enable autoformat-on-save",
})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*",
callback = function(args)
if vim.g.disable_autoformat or vim.b[args.buf].disable_autoformat then
return
end
require("conform").format({ bufnr = args.buf })
end,
})
vim.api.nvim_create_user_command("Format", function(args)
local range = nil
if args.count ~= -1 then
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
range = {
start = { args.line1, 0 },
["end"] = { args.line2, end_line:len() },
}
end
require("conform").format({ async = true, lsp_format = "fallback", range = range })
end, { range = true })
return {
{
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo", "FormatDisable", "FormatEnable" },
keys = {
{
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo", "FormatDisable", "FormatEnable" },
keys = {
-- stylua: ignore
{ "<leader>fmt", function() require("conform").format({ async = true, lsp_fallback = true }) end, mode = "", desc = "Format buffer", },
{ "<leader>fj", ":%!python -m json.tool" },
},
-- This will provide type hinting with LuaLS
---@module "conform"
---@type conform.setupOpts
opts = {
log_level = vim.log.levels.DEBUG,
formatters_by_ft = {
rust = { "rustfmt", lsp_format = "fallback" },
-- Conform will run multiple formatters sequentially
-- go = { "goimports", "gofmt" },
-- Use a sub-list to run only the first available formatter
lua = { "stylua" },
-- Conform will run multiple formatters sequentially
python = { "isort" },
-- Use a sub-list to run only the first available formatter
javascript = { { "prettier" } },
gdscript = { "gdformat" },
ron = { "ronfmt" },
dashboard = {},
-- Use the "*" filetype to run formatters on all filetypes.
-- ["*"] = { "codespell" },
-- Use the "_" filetype to run formatters on filetypes that don't
-- have other formatters configured.
["_"] = { "trim_whitespace" },
},
formatters = {
-- ronfmt = {
-- command = "ronfmt",
-- args = { "-d", "$FILENAME" },
-- },
gdformat = {
prepend_args = { "-l", "100" },
},
},
},
},
{ "<leader>fj", ":%!python -m json.tool" },
},
config = function()
vim.g.disable_autoformat = false
vim.api.nvim_create_user_command("FormatDisable", function(args)
if args.bang then
-- FormatDisable! will disable formatting just for this buffer
vim.b.disable_autoformat = true
else
vim.g.disable_autoformat = true
end
end, {
desc = "Disable autoformat-on-save",
bang = true,
})
vim.api.nvim_create_user_command("FormatEnable", function()
vim.b.disable_autoformat = false
vim.g.disable_autoformat = false
end, {
desc = "Re-enable autoformat-on-save",
})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*",
callback = function(args)
if vim.g.disable_autoformat or vim.b[args.buf].disable_autoformat then
return
end
require("conform").format({ bufnr = args.buf })
end,
})
vim.api.nvim_create_user_command("Format", function(args)
local range = nil
if args.count ~= -1 then
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
range = {
start = { args.line1, 0 },
["end"] = { args.line2, end_line:len() },
}
end
require("conform").format({ async = true })
end, { range = true })
require("conform").setup(
{
log_level = vim.log.levels.DEBUG,
formatters_by_ft = {
rust = { "rustfmt" },
-- Conform will run multiple formatters sequentially
-- go = { "goimports", "gofmt" },
-- Use a sub-list to run only the first available formatter
lua = { "stylua" },
-- Conform will run multiple formatters sequentially
python = { "isort" },
-- Use a sub-list to run only the first available formatter
javascript = { "prettier" },
gdscript = { "gdformat" },
ron = { "ronfmt" },
dashboard = {},
-- Use the "*" filetype to run formatters on all filetypes.
-- ["*"] = { "codespell" },
-- Use the "_" filetype to run formatters on filetypes that don't
-- have other formatters configured.
["_"] = { "trim_whitespace" },
},
formatters = {
-- ronfmt = {
-- command = "ronfmt",
-- args = { "-d", "$FILENAME" },
-- },
gdformat = {
prepend_args = { "-l", "100" },
},
},
})
end,
},
}

View File

@ -1,7 +1,7 @@
local use_google = require("utils").use_google
if not use_google() then
return {}
return {}
end
vim.opt.rtp:append("/google/src/head/depot/google3/experimental/users/fentanes/nvgoog/")
@ -11,69 +11,69 @@ local glugOpts = require("glug").glugOpts
local superlazy = require("nvgoog.util.superlazy")
return {
{ import = "nvgoog.google.format" },
-- maktaba is required by all google plugins
glug("maktaba", {
lazy = true,
dependencies = {},
config = function() -- init?
vim.cmd("source /usr/share/vim/google/glug/bootstrap.vim")
end,
}),
glug("googler", {
event = "VeryLazy",
}),
glug("glaive"),
glug("alert"),
glug("googlespell"),
-- Add support for google filetypes
glug("google-filetypes", { event = { "BufReadPre", "BufNewFile" }, dependencies = {} }),
{ import = "nvgoog.google.format" },
-- maktaba is required by all google plugins
glug("maktaba", {
lazy = true,
dependencies = {},
config = function() -- init?
vim.cmd("source /usr/share/vim/google/glug/bootstrap.vim")
end,
}),
glug("googler", {
event = "VeryLazy",
}),
glug("glaive"),
glug("alert"),
glug("googlespell"),
-- Add support for google filetypes
glug("google-filetypes", { event = { "BufReadPre", "BufNewFile" }, dependencies = {} }),
glug("add_usings"),
-- Autogens boilerplate when creating new files
glug("autogen", {
event = "BufNewFile",
}),
-- Adds G4 support to the vcscommand plugin
glug("googlepaths"),
-- Set up syntax, indent, and core settings for various filetypes
superlazy(glug("ft-cpp", { event = "BufRead,BufNewFile *.[ch],*.cc,*.cpp" })),
-- superlazy(glug("ft-go", { event = "BufRead,BufNewFile *.go" })),
superlazy(glug("ft-java", { event = "BufRead,BufNewFile *.java" })),
superlazy(glug("ft-javascript", { event = "BufRead,BufNewFile *.js,*.jsx" })),
superlazy(glug("ft-kotlin", { event = "BufRead,BufNewFile *.kt,*.kts" })),
superlazy(glug("ft-python", { event = "BufRead,BufNewFile *.py" })),
glug("add_usings"),
-- Autogens boilerplate when creating new files
glug("autogen", {
event = "BufNewFile",
}),
-- Adds G4 support to the vcscommand plugin
glug("googlepaths"),
-- Set up syntax, indent, and core settings for various filetypes
superlazy(glug("ft-cpp", { event = "BufRead,BufNewFile *.[ch],*.cc,*.cpp" })),
superlazy(glug("ft-go", { event = "BufRead,BufNewFile *.go" })),
superlazy(glug("ft-java", { event = "BufRead,BufNewFile *.java" })),
superlazy(glug("ft-javascript", { event = "BufRead,BufNewFile *.js,*.jsx" })),
superlazy(glug("ft-kotlin", { event = "BufRead,BufNewFile *.kt,*.kts" })),
superlazy(glug("ft-python", { event = "BufRead,BufNewFile *.py" })),
-- Configures nvim to respect Google's coding style
superlazy(glug("googlestyle", { event = { "BufRead", "BufNewFile" } })),
-- Configures nvim to respect Google's coding style
superlazy(glug("googlestyle", { event = { "BufRead", "BufNewFile" } })),
glug("ft-soy"),
glug("ft-gss"),
glug("ft-proto"),
glug("g4"),
glug("outline-window"),
glug("fzf-query"),
-- Open current file in chrome
glug("corpweb", {
dependencies = {
glug("launchbrowser"),
},
cmd = {
-- Launches {query} under codesearch in a web browser
"CorpWebCs",
-- Launches the current file under codesearch in a web browser
"CorpWebCsFile",
-- Launches the current file doc view (i.e., Cantata, G3Docs, or godoc)
"CorpWebDocFindFile",
-- Launches the current CL in Critique
"CorpWebCritiqueCl",
-- Launches the current CL in Cider
"CorpWebCider",
-- Launches {query} under cs.chromium.org in a web browser
"CorpWebChromeCs",
},
}),
glug("relatedfiles", {
glug("ft-soy"),
glug("ft-gss"),
glug("ft-proto"),
glug("g4"),
glug("outline-window"),
glug("fzf-query"),
-- Open current file in chrome
glug("corpweb", {
dependencies = {
glug("launchbrowser"),
},
cmd = {
-- Launches {query} under codesearch in a web browser
"CorpWebCs",
-- Launches the current file under codesearch in a web browser
"CorpWebCsFile",
-- Launches the current file doc view (i.e., Cantata, G3Docs, or godoc)
"CorpWebDocFindFile",
-- Launches the current CL in Critique
"CorpWebCritiqueCl",
-- Launches the current CL in Cider
"CorpWebCider",
-- Launches {query} under cs.chromium.org in a web browser
"CorpWebChromeCs",
},
}),
glug("relatedfiles", {
-- stylua: ignore
keys = {
{ "<leader>rb", ":exec relatedfiles#selector#JumpToBuild()<CR>" },
@ -81,232 +81,242 @@ return {
{ "<leader>rh", ":exec relatedfiles#selector#JumpToHeader()<CR>" },
{ "<leader>rc", ":exec relatedfiles#selector#JumpToCodeFile()<CR>" },
},
}),
{ "junegunn/fzf", dir = "~/.fzf", build = "./install --all" },
{ "junegunn/fzf.vim", dependencies = { "junegunn/fzf" } },
-- Format google code
glug("codefmt-google", {
dependencies = {
glug("codefmt", {
opts = {
clang_format_executable = "/usr/bin/clang-format",
clang_format_style = "function('codefmtgoogle#GetClangFormatStyle')",
gofmt_executable = "/usr/lib/google-golang/bin/gofmt",
prettier_executable = "/google/data/ro/teams/prettier/prettier",
ktfmt_executable = { "/google/bin/releases/kotlin-google-eng/ktfmt/ktfmt", "--google-style" },
},
}),
},
opts = {
auto_format = {
["borg"] = "gclfmt",
["gcl"] = "gclfmt",
["patchpanel"] = "gclfmt",
["bzl"] = "buildifier",
["c"] = "clang-format",
["cpp"] = "clang-format",
["javascript"] = "clang-format",
["typescript"] = "clang-format",
["dart"] = "dartfmt",
["go"] = "gofmt",
["java"] = "google-java-format",
["kotlin"] = "ktfmt",
["jslayout"] = "jslfmt",
["markdown"] = "mdformat",
["ncl"] = "nclfmt",
["python,piccolo"] = "pyformat",
["soy"] = "soyfmt",
["textpb"] = "text-proto-format",
["proto"] = "protofmt",
["sql"] = "format_sql",
},
},
cmd = { "FormatLines", "FormatCode", "AutoFormatBuffer" },
event = "VimEnter",
}),
{ "junegunn/fzf", dir = "~/.fzf", build = "./install --all" },
{ "junegunn/fzf.vim", dependencies = { "junegunn/fzf" } },
-- Format google code
glug("codefmt-google", {
dependencies = {
glug("codefmt", {
opts = {
clang_format_executable = "/usr/bin/clang-format",
clang_format_style = "function('codefmtgoogle#GetClangFormatStyle')",
gofmt_executable = "/usr/lib/google-golang/bin/gofmt",
prettier_executable = "/google/data/ro/teams/prettier/prettier",
ktfmt_executable = { "/google/bin/releases/kotlin-google-eng/ktfmt/ktfmt", "--google-style" },
},
}),
},
opts = {
auto_format = {
["borg"] = "gclfmt",
["gcl"] = "gclfmt",
["patchpanel"] = "gclfmt",
["bzl"] = "buildifier",
["c"] = "clang-format",
["cpp"] = "clang-format",
["javascript"] = "clang-format",
["typescript"] = "clang-format",
["dart"] = "dartfmt",
["go"] = "gofmt",
["java"] = "google-java-format",
["kotlin"] = "ktfmt",
["jslayout"] = "jslfmt",
["markdown"] = "mdformat",
["ncl"] = "nclfmt",
["python,piccolo"] = "pyformat",
["soy"] = "soyfmt",
["textpb"] = "text-proto-format",
["proto"] = "protofmt",
["sql"] = "format_sql",
},
},
cmd = { "FormatLines", "FormatCode", "AutoFormatBuffer" },
event = "VimEnter",
-- Setting up autocmds in init allows deferring loading the plugin until
-- the `BufWritePre` event. One caveat is we must call `codefmt#FormatBuffer()`
-- manually the first time since the plugin relies on the `BufWritePre` command to call it,
-- but by the time it's first loaded it has already happened.
-- TODO: check if that is fixed when the following issue is fixed
-- https://github.com/folke/lazy.nvim/issues/858
-- if so, remove the call to `FormatBuffer`
init = function(plugin)
local group = vim.api.nvim_create_augroup("autoformat_settings", {})
local function autocmd(filetypes, formatter)
vim.api.nvim_create_autocmd("FileType", {
pattern = filetypes,
group = group,
callback = function(event)
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = event.buf,
group = group,
once = true,
command = "call codefmt#FormatBuffer() | AutoFormatBuffer " .. formatter,
})
end,
})
end
-- Build opts from possible parent specs since lazy.nvim doesn't provide it in `init`
local plugin_opts = require("lazy.core.plugin").values(plugin, "opts", false)
for filetypes, formatter in pairs(plugin_opts.auto_format or {}) do
autocmd(filetypes, formatter)
end
end,
}),
-- Setting up autocmds in init allows deferring loading the plugin until
-- the `BufWritePre` event. One caveat is we must call `codefmt#FormatBuffer()`
-- manually the first time since the plugin relies on the `BufWritePre` command to call it,
-- but by the time it's first loaded it has already happened.
-- TODO: check if that is fixed when the following issue is fixed
-- https://github.com/folke/lazy.nvim/issues/858
-- if so, remove the call to `FormatBuffer`
init = function(plugin)
local group = vim.api.nvim_create_augroup("autoformat_settings", {})
local function autocmd(filetypes, formatter)
vim.api.nvim_create_autocmd("FileType", {
pattern = filetypes,
group = group,
callback = function(event)
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = event.buf,
group = group,
once = true,
command = "call codefmt#FormatBuffer() | AutoFormatBuffer " .. formatter,
})
end,
})
end
-- Build opts from possible parent specs since lazy.nvim doesn't provide it in `init`
local plugin_opts = require("lazy.core.plugin").values(plugin, "opts", false)
for filetypes, formatter in pairs(plugin_opts.auto_format or {}) do
autocmd(filetypes, formatter)
end
end,
}),
-- Run blaze commands
glug("blaze", {
dependencies = {
glug("blazedeps"),
},
cmd = {
"Blaze",
"BlazeGoToSponge",
"BlazeViewCommandLog",
"BlazeLoadErrors",
"BlazeDebugCurrentFileTest",
"BlazeDebugCurrentTestMethod",
"BlazeDebugAddBreakpoint",
"BlazeDebugClearBreakpoint",
"BlazeDebugFinish",
"BlazeDepsUpdate",
},
keys = function()
local function runCommandWithTarget(cmd)
return function()
local targets = table.concat(vim.fn["blaze#GetTargets"](), " ")
local command = "VimuxRunCommand('" .. cmd .. " " .. targets .. "')"
print(vim.inspect(command))
vim.cmd(command)
end
end
return {
{ "<leader>b", desc = "Blaze" },
{ "<leader>bb", runCommandWithTarget("blaze build"), desc = "Blaze Build" },
{ "<leader>br", runCommandWithTarget("blaze run"), desc = "Blaze Run" },
{ "<leader>bt", runCommandWithTarget("blaze test"), desc = "Blaze Test" },
{ "<leader>bc", runCommandWithTarget("build_cleaner"), desc = "Blaze Run" },
{
"<leader>yb",
":let t = join(blaze#GetTargets(), ' ') | echo t | let @+ = t | let @\" = t<CR>",
desc = "Yank Blaze Target",
},
{
"<leader>bq",
function()
local targets = vim.fn["blaze#GetTargets"]()
for _, t in ipairs(targets) do
print(vim.inspect(t))
vim.cmd("VimuxRunCommand('blaze query " .. t:gsub(":.+", "") .. ":\\*" .. "')")
end
end,
desc = "Blaze query the current package",
},
}
end,
}),
-- Imports
glug("imp-google", {
dependencies = {
glugOpts("vim-imp", {
"flwyd/vim-imp",
opts = {
["Suggest[default]"] = { "buffer", "csearch", "ripgrep", "prompt" },
["Report[default]"] = "popupnotify",
["Location[default]"] = "packageroot",
-- ["Location[gcl]"] = "parent",
["Pick[default]"] = "fzf",
},
}),
},
cmd = { "ImpSuggest", "ImpFirst" },
keys = {
{ "<leader>i", ":ImpSuggest <C-r><C-w><cr>" },
},
}),
{
url = "sso://user/fentanes/googlepaths.nvim",
event = { "VeryLazy", "BufReadCmd //*", "BufReadCmd google3/*" },
opts = {},
},
{
name = "ai.nvim",
url = "sso://googler@user/vvvv/ai.nvim",
},
{
name = "cmp-nvim-ciderlsp",
url = "sso://googler@user/piloto/cmp-nvim-ciderlsp",
event = "VimEnter",
},
{
name = "ciderlsp-nvim",
url = "sso://googler@user/kdark/ciderlsp-nvim",
event = "VimEnter",
},
-- {
-- name = "nvim_figtree",
-- url = "sso://googler@user/jackcogdill/nvim-figtree",
-- },
{
name = "telescope_codesearch",
url = "sso://googler@user/vintharas/telescope-codesearch.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
config = function() end,
},
{
name = "telescope_citc",
url = "sso://googler@user/aktau/telescope-citc.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
},
{
name = "telescope_fig",
url = "sso://googler@user/tylersaunders/telescope-fig.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
},
{
name = "critique-nvim",
dir = "~/critique-nvim/",
lazy = false,
dependencies = {
"rktjmp/time-ago.vim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"runiq/neovim-throttle-debounce",
},
-- here are some mappings you might want:
keys = {
{ "<Leader>lc", ":CritiqueToggleLineComment<CR>" },
{ "<Leader>ac", ":CritiqueToggleAllComments<CR>" },
{ "<Leader>uc", ":CritiqueToggleUnresolvedComments<CR>" },
{ "<Leader>fc", ":CritiqueFetchComments<CR>" },
{ "<Leader>tc", ":CritiqueCommentsTelescope<CR>" },
},
config = function()
-- Here are all the options and their default values:
require("critique.comments").setup({
-- debug = 1, -- default = 0
-- Fetch the comments after calling `setup`.
auto_fetch = true, -- default = true
auto_render = true, -- default = true
-- Allow checking for comments on BufEnter events. This is throttled to once every 10 seconds.
frequent_fetch = true, -- default = false
verbose_notifications = true,
})
end,
},
{
url = "sso://googler@user/mccloskeybr/luasnip-google.nvim",
config = function()
require("luasnip-google").load_snippets()
end,
},
{
name = "hg",
url = "sso://googler@user/smwang/hg.nvim",
dependencies = { "ipod825/libp.nvim" },
config = function()
require("hg").setup()
end,
},
-- Run blaze commands
glug("blaze", {
dependencies = {
glug("blazedeps"),
},
cmd = {
"Blaze",
"BlazeGoToSponge",
"BlazeViewCommandLog",
"BlazeLoadErrors",
"BlazeDebugCurrentFileTest",
"BlazeDebugCurrentTestMethod",
"BlazeDebugAddBreakpoint",
"BlazeDebugClearBreakpoint",
"BlazeDebugFinish",
"BlazeDepsUpdate",
},
keys = function()
local function runCommandWithTarget(cmd)
return function()
local targets = table.concat(vim.fn["blaze#GetTargets"](), " ")
local command = "VimuxRunCommand('" .. cmd .. " " .. targets .. "')"
print(vim.inspect(command))
vim.cmd(command)
end
end
return {
{ "<leader>b", desc = "Blaze" },
{ "<leader>bb", runCommandWithTarget("blaze build"), desc = "Blaze Build" },
{ "<leader>br", runCommandWithTarget("blaze run"), desc = "Blaze Run" },
{ "<leader>bt", runCommandWithTarget("blaze test"), desc = "Blaze Test" },
{ "<leader>bc", runCommandWithTarget("build_cleaner"), desc = "Blaze Run" },
{
"<leader>yb",
":let t = join(blaze#GetTargets(), ' ') | echo t | let @+ = t | let @\" = t<CR>",
desc = "Yank Blaze Target",
},
{
"<leader>bq",
function()
local targets = vim.fn["blaze#GetTargets"]()
for _, t in ipairs(targets) do
print(vim.inspect(t))
vim.cmd("VimuxRunCommand('blaze query " .. t:gsub(":.+", "") .. ":\\*" .. "')")
end
end,
desc = "Blaze query the current package",
},
}
end,
}),
-- Imports
glug("imp-google", {
dependencies = {
glugOpts("vim-imp", {
"flwyd/vim-imp",
opts = {
["Suggest[default]"] = { "buffer", "csearch", "ripgrep", "prompt" },
["Report[default]"] = "popupnotify",
["Location[default]"] = "packageroot",
-- ["Location[gcl]"] = "parent",
["Pick[default]"] = "fzf",
},
}),
},
cmd = { "ImpSuggest", "ImpFirst" },
keys = {
{ "<leader>I", ":ImpSuggest <C-r><C-w><cr>" },
},
}),
{
url = "sso://user/fentanes/googlepaths.nvim",
event = { "VeryLazy", "BufReadCmd //*", "BufReadCmd google3/*" },
opts = {},
},
{
name = "ai.nvim",
url = "sso://googler@user/vvvv/ai.nvim",
},
{
name = "cmp-nvim-ciderlsp",
url = "sso://googler@user/piloto/cmp-nvim-ciderlsp",
event = "VimEnter",
},
{
name = "ciderlsp-nvim",
url = "sso://googler@user/kdark/ciderlsp-nvim",
event = "VimEnter",
},
{
url = "sso://user/jackcogdill/nvim-figtree",
keys = {
{
"<Leader>ft",
function()
require("figtree").toggle()
end,
},
},
opts = {
-- see |figtree-configuration| for all possible options
},
},
{
name = "telescope_codesearch",
url = "sso://googler@user/vintharas/telescope-codesearch.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
config = function() end,
},
{
name = "telescope_citc",
url = "sso://googler@user/aktau/telescope-citc.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
},
{
name = "telescope_fig",
url = "sso://googler@user/tylersaunders/telescope-fig.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
},
{
name = "critique-nvim",
dir = "~/critique-nvim/",
lazy = false,
dependencies = {
"rktjmp/time-ago.vim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"runiq/neovim-throttle-debounce",
},
-- here are some mappings you might want:
keys = {
{ "<Leader>lc", ":CritiqueToggleLineComment<CR>" },
{ "<Leader>ac", ":CritiqueToggleAllComments<CR>" },
{ "<Leader>uc", ":CritiqueToggleUnresolvedComments<CR>" },
{ "<Leader>fc", ":CritiqueFetchComments<CR>" },
{ "<Leader>tc", ":CritiqueCommentsTelescope<CR>" },
},
config = function()
-- Here are all the options and their default values:
require("critique.comments").setup({
-- debug = 1, -- default = 0
-- Fetch the comments after calling `setup`.
auto_fetch = true, -- default = true
auto_render = true, -- default = true
-- Allow checking for comments on BufEnter events. This is throttled to once every 10 seconds.
frequent_fetch = true, -- default = false
verbose_notifications = true,
})
end,
},
{
url = "sso://googler@user/mccloskeybr/luasnip-google.nvim",
config = function()
require("luasnip-google").load_snippets()
end,
},
{
name = "hg",
url = "sso://googler@user/smwang/hg.nvim",
dependencies = { "ipod825/libp.nvim" },
config = function()
require("hg").setup()
end,
},
}

View File

@ -1,50 +1,60 @@
local use_google = require("utils").use_google
local flags = require("utils").flags
local function add_import()
vim.lsp.buf.code_action({
apply = true,
context = {
only = { "quickfix.addImports" },
},
})
end
return {
{
"kosayoda/nvim-lightbulb",
commit = "1cae7b7153ae98dcf1b11173a443ac1b6d8e3d49",
event = { "LspAttach" },
opts = {
autocmd = { enabled = true },
virtual_text = {
enabled = true,
text = " 󱐋",
hl = "DiagnosticWarn",
},
sign = { enabled = false },
},
},
{
"L3MON4D3/LuaSnip",
build = "make install_jsregexp",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
dependencies = { "rafamadriz/friendly-snippets" },
},
{
"ray-x/go.nvim",
dependencies = { -- optional packages
"ray-x/guihua.lua",
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
-- cond = not use_google(),
config = function()
local capabilities = flags.blink
and require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
or require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
capabilities.offsetEncoding = { "utf-16" }
require("go").setup({
lsp_cfg = { capabilities = capabilities },
lsp_keymaps = false,
lsp_inlay_hints = {
enable = not use_google(), -- doesn't work with ciderlsp
},
})
-- Run gofmt + goimports on save
{
"kosayoda/nvim-lightbulb",
commit = "1cae7b7153ae98dcf1b11173a443ac1b6d8e3d49",
event = { "LspAttach" },
opts = {
autocmd = { enabled = true },
virtual_text = {
enabled = true,
text = " 󱐋",
hl = "DiagnosticWarn",
},
sign = { enabled = false },
},
},
{
"L3MON4D3/LuaSnip",
build = "make install_jsregexp",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
dependencies = { "rafamadriz/friendly-snippets" },
},
{
"ray-x/go.nvim",
dependencies = { -- optional packages
"ray-x/guihua.lua",
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
-- cond = not use_google(),
config = function()
local capabilities = flags.blink
and require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
or require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
capabilities.offsetEncoding = { "utf-16" }
require("go").setup({
lsp_cfg = { capabilities = capabilities },
lsp_keymaps = false,
lsp_inlay_hints = {
enable = not use_google(), -- doesn't work with ciderlsp
},
})
-- Run gofmt + goimports on save
local format_sync_grp = vim.api.nvim_create_augroup("goimports", {})
vim.api.nvim_create_autocmd("BufWritePre", {
@ -69,6 +79,7 @@ return {
},
keys = {
{ "<leader>F", ":lua vim.lsp.buf.format()<CR>" },
{ "<leader>i", add_import },
{ "<leader>rn", ":lua vim.lsp.buf.rename()<CR>" },
{ "L", ":lua vim.lsp.buf.hover()<CR>" },
{ "gr", ":Telescope lsp_references<CR>" },
@ -86,41 +97,44 @@ return {
local lspconfig = require("lspconfig")
local lsp_configs = require("lspconfig.configs")
lsp_configs.ciderlsp = {
default_config = {
cmd = {
"/google/bin/releases/cider/ciderlsp/ciderlsp",
"--tooltag=nvim-lsp",
"--noforward_sync_responses",
},
filetypes = {
"c",
"cpp",
"java",
"kotlin",
"objc",
"proto",
"textproto",
"go",
"python",
"bzl",
"typescript",
},
offset_encoding = "utf-8",
root_dir = lspconfig.util.root_pattern(".citc"),
settings = {},
},
}
lsp_configs.ciderlsp = {
default_config = {
cmd = {
"/google/bin/releases/cider/ciderlsp/ciderlsp",
"--tooltag=nvim-lsp",
"--noforward_sync_responses",
},
filetypes = {
"c",
"cpp",
"java",
"kotlin",
"objc",
"proto",
"textproto",
"go",
"python",
"bzl",
"typescript",
},
offset_encoding = "utf-8",
root_dir = lspconfig.util.root_pattern(".citc"),
settings = {},
},
}
if use_google() then
lspconfig.ciderlsp.setup({})
end
if use_google() then
lspconfig.ciderlsp.setup({})
end
require("lspconfig").gdscript.setup({})
vim.cmd([[autocmd FileType gdscript setlocal commentstring=#\ %s]])
vim.cmd([[autocmd FileType gdscript setlocal autoindent noexpandtab tabstop=4 shiftwidth=4]])
lspconfig.gdscript.setup({})
-- require('lspconfig').gdscript.setup { cmd = { "ncat", "localhost", "6005" }, root_dir = function()
-- return vim.fs.dirname(vim.fs.find('project.godot', { upward = true })[1])
-- end
-- }
require("lspconfig").gdshader_lsp.setup({})
end,
},
vim.cmd([[autocmd FileType gdscript setlocal commentstring=#\ %s]])
vim.cmd([[autocmd FileType gdscript setlocal autoindent noexpandtab tabstop=4 shiftwidth=4 wrap]])
end,
},
}

View File

@ -0,0 +1,44 @@
return {
'milanglacier/minuet-ai.nvim',
config = function()
require('minuet').setup {
provider = 'gemini',
provider_options = {
gemini = {
optional = {
generationConfig = {
maxOutputTokens = 256,
},
safetySettings = {
{
-- HARM_CATEGORY_HATE_SPEECH,
-- HARM_CATEGORY_HARASSMENT
-- HARM_CATEGORY_SEXUALLY_EXPLICIT
category = 'HARM_CATEGORY_DANGEROUS_CONTENT',
-- BLOCK_NONE
threshold = 'BLOCK_ONLY_HIGH',
},
},
},
},
},
virtualtext = {
auto_trigger_ft = {},
keymap = {
-- accept whole completion
accept = '<A-A>',
-- accept one line
accept_line = '<A-a>',
-- accept n lines (prompts for number)
-- e.g. "A-z 2 CR" will accept 2 lines
accept_n_lines = '<A-z>',
-- Cycle to prev completion item, or manually invoke completion
prev = '<A-[>',
-- Cycle to next completion item, or manually invoke completion
next = '<A-]>',
dismiss = '<A-e>',
},
}
}
end,
}

View File

@ -1,52 +1,57 @@
local use_google = require("utils").use_google
return {
-- {
-- "cmdtree",
-- dir = "~/cmdtree",
-- },
{
"nvim-neo-tree/neo-tree.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
-- "~/cmdtree",
},
cmd = {
"Neotree",
},
config = function()
require("neo-tree").setup({
hijack_netrw_behavior = "open_default",
filesystem = {
filtered_items = {
hide_dotfiles = false,
},
bind_to_cwd = false,
},
sources = {
"filesystem",
"buffers",
"git_status",
--"cmdtree",
-- ...and any additional source
},
window = {
mappings = {
["O"] = "expand_all_nodes",
},
},
})
end,
-- {
-- "cmdtree",
-- dir = "~/cmdtree",
-- },
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
lazy = false, -- neo-tree will lazily load itself
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
-- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
},
-----@module "neo-tree"
-----@type neotree.Config
opts = {
filesystem = {
hijack_netrw_behavior = "open_default",
filtered_items = {
hide_dotfiles = false,
},
-- follow_current_file = {
-- enabled = true,
-- leave_dirs_open = false,
-- },
group_empty_dirs = true,
},
sources = {
"filesystem",
"buffers",
"git_status",
--"cmdtree",
-- ...and any additional source
},
window = {
mappings = {
["O"] = "expand_all_nodes",
},
},
},
-- stylua: ignore
keys = {
(function()
if use_google() then
return { "<C-n>m", ":Neotree float cmdtree<CR>", desc = "Open NeoTree CWD float" }
end
-- if use_google() then
-- return { "<C-n>m", ":Neotree float cmdtree<CR>", desc = "Open NeoTree CWD float" }
-- end
return { "<C-n>m", ":Neotree float git_status<CR>", desc = "Open NeoTree CWD float" }
end)(),
{ "<C-n>", ":Neotree toggle left dir=%:p:h<cr>" },
{ "<C-n>", ":Neotree reveal left<cr>" },
{ "<C-n>.", ":Neotree reveal left dir=%:p:h<cr>" },
},
},
},
}

View File

@ -4,7 +4,7 @@ local function change_diffbase(hg_revision, git_revision)
vim.g.signify_vcs_cmds = {
git = "git diff --no-color --diff-algorithm=histogram --no-ext-diff -U0 " .. git_revision .. " -- %f",
yadm = 'yadm diff --no-color --no-ext-diff -U0 -- %f',
hg = 'chg --config alias.diff=diff diff --color=never --nodates -U0 -- %f',
hg = 'chg --config alias.diff=diff diff '.. hg_revision .. ' --color=never --nodates -U0 -- %f',
svn = 'svn diff --diff-cmd %d -x -U0 -- %f',
bzr = 'bzr diff --using %d --diff-options=-U0 -- %f',
darcs = 'darcs diff --no-pause-for-gui --no-unified --diff-opts=-U0 -- %f',

View File

@ -196,6 +196,18 @@ return {
codesearch = {
experimental = true, -- enable results from google3/experimental
},
live_grep_args = {
auto_quoting = true, -- enable/disable auto-quoting
-- define mappings, e.g.
mappings = { -- extend mappings
i = {
["<C-k>"] = require("telescope-live-grep-args.actions").quote_prompt(),
["<C-i>"] = require("telescope-live-grep-args.actions").quote_prompt({ postfix = " --iglob " }),
-- freeze the current list and start a fuzzy search in the frozen list
["<C-.>"] = require("telescope-live-grep-args.actions").to_fuzzy_refine,
},
},
},
recent_files = {
-- This function rewrites all file paths to the current workspace.
-- For example, if w2 is the current workspace, then

View File

@ -6,7 +6,7 @@ return {
lazy = false,
cond = not use_google(),
priority = 1000,
dir = "~/neovim-plugins/squk/ableton.nvim",
-- dir = "~/neovim-plugins/squk/ableton.nvim",
opts = {
variant = "cooler",
},

View File

@ -40,48 +40,6 @@ function M.file_exists(name)
end
end
function M.dump(o)
if type(o) == "table" then
local s = "{ "
for k, v in pairs(o) do
if type(k) ~= "number" then
k = '"' .. k .. '"'
end
s = s .. "[" .. k .. "] = " .. M.dump(v) .. ","
end
return s .. "} "
else
return tostring(o)
end
end
function M.tprint(tbl, indent)
if not indent then
indent = 0
end
local toprint = string.rep(" ", indent) .. "{\r\n"
indent = indent + 2
for k, v in pairs(tbl) do
toprint = toprint .. string.rep(" ", indent)
if type(k) == "number" then
toprint = toprint .. "[" .. k .. "] = "
elseif type(k) == "string" then
toprint = toprint .. k .. "= "
end
if type(v) == "number" then
toprint = toprint .. v .. ",\r\n"
elseif type(v) == "string" then
toprint = toprint .. '"' .. v .. '",\r\n'
elseif type(v) == "table" then
toprint = toprint .. M.tprint(v, indent + 2) .. ",\r\n"
else
toprint = toprint .. '"' .. tostring(v) .. '",\r\n'
end
end
toprint = toprint .. string.rep(" ", indent - 2) .. "}"
return toprint
end
function M.log(message)
local log_file_path = vim.fn.expand("$HOME/nvim.log")
local log_file = io.open(log_file_path, "a")
@ -97,4 +55,6 @@ function M.TableConcat(t1, t2)
return t1
end
M.flags.blink = not M.use_google()
return M

View File

@ -26,3 +26,5 @@ fi
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
. "$HOME/.cargo/env"
ulimit -n 10240

View File

@ -5,8 +5,11 @@ export ABBR_QUIET=1
# ---------------
export PATH=$PATH:/google/src/head/depot/google3/experimental/users/cnieves/util
export PATH="${HOME}/.config/lsp/lua-language-server/bin:${PATH}"
export GOROOT=/usr/lib/google-golang
export PATH=$PATH:/${HOME}/nvim-linux-x86_64/bin/
export PATH=$GOROOT/bin:$PATH
export DUMMY_API_KEY="DUMMY_API_KEY"
export GOROOT=/usr/lib/google-golang
export JAVA_HOME=$(readlink -ne /usr/local/buildtools/java/jdk)
export CARGO_NET_GIT_FETCH_WITH_CLI=true
source ~/g3path.zsh
@ -147,6 +150,7 @@ alias bisect=/google/data/ro/teams/tetralight/bin/bisect
alias copybara='/google/bin/releases/copybara/public/copybara/copybara'
alias allow_ptrace='/google/bin/releases/cider/dbg/allow_ptrace'
alias bluze=/google/bin/releases/blueprint-bluze/public/bluze
alias cclean=/google/src/head/depot/google3/devtools/maintenance/cclean/cclean
source /google/bin/releases/gmscore-tools/cli/prod/setup_prod_gms.sh
abbr bq="blaze query"

View File

@ -37,6 +37,7 @@ zplug "zsh-users/zsh-syntax-highlighting", defer:2
zplug "mafredri/zsh-async", from:"github", use:"async.zsh"
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-history-substring-search"
zplug 'joshskidmore/zsh-fzf-history-search'
zplug "modules/command-not-found", from:prezto
zplug "romkatv/powerlevel10k", as:theme, depth:1
@ -77,7 +78,7 @@ fi
zle -N fancy-ctrl-z
bindkey '^Z' fancy-ctrl-z
bindkey '^R' fzf-history-widget
# bindkey '^R' fzf-history-widget
bindkey "^A" beginning-of-line
bindkey "^E" end-of-line
bindkey '\eK' kill-line