Compare commits
18 Commits
4c5bd3505f
...
main
Author | SHA1 | Date | |
---|---|---|---|
036a55effc | |||
8345f91cc8 | |||
b5e0e2ebf5 | |||
1f30ce43c7 | |||
edf9ae6ada | |||
28ac8a99b9 | |||
8b3bd23fa6 | |||
e4efa6b209 | |||
e588888143 | |||
d261f8b3bd | |||
5f814e7560 | |||
f9a40408aa | |||
a6eee81db6 | |||
a9a196baf1 | |||
2907bda8d3 | |||
348b966c1a | |||
736ba50a7a | |||
758afadb6f |
@ -3,4 +3,4 @@ set nowrap
|
|||||||
set tabstop=4
|
set tabstop=4
|
||||||
set softtabstop=4
|
set softtabstop=4
|
||||||
set shiftwidth=4
|
set shiftwidth=4
|
||||||
set noexpandtab
|
set expandtab
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
set tabstop=2
|
set tabstop=2
|
||||||
set softtabstop=2
|
|
||||||
set shiftwidth=2
|
set shiftwidth=2
|
||||||
|
set softtabstop=2
|
||||||
|
set expandtab
|
||||||
|
|
||||||
|
set textwidth=80
|
||||||
|
set colorcolumn=80
|
||||||
|
@ -4,5 +4,6 @@ abbr "bq"="blaze query"
|
|||||||
abbr "br"="blaze run"
|
abbr "br"="blaze run"
|
||||||
abbr "bt"="blaze test"
|
abbr "bt"="blaze test"
|
||||||
abbr "ds_clean"="find ./ -name \".DS_Store\" -depth -exec rm {} \;"
|
abbr "ds_clean"="find ./ -name \".DS_Store\" -depth -exec rm {} \;"
|
||||||
|
abbr "gdvim"="nvim --listen /tmp/godot.pipe"
|
||||||
abbr "mux"="tmuxinator"
|
abbr "mux"="tmuxinator"
|
||||||
abbr "replace_string"="replace_string --disable_p4 \"%\" \"%\""
|
abbr "replace_string"="replace_string --disable_p4 \"%\" \"%\""
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
Host workstation
|
|
||||||
Hostname cnieves.aus.corp.google.com
|
|
||||||
User cnieves
|
|
||||||
LocalForward 5005 localhost:5005 # Java Debug
|
|
||||||
RemoteForward 5037 localhost:5037 # ADB
|
|
||||||
RemoteForward 2222 localhost:22 # SSH/SCP
|
|
||||||
RemoteForward 2489 localhost:2489 # Lemonade
|
|
||||||
Compression no
|
|
||||||
ControlMaster auto
|
|
||||||
ControlPath /tmp/ssh_control-%r-%h-%p
|
|
||||||
ControlPersist 5m
|
|
||||||
|
|
||||||
Host vilya
|
|
||||||
Hostname vilya.c.googlers.com
|
|
||||||
User cnieves
|
|
||||||
LocalForward 5005 localhost:5005 # Java Debug
|
|
||||||
RemoteForward 5037 localhost:5037 # ADB
|
|
||||||
RemoteForward 2222 localhost:22 # SSH/SCP
|
|
||||||
RemoteForward 2489 localhost:2489 # Lemonade
|
|
||||||
Compression yes
|
|
||||||
ControlMaster auto
|
|
||||||
ControlPath /tmp/ssh_control-%r-%h-%p
|
|
||||||
ControlPersist 5m
|
|
||||||
|
|
||||||
Host gateway-workaround
|
|
||||||
Hostname cnieves.aus.corp.google.com
|
|
||||||
ProxyCommand /usr/local/bin/corp-ssh-helper -relay=sup-ssh-relay.corp.google.com -enable_measurements -report_measurement_results -proxy-mode=grue -dst_username=%r %h %p
|
|
@ -1,7 +0,0 @@
|
|||||||
-----BEGIN OPENSSH PRIVATE KEY-----
|
|
||||||
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
|
||||||
QyNTUxOQAAACAiobqOMGqa/WV98SogFgRxmR8piZIjB9YHv+EaKOszPwAAAJgwYgAoMGIA
|
|
||||||
KAAAAAtzc2gtZWQyNTUxOQAAACAiobqOMGqa/WV98SogFgRxmR8piZIjB9YHv+EaKOszPw
|
|
||||||
AAAEDCx1cXVSYtGOaZ3eY5Pi+vxI8IFQePfbR6anh7EIXnQSKhuo4wapr9ZX3xKiAWBHGZ
|
|
||||||
HymJkiMH1ge/4Roo6zM/AAAAE2NocmlzdGlhbkBuaWV2ZXMuaW8BAg==
|
|
||||||
-----END OPENSSH PRIVATE KEY-----
|
|
@ -1 +0,0 @@
|
|||||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICKhuo4wapr9ZX3xKiAWBHGZHymJkiMH1ge/4Roo6zM/ christian@nieves.io
|
|
@ -1,6 +0,0 @@
|
|||||||
|1|CIIWBGAPZWh0AC6+VhzGeTCp2zU=|tvDRuKqQI9R5hYflMTFC0UjxSLg= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
|
|
||||||
|1|2zYwaWz04YT0n3X4DoUJ/GyfvJc=|qEkYdDiBbUaZBIJuJgSjpgAIIcc= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=
|
|
||||||
|1|kyd+2TLRVx5WkeYWt5KZG5xkiRY=|Av44XxYX/tB5AylJYGwe1+aYRH8= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=
|
|
||||||
|1|57Mc7AkMixA2wO/oaXe0kDmn7bk=|WEvNB7cfFsTcYNQSk2tRgin+mfg= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJXuVwIE9ZFHrqkRqzCToEwBR4V+1YoBZf+7PwQOm9uo
|
|
||||||
|1|Gc8JQLe9H1GKkfEpatYPwqaM5u0=|CsQrFpSf02UbF27MlvOQB0enGuQ= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaRpBbAotScjprZd4DSlGw6FVRobxdo5YX1LLl9yoIhBfXXQIIHvYq3sRnS9GhhOBhoEBcqOZm7jj4GG8TnnANYEAoulR0dfGLAZbftpz95wNaWo9veiA45k8Ihx5fpZ2c0WlJnTZYyz+0+WaL3AY7yz7p1gyfTYOWp7Q4LJcY4kK/tkLnMYSsCTGwMAco2jR9CDdXZGLdAVB4BoZOAEYJ3wUGWCxcFMVgy+X7iQwIkrNyRCBw/BV3EjXqSNjD/XbrsMfuiVhhDgZS7r+u+yQCxqFu60OOLCXU9++UgKy2ICVDP8mBoJW/zKvJ0OOoylt7vSVWp67uiHe7f/0rywN1
|
|
||||||
|1|wBajkjvDTSC0NG6PWiSGhwPPhdY=|USSmnu2FmIcv4gzM4t4+3+RoBV8= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBA8e+6iO+UmorfX7JWKglc4QptEczpe2LG3PidmsS7tDPcUK9Vbn/eyEkY61Us1Zo7rGqrAT3wABOnRpftfg0IA=
|
|
@ -1,4 +0,0 @@
|
|||||||
|1|CIIWBGAPZWh0AC6+VhzGeTCp2zU=|tvDRuKqQI9R5hYflMTFC0UjxSLg= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
|
|
||||||
|1|2zYwaWz04YT0n3X4DoUJ/GyfvJc=|qEkYdDiBbUaZBIJuJgSjpgAIIcc= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=
|
|
||||||
|1|kyd+2TLRVx5WkeYWt5KZG5xkiRY=|Av44XxYX/tB5AylJYGwe1+aYRH8= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=
|
|
||||||
|1|57Mc7AkMixA2wO/oaXe0kDmn7bk=|WEvNB7cfFsTcYNQSk2tRgin+mfg= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJXuVwIE9ZFHrqkRqzCToEwBR4V+1YoBZf+7PwQOm9uo
|
|
35
vim/.vim/lua/plugins/avante.lua
Normal file
35
vim/.vim/lua/plugins/avante.lua
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
local use_google = require("utils").use_google
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"yetone/avante.nvim",
|
||||||
|
build = "make",
|
||||||
|
enable = true,
|
||||||
|
branch = "working",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"stevearc/dressing.nvim",
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
-- Add vintharas/avante-goose.nvim as a dependecy to avante.nvim
|
||||||
|
-- That'll ensure that you'll load avante-goose when you load avante.
|
||||||
|
{
|
||||||
|
"vintharas/avante-goose.nvim",
|
||||||
|
url = "sso://user/vintharas/avante-goose.nvim",
|
||||||
|
cond = use_google(),
|
||||||
|
opts = {
|
||||||
|
model = "gemini-for-google-2.5-pro", -- Select model from go/goose-models.
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
provider = "goose", -- Select goose as provider
|
||||||
|
vendors = {}, -- Makes sure there's a vendors table
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
-- Load provider from the plugin
|
||||||
|
opts.vendors["goose"] = require("avante-goose").getProvider()
|
||||||
|
require("avante").setup(opts)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
@ -1,6 +1,20 @@
|
|||||||
local use_google = require("utils").use_google
|
local use_google = require("utils").use_google
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
{
|
||||||
|
"folke/flash.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
---@type Flash.Config
|
||||||
|
opts = {},
|
||||||
|
-- stylua: ignore
|
||||||
|
keys = {
|
||||||
|
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
||||||
|
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
|
||||||
|
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
|
||||||
|
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
|
||||||
|
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||||
|
},
|
||||||
|
},
|
||||||
"tikhomirov/vim-glsl",
|
"tikhomirov/vim-glsl",
|
||||||
"sindrets/diffview.nvim",
|
"sindrets/diffview.nvim",
|
||||||
{ "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" } },
|
{ "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" } },
|
||||||
|
@ -1,17 +1,30 @@
|
|||||||
return {
|
return {
|
||||||
"LunarVim/bigfile.nvim",
|
"LunarVim/bigfile.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest MiB
|
filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest MiB
|
||||||
pattern = { "*" }, -- autocmd pattern or function see <### Overriding the detection of big files>
|
pattern = function(bufnr, filesize_mib)
|
||||||
features = { -- features to disable
|
-- you can't use `nvim_buf_line_count` because this runs on BufReadPre
|
||||||
|
local file_contents = vim.fn.readfile(vim.api.nvim_buf_get_name(bufnr))
|
||||||
|
local file_lines = #file_contents
|
||||||
|
local filetype = vim.filetype.match({ buf = bufnr })
|
||||||
|
if filetype == "c" or filetype == "cpp" then
|
||||||
|
if file_lines > 1000 then
|
||||||
|
vim.b.codefmt_formatt = "" -- disable codefmt
|
||||||
|
vim.cmd(":FormatDisable") -- disable conform
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return filesize_mib > 1
|
||||||
|
end,
|
||||||
|
features = { -- features to disable
|
||||||
"indent_blankline",
|
"indent_blankline",
|
||||||
"illuminate",
|
"illuminate",
|
||||||
"lsp",
|
"lsp",
|
||||||
"treesitter",
|
"treesitter",
|
||||||
"syntax",
|
-- "syntax",
|
||||||
"matchparen",
|
"matchparen",
|
||||||
"vimopts",
|
-- "vimopts",
|
||||||
"filetype",
|
-- "filetype",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,51 +15,6 @@ local kind_icons = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
|
||||||
"milanglacier/minuet-ai.nvim",
|
|
||||||
config = function()
|
|
||||||
require("minuet").setup({
|
|
||||||
provider = "gemini",
|
|
||||||
provider_options = {
|
|
||||||
gemini = {
|
|
||||||
optional = {
|
|
||||||
generationConfig = {
|
|
||||||
maxOutputTokens = 256,
|
|
||||||
},
|
|
||||||
safetySettings = {
|
|
||||||
{
|
|
||||||
-- HARM_CATEGORY_HATE_SPEECH,
|
|
||||||
-- HARM_CATEGORY_HARASSMENT
|
|
||||||
-- HARM_CATEGORY_SEXUALLY_EXPLICIT
|
|
||||||
category = "HARM_CATEGORY_DANGEROUS_CONTENT",
|
|
||||||
-- BLOCK_NONE
|
|
||||||
threshold = "BLOCK_ONLY_HIGH",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- Your configuration options here
|
|
||||||
virtualtext = {
|
|
||||||
auto_trigger_ft = {},
|
|
||||||
keymap = {
|
|
||||||
-- accept whole completion
|
|
||||||
accept = "<A-A>",
|
|
||||||
-- accept one line
|
|
||||||
accept_line = "<A-a>",
|
|
||||||
-- accept n lines (prompts for number)
|
|
||||||
-- e.g. "A-z 2 CR" will accept 2 lines
|
|
||||||
accept_n_lines = "<A-z>",
|
|
||||||
-- Cycle to prev completion item, or manually invoke completion
|
|
||||||
prev = "<A-[>",
|
|
||||||
-- Cycle to next completion item, or manually invoke completion
|
|
||||||
next = "<A-]>",
|
|
||||||
dismiss = "<A-e>",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"saghen/blink.compat",
|
"saghen/blink.compat",
|
||||||
-- use the latest release, via version = '*', if you also use the latest release for blink.cmp
|
-- use the latest release, via version = '*', if you also use the latest release for blink.cmp
|
||||||
@ -122,11 +77,14 @@ return {
|
|||||||
"emoji",
|
"emoji",
|
||||||
"nerdfont",
|
"nerdfont",
|
||||||
"buffer",
|
"buffer",
|
||||||
|
"avante",
|
||||||
}
|
}
|
||||||
if use_google() then
|
if use_google() then
|
||||||
table.insert(providerToEnable, "nvim_ciderlsp")
|
table.insert(providerToEnable, "nvim_ciderlsp")
|
||||||
table.insert(providerToEnable, "buganizer")
|
table.insert(providerToEnable, "buganizer")
|
||||||
|
-- table.insert(providerToEnable, "avante")
|
||||||
else
|
else
|
||||||
|
-- table.insert(providerToEnable, "avante")
|
||||||
table.insert(providerToEnable, "minuet")
|
table.insert(providerToEnable, "minuet")
|
||||||
end
|
end
|
||||||
return providerToEnable
|
return providerToEnable
|
||||||
@ -147,12 +105,13 @@ return {
|
|||||||
max_filesize = "1M",
|
max_filesize = "1M",
|
||||||
additional_rg_options = {},
|
additional_rg_options = {},
|
||||||
},
|
},
|
||||||
|
score_offset = 20, -- the higher the number, the higher the priority
|
||||||
},
|
},
|
||||||
-- https://github.com/moyiz/blink-emoji.nvim
|
-- https://github.com/moyiz/blink-emoji.nvim
|
||||||
emoji = {
|
emoji = {
|
||||||
module = "blink-emoji",
|
module = "blink-emoji",
|
||||||
name = "Emoji",
|
name = "Emoji",
|
||||||
score_offset = 15, -- the higher the number, the higher the priority
|
score_offset = 1, -- the higher the number, the higher the priority
|
||||||
opts = { insert = true }, -- Insert emoji (default) or complete its name
|
opts = { insert = true }, -- Insert emoji (default) or complete its name
|
||||||
},
|
},
|
||||||
buffer = {
|
buffer = {
|
||||||
@ -167,12 +126,20 @@ return {
|
|||||||
nerdfont = {
|
nerdfont = {
|
||||||
name = "nerdfont",
|
name = "nerdfont",
|
||||||
module = "blink.compat.source",
|
module = "blink.compat.source",
|
||||||
|
score_offset = 1, -- the higher the number, the higher the priority
|
||||||
},
|
},
|
||||||
minuet = {
|
minuet = {
|
||||||
name = "minuet",
|
name = "minuet",
|
||||||
module = "minuet.blink",
|
module = "minuet.blink",
|
||||||
score_offset = 100, -- Gives minuet higher priority among suggestions
|
score_offset = 100, -- Gives minuet higher priority among suggestions
|
||||||
},
|
},
|
||||||
|
-- avante = {
|
||||||
|
-- module = "blink-cmp-avante",
|
||||||
|
-- name = "Avante",
|
||||||
|
-- opts = {
|
||||||
|
-- -- options for blink-cmp-avante
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
nvim_ciderlsp = {
|
nvim_ciderlsp = {
|
||||||
name = "nvim_ciderlsp",
|
name = "nvim_ciderlsp",
|
||||||
module = "blink.compat.source",
|
module = "blink.compat.source",
|
||||||
|
@ -1,89 +1,89 @@
|
|||||||
local use_google = require("utils").use_google
|
local use_google = require("utils").use_google
|
||||||
|
|
||||||
vim.g.disable_autoformat = false
|
|
||||||
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
|
||||||
if args.bang then
|
|
||||||
-- FormatDisable! will disable formatting just for this buffer
|
|
||||||
vim.b.disable_autoformat = true
|
|
||||||
else
|
|
||||||
vim.g.disable_autoformat = true
|
|
||||||
end
|
|
||||||
end, {
|
|
||||||
desc = "Disable autoformat-on-save",
|
|
||||||
bang = true,
|
|
||||||
})
|
|
||||||
vim.api.nvim_create_user_command("FormatEnable", function()
|
|
||||||
vim.b.disable_autoformat = false
|
|
||||||
vim.g.disable_autoformat = false
|
|
||||||
end, {
|
|
||||||
desc = "Re-enable autoformat-on-save",
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
||||||
pattern = "*",
|
|
||||||
callback = function(args)
|
|
||||||
if vim.g.disable_autoformat or vim.b[args.buf].disable_autoformat then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
require("conform").format({ bufnr = args.buf })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("Format", function(args)
|
|
||||||
local range = nil
|
|
||||||
if args.count ~= -1 then
|
|
||||||
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
|
||||||
range = {
|
|
||||||
start = { args.line1, 0 },
|
|
||||||
["end"] = { args.line2, end_line:len() },
|
|
||||||
}
|
|
||||||
end
|
|
||||||
require("conform").format({ async = true, lsp_format = "fallback", range = range })
|
|
||||||
end, { range = true })
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"stevearc/conform.nvim",
|
"stevearc/conform.nvim",
|
||||||
event = { "BufWritePre" },
|
event = { "BufWritePre" },
|
||||||
cmd = { "ConformInfo", "FormatDisable", "FormatEnable" },
|
cmd = { "ConformInfo", "FormatDisable", "FormatEnable" },
|
||||||
keys = {
|
keys = {
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
{ "<leader>fmt", function() require("conform").format({ async = true, lsp_fallback = true }) end, mode = "", desc = "Format buffer", },
|
{ "<leader>fmt", function() require("conform").format({ async = true, lsp_fallback = true }) end, mode = "", desc = "Format buffer", },
|
||||||
{ "<leader>fj", ":%!python -m json.tool" },
|
{ "<leader>fj", ":%!python -m json.tool" },
|
||||||
},
|
},
|
||||||
-- This will provide type hinting with LuaLS
|
config = function()
|
||||||
---@module "conform"
|
vim.g.disable_autoformat = false
|
||||||
---@type conform.setupOpts
|
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
||||||
opts = {
|
if args.bang then
|
||||||
log_level = vim.log.levels.DEBUG,
|
-- FormatDisable! will disable formatting just for this buffer
|
||||||
formatters_by_ft = {
|
vim.b.disable_autoformat = true
|
||||||
rust = { "rustfmt", lsp_format = "fallback" },
|
else
|
||||||
-- Conform will run multiple formatters sequentially
|
vim.g.disable_autoformat = true
|
||||||
-- go = { "goimports", "gofmt" },
|
end
|
||||||
-- Use a sub-list to run only the first available formatter
|
end, {
|
||||||
lua = { "stylua" },
|
desc = "Disable autoformat-on-save",
|
||||||
-- Conform will run multiple formatters sequentially
|
bang = true,
|
||||||
python = { "isort" },
|
})
|
||||||
-- Use a sub-list to run only the first available formatter
|
vim.api.nvim_create_user_command("FormatEnable", function()
|
||||||
javascript = { { "prettier" } },
|
vim.b.disable_autoformat = false
|
||||||
gdscript = { "gdformat" },
|
vim.g.disable_autoformat = false
|
||||||
ron = { "ronfmt" },
|
end, {
|
||||||
dashboard = {},
|
desc = "Re-enable autoformat-on-save",
|
||||||
-- Use the "*" filetype to run formatters on all filetypes.
|
})
|
||||||
-- ["*"] = { "codespell" },
|
|
||||||
-- Use the "_" filetype to run formatters on filetypes that don't
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
-- have other formatters configured.
|
pattern = "*",
|
||||||
["_"] = { "trim_whitespace" },
|
callback = function(args)
|
||||||
},
|
if vim.g.disable_autoformat or vim.b[args.buf].disable_autoformat then
|
||||||
formatters = {
|
return
|
||||||
-- ronfmt = {
|
end
|
||||||
-- command = "ronfmt",
|
require("conform").format({ bufnr = args.buf })
|
||||||
-- args = { "-d", "$FILENAME" },
|
end,
|
||||||
-- },
|
})
|
||||||
gdformat = {
|
|
||||||
prepend_args = { "-l", "100" },
|
vim.api.nvim_create_user_command("Format", function(args)
|
||||||
},
|
local range = nil
|
||||||
},
|
if args.count ~= -1 then
|
||||||
},
|
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
||||||
},
|
range = {
|
||||||
|
start = { args.line1, 0 },
|
||||||
|
["end"] = { args.line2, end_line:len() },
|
||||||
|
}
|
||||||
|
end
|
||||||
|
require("conform").format({ async = true })
|
||||||
|
end, { range = true })
|
||||||
|
|
||||||
|
require("conform").setup(
|
||||||
|
{
|
||||||
|
log_level = vim.log.levels.DEBUG,
|
||||||
|
formatters_by_ft = {
|
||||||
|
rust = { "rustfmt" },
|
||||||
|
-- Conform will run multiple formatters sequentially
|
||||||
|
-- go = { "goimports", "gofmt" },
|
||||||
|
-- Use a sub-list to run only the first available formatter
|
||||||
|
lua = { "stylua" },
|
||||||
|
-- Conform will run multiple formatters sequentially
|
||||||
|
python = { "isort" },
|
||||||
|
-- Use a sub-list to run only the first available formatter
|
||||||
|
javascript = { "prettier" },
|
||||||
|
gdscript = { "gdformat" },
|
||||||
|
ron = { "ronfmt" },
|
||||||
|
dashboard = {},
|
||||||
|
-- Use the "*" filetype to run formatters on all filetypes.
|
||||||
|
-- ["*"] = { "codespell" },
|
||||||
|
-- Use the "_" filetype to run formatters on filetypes that don't
|
||||||
|
-- have other formatters configured.
|
||||||
|
["_"] = { "trim_whitespace" },
|
||||||
|
},
|
||||||
|
formatters = {
|
||||||
|
-- ronfmt = {
|
||||||
|
-- command = "ronfmt",
|
||||||
|
-- args = { "-d", "$FILENAME" },
|
||||||
|
-- },
|
||||||
|
gdformat = {
|
||||||
|
prepend_args = { "-l", "100" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local use_google = require("utils").use_google
|
local use_google = require("utils").use_google
|
||||||
|
|
||||||
if not use_google() then
|
if not use_google() then
|
||||||
return {}
|
return {}
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.opt.rtp:append("/google/src/head/depot/google3/experimental/users/fentanes/nvgoog/")
|
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")
|
local superlazy = require("nvgoog.util.superlazy")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{ import = "nvgoog.google.format" },
|
{ import = "nvgoog.google.format" },
|
||||||
-- maktaba is required by all google plugins
|
-- maktaba is required by all google plugins
|
||||||
glug("maktaba", {
|
glug("maktaba", {
|
||||||
lazy = true,
|
lazy = true,
|
||||||
dependencies = {},
|
dependencies = {},
|
||||||
config = function() -- init?
|
config = function() -- init?
|
||||||
vim.cmd("source /usr/share/vim/google/glug/bootstrap.vim")
|
vim.cmd("source /usr/share/vim/google/glug/bootstrap.vim")
|
||||||
end,
|
end,
|
||||||
}),
|
}),
|
||||||
glug("googler", {
|
glug("googler", {
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
}),
|
}),
|
||||||
glug("glaive"),
|
glug("glaive"),
|
||||||
glug("alert"),
|
glug("alert"),
|
||||||
glug("googlespell"),
|
glug("googlespell"),
|
||||||
-- Add support for google filetypes
|
-- Add support for google filetypes
|
||||||
glug("google-filetypes", { event = { "BufReadPre", "BufNewFile" }, dependencies = {} }),
|
glug("google-filetypes", { event = { "BufReadPre", "BufNewFile" }, dependencies = {} }),
|
||||||
|
|
||||||
glug("add_usings"),
|
glug("add_usings"),
|
||||||
-- Autogens boilerplate when creating new files
|
-- Autogens boilerplate when creating new files
|
||||||
glug("autogen", {
|
glug("autogen", {
|
||||||
event = "BufNewFile",
|
event = "BufNewFile",
|
||||||
}),
|
}),
|
||||||
-- Adds G4 support to the vcscommand plugin
|
-- Adds G4 support to the vcscommand plugin
|
||||||
glug("googlepaths"),
|
glug("googlepaths"),
|
||||||
-- Set up syntax, indent, and core settings for various filetypes
|
-- Set up syntax, indent, and core settings for various filetypes
|
||||||
superlazy(glug("ft-cpp", { event = "BufRead,BufNewFile *.[ch],*.cc,*.cpp" })),
|
superlazy(glug("ft-cpp", { event = "BufRead,BufNewFile *.[ch],*.cc,*.cpp" })),
|
||||||
-- superlazy(glug("ft-go", { event = "BufRead,BufNewFile *.go" })),
|
superlazy(glug("ft-go", { event = "BufRead,BufNewFile *.go" })),
|
||||||
superlazy(glug("ft-java", { event = "BufRead,BufNewFile *.java" })),
|
superlazy(glug("ft-java", { event = "BufRead,BufNewFile *.java" })),
|
||||||
superlazy(glug("ft-javascript", { event = "BufRead,BufNewFile *.js,*.jsx" })),
|
superlazy(glug("ft-javascript", { event = "BufRead,BufNewFile *.js,*.jsx" })),
|
||||||
superlazy(glug("ft-kotlin", { event = "BufRead,BufNewFile *.kt,*.kts" })),
|
superlazy(glug("ft-kotlin", { event = "BufRead,BufNewFile *.kt,*.kts" })),
|
||||||
superlazy(glug("ft-python", { event = "BufRead,BufNewFile *.py" })),
|
superlazy(glug("ft-python", { event = "BufRead,BufNewFile *.py" })),
|
||||||
|
|
||||||
-- Configures nvim to respect Google's coding style
|
-- Configures nvim to respect Google's coding style
|
||||||
superlazy(glug("googlestyle", { event = { "BufRead", "BufNewFile" } })),
|
superlazy(glug("googlestyle", { event = { "BufRead", "BufNewFile" } })),
|
||||||
|
|
||||||
glug("ft-soy"),
|
glug("ft-soy"),
|
||||||
glug("ft-gss"),
|
glug("ft-gss"),
|
||||||
glug("ft-proto"),
|
glug("ft-proto"),
|
||||||
glug("g4"),
|
glug("g4"),
|
||||||
glug("outline-window"),
|
glug("outline-window"),
|
||||||
glug("fzf-query"),
|
glug("fzf-query"),
|
||||||
-- Open current file in chrome
|
-- Open current file in chrome
|
||||||
glug("corpweb", {
|
glug("corpweb", {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
glug("launchbrowser"),
|
glug("launchbrowser"),
|
||||||
},
|
},
|
||||||
cmd = {
|
cmd = {
|
||||||
-- Launches {query} under codesearch in a web browser
|
-- Launches {query} under codesearch in a web browser
|
||||||
"CorpWebCs",
|
"CorpWebCs",
|
||||||
-- Launches the current file under codesearch in a web browser
|
-- Launches the current file under codesearch in a web browser
|
||||||
"CorpWebCsFile",
|
"CorpWebCsFile",
|
||||||
-- Launches the current file doc view (i.e., Cantata, G3Docs, or godoc)
|
-- Launches the current file doc view (i.e., Cantata, G3Docs, or godoc)
|
||||||
"CorpWebDocFindFile",
|
"CorpWebDocFindFile",
|
||||||
-- Launches the current CL in Critique
|
-- Launches the current CL in Critique
|
||||||
"CorpWebCritiqueCl",
|
"CorpWebCritiqueCl",
|
||||||
-- Launches the current CL in Cider
|
-- Launches the current CL in Cider
|
||||||
"CorpWebCider",
|
"CorpWebCider",
|
||||||
-- Launches {query} under cs.chromium.org in a web browser
|
-- Launches {query} under cs.chromium.org in a web browser
|
||||||
"CorpWebChromeCs",
|
"CorpWebChromeCs",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
glug("relatedfiles", {
|
glug("relatedfiles", {
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>rb", ":exec relatedfiles#selector#JumpToBuild()<CR>" },
|
{ "<leader>rb", ":exec relatedfiles#selector#JumpToBuild()<CR>" },
|
||||||
@ -81,232 +81,242 @@ return {
|
|||||||
{ "<leader>rh", ":exec relatedfiles#selector#JumpToHeader()<CR>" },
|
{ "<leader>rh", ":exec relatedfiles#selector#JumpToHeader()<CR>" },
|
||||||
{ "<leader>rc", ":exec relatedfiles#selector#JumpToCodeFile()<CR>" },
|
{ "<leader>rc", ":exec relatedfiles#selector#JumpToCodeFile()<CR>" },
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
{ "junegunn/fzf", dir = "~/.fzf", build = "./install --all" },
|
{ "junegunn/fzf", dir = "~/.fzf", build = "./install --all" },
|
||||||
{ "junegunn/fzf.vim", dependencies = { "junegunn/fzf" } },
|
{ "junegunn/fzf.vim", dependencies = { "junegunn/fzf" } },
|
||||||
-- Format google code
|
-- Format google code
|
||||||
glug("codefmt-google", {
|
glug("codefmt-google", {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
glug("codefmt", {
|
glug("codefmt", {
|
||||||
opts = {
|
opts = {
|
||||||
clang_format_executable = "/usr/bin/clang-format",
|
clang_format_executable = "/usr/bin/clang-format",
|
||||||
clang_format_style = "function('codefmtgoogle#GetClangFormatStyle')",
|
clang_format_style = "function('codefmtgoogle#GetClangFormatStyle')",
|
||||||
gofmt_executable = "/usr/lib/google-golang/bin/gofmt",
|
gofmt_executable = "/usr/lib/google-golang/bin/gofmt",
|
||||||
prettier_executable = "/google/data/ro/teams/prettier/prettier",
|
prettier_executable = "/google/data/ro/teams/prettier/prettier",
|
||||||
ktfmt_executable = { "/google/bin/releases/kotlin-google-eng/ktfmt/ktfmt", "--google-style" },
|
ktfmt_executable = { "/google/bin/releases/kotlin-google-eng/ktfmt/ktfmt", "--google-style" },
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
auto_format = {
|
auto_format = {
|
||||||
["borg"] = "gclfmt",
|
["borg"] = "gclfmt",
|
||||||
["gcl"] = "gclfmt",
|
["gcl"] = "gclfmt",
|
||||||
["patchpanel"] = "gclfmt",
|
["patchpanel"] = "gclfmt",
|
||||||
["bzl"] = "buildifier",
|
["bzl"] = "buildifier",
|
||||||
["c"] = "clang-format",
|
["c"] = "clang-format",
|
||||||
["cpp"] = "clang-format",
|
["cpp"] = "clang-format",
|
||||||
["javascript"] = "clang-format",
|
["javascript"] = "clang-format",
|
||||||
["typescript"] = "clang-format",
|
["typescript"] = "clang-format",
|
||||||
["dart"] = "dartfmt",
|
["dart"] = "dartfmt",
|
||||||
["go"] = "gofmt",
|
["go"] = "gofmt",
|
||||||
["java"] = "google-java-format",
|
["java"] = "google-java-format",
|
||||||
["kotlin"] = "ktfmt",
|
["kotlin"] = "ktfmt",
|
||||||
["jslayout"] = "jslfmt",
|
["jslayout"] = "jslfmt",
|
||||||
["markdown"] = "mdformat",
|
["markdown"] = "mdformat",
|
||||||
["ncl"] = "nclfmt",
|
["ncl"] = "nclfmt",
|
||||||
["python,piccolo"] = "pyformat",
|
["python,piccolo"] = "pyformat",
|
||||||
["soy"] = "soyfmt",
|
["soy"] = "soyfmt",
|
||||||
["textpb"] = "text-proto-format",
|
["textpb"] = "text-proto-format",
|
||||||
["proto"] = "protofmt",
|
["proto"] = "protofmt",
|
||||||
["sql"] = "format_sql",
|
["sql"] = "format_sql",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
cmd = { "FormatLines", "FormatCode", "AutoFormatBuffer" },
|
cmd = { "FormatLines", "FormatCode", "AutoFormatBuffer" },
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
|
|
||||||
-- Setting up autocmds in init allows deferring loading the plugin until
|
-- Setting up autocmds in init allows deferring loading the plugin until
|
||||||
-- the `BufWritePre` event. One caveat is we must call `codefmt#FormatBuffer()`
|
-- 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,
|
-- 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.
|
-- but by the time it's first loaded it has already happened.
|
||||||
-- TODO: check if that is fixed when the following issue is fixed
|
-- TODO: check if that is fixed when the following issue is fixed
|
||||||
-- https://github.com/folke/lazy.nvim/issues/858
|
-- https://github.com/folke/lazy.nvim/issues/858
|
||||||
-- if so, remove the call to `FormatBuffer`
|
-- if so, remove the call to `FormatBuffer`
|
||||||
init = function(plugin)
|
init = function(plugin)
|
||||||
local group = vim.api.nvim_create_augroup("autoformat_settings", {})
|
local group = vim.api.nvim_create_augroup("autoformat_settings", {})
|
||||||
local function autocmd(filetypes, formatter)
|
local function autocmd(filetypes, formatter)
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = filetypes,
|
pattern = filetypes,
|
||||||
group = group,
|
group = group,
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
buffer = event.buf,
|
buffer = event.buf,
|
||||||
group = group,
|
group = group,
|
||||||
once = true,
|
once = true,
|
||||||
command = "call codefmt#FormatBuffer() | AutoFormatBuffer " .. formatter,
|
command = "call codefmt#FormatBuffer() | AutoFormatBuffer " .. formatter,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
-- Build opts from possible parent specs since lazy.nvim doesn't provide it in `init`
|
-- 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)
|
local plugin_opts = require("lazy.core.plugin").values(plugin, "opts", false)
|
||||||
for filetypes, formatter in pairs(plugin_opts.auto_format or {}) do
|
for filetypes, formatter in pairs(plugin_opts.auto_format or {}) do
|
||||||
autocmd(filetypes, formatter)
|
autocmd(filetypes, formatter)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
-- Run blaze commands
|
-- Run blaze commands
|
||||||
glug("blaze", {
|
glug("blaze", {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
glug("blazedeps"),
|
glug("blazedeps"),
|
||||||
},
|
},
|
||||||
cmd = {
|
cmd = {
|
||||||
"Blaze",
|
"Blaze",
|
||||||
"BlazeGoToSponge",
|
"BlazeGoToSponge",
|
||||||
"BlazeViewCommandLog",
|
"BlazeViewCommandLog",
|
||||||
"BlazeLoadErrors",
|
"BlazeLoadErrors",
|
||||||
"BlazeDebugCurrentFileTest",
|
"BlazeDebugCurrentFileTest",
|
||||||
"BlazeDebugCurrentTestMethod",
|
"BlazeDebugCurrentTestMethod",
|
||||||
"BlazeDebugAddBreakpoint",
|
"BlazeDebugAddBreakpoint",
|
||||||
"BlazeDebugClearBreakpoint",
|
"BlazeDebugClearBreakpoint",
|
||||||
"BlazeDebugFinish",
|
"BlazeDebugFinish",
|
||||||
"BlazeDepsUpdate",
|
"BlazeDepsUpdate",
|
||||||
},
|
},
|
||||||
keys = function()
|
keys = function()
|
||||||
local function runCommandWithTarget(cmd)
|
local function runCommandWithTarget(cmd)
|
||||||
return function()
|
return function()
|
||||||
local targets = table.concat(vim.fn["blaze#GetTargets"](), " ")
|
local targets = table.concat(vim.fn["blaze#GetTargets"](), " ")
|
||||||
local command = "VimuxRunCommand('" .. cmd .. " " .. targets .. "')"
|
local command = "VimuxRunCommand('" .. cmd .. " " .. targets .. "')"
|
||||||
print(vim.inspect(command))
|
print(vim.inspect(command))
|
||||||
vim.cmd(command)
|
vim.cmd(command)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return {
|
return {
|
||||||
{ "<leader>b", desc = "Blaze" },
|
{ "<leader>b", desc = "Blaze" },
|
||||||
{ "<leader>bb", runCommandWithTarget("blaze build"), desc = "Blaze Build" },
|
{ "<leader>bb", runCommandWithTarget("blaze build"), desc = "Blaze Build" },
|
||||||
{ "<leader>br", runCommandWithTarget("blaze run"), desc = "Blaze Run" },
|
{ "<leader>br", runCommandWithTarget("blaze run"), desc = "Blaze Run" },
|
||||||
{ "<leader>bt", runCommandWithTarget("blaze test"), desc = "Blaze Test" },
|
{ "<leader>bt", runCommandWithTarget("blaze test"), desc = "Blaze Test" },
|
||||||
{ "<leader>bc", runCommandWithTarget("build_cleaner"), desc = "Blaze Run" },
|
{ "<leader>bc", runCommandWithTarget("build_cleaner"), desc = "Blaze Run" },
|
||||||
{
|
{
|
||||||
"<leader>yb",
|
"<leader>yb",
|
||||||
":let t = join(blaze#GetTargets(), ' ') | echo t | let @+ = t | let @\" = t<CR>",
|
":let t = join(blaze#GetTargets(), ' ') | echo t | let @+ = t | let @\" = t<CR>",
|
||||||
desc = "Yank Blaze Target",
|
desc = "Yank Blaze Target",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>bq",
|
"<leader>bq",
|
||||||
function()
|
function()
|
||||||
local targets = vim.fn["blaze#GetTargets"]()
|
local targets = vim.fn["blaze#GetTargets"]()
|
||||||
for _, t in ipairs(targets) do
|
for _, t in ipairs(targets) do
|
||||||
print(vim.inspect(t))
|
print(vim.inspect(t))
|
||||||
vim.cmd("VimuxRunCommand('blaze query " .. t:gsub(":.+", "") .. ":\\*" .. "')")
|
vim.cmd("VimuxRunCommand('blaze query " .. t:gsub(":.+", "") .. ":\\*" .. "')")
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
desc = "Blaze query the current package",
|
desc = "Blaze query the current package",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
}),
|
}),
|
||||||
-- Imports
|
-- Imports
|
||||||
glug("imp-google", {
|
glug("imp-google", {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
glugOpts("vim-imp", {
|
glugOpts("vim-imp", {
|
||||||
"flwyd/vim-imp",
|
"flwyd/vim-imp",
|
||||||
opts = {
|
opts = {
|
||||||
["Suggest[default]"] = { "buffer", "csearch", "ripgrep", "prompt" },
|
["Suggest[default]"] = { "buffer", "csearch", "ripgrep", "prompt" },
|
||||||
["Report[default]"] = "popupnotify",
|
["Report[default]"] = "popupnotify",
|
||||||
["Location[default]"] = "packageroot",
|
["Location[default]"] = "packageroot",
|
||||||
-- ["Location[gcl]"] = "parent",
|
-- ["Location[gcl]"] = "parent",
|
||||||
["Pick[default]"] = "fzf",
|
["Pick[default]"] = "fzf",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
cmd = { "ImpSuggest", "ImpFirst" },
|
cmd = { "ImpSuggest", "ImpFirst" },
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>i", ":ImpSuggest <C-r><C-w><cr>" },
|
{ "<leader>I", ":ImpSuggest <C-r><C-w><cr>" },
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
url = "sso://user/fentanes/googlepaths.nvim",
|
url = "sso://user/fentanes/googlepaths.nvim",
|
||||||
event = { "VeryLazy", "BufReadCmd //*", "BufReadCmd google3/*" },
|
event = { "VeryLazy", "BufReadCmd //*", "BufReadCmd google3/*" },
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "ai.nvim",
|
name = "ai.nvim",
|
||||||
url = "sso://googler@user/vvvv/ai.nvim",
|
url = "sso://googler@user/vvvv/ai.nvim",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "cmp-nvim-ciderlsp",
|
name = "cmp-nvim-ciderlsp",
|
||||||
url = "sso://googler@user/piloto/cmp-nvim-ciderlsp",
|
url = "sso://googler@user/piloto/cmp-nvim-ciderlsp",
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "ciderlsp-nvim",
|
name = "ciderlsp-nvim",
|
||||||
url = "sso://googler@user/kdark/ciderlsp-nvim",
|
url = "sso://googler@user/kdark/ciderlsp-nvim",
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
},
|
},
|
||||||
-- {
|
{
|
||||||
-- name = "nvim_figtree",
|
url = "sso://user/jackcogdill/nvim-figtree",
|
||||||
-- url = "sso://googler@user/jackcogdill/nvim-figtree",
|
keys = {
|
||||||
-- },
|
{
|
||||||
{
|
"<Leader>ft",
|
||||||
name = "telescope_codesearch",
|
function()
|
||||||
url = "sso://googler@user/vintharas/telescope-codesearch.nvim",
|
require("figtree").toggle()
|
||||||
dependencies = { "nvim-telescope/telescope.nvim" },
|
end,
|
||||||
config = function() end,
|
},
|
||||||
},
|
},
|
||||||
{
|
opts = {
|
||||||
name = "telescope_citc",
|
-- see |figtree-configuration| for all possible options
|
||||||
url = "sso://googler@user/aktau/telescope-citc.nvim",
|
},
|
||||||
dependencies = { "nvim-telescope/telescope.nvim" },
|
},
|
||||||
},
|
{
|
||||||
{
|
name = "telescope_codesearch",
|
||||||
name = "telescope_fig",
|
url = "sso://googler@user/vintharas/telescope-codesearch.nvim",
|
||||||
url = "sso://googler@user/tylersaunders/telescope-fig.nvim",
|
dependencies = { "nvim-telescope/telescope.nvim" },
|
||||||
dependencies = { "nvim-telescope/telescope.nvim" },
|
config = function() end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "critique-nvim",
|
name = "telescope_citc",
|
||||||
dir = "~/critique-nvim/",
|
url = "sso://googler@user/aktau/telescope-citc.nvim",
|
||||||
lazy = false,
|
dependencies = { "nvim-telescope/telescope.nvim" },
|
||||||
dependencies = {
|
},
|
||||||
"rktjmp/time-ago.vim",
|
{
|
||||||
"nvim-lua/plenary.nvim",
|
name = "telescope_fig",
|
||||||
"nvim-telescope/telescope.nvim",
|
url = "sso://googler@user/tylersaunders/telescope-fig.nvim",
|
||||||
"runiq/neovim-throttle-debounce",
|
dependencies = { "nvim-telescope/telescope.nvim" },
|
||||||
},
|
},
|
||||||
-- here are some mappings you might want:
|
{
|
||||||
keys = {
|
name = "critique-nvim",
|
||||||
{ "<Leader>lc", ":CritiqueToggleLineComment<CR>" },
|
dir = "~/critique-nvim/",
|
||||||
{ "<Leader>ac", ":CritiqueToggleAllComments<CR>" },
|
lazy = false,
|
||||||
{ "<Leader>uc", ":CritiqueToggleUnresolvedComments<CR>" },
|
dependencies = {
|
||||||
{ "<Leader>fc", ":CritiqueFetchComments<CR>" },
|
"rktjmp/time-ago.vim",
|
||||||
{ "<Leader>tc", ":CritiqueCommentsTelescope<CR>" },
|
"nvim-lua/plenary.nvim",
|
||||||
},
|
"nvim-telescope/telescope.nvim",
|
||||||
config = function()
|
"runiq/neovim-throttle-debounce",
|
||||||
-- Here are all the options and their default values:
|
},
|
||||||
require("critique.comments").setup({
|
-- here are some mappings you might want:
|
||||||
-- debug = 1, -- default = 0
|
keys = {
|
||||||
-- Fetch the comments after calling `setup`.
|
{ "<Leader>lc", ":CritiqueToggleLineComment<CR>" },
|
||||||
auto_fetch = true, -- default = true
|
{ "<Leader>ac", ":CritiqueToggleAllComments<CR>" },
|
||||||
auto_render = true, -- default = true
|
{ "<Leader>uc", ":CritiqueToggleUnresolvedComments<CR>" },
|
||||||
-- Allow checking for comments on BufEnter events. This is throttled to once every 10 seconds.
|
{ "<Leader>fc", ":CritiqueFetchComments<CR>" },
|
||||||
frequent_fetch = true, -- default = false
|
{ "<Leader>tc", ":CritiqueCommentsTelescope<CR>" },
|
||||||
verbose_notifications = true,
|
},
|
||||||
})
|
config = function()
|
||||||
end,
|
-- Here are all the options and their default values:
|
||||||
},
|
require("critique.comments").setup({
|
||||||
{
|
-- debug = 1, -- default = 0
|
||||||
url = "sso://googler@user/mccloskeybr/luasnip-google.nvim",
|
-- Fetch the comments after calling `setup`.
|
||||||
config = function()
|
auto_fetch = true, -- default = true
|
||||||
require("luasnip-google").load_snippets()
|
auto_render = true, -- default = true
|
||||||
end,
|
-- Allow checking for comments on BufEnter events. This is throttled to once every 10 seconds.
|
||||||
},
|
frequent_fetch = true, -- default = false
|
||||||
{
|
verbose_notifications = true,
|
||||||
name = "hg",
|
})
|
||||||
url = "sso://googler@user/smwang/hg.nvim",
|
end,
|
||||||
dependencies = { "ipod825/libp.nvim" },
|
},
|
||||||
config = function()
|
{
|
||||||
require("hg").setup()
|
url = "sso://googler@user/mccloskeybr/luasnip-google.nvim",
|
||||||
end,
|
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,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,50 +1,60 @@
|
|||||||
local use_google = require("utils").use_google
|
local use_google = require("utils").use_google
|
||||||
local flags = require("utils").flags
|
local flags = require("utils").flags
|
||||||
|
|
||||||
|
local function add_import()
|
||||||
|
vim.lsp.buf.code_action({
|
||||||
|
apply = true,
|
||||||
|
context = {
|
||||||
|
only = { "quickfix.addImports" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"kosayoda/nvim-lightbulb",
|
"kosayoda/nvim-lightbulb",
|
||||||
commit = "1cae7b7153ae98dcf1b11173a443ac1b6d8e3d49",
|
commit = "1cae7b7153ae98dcf1b11173a443ac1b6d8e3d49",
|
||||||
event = { "LspAttach" },
|
event = { "LspAttach" },
|
||||||
opts = {
|
opts = {
|
||||||
autocmd = { enabled = true },
|
autocmd = { enabled = true },
|
||||||
virtual_text = {
|
virtual_text = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
text = " ",
|
text = " ",
|
||||||
hl = "DiagnosticWarn",
|
hl = "DiagnosticWarn",
|
||||||
},
|
},
|
||||||
sign = { enabled = false },
|
sign = { enabled = false },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
build = "make install_jsregexp",
|
build = "make install_jsregexp",
|
||||||
config = function()
|
config = function()
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
end,
|
end,
|
||||||
dependencies = { "rafamadriz/friendly-snippets" },
|
dependencies = { "rafamadriz/friendly-snippets" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ray-x/go.nvim",
|
"ray-x/go.nvim",
|
||||||
dependencies = { -- optional packages
|
dependencies = { -- optional packages
|
||||||
"ray-x/guihua.lua",
|
"ray-x/guihua.lua",
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
},
|
},
|
||||||
-- cond = not use_google(),
|
-- cond = not use_google(),
|
||||||
config = function()
|
config = function()
|
||||||
local capabilities = flags.blink
|
local capabilities = flags.blink
|
||||||
and require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
|
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())
|
or require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
capabilities.offsetEncoding = { "utf-16" }
|
capabilities.offsetEncoding = { "utf-16" }
|
||||||
require("go").setup({
|
require("go").setup({
|
||||||
lsp_cfg = { capabilities = capabilities },
|
lsp_cfg = { capabilities = capabilities },
|
||||||
lsp_keymaps = false,
|
lsp_keymaps = false,
|
||||||
lsp_inlay_hints = {
|
lsp_inlay_hints = {
|
||||||
enable = not use_google(), -- doesn't work with ciderlsp
|
enable = not use_google(), -- doesn't work with ciderlsp
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
-- Run gofmt + goimports on save
|
-- Run gofmt + goimports on save
|
||||||
|
|
||||||
local format_sync_grp = vim.api.nvim_create_augroup("goimports", {})
|
local format_sync_grp = vim.api.nvim_create_augroup("goimports", {})
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
@ -69,6 +79,7 @@ return {
|
|||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>F", ":lua vim.lsp.buf.format()<CR>" },
|
{ "<leader>F", ":lua vim.lsp.buf.format()<CR>" },
|
||||||
|
{ "<leader>i", add_import },
|
||||||
{ "<leader>rn", ":lua vim.lsp.buf.rename()<CR>" },
|
{ "<leader>rn", ":lua vim.lsp.buf.rename()<CR>" },
|
||||||
{ "L", ":lua vim.lsp.buf.hover()<CR>" },
|
{ "L", ":lua vim.lsp.buf.hover()<CR>" },
|
||||||
{ "gr", ":Telescope lsp_references<CR>" },
|
{ "gr", ":Telescope lsp_references<CR>" },
|
||||||
@ -86,41 +97,44 @@ return {
|
|||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
local lsp_configs = require("lspconfig.configs")
|
local lsp_configs = require("lspconfig.configs")
|
||||||
|
|
||||||
lsp_configs.ciderlsp = {
|
lsp_configs.ciderlsp = {
|
||||||
default_config = {
|
default_config = {
|
||||||
cmd = {
|
cmd = {
|
||||||
"/google/bin/releases/cider/ciderlsp/ciderlsp",
|
"/google/bin/releases/cider/ciderlsp/ciderlsp",
|
||||||
"--tooltag=nvim-lsp",
|
"--tooltag=nvim-lsp",
|
||||||
"--noforward_sync_responses",
|
"--noforward_sync_responses",
|
||||||
},
|
},
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"c",
|
"c",
|
||||||
"cpp",
|
"cpp",
|
||||||
"java",
|
"java",
|
||||||
"kotlin",
|
"kotlin",
|
||||||
"objc",
|
"objc",
|
||||||
"proto",
|
"proto",
|
||||||
"textproto",
|
"textproto",
|
||||||
"go",
|
"go",
|
||||||
"python",
|
"python",
|
||||||
"bzl",
|
"bzl",
|
||||||
"typescript",
|
"typescript",
|
||||||
},
|
},
|
||||||
offset_encoding = "utf-8",
|
offset_encoding = "utf-8",
|
||||||
root_dir = lspconfig.util.root_pattern(".citc"),
|
root_dir = lspconfig.util.root_pattern(".citc"),
|
||||||
settings = {},
|
settings = {},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if use_google() then
|
if use_google() then
|
||||||
lspconfig.ciderlsp.setup({})
|
lspconfig.ciderlsp.setup({})
|
||||||
end
|
end
|
||||||
|
|
||||||
require("lspconfig").gdscript.setup({})
|
lspconfig.gdscript.setup({})
|
||||||
vim.cmd([[autocmd FileType gdscript setlocal commentstring=#\ %s]])
|
-- require('lspconfig').gdscript.setup { cmd = { "ncat", "localhost", "6005" }, root_dir = function()
|
||||||
vim.cmd([[autocmd FileType gdscript setlocal autoindent noexpandtab tabstop=4 shiftwidth=4]])
|
-- return vim.fs.dirname(vim.fs.find('project.godot', { upward = true })[1])
|
||||||
|
-- end
|
||||||
|
-- }
|
||||||
|
|
||||||
require("lspconfig").gdshader_lsp.setup({})
|
vim.cmd([[autocmd FileType gdscript setlocal commentstring=#\ %s]])
|
||||||
end,
|
vim.cmd([[autocmd FileType gdscript setlocal autoindent noexpandtab tabstop=4 shiftwidth=4 wrap]])
|
||||||
},
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
44
vim/.vim/lua/plugins/minuet.lua
Normal file
44
vim/.vim/lua/plugins/minuet.lua
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
return {
|
||||||
|
'milanglacier/minuet-ai.nvim',
|
||||||
|
config = function()
|
||||||
|
require('minuet').setup {
|
||||||
|
provider = 'gemini',
|
||||||
|
provider_options = {
|
||||||
|
gemini = {
|
||||||
|
optional = {
|
||||||
|
generationConfig = {
|
||||||
|
maxOutputTokens = 256,
|
||||||
|
},
|
||||||
|
safetySettings = {
|
||||||
|
{
|
||||||
|
-- HARM_CATEGORY_HATE_SPEECH,
|
||||||
|
-- HARM_CATEGORY_HARASSMENT
|
||||||
|
-- HARM_CATEGORY_SEXUALLY_EXPLICIT
|
||||||
|
category = 'HARM_CATEGORY_DANGEROUS_CONTENT',
|
||||||
|
-- BLOCK_NONE
|
||||||
|
threshold = 'BLOCK_ONLY_HIGH',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
virtualtext = {
|
||||||
|
auto_trigger_ft = {},
|
||||||
|
keymap = {
|
||||||
|
-- accept whole completion
|
||||||
|
accept = '<A-A>',
|
||||||
|
-- accept one line
|
||||||
|
accept_line = '<A-a>',
|
||||||
|
-- accept n lines (prompts for number)
|
||||||
|
-- e.g. "A-z 2 CR" will accept 2 lines
|
||||||
|
accept_n_lines = '<A-z>',
|
||||||
|
-- Cycle to prev completion item, or manually invoke completion
|
||||||
|
prev = '<A-[>',
|
||||||
|
-- Cycle to next completion item, or manually invoke completion
|
||||||
|
next = '<A-]>',
|
||||||
|
dismiss = '<A-e>',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
@ -1,52 +1,57 @@
|
|||||||
local use_google = require("utils").use_google
|
local use_google = require("utils").use_google
|
||||||
|
|
||||||
return {
|
return {
|
||||||
-- {
|
-- {
|
||||||
-- "cmdtree",
|
-- "cmdtree",
|
||||||
-- dir = "~/cmdtree",
|
-- dir = "~/cmdtree",
|
||||||
-- },
|
-- },
|
||||||
{
|
{
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
dependencies = {
|
branch = "v3.x",
|
||||||
"nvim-lua/plenary.nvim",
|
lazy = false, -- neo-tree will lazily load itself
|
||||||
"MunifTanjim/nui.nvim",
|
dependencies = {
|
||||||
-- "~/cmdtree",
|
"nvim-lua/plenary.nvim",
|
||||||
},
|
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||||
cmd = {
|
"MunifTanjim/nui.nvim",
|
||||||
"Neotree",
|
-- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||||
},
|
},
|
||||||
config = function()
|
-----@module "neo-tree"
|
||||||
require("neo-tree").setup({
|
-----@type neotree.Config
|
||||||
hijack_netrw_behavior = "open_default",
|
opts = {
|
||||||
filesystem = {
|
filesystem = {
|
||||||
filtered_items = {
|
hijack_netrw_behavior = "open_default",
|
||||||
hide_dotfiles = false,
|
filtered_items = {
|
||||||
},
|
hide_dotfiles = false,
|
||||||
bind_to_cwd = false,
|
},
|
||||||
},
|
-- follow_current_file = {
|
||||||
sources = {
|
-- enabled = true,
|
||||||
"filesystem",
|
-- leave_dirs_open = false,
|
||||||
"buffers",
|
-- },
|
||||||
"git_status",
|
group_empty_dirs = true,
|
||||||
--"cmdtree",
|
},
|
||||||
-- ...and any additional source
|
sources = {
|
||||||
},
|
"filesystem",
|
||||||
window = {
|
"buffers",
|
||||||
mappings = {
|
"git_status",
|
||||||
["O"] = "expand_all_nodes",
|
--"cmdtree",
|
||||||
},
|
-- ...and any additional source
|
||||||
},
|
},
|
||||||
})
|
window = {
|
||||||
end,
|
mappings = {
|
||||||
|
["O"] = "expand_all_nodes",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
(function()
|
(function()
|
||||||
if use_google() then
|
-- if use_google() then
|
||||||
return { "<C-n>m", ":Neotree float cmdtree<CR>", desc = "Open NeoTree CWD float" }
|
-- return { "<C-n>m", ":Neotree float cmdtree<CR>", desc = "Open NeoTree CWD float" }
|
||||||
end
|
-- end
|
||||||
return { "<C-n>m", ":Neotree float git_status<CR>", desc = "Open NeoTree CWD float" }
|
return { "<C-n>m", ":Neotree float git_status<CR>", desc = "Open NeoTree CWD float" }
|
||||||
end)(),
|
end)(),
|
||||||
{ "<C-n>", ":Neotree toggle left dir=%:p:h<cr>" },
|
{ "<C-n>", ":Neotree reveal left<cr>" },
|
||||||
|
{ "<C-n>.", ":Neotree reveal left dir=%:p:h<cr>" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,58 +1,61 @@
|
|||||||
local use_google = require("utils").use_google
|
local use_google = require("utils").use_google
|
||||||
|
|
||||||
local function setup_mercurial(hg_revision)
|
local function change_diffbase(hg_revision, git_revision)
|
||||||
local git_cmd = "git diff --no-color --no-ext-diff -U0 -- %f"
|
vim.g.signify_vcs_cmds = {
|
||||||
local rcs_cmd = "rcsdiff -U0 %f 2>%n"
|
git = "git diff --no-color --diff-algorithm=histogram --no-ext-diff -U0 " .. git_revision .. " -- %f",
|
||||||
local svn_cmd = "svn diff --diff-cmd %d -x -U0 -- %f"
|
yadm = 'yadm diff --no-color --no-ext-diff -U0 -- %f',
|
||||||
local hg_diff = hg_revision .. " --color=never config aliases.diff= --nodates -U0 -- %f"
|
hg = 'chg --config alias.diff=diff diff '.. hg_revision .. ' --color=never --nodates -U0 -- %f',
|
||||||
local hg_cat = hg_revision .. " -- %f"
|
svn = 'svn diff --diff-cmd %d -x -U0 -- %f',
|
||||||
|
bzr = 'bzr diff --using %d --diff-options=-U0 -- %f',
|
||||||
vim.cmd(string.format(
|
darcs = 'darcs diff --no-pause-for-gui --no-unified --diff-opts=-U0 -- %f',
|
||||||
[[
|
fossil = 'fossil diff --unified -c 0 -- %f',
|
||||||
let g:signify_vcs_cmds = {
|
cvs = 'cvs diff -U0 -- %f',
|
||||||
\ 'git': '%s',
|
rcs = 'rcsdiff -U0 %f 2>%n',
|
||||||
\ 'rcs': '%s',
|
accurev = 'accurev diff %f -- -U0',
|
||||||
\ 'svn': '%s',
|
tfs = 'tf diff -version=W -noprompt -format=Unified %f'
|
||||||
\ 'hg': 'chg diff %s',
|
}
|
||||||
\ }
|
vim.g.signify_vcs_cmds_diffmode = {
|
||||||
let g:signify_vcs_cmds_diffmode = {
|
git = "git show " .. git_revision .. ":./%f",
|
||||||
\ 'hg': 'chg cat %s',
|
hg = "chg cat " .. hg_revision .. " -- %f",
|
||||||
\ }
|
yadm = 'yadm show HEAD:./%f',
|
||||||
]],
|
svn = 'svn cat %f',
|
||||||
git_cmd,
|
bzr = 'bzr cat %f',
|
||||||
rcs_cmd,
|
darcs = 'darcs show contents -- %f',
|
||||||
svn_cmd,
|
fossil = 'fossil cat %f',
|
||||||
hg_diff,
|
cvs = 'cvs up -p -- %f 2>%n',
|
||||||
hg_cat
|
rcs = 'co -q -p %f',
|
||||||
))
|
accurev = 'accurev cat %f',
|
||||||
|
perforce = 'p4 print %f',
|
||||||
|
tfs = 'tf view -version:W -noprompt %f',
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.signify_dtup = function()
|
_G.signify_dtup = function()
|
||||||
setup_mercurial('-r ".^"')
|
change_diffbase('-r ".^"', 'HEAD^')
|
||||||
vim.cmd([[:SignifyEnable]])
|
vim.cmd([[:SignifyEnable]])
|
||||||
vim.cmd([[:SignifyRefresh]])
|
vim.cmd([[:SignifyRefresh]])
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.signify_normal = function()
|
_G.signify_normal = function()
|
||||||
setup_mercurial("-r .")
|
change_diffbase("-r .", "")
|
||||||
vim.cmd([[:SignifyEnable]])
|
vim.cmd([[:SignifyEnable]])
|
||||||
vim.cmd([[:SignifyRefresh]])
|
vim.cmd([[:SignifyRefresh]])
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.signify_dtp4 = function()
|
_G.signify_dtp4 = function()
|
||||||
setup_mercurial("-r p4head")
|
change_diffbase("-r p4head", "main")
|
||||||
vim.cmd([[:SignifyEnable]])
|
vim.cmd([[:SignifyEnable]])
|
||||||
vim.cmd([[:SignifyRefresh]])
|
vim.cmd([[:SignifyRefresh]])
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.signify_dtex = function()
|
_G.signify_dtex = function()
|
||||||
setup_mercurial("-r exported(.)")
|
change_diffbase("-r exported(.)", "origin/main")
|
||||||
vim.cmd([[:SignifyEnable]])
|
vim.cmd([[:SignifyEnable]])
|
||||||
vim.cmd([[:SignifyRefresh]])
|
vim.cmd([[:SignifyRefresh]])
|
||||||
end
|
end
|
||||||
return {
|
return {
|
||||||
"mhinz/vim-signify",
|
"mhinz/vim-signify",
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ "]d", "<plug>(signify-next-hunk)" },
|
{ "]d", "<plug>(signify-next-hunk)" },
|
||||||
@ -62,23 +65,24 @@ return {
|
|||||||
{ "<leader>sup", ":lua signify_dtup()<CR>" },
|
{ "<leader>sup", ":lua signify_dtup()<CR>" },
|
||||||
{ "<leader>sex", ":lua signify_dtex()<CR>" },
|
{ "<leader>sex", ":lua signify_dtex()<CR>" },
|
||||||
{ "<leader>sp4", ":lua signify_dtp4()<CR>" },
|
{ "<leader>sp4", ":lua signify_dtp4()<CR>" },
|
||||||
|
{ "<leader>sb", ":lua signify_dtp4()<CR>" },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.signify_vcs_list = { "hg", "git" }
|
vim.g.signify_vcs_list = { "hg", "git" }
|
||||||
vim.g.signify_disable_by_default = 0
|
vim.g.signify_disable_by_default = 0
|
||||||
-- vim.g.signify_number_highlight = 1
|
-- vim.g.signify_number_highlight = 1
|
||||||
vim.g.signify_sign_show_count = 0
|
vim.g.signify_sign_show_count = 0
|
||||||
local s = "▕"
|
local s = "▕"
|
||||||
vim.g.signify_sign_add = s
|
vim.g.signify_sign_add = s
|
||||||
vim.g.signify_sign_delete = s
|
vim.g.signify_sign_delete = s
|
||||||
vim.g.signify_sign_change = s
|
vim.g.signify_sign_change = s
|
||||||
vim.api.nvim_set_hl(0, "SignifySignAdd", { fg = "#9cd9b8" })
|
vim.api.nvim_set_hl(0, "SignifySignAdd", { fg = "#9cd9b8" })
|
||||||
vim.api.nvim_set_hl(0, "SignifySignChange", { fg = "#849ee3" })
|
vim.api.nvim_set_hl(0, "SignifySignChange", { fg = "#849ee3" })
|
||||||
|
|
||||||
local myred = "#f296a0"
|
local myred = "#f296a0"
|
||||||
vim.api.nvim_set_hl(0, "SignifySignChangeDelete", { fg = myred })
|
vim.api.nvim_set_hl(0, "SignifySignChangeDelete", { fg = myred })
|
||||||
vim.api.nvim_set_hl(0, "SignifySignDelete", { fg = myred })
|
vim.api.nvim_set_hl(0, "SignifySignDelete", { fg = myred })
|
||||||
vim.api.nvim_set_hl(0, "SignifyLineDelete", { fg = myred })
|
vim.api.nvim_set_hl(0, "SignifyLineDelete", { fg = myred })
|
||||||
vim.api.nvim_set_hl(0, "SignifySignDeleteDeleteFirstLine", { fg = myred })
|
vim.api.nvim_set_hl(0, "SignifySignDeleteDeleteFirstLine", { fg = myred })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -196,6 +196,18 @@ return {
|
|||||||
codesearch = {
|
codesearch = {
|
||||||
experimental = true, -- enable results from google3/experimental
|
experimental = true, -- enable results from google3/experimental
|
||||||
},
|
},
|
||||||
|
live_grep_args = {
|
||||||
|
auto_quoting = true, -- enable/disable auto-quoting
|
||||||
|
-- define mappings, e.g.
|
||||||
|
mappings = { -- extend mappings
|
||||||
|
i = {
|
||||||
|
["<C-k>"] = require("telescope-live-grep-args.actions").quote_prompt(),
|
||||||
|
["<C-i>"] = require("telescope-live-grep-args.actions").quote_prompt({ postfix = " --iglob " }),
|
||||||
|
-- freeze the current list and start a fuzzy search in the frozen list
|
||||||
|
["<C-.>"] = require("telescope-live-grep-args.actions").to_fuzzy_refine,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
recent_files = {
|
recent_files = {
|
||||||
-- This function rewrites all file paths to the current workspace.
|
-- This function rewrites all file paths to the current workspace.
|
||||||
-- For example, if w2 is the current workspace, then
|
-- For example, if w2 is the current workspace, then
|
||||||
|
@ -6,7 +6,7 @@ return {
|
|||||||
lazy = false,
|
lazy = false,
|
||||||
cond = not use_google(),
|
cond = not use_google(),
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
dir = "~/neovim-plugins/squk/ableton.nvim",
|
-- dir = "~/neovim-plugins/squk/ableton.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
variant = "cooler",
|
variant = "cooler",
|
||||||
},
|
},
|
||||||
|
@ -1,97 +1,93 @@
|
|||||||
local use_google = require("utils").use_google
|
local use_google = require("utils").use_google
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"ful1e5/onedark.nvim",
|
"ful1e5/onedark.nvim",
|
||||||
priority = 1000, -- make sure to load this before all the other start plugins
|
priority = 1000, -- make sure to load this before all the other start plugins
|
||||||
lazy = not use_google(), -- make sure we load this during startup if it is your main colorscheme
|
lazy = not use_google(), -- make sure we load this during startup if it is your main colorscheme
|
||||||
cond = use_google(),
|
cond = use_google(),
|
||||||
config = function()
|
config = function()
|
||||||
-- require("onedark").setup()
|
-- require("onedark").setup()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"catppuccin/nvim",
|
"catppuccin/nvim",
|
||||||
name = "catppuccin",
|
name = "catppuccin",
|
||||||
priority = 1000, -- make sure to load this before all the other start plugins
|
priority = 1000, -- make sure to load this before all the other start plugins
|
||||||
lazy = not use_google(), -- make sure we load this during startup if it is your main colorscheme
|
lazy = not use_google(), -- make sure we load this during startup if it is your main colorscheme
|
||||||
cond = use_google(),
|
cond = use_google(),
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.catppuccin_flavour = "macchiato" -- latte, frappe, macchiato, mocha
|
vim.g.catppuccin_flavour = "macchiato" -- latte, frappe, macchiato, mocha
|
||||||
local colors = require("catppuccin.palettes").get_palette()
|
local colors = require("catppuccin.palettes").get_palette()
|
||||||
|
|
||||||
require("catppuccin").setup({
|
require("catppuccin").setup({
|
||||||
flavour = "mocha",
|
flavour = "mocha",
|
||||||
integrations = {
|
integrations = {
|
||||||
cmp = true,
|
cmp = true,
|
||||||
-- coc_nvim = false,
|
-- coc_nvim = false,
|
||||||
dashboard = true,
|
dashboard = true,
|
||||||
-- fern = false,
|
-- fern = false,
|
||||||
fidget = true,
|
fidget = true,
|
||||||
gitgutter = true,
|
gitgutter = true,
|
||||||
gitsigns = true,
|
gitsigns = true,
|
||||||
-- hop = false,
|
-- hop = false,
|
||||||
illuminate = true,
|
illuminate = true,
|
||||||
-- leap = false,
|
leap = false,
|
||||||
-- lightspeed = false,
|
-- lightspeed = false,
|
||||||
-- lsp_saga = false,
|
-- lsp_saga = false,
|
||||||
lsp_trouble = true,
|
lsp_trouble = true,
|
||||||
illuminate = {
|
mason = true,
|
||||||
enabled = true,
|
markdown = true,
|
||||||
-- lsp = false
|
-- neogit = false,
|
||||||
},
|
-- neotest = false,
|
||||||
mason = true,
|
neotree = true,
|
||||||
markdown = true,
|
notify = true,
|
||||||
-- neogit = false,
|
nvimtree = true,
|
||||||
-- neotest = false,
|
-- overseer = false,
|
||||||
neotree = true,
|
-- pounce = false,
|
||||||
notify = true,
|
symbols_outline = true,
|
||||||
nvimtree = true,
|
telescope = true,
|
||||||
-- overseer = false,
|
treesitter = true,
|
||||||
-- pounce = false,
|
treesitter_context = true,
|
||||||
symbols_outline = true,
|
-- ts_rainbow = false,
|
||||||
telescope = true,
|
-- vim_sneak = false,
|
||||||
treesitter = true,
|
-- vimwiki = false,
|
||||||
treesitter_context = true,
|
which_key = true,
|
||||||
-- ts_rainbow = false,
|
-- Special integrations, see https://github.com/catppuccin/nvim#special-integrations
|
||||||
-- vim_sneak = false,
|
dap = true,
|
||||||
-- vimwiki = false,
|
dap_ui = true,
|
||||||
which_key = true,
|
indent_blankline = {
|
||||||
-- Special integrations, see https://github.com/catppuccin/nvim#special-integrations
|
enabled = true,
|
||||||
dap = true,
|
colored_indent_levels = false,
|
||||||
dap_ui = true,
|
},
|
||||||
indent_blankline = {
|
},
|
||||||
enabled = true,
|
native_lsp = {
|
||||||
colored_indent_levels = false,
|
enabled = true,
|
||||||
},
|
virtual_text = {
|
||||||
},
|
errors = { "italic" },
|
||||||
native_lsp = {
|
hints = { "italic" },
|
||||||
enabled = true,
|
warnings = { "italic" },
|
||||||
virtual_text = {
|
information = { "italic" },
|
||||||
errors = { "italic" },
|
},
|
||||||
hints = { "italic" },
|
underlines = {
|
||||||
warnings = { "italic" },
|
errors = { "underline" },
|
||||||
information = { "italic" },
|
hints = { "underline" },
|
||||||
},
|
warnings = { "underline" },
|
||||||
underlines = {
|
information = { "underline" },
|
||||||
errors = { "underline" },
|
},
|
||||||
hints = { "underline" },
|
inlay_hints = {
|
||||||
warnings = { "underline" },
|
background = true,
|
||||||
information = { "underline" },
|
},
|
||||||
},
|
},
|
||||||
inlay_hints = {
|
custom_highlights = {
|
||||||
background = true,
|
-- Identifier = { fg = colors.lavender },
|
||||||
},
|
-- Statement = { fg = colors.rosewater },
|
||||||
},
|
-- Identifier = { fg = colors.sapphire },
|
||||||
custom_highlights = {
|
-- Function = { fg = colors.mauve },
|
||||||
-- Identifier = { fg = colors.lavender },
|
},
|
||||||
-- Statement = { fg = colors.rosewater },
|
})
|
||||||
-- Identifier = { fg = colors.sapphire },
|
|
||||||
-- Function = { fg = colors.mauve },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_command("colorscheme catppuccin")
|
vim.api.nvim_command("colorscheme catppuccin")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -40,48 +40,6 @@ function M.file_exists(name)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.dump(o)
|
|
||||||
if type(o) == "table" then
|
|
||||||
local s = "{ "
|
|
||||||
for k, v in pairs(o) do
|
|
||||||
if type(k) ~= "number" then
|
|
||||||
k = '"' .. k .. '"'
|
|
||||||
end
|
|
||||||
s = s .. "[" .. k .. "] = " .. M.dump(v) .. ","
|
|
||||||
end
|
|
||||||
return s .. "} "
|
|
||||||
else
|
|
||||||
return tostring(o)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function M.tprint(tbl, indent)
|
|
||||||
if not indent then
|
|
||||||
indent = 0
|
|
||||||
end
|
|
||||||
local toprint = string.rep(" ", indent) .. "{\r\n"
|
|
||||||
indent = indent + 2
|
|
||||||
for k, v in pairs(tbl) do
|
|
||||||
toprint = toprint .. string.rep(" ", indent)
|
|
||||||
if type(k) == "number" then
|
|
||||||
toprint = toprint .. "[" .. k .. "] = "
|
|
||||||
elseif type(k) == "string" then
|
|
||||||
toprint = toprint .. k .. "= "
|
|
||||||
end
|
|
||||||
if type(v) == "number" then
|
|
||||||
toprint = toprint .. v .. ",\r\n"
|
|
||||||
elseif type(v) == "string" then
|
|
||||||
toprint = toprint .. '"' .. v .. '",\r\n'
|
|
||||||
elseif type(v) == "table" then
|
|
||||||
toprint = toprint .. M.tprint(v, indent + 2) .. ",\r\n"
|
|
||||||
else
|
|
||||||
toprint = toprint .. '"' .. tostring(v) .. '",\r\n'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
toprint = toprint .. string.rep(" ", indent - 2) .. "}"
|
|
||||||
return toprint
|
|
||||||
end
|
|
||||||
|
|
||||||
function M.log(message)
|
function M.log(message)
|
||||||
local log_file_path = vim.fn.expand("$HOME/nvim.log")
|
local log_file_path = vim.fn.expand("$HOME/nvim.log")
|
||||||
local log_file = io.open(log_file_path, "a")
|
local log_file = io.open(log_file_path, "a")
|
||||||
@ -97,4 +55,6 @@ function M.TableConcat(t1, t2)
|
|||||||
return t1
|
return t1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
M.flags.blink = not M.use_google()
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -26,3 +26,5 @@ fi
|
|||||||
|
|
||||||
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
|
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
|
||||||
. "$HOME/.cargo/env"
|
. "$HOME/.cargo/env"
|
||||||
|
|
||||||
|
ulimit -n 10240
|
||||||
|
@ -5,8 +5,11 @@ export ABBR_QUIET=1
|
|||||||
# ---------------
|
# ---------------
|
||||||
export PATH=$PATH:/google/src/head/depot/google3/experimental/users/cnieves/util
|
export PATH=$PATH:/google/src/head/depot/google3/experimental/users/cnieves/util
|
||||||
export PATH="${HOME}/.config/lsp/lua-language-server/bin:${PATH}"
|
export PATH="${HOME}/.config/lsp/lua-language-server/bin:${PATH}"
|
||||||
export GOROOT=/usr/lib/google-golang
|
export PATH=$PATH:/${HOME}/nvim-linux-x86_64/bin/
|
||||||
export PATH=$GOROOT/bin:$PATH
|
export PATH=$GOROOT/bin:$PATH
|
||||||
|
|
||||||
|
export DUMMY_API_KEY="DUMMY_API_KEY"
|
||||||
|
export GOROOT=/usr/lib/google-golang
|
||||||
export JAVA_HOME=$(readlink -ne /usr/local/buildtools/java/jdk)
|
export JAVA_HOME=$(readlink -ne /usr/local/buildtools/java/jdk)
|
||||||
export CARGO_NET_GIT_FETCH_WITH_CLI=true
|
export CARGO_NET_GIT_FETCH_WITH_CLI=true
|
||||||
source ~/g3path.zsh
|
source ~/g3path.zsh
|
||||||
@ -147,6 +150,7 @@ alias bisect=/google/data/ro/teams/tetralight/bin/bisect
|
|||||||
alias copybara='/google/bin/releases/copybara/public/copybara/copybara'
|
alias copybara='/google/bin/releases/copybara/public/copybara/copybara'
|
||||||
alias allow_ptrace='/google/bin/releases/cider/dbg/allow_ptrace'
|
alias allow_ptrace='/google/bin/releases/cider/dbg/allow_ptrace'
|
||||||
alias bluze=/google/bin/releases/blueprint-bluze/public/bluze
|
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
|
source /google/bin/releases/gmscore-tools/cli/prod/setup_prod_gms.sh
|
||||||
|
|
||||||
abbr bq="blaze query"
|
abbr bq="blaze query"
|
||||||
|
@ -37,6 +37,7 @@ zplug "zsh-users/zsh-syntax-highlighting", defer:2
|
|||||||
zplug "mafredri/zsh-async", from:"github", use:"async.zsh"
|
zplug "mafredri/zsh-async", from:"github", use:"async.zsh"
|
||||||
zplug "zsh-users/zsh-autosuggestions"
|
zplug "zsh-users/zsh-autosuggestions"
|
||||||
zplug "zsh-users/zsh-history-substring-search"
|
zplug "zsh-users/zsh-history-substring-search"
|
||||||
|
zplug 'joshskidmore/zsh-fzf-history-search'
|
||||||
zplug "modules/command-not-found", from:prezto
|
zplug "modules/command-not-found", from:prezto
|
||||||
zplug "romkatv/powerlevel10k", as:theme, depth:1
|
zplug "romkatv/powerlevel10k", as:theme, depth:1
|
||||||
|
|
||||||
@ -77,7 +78,7 @@ fi
|
|||||||
|
|
||||||
zle -N fancy-ctrl-z
|
zle -N fancy-ctrl-z
|
||||||
bindkey '^Z' fancy-ctrl-z
|
bindkey '^Z' fancy-ctrl-z
|
||||||
bindkey '^R' fzf-history-widget
|
# bindkey '^R' fzf-history-widget
|
||||||
bindkey "^A" beginning-of-line
|
bindkey "^A" beginning-of-line
|
||||||
bindkey "^E" end-of-line
|
bindkey "^E" end-of-line
|
||||||
bindkey '\eK' kill-line
|
bindkey '\eK' kill-line
|
||||||
|
Reference in New Issue
Block a user