From 1f30ce43c72b71e54d959eeae2b832b7c4072cca Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Mon, 2 Jun 2025 16:22:08 +0000 Subject: [PATCH] google --- config/.config/nvim/lazy-lock.json | 132 +------ vim/.vim/lua/plugins/avante.lua | 97 ++--- vim/.vim/lua/plugins/google.lua | 584 +++++++++++++++-------------- zsh/.bash_profile.google | 1 + 4 files changed, 339 insertions(+), 475 deletions(-) diff --git a/config/.config/nvim/lazy-lock.json b/config/.config/nvim/lazy-lock.json index f233d66..57d2f1e 100644 --- a/config/.config/nvim/lazy-lock.json +++ b/config/.config/nvim/lazy-lock.json @@ -1,133 +1,3 @@ { - "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, - "actions-preview.nvim": { "branch": "master", "commit": "36513ad213855d497b7dd3391a24d1d75d58e36f" }, - "aerial.nvim": { "branch": "master", "commit": "2e00d1d4248f08dddfceacb8d2996e51e13e00f6" }, - "ai.nvim": { "branch": "main", "commit": "f042afc07d2815aa7aef9d1d8bd7e6f4f4957296" }, - "asyncrun.vim": { "branch": "master", "commit": "e17c49c67d1dd847cd1d7d6077a7168816f546cc" }, - "auto-session": { "branch": "main", "commit": "00334ee24b9a05001ad50221c8daffbeedaa0842" }, - "avante-goose.nvim": { "branch": "main", "commit": "124229c61bd4c63839029086f110ce51ae54caa7" }, - "avante.nvim": { "branch": "main", "commit": "f9aa75459d403d9e963ef2647c9791e0dfc9e5f9" }, - "bevy_inspector.nvim": { "branch": "master", "commit": "627d172ce0ef65c52e10cdb0c38bd5b301d90b3c" }, - "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, - "blink-cmp-avante": { "branch": "master", "commit": "ddefb8de3cb1286ab39e0ccec0f32a45d03391f2" }, - "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" }, - "ciderlsp-nvim": { "branch": "main", "commit": "9cd409f51cbb25a9813a15dfa84753fe7f26caac" }, - "cmp-async-path": { "branch": "main", "commit": "9d581eec5acf812316913565c135b0d1ee2c9a71" }, - "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, - "cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" }, - "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-cmdline-history": { "branch": "master", "commit": "003573b72d4635ce636234a826fa8c4ba2895ffe" }, - "cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" }, - "cmp-nerdfont": { "branch": "main", "commit": "e97482344ebed29093015a18c155057adf5c842b" }, - "cmp-nvim-ciderlsp": { "branch": "main", "commit": "58faf9323bcbb5358d820d3fa7f5d0b4c0608b62" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, - "cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f94f7ba948e32cd302caba1c2ca3f7c697fb4fcf" }, - "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, - "cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" }, - "cmp-treesitter": { "branch": "master", "commit": "958fcfa0d8ce46d215e19cc3992c542f576c4123" }, - "cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" }, - "conflict-marker.vim": { "branch": "master", "commit": "62742b2ffe7a433988759c67b5c5a22eff74a14b" }, - "conform.nvim": { "branch": "master", "commit": "372fc521f8421b7830ea6db4d6ea3bae1c77548c" }, - "copilot.lua": { "branch": "master", "commit": "a5c390f8d8e85b501b22dcb2f30e0cbbd69d5ff0" }, - "crates.nvim": { "branch": "main", "commit": "2c8f4fab02e3e9ea42c6ad9b547e4207a914a397" }, - "dashboard-nvim": { "branch": "master", "commit": "591b5b29e2f17b97496ec3179f6ecd08bb8502cc" }, - "debugprint.nvim": { "branch": "main", "commit": "196d33d4026436f7eddc67136e98515d62259947" }, - "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, - "firenvim": { "branch": "master", "commit": "c4ab7d2aeb145cd93db8660cb134f771722f2b5e" }, - "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, - "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "fzf-lua": { "branch": "main", "commit": "b11467c3fbfe48e4a815e4909f5c4e5b413ce6d0" }, - "fzf.vim": { "branch": "master", "commit": "3cb44a8ba588e1ada409af495bdc6a4d2d37d5da" }, - "gdrama-syntax.vim": { "branch": "main", "commit": "004eda58d6e3ce3d1b46bbf257bd99784c475a0e" }, - "git-conflict.nvim": { "branch": "main", "commit": "4bbfdd92d547d2862a75b4e80afaf30e73f7bbb4" }, - "go.nvim": { "branch": "master", "commit": "fbceaf55e18e9e473f289df008d6b508a479fbf8" }, - "googlepaths.nvim": { "branch": "main", "commit": "53439c17178049096809b4fb963e75440b86ad78" }, - "grug-far.nvim": { "branch": "main", "commit": "6ff8a205a29db3a9b08e5debe09452b4d6fd6591" }, - "guihua.lua": { "branch": "master", "commit": "0cc9631914ffcbe3e474e809c610d12a75b660cf" }, - "headlines.nvim": { "branch": "master", "commit": "bf17c96a836ea27c0a7a2650ba385a7783ed322e" }, - "hg": { "branch": "main", "commit": "12ee0a788309734f1f312060b9f984a97157acf3" }, - "hlchunk.nvim": { "branch": "main", "commit": "19bf4090ab8619fffe07b73a4f92348324f35c98" }, - "java-syntax.vim": { "branch": "master", "commit": "9a3d76a8c6cd7765ba93a7bdd9280594167e3f1b" }, - "kotlin-vim": { "branch": "master", "commit": "53fe045906df8eeb07cb77b078fc93acda6c90b8" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, - "lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" }, - "libp.nvim": { "branch": "main", "commit": "636b1748e92f66022c1763f32b2ded6b8606eda5" }, - "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, - "lsp-zero.nvim": { "branch": "v4.x", "commit": "2afa32e732d7b36e80cd5241fbdc4a38e123c4e0" }, - "lsp_lines.nvim": { "branch": "main", "commit": "3b57922d2d79762e6baedaf9d66d8ba71f822816" }, - "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, - "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, - "luasnip-google.nvim": { "branch": "main", "commit": "86df31e12350c15e207fcbc255d951144bb6d0b5" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, - "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, - "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, - "mini.notify": { "branch": "main", "commit": "3a06b21dd0b335b95d125eae813276113b5e9ce7" }, - "mini.pick": { "branch": "main", "commit": "417c273861971b451687e847383e61687463b06e" }, - "minuet-ai.nvim": { "branch": "main", "commit": "fb1616faaf4af1c6a4ac6952d9e73833206600a5" }, - "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, - "neo-tree.nvim": { "branch": "main", "commit": "71bfdeddc90225e281ce34c378dc1b5914f5018d" }, - "neovim-throttle-debounce": { "branch": "main", "commit": "f6bf97fa0dc704affc8149aeaef5ef0cafa4d10c" }, - "nui.nvim": { "branch": "main", "commit": "8d5b0b568517935d3c84f257f272ef004d9f5a59" }, - "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, - "nvim-cmp-buffer-lines": { "branch": "master", "commit": "924ccc04dc5c919b6baa05d45818025baa82699a" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "517df88cf2afb36652830df2c655df2da416a0ae" }, - "nvim-dap": { "branch": "master", "commit": "8df427aeba0a06c6577dc3ab82de3076964e3b8d" }, - "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" }, - "nvim-jdtls": { "branch": "master", "commit": "c23f200fee469a415c77265ca55b496feb646992" }, - "nvim-lightbulb": { "branch": "master", "commit": "1cae7b7153ae98dcf1b11173a443ac1b6d8e3d49" }, - "nvim-lint": { "branch": "master", "commit": "9dfb77ef6c5092a19502883c02dc5a02ec648729" }, - "nvim-lspconfig": { "branch": "master", "commit": "37cc31c64d657feff6f752a1bf15f584d4734eca" }, - "nvim-luapad": { "branch": "master", "commit": "176686eb616a5ada5dfc748f2b5109194bbe8a71" }, - "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-notify": { "branch": "master", "commit": "b5825cf9ee881dd8e43309c93374ed5b87b7a896" }, - "nvim-scrollbar": { "branch": "main", "commit": "6994eb9f73d5fdc36ee2c8717940e8c853e51a49" }, - "nvim-surround": { "branch": "main", "commit": "0e62500b98f4513feaaf7425c135472457ea5b7d" }, - "nvim-treesitter": { "branch": "master", "commit": "3b308861a8d7d7bfbe9be51d52e54dcfd9fe3d38" }, - "omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "ec1a2431f8872f650a85ed71c24f0715df2e49c2" }, - "onedark.nvim": { "branch": "main", "commit": "b5161f0c631571640485be5d1c059cab82c86872" }, - "paint.nvim": { "branch": "main", "commit": "ef6f717a8669619ebbd098fb72f85115d64c6c92" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "refactoring.nvim": { "branch": "master", "commit": "2be7ea3f10b7e59658f5abf6dffc50b5d61964d6" }, - "ron.vim": { "branch": "master", "commit": "f749e543975a82e8dd9a6e7df9600a1c098ae800" }, - "rustaceanvim": { "branch": "master", "commit": "3f2b7a94b7fa3c0f301dfa9644c94b543000efc2" }, - "tagalong.vim": { "branch": "main", "commit": "5a2bbf2b1d5b657685a49d48d98a4aa921c1fde3" }, - "telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" }, - "telescope-import.nvim": { "branch": "main", "commit": "6fd69447679a99b463025e7f2f787e8b185dd740" }, - "telescope-live-grep-args.nvim": { "branch": "master", "commit": "b80ec2c70ec4f32571478b501218c8979fab5201" }, - "telescope-recent-files": { "branch": "main", "commit": "eb190c0baded1cbfa9d8767c817b054377683163" }, - "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" }, - "telescope_citc": { "branch": "main", "commit": "61df86dc218198a730e27bafd33535dac8539dcf" }, - "telescope_codesearch": { "branch": "main", "commit": "4c6ad26b1b0a7db6f5de8f0a619a105f93bf63f3" }, - "telescope_fig": { "branch": "main", "commit": "6ce47b13e7d38584934df5b20f80cbfa825df20a" }, - "text-case.nvim": { "branch": "main", "commit": "e898cfd46fa6cde0e83abb624a16e67d2ffc6457" }, - "time-ago.vim": { "branch": "master", "commit": "be978d5c790cfcc41f524205f28783b9937fd0ee" }, - "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, - "tree-sitter-gdscript": { "branch": "master", "commit": "33d37a577e1e9f473602a63f06f97119aa5cd710" }, - "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, - "undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" }, - "vcscommand.vim": { "branch": "master", "commit": "2fb32681361f37533455d20aaa7fc6eb11b0fa4b" }, - "vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" }, - "vim-bazel": { "branch": "master", "commit": "31b0d5e4f51da1aeb56d65bf505a744e6de405de" }, - "vim-better-whitespace": { "branch": "master", "commit": "86a0579b330b133b8181b8e088943e81c26a809e" }, - "vim-conjoin": { "branch": "master", "commit": "2ea3b8ed994d12bbf255825d973d865621c64860" }, - "vim-floaterm": { "branch": "master", "commit": "204a01a3868cbe4549640dca857fb3880ee92b17" }, - "vim-glsl": { "branch": "master", "commit": "40dd0b143ef93f3930a8a409f60c1bb85e28b727" }, - "vim-illuminate": { "branch": "master", "commit": "fbc16dee336d8cc0d3d2382ea4a53f4a29725abf" }, - "vim-imp": { "branch": "main", "commit": "87d5725e065a76d89aa52889ee8804e723d16e14" }, - "vim-maktaba": { "branch": "master", "commit": "fe95bb10f6bb250943a44632107f6a3d76ce5f28" }, - "vim-matchup": { "branch": "master", "commit": "ea2ff43e09e68b63fc6d9268fc5d82d82d433cb3" }, - "vim-signify": { "branch": "master", "commit": "8670143f9e12ed1cd3c9b2c54f345cdd9a4baac3" }, - "vim-tmux": { "branch": "master", "commit": "cfe76281efc29890548cf9eedd42ad51c7a1faf0" }, - "vim-tmux-focus-events": { "branch": "master", "commit": "b1330e04ffb95ede8e02b2f7df1f238190c67056" }, - "vim-tmux-navigator": { "branch": "master", "commit": "33afa80db65113561dc53fa732b7f5e53d5ecfd0" }, - "vim-tmux-syntax": { "branch": "master", "commit": "1b6a6a5beb96fa232c8d35d305f77496b12678a9" }, - "vimux": { "branch": "master", "commit": "7db6b2f79d432ee3820668b1d4625311dbe1d0ad" }, - "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, - "yankwin.vim": { "branch": "master", "commit": "d3e3bbb0f785115c2f24b44ddf12e9378a1c1266" }, - "zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" } + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" } } diff --git a/vim/.vim/lua/plugins/avante.lua b/vim/.vim/lua/plugins/avante.lua index aac48f2..4a670e1 100644 --- a/vim/.vim/lua/plugins/avante.lua +++ b/vim/.vim/lua/plugins/avante.lua @@ -1,61 +1,44 @@ local use_google = require("utils").use_google return { - { - "vintharas/avante-goose.nvim", - url = "sso://user/vintharas/avante-goose.nvim", - opts = {}, - cond = use_google(), - }, - { - "yetone/avante.nvim", - event = "VeryLazy", - version = false, -- Never set this value to "*"! Never! - opts = { - -- add any opts here - -- for example - openai = { - endpoint = "https://api.openai.com/v1", - model = "gpt-4o", -- your desired model (or use gpt-4o, etc.) - timeout = 30000, -- Timeout in milliseconds, increase this for reasoning models - temperature = 0, - max_completion_tokens = 8192, -- Increase this to include reasoning tokens (for reasoning models) - --reasoning_effort = "medium", -- low|medium|high, only used for reasoning models - }, - vendors = {}, -- Makes sure there's a vendors table - }, - config = function(_, opts) - -- Load provider from the plugin - opts.vendors["goose"] = require("avante-goose").getProvider({ - -- Add your options here - model = "goose-v3.5-s", -- go/goose-models - temperature = 0.1, - }) - - if use_google() then - opts.provider = "goose" - else - opts.provider = "openai" - end - require("avante").setup(opts) - end, - -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` - build = "make", - -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows - dependencies = { - "nvim-treesitter/nvim-treesitter", - -- "vintharas/avante-goose.nvim", - "stevearc/dressing.nvim", - "Kaiser-Yang/blink-cmp-avante", - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - --- The below dependencies are optional, - "echasnovski/mini.pick", -- for file_selector provider mini.pick - "nvim-telescope/telescope.nvim", -- for file_selector provider telescope - "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions - "ibhagwan/fzf-lua", -- for file_selector provider fzf - "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons - "zbirenbaum/copilot.lua", -- for providers='copilot' - }, - }, + { + "yetone/avante.nvim", + build = "make", + enable = true, + commit = "f9aa754", -- See g/avante-goose-users/c/h1eEYWBDW3k/m/6RGK2B89AAAJ + 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 = { + -- Add your options here + -- These are the defaults + auto_start_backend = true, -- Whether to automatically start go/devai-api-http-proxy. If false you can use :AvanteGooseServerStart to start the server + auto_start_silent = true, -- Whether to have a silent auto start (don't log status messages) + model = 'goose-v3.5-s', -- Select model from go/goose-models. + temperature = 0.1, -- Model temperature + max_decoder_steps = 8192, -- Maximum decoder steps (This affects the token limit of the output. More decoder steps -> higher limit in output tokens) + endpoint = 'http://localhost:8080/predict', -- Endpoint to start/listen to go/devai-api-http-proxy + debug = false, -- Enables debug mode (outputs lots of logs for troubleshooting issues) + debug_backend = false, -- Whether to start the backend in debug mode. This logs backend output information under stdpath('cache')/devai-http-wrapper.log + }, + }, + }, + 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, + }, } diff --git a/vim/.vim/lua/plugins/google.lua b/vim/.vim/lua/plugins/google.lua index 981b142..7772bff 100644 --- a/vim/.vim/lua/plugins/google.lua +++ b/vim/.vim/lua/plugins/google.lua @@ -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 = { { "rb", ":exec relatedfiles#selector#JumpToBuild()" }, @@ -81,232 +81,242 @@ return { { "rh", ":exec relatedfiles#selector#JumpToHeader()" }, { "rc", ":exec relatedfiles#selector#JumpToCodeFile()" }, }, - }), - { "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 { - { "b", desc = "Blaze" }, - { "bb", runCommandWithTarget("blaze build"), desc = "Blaze Build" }, - { "br", runCommandWithTarget("blaze run"), desc = "Blaze Run" }, - { "bt", runCommandWithTarget("blaze test"), desc = "Blaze Test" }, - { "bc", runCommandWithTarget("build_cleaner"), desc = "Blaze Run" }, - { - "yb", - ":let t = join(blaze#GetTargets(), ' ') | echo t | let @+ = t | let @\" = t", - desc = "Yank Blaze Target", - }, - { - "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 = { - { "I", ":ImpSuggest " }, - }, - }), - { - 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 = { - { "lc", ":CritiqueToggleLineComment" }, - { "ac", ":CritiqueToggleAllComments" }, - { "uc", ":CritiqueToggleUnresolvedComments" }, - { "fc", ":CritiqueFetchComments" }, - { "tc", ":CritiqueCommentsTelescope" }, - }, - 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 { + { "b", desc = "Blaze" }, + { "bb", runCommandWithTarget("blaze build"), desc = "Blaze Build" }, + { "br", runCommandWithTarget("blaze run"), desc = "Blaze Run" }, + { "bt", runCommandWithTarget("blaze test"), desc = "Blaze Test" }, + { "bc", runCommandWithTarget("build_cleaner"), desc = "Blaze Run" }, + { + "yb", + ":let t = join(blaze#GetTargets(), ' ') | echo t | let @+ = t | let @\" = t", + desc = "Yank Blaze Target", + }, + { + "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 = { + { "I", ":ImpSuggest " }, + }, + }), + { + 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 = { + { + "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 = { + { "lc", ":CritiqueToggleLineComment" }, + { "ac", ":CritiqueToggleAllComments" }, + { "uc", ":CritiqueToggleUnresolvedComments" }, + { "fc", ":CritiqueFetchComments" }, + { "tc", ":CritiqueCommentsTelescope" }, + }, + 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, + }, } diff --git a/zsh/.bash_profile.google b/zsh/.bash_profile.google index 69c913e..ffc2aea 100644 --- a/zsh/.bash_profile.google +++ b/zsh/.bash_profile.google @@ -150,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"