Compare commits

..

17 Commits

Author SHA1 Message Date
196c9d1a3b simplify google 2025-02-04 23:09:40 +00:00
9988bd13b2 things 2025-01-29 21:55:07 -06:00
0300264961 neotree bindings 2025-01-29 21:27:12 -06:00
1bbcef640d who knows 2025-01-27 20:49:29 +00:00
5e739703d0 format 2025-01-27 20:44:12 +00:00
d0b81f87cb plz 2025-01-24 19:10:02 +00:00
f815679d89 blink stuff 2025-01-11 20:36:39 -06:00
513dfe695f i dont even know 2025-01-11 20:13:19 -06:00
c869fbd48a bug 2025-01-06 19:23:04 +00:00
6f857496c0 google 2025-01-06 19:01:42 +00:00
3ea53a113f idk 2024-12-25 20:12:28 -07:00
fe2fed17ed whhops 2024-12-20 17:41:22 +00:00
3ae68d6e0b dev config 2024-12-19 23:29:04 +00:00
7942d2083c boop 2024-12-19 23:24:13 +00:00
664c555107 plugs 2024-12-16 14:42:15 +00:00
9ceca10f72 lol 2024-12-16 14:23:17 +00:00
b016ad5d56 meh 2024-12-15 14:23:36 -06:00
26 changed files with 967 additions and 986 deletions

View File

@ -13,18 +13,24 @@ end
vim.opt.rtp:prepend(lazypath)
vim.opt.rtp:prepend(vim.env.HOME .. "/.vim")
vim.opt.rtp:prepend(vim.env.HOME .. "/.vim/lua")
vim.opt.rtp:prepend(vim.env.HOME .. "/.vim/lua")
package.path = package.path .. ";" .. vim.env.HOME .. "/.vim/lua/?.lua"
local plugins = {
-- this entry tells lazy.nvim to load the list of of *.lua files from plugins/
{ import = "plugins" },
}
require("config.clipboard")
require("config.tmpl")
require("config.zip")
require("lazy").setup(plugins)
require("lazy").setup({
-- this entry tells lazy.nvim to load the list of of *.lua files from plugins/
import = "plugins" ,
-- Dev configuration
dev = {
-- Directory where you store your local plugin projects
path = "~/neovim-plugins/squk/",
-- @type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub
patterns = { "squk" },
fallback = false, -- Fallback to git when local plugin doesn't exist
},
})
vim.opt.undodir = vim.fn.expand("$HOME") .. "/.undo/"

View File

@ -1,3 +1,3 @@
{
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }
}

View File

@ -0,0 +1,11 @@
" rainbow markdown
highlight h1 guifg=#50fa7b gui=bold
highlight _h1 guifg=#50fa7b gui=nocombine
highlight h2 guifg=#ff79c6 gui=bold
highlight _h2 guifg=#ff79c6 gui=nocombine
highlight h3 guifg=#ffb86c gui=bold
highlight _h3 guifg=#ffb86c gui=nocombine
highlight h4 guifg=#8be9fd gui=bold
highlight _h4 guifg=#8be9fd gui=nocombine
highlight h5 guifg=#f1fa8c gui=bold
highlight _h5 guifg=#f1fa8c gui=nocombine

View File

@ -88,6 +88,8 @@ bind-key s split-window -v -c '#{pane_current_path}'
bind -n M-s set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized,on,off}"
# bind -n C-Space select-pane -D \; resize-pane -Z
bind -n M-z resize-pane -Z
bind -n M-j resize-pane -D 5

View File

@ -1,77 +0,0 @@
local use_google = require("utils").use_google
local M = {}
function M.setup(capabilities)
if use_google() then
local lspconfig = require("lspconfig")
local configs = require("lspconfig.configs")
configs.ciderlsp = {
default_config = {
offset_encoding = "utf-16",
cmd = {
"/google/bin/releases/cider/ciderlsp/ciderlsp",
"--tooltag=nvim-lsp",
"--forward_sync_responses",
-- "--debug_relay",
},
filetypes = {
"c",
"cpp",
"java",
"kotlin",
"objc",
"proto",
"textproto",
"go",
"python",
"bzl",
"typescript",
},
root_dir = require("lspconfig").util.root_pattern(".citc"),
settings = {},
},
}
local my_on_attach = function(client, bufnr)
require("lualine").refresh()
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
if vim.lsp.formatexpr then -- Neovim v0.6.0+ only.
vim.api.nvim_buf_set_option(bufnr, "formatexpr", "v:lua.vim.lsp.formatexpr")
end
if vim.lsp.tagfunc then
vim.api.nvim_buf_set_option(bufnr, "tagfunc", "v:lua.vim.lsp.tagfunc")
end
local lsp_status = require("lsp-status")
lsp_status.on_attach(client)
end
local cider_on_attach = function(client, bufnr)
my_on_attach(client, bufnr)
vim.b["is_cider_lsp_attached"] = "no"
end
local cider_lsp_handlers = {
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
focusable = false,
}),
}
cider_lsp_handlers["$/syncResponse"] = function(_, result, ctx)
local first_fire = vim.b["is_cider_lsp_attached"] == "no"
vim.b["is_cider_lsp_attached"] = "yes"
if first_fire then
vim.notify("CiderLSP attached")
require("lualine").refresh()
end
end
lspconfig.ciderlsp.setup({
capabilities = capabilities,
on_attach = cider_on_attach,
handlers = cider_lsp_handlers,
})
end
end
return M

View File

@ -1,18 +1,18 @@
local use_google = require("utils").use_google
return {
"sindrets/diffview.nvim",
--{ "mizlan/iswap.nvim", event = "VeryLazy" },
{ "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" } },
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {
jump = {
nohlsearch = true,
},
},
"sindrets/diffview.nvim",
--{ "mizlan/iswap.nvim", event = "VeryLazy" },
{ "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" } },
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {
jump = {
nohlsearch = true,
},
},
-- stylua: ignore
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
@ -21,155 +21,146 @@ return {
{ "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" },
},
},
{
"MagicDuck/grug-far.nvim",
config = function()
require("grug-far").setup({
-- search and replace engines configuration
engines = {
-- see https://github.com/BurntSushi/ripgrep
ripgrep = {
-- ripgrep executable to use, can be a different path if you need to configure
path = "rg",
extraArgs = "--.",
},
},
})
end,
},
},
{
"MagicDuck/grug-far.nvim",
config = function()
vim.g.maplocalleader = ","
require("grug-far").setup({
-- search and replace engines configuration
engines = {
-- see https://github.com/BurntSushi/ripgrep
ripgrep = {
-- ripgrep executable to use, can be a different path if you need to configure
path = "rg",
-- extraArgs = "-.",
},
},
})
end,
},
{
"shellRaining/hlchunk.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
line_num = { enable = true },
chunk = {
enable = true,
priority = 15,
style = {
{ fg = "#393d4c" },
},
chars = {
horizontal_line = "",
-- vertical_line = "│",
vertical_line = "",
left_top = "",
left_bottom = "",
right_arrow = ">",
},
use_treesitter = true,
textobject = "",
max_file_size = 1024 * 1024,
error_sign = true,
-- animation related
duration = 0,
delay = 0,
},
},
},
{
"Bekaboo/dropbar.nvim",
-- optional, but required for fuzzy finder support
dependencies = {
"nvim-telescope/telescope-fzf-native.nvim",
},
config = function()
vim.ui.select = require("dropbar.utils.menu").select
end,
},
"RRethy/vim-illuminate",
"kdheepak/lazygit.nvim",
"flwyd/vim-conjoin",
"rafcamlet/nvim-luapad",
"vim-scripts/vcscommand.vim",
"AndrewRadev/tagalong.vim",
"AndrewRadev/yankwin.vim",
{ "squk/gdrama-syntax.vim", ft = "gdrama" },
{ "nvim-lua/plenary.nvim", lazy = false },
{ "squk/java-syntax.vim", ft = "java" },
{ "udalov/kotlin-vim", event = "VeryLazy", ft = "kotlin" },
-- { "andymass/vim-matchup", event = "VimEnter" },
{ "jghauser/mkdir.nvim", event = "BufWritePre" },
{
"rmagatti/auto-session",
dependencies = {
"nvim-telescope/telescope.nvim", -- Only needed if you want to use session lens
},
config = function()
require("auto-session").setup({
auto_session_suppress_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
args_allow_single_directory = false,
bypass_save_filetypes = { "netrw" },
})
end,
},
"tpope/vim-abolish",
{
"johmsalas/text-case.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
config = function()
require("textcase").setup({})
require("telescope").load_extension("textcase")
end,
cmd = {
"Subs",
},
{
"shellRaining/hlchunk.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
line_num = { enable = true },
chunk = {
enable = true,
priority = 15,
style = {
{ fg = "#393d4c" },
},
chars = {
horizontal_line = "",
-- vertical_line = "│",
vertical_line = "",
left_top = "",
left_bottom = "",
right_arrow = ">",
},
use_treesitter = true,
textobject = "",
max_file_size = 1024 * 1024,
error_sign = true,
-- animation related
duration = 0,
delay = 0,
},
},
},
"RRethy/vim-illuminate",
"kdheepak/lazygit.nvim",
"flwyd/vim-conjoin",
"rafcamlet/nvim-luapad",
"vim-scripts/vcscommand.vim",
"AndrewRadev/tagalong.vim",
"AndrewRadev/yankwin.vim",
{ "squk/gdrama-syntax.vim", ft = "gdrama" },
{ "nvim-lua/plenary.nvim", lazy = false },
{ "squk/java-syntax.vim", ft = "java" },
{ "udalov/kotlin-vim", event = "VeryLazy", ft = "kotlin" },
{ "andymass/vim-matchup", event = "VimEnter" },
{ "jghauser/mkdir.nvim", event = "BufWritePre" },
{
"rmagatti/auto-session",
dependencies = {
"nvim-telescope/telescope.nvim", -- Only needed if you want to use session lens
},
config = function()
require("auto-session").setup({
auto_session_suppress_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
args_allow_single_directory = false,
bypass_save_filetypes = { "netrw" },
})
end,
},
"tpope/vim-abolish",
{
"johmsalas/text-case.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
config = function()
require("textcase").setup({})
require("telescope").load_extension("textcase")
end,
cmd = {
"Subs",
},
-- stylua: ignore
keys = {
{ "<leader>tc", "<cmd>TextCaseOpenTelescope<CR>", mode = { "n", "v" }, desc = "Telescope" },
},
},
{
"NvChad/nvim-colorizer.lua",
ft = "lua",
config = function()
require("colorizer").setup()
end,
},
{
},
{
"NvChad/nvim-colorizer.lua",
ft = "lua",
config = function()
require("colorizer").setup()
end,
},
{
"andweeb/presence.nvim",
cond = not use_google(),
config = function()
require("presence").setup({
main_image = "file",
show_time = false,
})
end,
},
{
"ntpeters/vim-better-whitespace",
config = function()
vim.g.better_whitespace_filetypes_blacklist = { "dashboard" }
end,
},
{
"mbbill/undotree",
cmd = "UndotreeToggle",
config = function()
vim.g.undotree_SetFocusWhenToggle = 1
end,
"andweeb/presence.nvim",
cond = not use_google(),
config = function()
require("presence").setup({
main_image = "file",
show_time = false,
})
end,
},
{
"ntpeters/vim-better-whitespace",
config = function()
vim.g.better_whitespace_filetypes_blacklist = { "dashboard" }
end,
},
{
"mbbill/undotree",
cmd = "UndotreeToggle",
config = function()
vim.g.undotree_SetFocusWhenToggle = 1
end,
-- stylua: ignore
keys = { { "<leader>ut", ":UndotreeToggle<CR>" } },
},
{
"stevearc/aerial.nvim",
opts = {},
cmd = { "AerialToggle", "AerialOn" },
},
{
"stevearc/aerial.nvim",
opts = {},
cmd = { "AerialToggle", "AerialOn" },
-- stylua: ignore
keys = { { "<leader>so", ":AerialToggle<CR>", desc = "[S]symbols [O]utline" } },
},
{
"andrewferrier/debugprint.nvim",
opts = {},
-- Dependency only needed for NeoVim 0.8
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
-- Remove the following line to use development versions,
-- not just the formal releases
version = "*",
},
{
"andrewferrier/debugprint.nvim",
opts = {},
-- Dependency only needed for NeoVim 0.8
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
-- Remove the following line to use development versions,
-- not just the formal releases
version = "*",
-- stylua: ignore
keys = {
{ "<leader>dp", ":lua require('debugprint').debugprint()<cr>", desc = "Debug print" },
@ -177,5 +168,5 @@ return {
{ "<leader>dq", ":lua require('debugprint').debugprint({variable = true})<cr>", desc = "Debug print" },
{ "<leader>dQ", ":lua require('debugprint').debugprint({variable = true, above = true})<cr>", desc = "Debug print", },
},
},
},
}

View File

@ -0,0 +1,17 @@
return {
"lommix/bevy_inspector.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
},
config = function()
require("bevy_inspector").setup({})
end,
cmd = { "BevyInspect", "BevyInspectNamed", "BevyInspectQuery" },
-- stylua: ignore
keys = {
{ "<leader>bia", ":BevyInspect<Cr>", desc = "Lists all entities" },
{ "<leader>bin", ":BevyInspectNamed<Cr>", desc = "List all named entities" },
{ "<leader>biq", ":BevyInspectQuery<Cr>", desc = "Query a single component, continues to list all matching entities", },
},
}

View File

@ -2,117 +2,152 @@ local use_google = require("utils").use_google
local flags = require("utils").flags
return {
{
"saghen/blink.compat",
-- use the latest release, via version = '*', if you also use the latest release for blink.cmp
version = "*",
-- lazy.nvim will automatically load the plugin when it's required by blink.cmp
lazy = true,
-- make sure to set opts so that lazy.nvim calls blink.compat's setup
opts = {},
cond = flags.blink,
},
{
"saghen/blink.cmp",
lazy = false, -- lazy loading handled internally
cond = flags.blink,
dependencies = {
"Exafunction/codeium.nvim",
"mikavilpas/blink-ripgrep.nvim",
"hrsh7th/cmp-cmdline",
-- "FelipeLema/cmp-async-path",
"chrisgrieser/cmp-nerdfont",
"hrsh7th/cmp-emoji",
"rafamadriz/friendly-snippets", -- optional: provides snippets for the snippet source
},
version = "v0.*", -- use a release tag to download pre-built binaries
-- build = 'cargo build --release',
{
"saghen/blink.compat",
-- use the latest release, via version = '*', if you also use the latest release for blink.cmp
version = "*",
-- lazy.nvim will automatically load the plugin when it's required by blink.cmp
lazy = true,
cond = flags.blink,
-- make sure to set opts so that lazy.nvim calls blink.compat's setup
opts = {
impersonate_nvim_cmp = true,
debug = true,
},
},
{
"saghen/blink.cmp",
lazy = false, -- lazy loading handled internally
cond = flags.blink,
dependencies = {
"Exafunction/codeium.nvim",
"chrisgrieser/cmp-nerdfont",
"hrsh7th/cmp-nvim-lsp",
"mikavilpas/blink-ripgrep.nvim",
"moyiz/blink-emoji.nvim",
"rafamadriz/friendly-snippets", -- optional: provides snippets for the snippet source
"saghen/blink.compat",
},
version = "v0.*", -- use a release tag to download pre-built binaries
-- build = 'cargo build --release',
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
keymap = {
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
["<C-e>"] = { "hide", "fallback" },
["<CR>"] = { "accept", "fallback" },
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
-- stylua: ignore
keymap = {
preset = "none",
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
["<C-e>"] = { "hide", "fallback" },
["<CR>"] = { "accept", "fallback" },
["<Tab>"] = { "select_next", "snippet_forward", "accept", "fallback" },
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
["<Tab>"] = { "select_next", "snippet_forward", "accept", "fallback" },
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
["<Up>"] = { "select_prev", "fallback" },
["<Down>"] = { "select_next", "fallback" },
["<Up>"] = { "select_prev", "fallback" },
["<Down>"] = { "select_next", "fallback" },
["<S-Up>"] = { "scroll_documentation_up", "fallback" },
["<S-Down>"] = { "scroll_documentation_down", "fallback" },
},
sources = {
default = function(ctx)
local providerToEnable = {
"lsp",
"path",
"crates",
"snippets",
"ripgrep",
"emoji",
"nerdfont",
"buffer",
}
print(vim.inspect(providerToEnable))
if use_google() then
table.insert(providerToEnable, "nvim_ciderlsp")
table.insert(providerToEnable, "buganizer")
else
table.insert(providerToEnable, "codeium")
end
return providerToEnable
end,
},
providers = {
-- dont show LuaLS require statements when lazydev has items
lsp = { fallback_for = { "lazydev" } },
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink" },
ripgrep = {
module = "blink-ripgrep",
name = "Ripgrep",
-- the options below are optional, some default values are shown
---@module "blink-ripgrep"
---@type blink-ripgrep.Options
opts = {
prefix_min_len = 3,
context_size = 5,
max_filesize = "1M",
additional_rg_options = {},
},
},
nvim_ciderlsp = {
name = "nvim_ciderlsp",
module = "blink.compat.source",
},
buganizer = {
name = "nvim_buganizer",
module = "blink.compat.source",
},
codeium = {
name = "codeium",
module = "blink.compat.source",
},
},
-- experimental signature help support
signature = { enabled = true },
completion = {
trigger = {
show_on_x_blocked_trigger_characters = { "'", '"', "(", "{" },
},
menu = {
draw = {
-- columns = { { "label", "label_description", gap = 1 }, { "kind_icon", "kind" } },
},
},
},
},
["<S-Up>"] = { "scroll_documentation_up", "fallback" },
["<S-Down>"] = { "scroll_documentation_down", "fallback" },
},
sources = {
default = function(ctx)
local providerToEnable = {
"lsp",
"path",
"snippets",
"ripgrep",
"emoji",
"nerdfont",
"buffer",
}
if use_google() then
table.insert(providerToEnable, "nvim_ciderlsp")
table.insert(providerToEnable, "buganizer")
else
table.insert(providerToEnable, "codeium")
end
return providerToEnable
end,
-- default = { "lsp" },
providers = {
lsp = { name = "LSP", module = "blink.cmp.sources.lsp", score_offset = 90 },
-- dont show LuaLS require statements when lazydev has items
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink", fallbacks = { "lsp" } },
ripgrep = {
module = "blink-ripgrep",
name = "Ripgrep",
-- the options below are optional, some default values are shown
---@module "blink-ripgrep"
---@type blink-ripgrep.Options
opts = {
prefix_min_len = 3,
context_size = 5,
max_filesize = "1M",
additional_rg_options = {},
},
},
-- https://github.com/moyiz/blink-emoji.nvim
emoji = {
module = "blink-emoji",
name = "Emoji",
score_offset = 15, -- the higher the number, the higher the priority
opts = { insert = true }, -- Insert emoji (default) or complete its name
},
buffer = {
name = "Buffer",
enabled = true,
max_items = 3,
module = "blink.cmp.sources.buffer",
min_keyword_length = 4,
score_offset = 15, -- the higher the number, the higher the priority
},
-- compat sources
nerdfont = {
name = "nerdfont",
module = "blink.compat.source",
},
codeium = {
name = "codeium",
module = "blink.compat.source",
score_offset = 100,
},
nvim_ciderlsp = {
name = "nvim_ciderlsp",
module = "blink.compat.source",
score_offset = 100,
},
buganizer = {
name = "nvim_buganizer",
module = "blink.compat.source",
},
},
},
-- experimental signature help support
signature = { enabled = true },
completion = {
list = {
-- stylua: ignore
selection = {
preselect = function(ctx) return ctx.mode ~= 'cmdline' end,
auto_insert = function(ctx) return ctx.mode ~= 'cmdline' end,
},
},
documentation = {
auto_show = true,
},
-- Displays a preview of the selected item on the current line
ghost_text = {
enabled = true,
},
trigger = {
show_on_x_blocked_trigger_characters = { "'", '"', "(", "{" },
},
},
},
-- allows extending the providers array elsewhere in your config
-- without having to redefine it
opts_extend = { "sources.default" },
},
-- allows extending the providers array elsewhere in your config
-- without having to redefine it
opts_extend = { "sources.default" },
},
}

View File

@ -1,42 +1,72 @@
return {
{
"akinsho/bufferline.nvim",
version = "*",
dependencies = "nvim-tree/nvim-web-devicons",
config = function()
vim.opt.termguicolors = true
require("bufferline").setup({
options = {
hover = {
enabled = true,
delay = 200,
reveal = { "close" },
},
indicator = {
-- icon = "▎", -- this should be omitted if indicator style is not 'icon'
style = "icon", -- | 'underline' | 'none',
},
offsets = {
{
filetype = "NvimTree",
text = "File Explorer",
highlight = "Directory",
separator = true, -- use a "true" to enable the default, or set your own character
},
},
mode = "tabs",
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local symbols = { error = "", warning = "", info = "", hint = "󱠂 " }
local icon = symbols[level] or level
return "" .. icon .. count
end,
max_name_length = 30,
truncate_name = false,
show_close_icon = false,
show_buffer_close_icons = false,
},
})
end,
},
{
"akinsho/bufferline.nvim",
version = "*",
cond = false,
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
options = {
hover = {
enabled = true,
delay = 200,
reveal = { "close" },
},
indicator = {
-- icon = "▎", -- this should be omitted if indicator style is not 'icon'
style = "icon", -- | 'underline' | 'none',
},
offsets = {
{
filetype = "NvimTree",
text = "File Explorer",
highlight = "Directory",
separator = true, -- use a "true" to enable the default, or set your own character
},
},
-- mode = "tabs",
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local symbols = { error = "", warning = "", info = "", hint = "󱠂 " }
local icon = symbols[level] or level
return "" .. icon .. count
end,
max_name_length = 30,
truncate_name = false,
show_close_icon = false,
show_buffer_close_icons = false,
groups = {
options = {
toggle_hidden_on_enter = true, -- when you re-enter a hidden group this options re-opens that group so the buffer is visible
},
items = {
{
name = "Tests", -- Mandatory
highlight = { sp = "lightblue" }, -- Optional
priority = 2, -- determines where it will appear relative to other groups (Optional)
icon = "", -- Optional
matcher = function(buf) -- Mandatory
return buf.path:match("%_test.cc$") or buf.path:match("%Test.java$")
end,
},
{
name = "Docs",
highlight = { sp = "lightgreen" },
auto_close = false, -- whether or not close this group if it doesn't contain the current buffer
matcher = function(buf)
return buf.path:match("%.md$") or buf.path:match("%.txt$")
end,
},
{
name = "Lua",
highlight = { sp = "lightblue" },
auto_close = false, -- whether or not close this group if it doesn't contain the current buffer
matcher = function(buf)
return buf.path:match("%.lua$")
end,
},
},
},
},
},
},
}

View File

@ -2,76 +2,76 @@ 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
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,
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
vim.b.disable_autoformat = false
vim.g.disable_autoformat = false
end, {
desc = "Re-enable autoformat-on-save",
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,
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,
})
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", },
},
-- This will provide type hinting with LuaLS
---@module "conform"
---@type conform.setupOpts
opts = {
log_level = vim.log.levels.DEBUG,
formatters_by_ft = {
},
-- 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
-- javascript = { { "prettierd", "prettier" } },
lua = { "stylua" },
-- Conform will run multiple formatters sequentially
python = { "isort", "black" },
-- Use a sub-list to run only the first available formatter
javascript = { { "prettierd", "prettier" } },
gdscript = { "gdformat" },
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" },
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
end,
formatters = {
gdformat = {
prepend_args = { "-l", "100" },
},
},
},
},
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
-- javascript = { { "prettierd", "prettier" } },
lua = { "stylua" },
-- Conform will run multiple formatters sequentially
python = { "isort", "black" },
-- Use a sub-list to run only the first available formatter
javascript = { { "prettierd", "prettier" } },
gdscript = { "gdformat" },
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" },
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
end,
formatters = {
gdformat = {
prepend_args = { "-l", "100" },
},
},
},
},
}

View File

@ -0,0 +1,6 @@
return {
-- {
-- "squk/google3.nvim",
-- dev = true,
-- },
}

View File

@ -1,6 +1,19 @@
-- disable underline
vim.diagnostic.handlers.underline.show = function() end
local signs = {
Error = "",
Warning = "",
Warn = "",
Hint = "",
Info = "",
Other = "",
}
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
return {
{
"folke/trouble.nvim",
@ -11,32 +24,46 @@ return {
use_diagnostic_signs = true, -- enabling this will use the signs defined in your lsp client
})
end,
-- stylua: ignore
keys = {
{ "<leader>xt", "<cmd>:Telescope diagnostics<CR>" },
{ "<leader>xt", ":Telescope diagnostics<CR>" },
{ "gr", ":Telescope lsp_references<CR>" },
{ "<leader>xd", ":Trouble<CR>" },
{ "[g", "<cmd>lua vim.diagnostic.goto_prev()<CR>" },
{ "]g", "<cmd>lua vim.diagnostic.goto_next()<CR>" },
{ "<leader>xd", ":Trouble diagnostics toggle <CR>" },
{ "<leader>xbd", ":Trouble diagnostics toggle filter.buf=0<CR>" },
{ "<leader>xe", ":Trouble diagnostics toggle filter.severity=vim.diagnostic.severity.ERROR<CR>" },
{ "[g", ":lua vim.diagnostic.goto_prev()<CR>" },
{ "]g", ":lua vim.diagnostic.goto_next()<CR>" },
},
},
-- {
-- "rachartier/tiny-inline-diagnostic.nvim",
-- event = "LspAttach",
-- priority = 1000, -- needs to be loaded in first
-- config = function()
-- vim.diagnostic.config({ virtual_text = false })
--
-- require("tiny-inline-diagnostic").setup({
-- preset = "classic", -- Can be: "modern", "classic", "minimal", "powerline", ghost", "simple", "nonerdfont", "amongus"
--
-- -- Show the source of the diagnostic.
-- show_source = false,
--
-- -- Use your defined signs in the diagnostic config table.
-- use_icons_from_diagnostic = true,
--
-- -- Enable diagnostic message on all lines.
-- multilines = true,
--
-- -- Show all diagnostics on the cursor line.
-- show_all_diags_on_cursorline = false,
-- })
-- end,
-- },
{
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
"ErichDonGubler/lsp_lines.nvim",
event = { "LspAttach" },
name = "lsp_lines.nvim",
config = function()
local signs = {
Error = "",
Warning = "",
Warn = "",
Hint = "",
Info = "",
Other = "",
}
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
require("lsp_lines").setup()
-- vim.schedule(function()

View File

@ -27,14 +27,9 @@ return {
glug("googler", {
event = "VeryLazy",
}),
glug("core"),
glug("glaive"),
glug("alert"),
glug("csearch"),
glug("languages"),
glug("googlespell"),
-- Enable logmsgs ASAP to avoid maktaba's log message queue filling up
glug("google-logo"),
-- Add support for google filetypes
glug("google-filetypes", { event = { "BufReadPre", "BufNewFile" }, dependencies = {} }),
@ -48,7 +43,6 @@ return {
-- 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-gcl", { event = "BufRead,BufNewFile *.gcl" })),
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" })),
@ -84,13 +78,13 @@ return {
},
}),
glug("relatedfiles", {
-- stylua: ignore
keys = {
{ "<leader>rb", ":exec relatedfiles#selector#JumpToBuild()<CR>" },
{ "<leader>rt", ":exec relatedfiles#selector#JumpToTestFile()<CR>" },
{ "<leader>rh", ":exec relatedfiles#selector#JumpToHeader()<CR>" },
{ "<leader>rc", ":exec relatedfiles#selector#JumpToCodeFile()<CR>" },
},
-- stylua: ignore
keys = {
{ "<leader>rb", ":exec relatedfiles#selector#JumpToBuild()<CR>" },
{ "<leader>rt", ":exec relatedfiles#selector#JumpToTestFile()<CR>" },
{ "<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" } },
@ -182,9 +176,6 @@ return {
"BlazeDebugFinish",
"BlazeDepsUpdate",
},
config = function()
require("config.blaze")
end,
keys = function()
local function runCommandWithTarget(cmd)
return function()
@ -251,17 +242,11 @@ return {
name = "cmp-nvim-ciderlsp",
url = "sso://googler@user/piloto/cmp-nvim-ciderlsp",
event = "VimEnter",
dependencies = {
"hrsh7th/nvim-cmp",
},
},
{
name = "ciderlsp-nvim",
url = "sso://googler@user/kdark/ciderlsp-nvim",
event = "VimEnter",
dependencies = {
"hrsh7th/nvim-cmp",
},
},
-- {
-- name = "nvim_figtree",
@ -271,8 +256,7 @@ return {
name = "telescope_codesearch",
url = "sso://googler@user/vintharas/telescope-codesearch.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },
config = function()
end,
config = function() end,
},
{
name = "telescope_citc",

View File

@ -2,141 +2,148 @@ local use_google = require("utils").use_google
local flags = require("utils").flags
return {
{
"ray-x/lsp_signature.nvim",
event = "VeryLazy",
opts = {
floating_window = true,
hint_prefix = "󰡱 ",
},
config = function(_, opts)
require("lsp_signature").setup(opts)
end,
},
{
"luozhiya/lsp-virtual-improved.nvim",
event = { "LspAttach" },
config = function()
require("lsp-virtual-improved").setup()
end,
},
{
"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" },
},
{
"hinell/lsp-timeout.nvim",
event = { "LspAttach" },
dependencies = { "neovim/nvim-lspconfig" },
-- cond = not use_google(),
config = function()
vim.g.lspTimeoutConfig = {
filetypes = {
ignore = { -- filetypes to ignore; empty by default
"gdscript",
"rust",
}, -- for these filetypes
},
}
end,
},
{
"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
-- {
-- "ray-x/lsp_signature.nvim",
-- event = "VeryLazy",
-- opts = {
-- floating_window = true,
-- hint_prefix = "󰡱 ",
-- },
-- config = function(_, opts)
-- require("lsp_signature").setup(opts)
-- end,
-- },
{
"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" },
},
{
"hinell/lsp-timeout.nvim",
event = { "LspAttach" },
dependencies = { "neovim/nvim-lspconfig" },
-- cond = not use_google(),
config = function()
vim.g.lspTimeoutConfig = {
filetypes = {
ignore = { -- filetypes to ignore; empty by default
"gdscript",
"rust",
}, -- for these filetypes
},
}
end,
},
{
"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", {
pattern = "*.go",
callback = function()
require("go.format").goimports()
end,
group = format_sync_grp,
})
end,
ft = { "go", "gomod" },
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
},
{
"neovim/nvim-lspconfig",
dependencies = {
"hrsh7th/nvim-cmp",
"nvim-lua/lsp-status.nvim",
"VonHeikemen/lsp-zero.nvim",
},
-- stylua: ignore
keys = {
{ "<leader>F", "<cmd>lua vim.lsp.buf.format()<CR>" },
local format_sync_grp = vim.api.nvim_create_augroup("goimports", {})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = "*.go",
callback = function()
require("go.format").goimports()
end,
group = format_sync_grp,
})
end,
ft = { "go", "gomod" },
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
},
{
"neovim/nvim-lspconfig",
dependencies = {
"hrsh7th/nvim-cmp",
"saghen/blink.cmp",
"saghen/blink.compat",
"nvim-lua/lsp-status.nvim",
"VonHeikemen/lsp-zero.nvim",
},
keys = {
{ "<leader>F", ":lua vim.lsp.buf.format()<CR>" },
{ "<leader>rn", ":lua vim.lsp.buf.rename()<CR>" },
{ "L", ":lua vim.lsp.buf.hover()<CR>" },
{ "gr", ":Telescope lsp_references<CR>" },
{ "gd", ":lua vim.lsp.buf.definition()<CR>" },
-- { "gd", "<cmd>Telescope lsp_definitions<CR>" },
{ "gD", ":tab split | lua vim.lsp.buf.definition()<CR>" },
{ "gi", ":lua vim.lsp.buf.implementation()<CR>" },
{ "gI", ":lua vim.lsp.buf.implementation()<CR>" },
{ "gR", ":lua vim.lsp.buf.references()<CR>" },
{ "gt", ":lua vim.lsp.buf.type_definition()<CR>" },
{ "<C-g>", ":lua vim.lsp.buf.signature_help()<CR>" },
{ "<C-g>", ":lua vim.lsp.buf.signature_help()<CR>", mode = "i" },
},
config = function()
local lsp_status = require("lsp-status")
lsp_status.register_progress()
{ "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>" },
{ "L", "<cmd>lua vim.lsp.buf.hover()<CR>" },
{ "gr", "<Cmd>Telescope lsp_references<CR>" },
{ "gd", "<cmd>Telescope lsp_definitions<CR>" },
{ "gD", "<cmd>tab split | lua vim.lsp.buf.definition()<CR>" },
{ "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>" },
{ "gI", "<cmd>lua vim.lsp.buf.implementation()<CR>" },
{ "gR", "<cmd>lua vim.lsp.buf.references()<CR>" },
{ "gt", "<cmd>lua vim.lsp.buf.type_definition()<CR>" },
{ "<C-g>", "<cmd>lua vim.lsp.buf.signature_help()<CR>" },
{ "<C-g>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", mode = "i" },
},
config = function()
local lsp_status = require("lsp-status")
lsp_status.register_progress()
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 = vim.tbl_extend("keep", capabilities or {}, lsp_status.capabilities)
capabilities.offsetEncoding = { "utf-16" }
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 = vim.tbl_extend("keep", capabilities or {}, lsp_status.capabilities)
capabilities.offsetEncoding = { "utf-16" }
local lspconfig = require("lspconfig")
local configs = require("lspconfig.configs")
local lspconfig = require("lspconfig")
local configs = require("lspconfig.configs")
require("config.lsp-google").setup(capabilities)
local nvim_lspconfig = require("lspconfig")
local lsp_configs = require("lspconfig.configs")
-- Godot
lspconfig.gdscript.setup({
-- flags = {
-- debounce_text_changes = 2000, -- Wait 5 seconds before sending didChange
-- },
})
vim.cmd([[autocmd FileType gdscript setlocal commentstring=#\ %s]])
vim.cmd([[autocmd FileType gdscript setlocal autoindent noexpandtab tabstop=4 shiftwidth=4]])
end,
},
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 = nvim_lspconfig.util.root_pattern('.citc'),
settings = {},
}
}
nvim_lspconfig.ciderlsp.setup {}
-- Godot
lspconfig.gdscript.setup({
-- flags = {
-- debounce_text_changes = 2000, -- Wait 5 seconds before sending didChange
-- },
})
vim.cmd([[autocmd FileType gdscript setlocal commentstring=#\ %s]])
vim.cmd([[autocmd FileType gdscript setlocal autoindent noexpandtab tabstop=4 shiftwidth=4]])
end,
},
}

View File

@ -1,84 +1,41 @@
local split = function(inputstr, sep)
local t = {}
for str in string.gmatch(inputstr, "([^" .. sep .. "]+)") do
table.insert(t, str)
end
return t
end
local function getCitc()
local fname = vim.api.nvim_buf_get_name(0)
if string.find(fname, "/google/src/cloud/", 1, true) then
local parts = split(fname, "/")
return parts[5]
end
end
local function isCiderLspAttached()
if vim.b["is_cider_lsp_attached"] then
if vim.b["is_cider_lsp_attached"] == "yes" then
return ""
else
return "x"
end
else
return ""
end
end
local function getLightbulb()
return require("nvim-lightbulb").get_status_text()
end
local function getLGTMs()
local comments = require("google.comments")
local tracker = require("google.comments.tracker")
local dump = require("utils").dump
print(dump(tracker.get_all_comments()))
local lgtm = comments.get_lgtms()
local appr = comments.get_approvals()
print("lgtms" .. dump(lgtm))
print("approvals" .. dump(appr))
return "LGTM:" .. table.concat(lgtm, ",") .. " Approval:" .. table.concat(appr, ",")
end
return {
"nvim-lualine/lualine.nvim",
lazy = false,
config = function()
local lsp_status = require("lsp-status")
"nvim-lualine/lualine.nvim",
lazy = false,
config = function()
local lsp_status = require("lsp-status")
require("lualine").setup({
options = {
theme = "auto",
globalstatus = false,
refresh = {
statusline = 1000,
-- tabline = 1000,
winbar = 1000,
},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", getCitc, isCiderLspAttached },
lualine_c = {
getLightbulb,
{
"filename",
path = 4, -- 0 = just filename, 1 = relative path, 2 = absolute path
},
},
lualine_x = {
"",
{
"diagnostics",
sources = { "nvim_lsp" },
symbols = { error = "", warn = "", info = "", hint = "" },
},
"filetype",
},
lualine_y = { "progress" },
lualine_z = { "location" },
},
})
end,
require("lualine").setup({
options = {
theme = "auto",
globalstatus = false,
refresh = {
statusline = 100,
tabline = 100,
winbar = 100,
},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff" },
lualine_c = {
require("nvim-lightbulb").get_status_text,
{
"filename",
path = 4, -- 0 = just filename, 1 = relative path, 2 = absolute path
},
},
lualine_x = {
"",
{
"diagnostics",
sources = { "nvim_lsp" },
symbols = { error = "", warn = "", info = "", hint = "" },
},
"filetype",
},
lualine_y = { "progress" },
lualine_z = { "location" },
},
})
end,
}

View File

@ -1,35 +0,0 @@
return {
{
"danymat/neogen",
config = function()
require("neogen").setup({ snippet_engine = "luasnip" })
end,
},
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "<CurrentMajor>.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = "make install_jsregexp",
},
{ "saadparwaiz1/cmp_luasnip" },
config = function()
local ls = require("luasnip")
vim.keymap.set({ "i" }, "<Tab>", function()
ls.expand()
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<Tab>", function()
ls.jump(1)
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<S-Tab>", function()
ls.jump(-1)
end, { silent = true })
vim.keymap.set({ "i", "s" }, "<C-E>", function()
if ls.choice_active() then
ls.change_choice(1)
end
end, { silent = true })
end,
}

View File

@ -10,7 +10,7 @@ return {
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
-- "~/cmdtree",
-- "~/cmdtree",
},
cmd = {
"Neotree",
@ -47,10 +47,8 @@ return {
-- return { "<C-n>.", ":Neotree toggle reveal_force_cwd<CR>", desc = "Open NeoTree CWD float" }
return { "<C-n>m", ":Neotree float git_status<CR>", desc = "Open NeoTree CWD float" }
end)(),
-- { "<C-n>b", ":Neotree float buffers<CR>" },
{ "<C-n>f", ":Neotree float dir=%:p:h<cr>" },
{ "<C-n>", ":Neotree toggle dir=%:p:h<cr>" },
-- { "<C-n>.", ":Neotree reveal_force_cwd<CR>", desc = "Open NeoTree CWD float" },
{ "<C-n>", ":Neotree toggle left dir=%:p:h<cr>" },
{ "<leader>e", ":Neotree float dir=%:p:h<cr>/" },
},
},
}

View File

@ -3,6 +3,9 @@ return {
"mrcjkb/rustaceanvim",
version = "^5", -- Recommended
lazy = false, -- This plugin is already lazy
keys = {
-- { "" },
},
},
{
"saecki/crates.nvim",

View File

@ -65,19 +65,18 @@ return {
},
config = function()
vim.g.signify_vcs_list = { "hg", "git" }
local one_eighth = ""
local one_quarter = ""
local three_eighths = ""
vim.g.signify_disable_by_default = 0
vim.g.signify_sign_add = one_quarter
vim.g.signify_sign_delete = one_quarter
vim.g.signify_sign_change = one_quarter
local red = "#f8a6a0"
vim.api.nvim_set_hl(0, "SignifySignAdd", { fg = "#9cc9b8" })
vim.api.nvim_set_hl(0, "SignifySignChange", { fg = "#84cee3" })
-- vim.g.signify_number_highlight = 1
local s = ""
vim.g.signify_sign_add = s
vim.g.signify_sign_delete = s
vim.g.signify_sign_change = s
vim.api.nvim_set_hl(0, "SignifySignAdd", { fg = "#9cd9b8" })
vim.api.nvim_set_hl(0, "SignifySignChange", { fg = "#849ee3" })
local red = "#f896a0"
vim.api.nvim_set_hl(0, "SignifySignChangeDelete", { fg = red })
vim.api.nvim_set_hl(0, "SignifySignDelete", { fg = red })
vim.api.nvim_set_hl(0, "SignifySignDeleteDeleteFirstLine", { fg = red })
-- vim.cmd("highlight SignColumn ctermbg=NONE cterm=NONE guibg=NONE gui=NONE")
end,
}

View File

@ -3,43 +3,44 @@ local exec = require("utils").exec
local TableConcat = require("utils").TableConcat
_G.find_files = function(search_dirs)
require("telescope.builtin").find_files({ search_dirs = search_dirs })
require("telescope.builtin").find_files({ search_dirs = search_dirs })
end
-- Helper functions to fetch the current scope and set `search_dirs`
_G.find_dotfiles = function() end
_G.search_cwd = function()
local builtin = require("telescope.builtin")
local utils = require("telescope.utils")
builtin.find_files({ cwd = utils.buffer_dir() })
local builtin = require("telescope.builtin")
local utils = require("telescope.utils")
builtin.find_files({ cwd = utils.buffer_dir() })
end
_G.live_grep = function(search_dirs)
require("telescope.builtin").live_grep({
search_dirs = search_dirs,
})
require("telescope.builtin").live_grep({
search_dirs = search_dirs,
})
end
_G.live_grep_cword = function(search_dirs)
require("telescope.builtin").live_grep({ search_dirs = search_dirs })
require("telescope.builtin").live_grep({ search_dirs = search_dirs })
end
local function exe(cmd)
return vim.split(vim.fn.system(cmd), "\n")
return vim.split(vim.fn.system(cmd), "\n")
end
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")
return exe("hg status -ma -n --rev p4base --no-status --template= | sort")
end
-- stylua: ignore
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", require('telescope.builtin').live_grep },
{ "<leader>tb", ":Telescope buffers<CR>" },
{ "<leader>TS", function() require('telescope.builtin').live_grep { default_text = vim.fn.expand("<cword>") } end, },
{
"<leader>t.",
@ -61,8 +62,8 @@ local keys = {
}
if use_google() then
local find_files = require("telescope.builtin").find_files
local cs_query = require("telescope").extensions.codesearch.find_query
local find_files = require("telescope.builtin").find_files
local cs_query = require("telescope").extensions.codesearch.find_query
-- stylua: ignore
TableConcat(keys, {
{ "<leader>tm", function() find_files({ search_dirs = fig_modified() }) end, desc = "list modified Fig files." },
@ -77,144 +78,144 @@ if use_google() then
end
return {
{
"aznhe21/actions-preview.nvim",
config = function()
require("actions-preview").setup({
telescope = {
sorting_strategy = "ascending",
layout_strategy = "vertical",
layout_config = {
width = 0.8,
height = 0.9,
prompt_position = "top",
preview_cutoff = 20,
preview_height = function(_, _, max_lines)
return max_lines - 15
end,
},
},
})
end,
keys = {
{ "?", "<cmd>lua require('actions-preview').code_actions()<cr>" },
},
},
{
"smartpde/telescope-recent-files",
config = function()
require("telescope").load_extension("recent_files")
end,
keys = {
{ "<leader>to", [[<cmd>lua require('telescope').extensions.recent_files.pick()<CR>]] },
},
},
{
"piersolenski/telescope-import.nvim",
dependencies = "nvim-telescope/telescope.nvim",
config = function()
require("telescope").load_extension("import")
end,
keys = function()
if not use_google() then
return {
{ "<leader>i", ":Telescope import<CR>" },
}
end
end,
},
{
"nvim-telescope/telescope.nvim",
dependencies = {
"mfussenegger/nvim-dap",
"smartpde/telescope-recent-files",
"rcarriga/nvim-dap-ui",
},
config = function()
require("telescope").setup({
defaults = {
-- The vertical layout strategy is good to handle long paths like those in
-- google3 repos because you have nearly the full screen to display a file path.
-- The caveat is that the preview area is smaller.
layout_strategy = "vertical",
-- Common paths in google3 repos are collapsed following the example of Cider
-- It is nice to keep this as a user config rather than part of
-- telescope-codesearch because it can be reused by other telescope pickers.
path_display = function(opts, path)
-- Do common substitutions
path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1)
path = path:gsub("^google3/java/com/google/", "//j/c/g/", 1)
path = path:gsub("^google3/javatests/com/google/", "//jt/c/g/", 1)
path = path:gsub("^google3/third_party/", "//3p/", 1)
path = path:gsub("^google3/", "//", 1)
{
"aznhe21/actions-preview.nvim",
config = function()
require("actions-preview").setup({
telescope = {
sorting_strategy = "ascending",
layout_strategy = "vertical",
layout_config = {
width = 0.8,
height = 0.9,
prompt_position = "top",
preview_cutoff = 20,
preview_height = function(_, _, max_lines)
return max_lines - 15
end,
},
},
})
end,
keys = {
{ "?", "<cmd>lua require('actions-preview').code_actions()<cr>" },
},
},
{
"smartpde/telescope-recent-files",
config = function()
require("telescope").load_extension("recent_files")
end,
keys = {
{ "<leader>to", [[<cmd>lua require('telescope').extensions.recent_files.pick()<CR>]] },
},
},
{
"piersolenski/telescope-import.nvim",
dependencies = "nvim-telescope/telescope.nvim",
config = function()
require("telescope").load_extension("import")
end,
keys = function()
if not use_google() then
return {
{ "<leader>i", ":Telescope import<CR>" },
}
end
end,
},
{
"nvim-telescope/telescope.nvim",
dependencies = {
"mfussenegger/nvim-dap",
"smartpde/telescope-recent-files",
"rcarriga/nvim-dap-ui",
},
config = function()
require("telescope").setup({
defaults = {
-- The vertical layout strategy is good to handle long paths like those in
-- google3 repos because you have nearly the full screen to display a file path.
-- The caveat is that the preview area is smaller.
layout_strategy = "vertical",
-- Common paths in google3 repos are collapsed following the example of Cider
-- It is nice to keep this as a user config rather than part of
-- telescope-codesearch because it can be reused by other telescope pickers.
path_display = function(opts, path)
-- Do common substitutions
path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1)
path = path:gsub("^google3/java/com/google/", "//j/c/g/", 1)
path = path:gsub("^google3/javatests/com/google/", "//jt/c/g/", 1)
path = path:gsub("^google3/third_party/", "//3p/", 1)
path = path:gsub("^google3/", "//", 1)
-- Do truncation. This allows us to combine our custom display formatter
-- with the built-in truncation.
-- `truncate` handler in transform_path memoizes computed truncation length in opts.__length.
-- Here we are manually propagating this value between new_opts and opts.
-- We can make this cleaner and more complicated using metatables :)
local new_opts = {
path_display = {
truncate = true,
},
__length = opts.__length,
}
path = require("telescope.utils").transform_path(new_opts, path)
opts.__length = new_opts.__length
return path
end,
mappings = {
n = {
["<C-c>"] = "close",
["<Esc>"] = "close",
},
i = {
-- ["<cr>"] = function(bufnr)
-- require("telescope.actions.set").edit(bufnr, "tab drop")
-- end,
["<C-c>"] = "close",
["<Esc>"] = "close",
["<S-Down>"] = "cycle_history_next",
["<S-Up>"] = "cycle_history_prev",
},
},
},
extensions = {
codesearch = {
experimental = true, -- enable results from google3/experimental
},
recent_files = {
-- This function rewrites all file paths to the current workspace.
-- For example, if w2 is the current workspace, then
-- /google/.../w1/google3/my_file.cc becomes /google/.../w2/google3/my_file.cc,
transform_file_path = function(path)
local neocitc = require("neocitc")
local path_func = neocitc.path_in_current_workspace_or_head
or neocitc.path_in_current_workspace
return path_func(path)
end,
-- This is a useful option to speed up Telescope by avoiding the check
-- for file existence.
stat_files = false,
-- Ignore common patterns that can show up from other google plugins
ignore_patterns = {
"/%.git/COMMIT_EDITING$",
"/%.git/COMMIT_EDITMSG$",
"/%.git/MERGE_MSG$",
"^/tmp/%.pipertmp-",
"/Related_Files$",
"^term:",
";#toggleterm#",
},
},
persisted = {},
import = {
-- Add imports to the top of the file keeping the cursor in place
insert_at_top = true,
},
},
})
end,
keys = keys,
},
-- Do truncation. This allows us to combine our custom display formatter
-- with the built-in truncation.
-- `truncate` handler in transform_path memoizes computed truncation length in opts.__length.
-- Here we are manually propagating this value between new_opts and opts.
-- We can make this cleaner and more complicated using metatables :)
local new_opts = {
path_display = {
truncate = true,
},
__length = opts.__length,
}
path = require("telescope.utils").transform_path(new_opts, path)
opts.__length = new_opts.__length
return path
end,
mappings = {
n = {
["<C-c>"] = "close",
["<Esc>"] = "close",
},
i = {
-- ["<cr>"] = function(bufnr)
-- require("telescope.actions.set").edit(bufnr, "tab drop")
-- end,
["<C-c>"] = "close",
["<Esc>"] = "close",
["<S-Down>"] = "cycle_history_next",
["<S-Up>"] = "cycle_history_prev",
},
},
},
extensions = {
codesearch = {
experimental = true, -- enable results from google3/experimental
},
recent_files = {
-- This function rewrites all file paths to the current workspace.
-- For example, if w2 is the current workspace, then
-- /google/.../w1/google3/my_file.cc becomes /google/.../w2/google3/my_file.cc,
transform_file_path = function(path)
local neocitc = require("neocitc")
local path_func = neocitc.path_in_current_workspace_or_head
or neocitc.path_in_current_workspace
return path_func(path)
end,
-- This is a useful option to speed up Telescope by avoiding the check
-- for file existence.
stat_files = false,
-- Ignore common patterns that can show up from other google plugins
ignore_patterns = {
"/%.git/COMMIT_EDITING$",
"/%.git/COMMIT_EDITMSG$",
"/%.git/MERGE_MSG$",
"^/tmp/%.pipertmp-",
"/Related_Files$",
"^term:",
";#toggleterm#",
},
},
persisted = {},
import = {
-- Add imports to the top of the file keeping the cursor in place
insert_at_top = true,
},
},
})
end,
keys = keys,
},
}

View File

@ -1,10 +1,23 @@
local use_google = require("utils").use_google
return {
{
"dgox16/oldworld.nvim",
lazy = false,
cond = not use_google(),
priority = 1000,
opts = {
variant = "cooler",
},
config = function()
vim.cmd("colorscheme oldworld")
end,
},
{
"bluz71/vim-moonfly-colors",
name = "moonfly",
cond = not use_google(),
-- cond = not use_google(),
cond = false,
lazy = false,
priority = 1000,
config = function()
@ -26,11 +39,12 @@ return {
group = custom_highlight,
})
vim.cmd("colorscheme moonfly")
vim.g.moonflyCursorColor = true
vim.g.moonflyItalics = true
vim.g.moonflyUnderlineMatchParen = true
vim.g.moonflyVirtualTextColor = true
vim.cmd("colorscheme moonfly")
end,
},
-- {

View File

@ -1,9 +1,9 @@
return {
"preservim/vimux",
"tmux-plugins/vim-tmux",
"christoomey/vim-tmux-navigator",
"whatyouhide/vim-tmux-syntax",
"tmux-plugins/vim-tmux-focus-events",
-- 'jabirali/vim-tmux-yank',
"skywind3000/asyncrun.vim",
"preservim/vimux",
"tmux-plugins/vim-tmux",
"christoomey/vim-tmux-navigator",
"whatyouhide/vim-tmux-syntax",
"tmux-plugins/vim-tmux-focus-events",
-- 'jabirali/vim-tmux-yank',
"skywind3000/asyncrun.vim",
}

View File

@ -1,102 +1,100 @@
local M = {
use_google_cache = nil,
flags = {
blink = true,
},
use_google_cache = nil,
flags = { blink = true },
}
function M.exec(command, args)
local Job = require("plenary.job")
local job = Job:new({
command = command,
args = args,
})
job:sync()
job:wait()
return job:result()
local Job = require("plenary.job")
local job = Job:new({
command = command,
args = args,
})
job:sync()
job:wait()
return job:result()
end
function M.map(mode, lhs, rhs, opts)
local options = { noremap = true }
if opts then
options = vim.tbl_extend("force", options, opts)
end
-- vim.api.nvim_set_keymap(mode, lhs, rhs, options)
vim.keymap.set(mode, lhs, rhs, options)
local options = { noremap = true }
if opts then
options = vim.tbl_extend("force", options, opts)
end
-- vim.api.nvim_set_keymap(mode, lhs, rhs, options)
vim.keymap.set(mode, lhs, rhs, options)
end
function M.use_google()
if M.use_google_cache == nil then
M.use_google_cache = M.file_exists(os.getenv("HOME") .. "/use_google")
end
return M.use_google_cache
if M.use_google_cache == nil then
M.use_google_cache = M.file_exists(os.getenv("HOME") .. "/use_google")
end
return M.use_google_cache
end
function M.file_exists(name)
local f = io.open(name, "r")
if f ~= nil then
io.close(f)
return true
else
return false
end
local f = io.open(name, "r")
if f ~= nil then
io.close(f)
return true
else
return false
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
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
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")
io.output(log_file)
io.write(message .. "\n")
io.close(log_file)
local log_file_path = vim.fn.expand("$HOME/nvim.log")
local log_file = io.open(log_file_path, "a")
io.output(log_file)
io.write(message .. "\n")
io.close(log_file)
end
function M.TableConcat(t1, t2)
for i = 1, #t2 do
t1[#t1 + 1] = t2[i]
end
return t1
for i = 1, #t2 do
t1[#t1 + 1] = t2[i]
end
return t1
end
return M

View File

@ -15,7 +15,7 @@ map <leader>` ysiw`
vmap <leader>` c`<C-R>"`<ESC>
" --------- SEARCH MAPPINGS ---------
" unhilight search
" unhighlight search
nnoremap <leader><space> :nohlsearch<CR>
" --------- CLIPBOARD MAPPINGS ---------
@ -46,4 +46,5 @@ nmap <leader>yf :let @+ = expand("%") \| let @" = expand("%")<cr>
" replace currently selected text with default register
" without yanking it
vnoremap <leader>p "_dP
nnoremap <leader><leader> :VimuxOpenRunner<cr> :VimuxRunCommand '!!'<cr> :call VimuxSendKeys("Enter")<cr>
nnoremap <leader><leader> :VimuxZoomRunner<cr> :VimuxRunCommand '!!'<cr> :call VimuxSendKeys("Enter")<cr>
nnoremap <leader>. :VimuxOpenRunner<cr> :VimuxRunCommand '!!'<cr> :call VimuxSendKeys("Enter")<cr>

View File

@ -152,3 +152,9 @@ source /google/bin/releases/gmscore-tools/cli/prod/setup_prod_gms.sh
abbr bq="blaze query"
abbr br="blaze run"
abbr bb="blaze build"
function phenodb() {
adb shell sqlite3 /data/data/com.google.android.gms/databases/phenotype.db "'$*'"
}
export PHENOTYPE_PACKAGE_NAME="com.google.YOUR.PHENOTYPE.PACKAGE.NAME"

View File

@ -13,7 +13,7 @@ autoload -Uz add-zsh-hook
add-zsh-hook chpwd g3path::hook
g3path::zle::accept-line () {
if [[ -n $GOOGLE3_ROOT && ! $BUFFER =~ \\s*(bb|bq|br|blaze|g4|p4|g4d|add_dep|buildozer|build_cleaner|debug_android_lint|rabbit|hb|gqui|builddoctor|unused_deps|clipper|blaze_lint_refactoring|migrants_sh.sar) ]]; then
if [[ -n $GOOGLE3_ROOT && ! $BUFFER =~ \\s*(bb|bq|br|blaze|g4|p4|g4d|add_dep|buildozer|build_cleaner|debug_android_lint|rabbit|hb|gqui|builddoctor|unused_deps|clipper|blaze_lint_refactoring|migrants_sh.sar|bloaty) ]]; then
BUFFER=${BUFFER// \/\// $GOOGLE3_ROOT\/}
fi
zle .accept-line