Compare commits
17 Commits
d06b8c1693
...
196c9d1a3b
Author | SHA1 | Date | |
---|---|---|---|
196c9d1a3b | |||
9988bd13b2 | |||
0300264961 | |||
1bbcef640d | |||
5e739703d0 | |||
d0b81f87cb | |||
f815679d89 | |||
513dfe695f | |||
c869fbd48a | |||
6f857496c0 | |||
3ea53a113f | |||
fe2fed17ed | |||
3ae68d6e0b | |||
7942d2083c | |||
664c555107 | |||
9ceca10f72 | |||
b016ad5d56 |
@ -13,18 +13,24 @@ end
|
|||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
vim.opt.rtp:prepend(vim.env.HOME .. "/.vim")
|
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")
|
||||||
vim.opt.rtp:prepend(vim.env.HOME .. "/.vim/lua")
|
|
||||||
|
|
||||||
package.path = package.path .. ";" .. vim.env.HOME .. "/.vim/lua/?.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.clipboard")
|
||||||
require("config.tmpl")
|
require("config.tmpl")
|
||||||
require("config.zip")
|
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/"
|
vim.opt.undodir = vim.fn.expand("$HOME") .. "/.undo/"
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }
|
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }
|
||||||
}
|
}
|
||||||
|
11
config/.config/nvim/syntax/markdown.vim
Normal file
11
config/.config/nvim/syntax/markdown.vim
Normal 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
|
@ -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 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-z resize-pane -Z
|
||||||
|
|
||||||
bind -n M-j resize-pane -D 5
|
bind -n M-j resize-pane -D 5
|
||||||
|
@ -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
|
|
@ -1,18 +1,18 @@
|
|||||||
local use_google = require("utils").use_google
|
local use_google = require("utils").use_google
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"sindrets/diffview.nvim",
|
"sindrets/diffview.nvim",
|
||||||
--{ "mizlan/iswap.nvim", event = "VeryLazy" },
|
--{ "mizlan/iswap.nvim", event = "VeryLazy" },
|
||||||
{ "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" } },
|
{ "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" } },
|
||||||
{
|
{
|
||||||
"folke/flash.nvim",
|
"folke/flash.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
---@type Flash.Config
|
---@type Flash.Config
|
||||||
opts = {
|
opts = {
|
||||||
jump = {
|
jump = {
|
||||||
nohlsearch = true,
|
nohlsearch = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
|
{ "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" },
|
{ "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" },
|
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"MagicDuck/grug-far.nvim",
|
"MagicDuck/grug-far.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("grug-far").setup({
|
vim.g.maplocalleader = ","
|
||||||
-- search and replace engines configuration
|
require("grug-far").setup({
|
||||||
engines = {
|
-- search and replace engines configuration
|
||||||
-- see https://github.com/BurntSushi/ripgrep
|
engines = {
|
||||||
ripgrep = {
|
-- see https://github.com/BurntSushi/ripgrep
|
||||||
-- ripgrep executable to use, can be a different path if you need to configure
|
ripgrep = {
|
||||||
path = "rg",
|
-- ripgrep executable to use, can be a different path if you need to configure
|
||||||
extraArgs = "--.",
|
path = "rg",
|
||||||
},
|
-- extraArgs = "-.",
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
end,
|
})
|
||||||
},
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"shellRaining/hlchunk.nvim",
|
"shellRaining/hlchunk.nvim",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
opts = {
|
opts = {
|
||||||
line_num = { enable = true },
|
line_num = { enable = true },
|
||||||
chunk = {
|
chunk = {
|
||||||
enable = true,
|
enable = true,
|
||||||
priority = 15,
|
priority = 15,
|
||||||
style = {
|
style = {
|
||||||
{ fg = "#393d4c" },
|
{ fg = "#393d4c" },
|
||||||
},
|
},
|
||||||
chars = {
|
chars = {
|
||||||
horizontal_line = "─",
|
horizontal_line = "─",
|
||||||
-- vertical_line = "│",
|
-- vertical_line = "│",
|
||||||
vertical_line = "┊",
|
vertical_line = "┊",
|
||||||
left_top = "╭",
|
left_top = "╭",
|
||||||
left_bottom = "╰",
|
left_bottom = "╰",
|
||||||
right_arrow = ">",
|
right_arrow = ">",
|
||||||
},
|
},
|
||||||
use_treesitter = true,
|
use_treesitter = true,
|
||||||
textobject = "",
|
textobject = "",
|
||||||
max_file_size = 1024 * 1024,
|
max_file_size = 1024 * 1024,
|
||||||
error_sign = true,
|
error_sign = true,
|
||||||
-- animation related
|
-- animation related
|
||||||
duration = 0,
|
duration = 0,
|
||||||
delay = 0,
|
delay = 0,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
"RRethy/vim-illuminate",
|
||||||
"Bekaboo/dropbar.nvim",
|
"kdheepak/lazygit.nvim",
|
||||||
-- optional, but required for fuzzy finder support
|
"flwyd/vim-conjoin",
|
||||||
dependencies = {
|
"rafcamlet/nvim-luapad",
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
"vim-scripts/vcscommand.vim",
|
||||||
},
|
"AndrewRadev/tagalong.vim",
|
||||||
config = function()
|
"AndrewRadev/yankwin.vim",
|
||||||
vim.ui.select = require("dropbar.utils.menu").select
|
{ "squk/gdrama-syntax.vim", ft = "gdrama" },
|
||||||
end,
|
{ "nvim-lua/plenary.nvim", lazy = false },
|
||||||
},
|
{ "squk/java-syntax.vim", ft = "java" },
|
||||||
"RRethy/vim-illuminate",
|
{ "udalov/kotlin-vim", event = "VeryLazy", ft = "kotlin" },
|
||||||
"kdheepak/lazygit.nvim",
|
{ "andymass/vim-matchup", event = "VimEnter" },
|
||||||
"flwyd/vim-conjoin",
|
{ "jghauser/mkdir.nvim", event = "BufWritePre" },
|
||||||
"rafcamlet/nvim-luapad",
|
{
|
||||||
"vim-scripts/vcscommand.vim",
|
"rmagatti/auto-session",
|
||||||
"AndrewRadev/tagalong.vim",
|
dependencies = {
|
||||||
"AndrewRadev/yankwin.vim",
|
"nvim-telescope/telescope.nvim", -- Only needed if you want to use session lens
|
||||||
{ "squk/gdrama-syntax.vim", ft = "gdrama" },
|
},
|
||||||
{ "nvim-lua/plenary.nvim", lazy = false },
|
config = function()
|
||||||
{ "squk/java-syntax.vim", ft = "java" },
|
require("auto-session").setup({
|
||||||
{ "udalov/kotlin-vim", event = "VeryLazy", ft = "kotlin" },
|
auto_session_suppress_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
|
||||||
-- { "andymass/vim-matchup", event = "VimEnter" },
|
args_allow_single_directory = false,
|
||||||
{ "jghauser/mkdir.nvim", event = "BufWritePre" },
|
bypass_save_filetypes = { "netrw" },
|
||||||
{
|
})
|
||||||
"rmagatti/auto-session",
|
end,
|
||||||
dependencies = {
|
},
|
||||||
"nvim-telescope/telescope.nvim", -- Only needed if you want to use session lens
|
"tpope/vim-abolish",
|
||||||
},
|
{
|
||||||
config = function()
|
"johmsalas/text-case.nvim",
|
||||||
require("auto-session").setup({
|
dependencies = { "nvim-telescope/telescope.nvim" },
|
||||||
auto_session_suppress_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
|
config = function()
|
||||||
args_allow_single_directory = false,
|
require("textcase").setup({})
|
||||||
bypass_save_filetypes = { "netrw" },
|
require("telescope").load_extension("textcase")
|
||||||
})
|
end,
|
||||||
end,
|
cmd = {
|
||||||
},
|
"Subs",
|
||||||
"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
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>tc", "<cmd>TextCaseOpenTelescope<CR>", mode = { "n", "v" }, desc = "Telescope" },
|
{ "<leader>tc", "<cmd>TextCaseOpenTelescope<CR>", mode = { "n", "v" }, desc = "Telescope" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"NvChad/nvim-colorizer.lua",
|
"NvChad/nvim-colorizer.lua",
|
||||||
ft = "lua",
|
ft = "lua",
|
||||||
config = function()
|
config = function()
|
||||||
require("colorizer").setup()
|
require("colorizer").setup()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
||||||
"andweeb/presence.nvim",
|
"andweeb/presence.nvim",
|
||||||
cond = not use_google(),
|
cond = not use_google(),
|
||||||
config = function()
|
config = function()
|
||||||
require("presence").setup({
|
require("presence").setup({
|
||||||
main_image = "file",
|
main_image = "file",
|
||||||
show_time = false,
|
show_time = false,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ntpeters/vim-better-whitespace",
|
"ntpeters/vim-better-whitespace",
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.better_whitespace_filetypes_blacklist = { "dashboard" }
|
vim.g.better_whitespace_filetypes_blacklist = { "dashboard" }
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mbbill/undotree",
|
"mbbill/undotree",
|
||||||
cmd = "UndotreeToggle",
|
cmd = "UndotreeToggle",
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.undotree_SetFocusWhenToggle = 1
|
vim.g.undotree_SetFocusWhenToggle = 1
|
||||||
end,
|
end,
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = { { "<leader>ut", ":UndotreeToggle<CR>" } },
|
keys = { { "<leader>ut", ":UndotreeToggle<CR>" } },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"stevearc/aerial.nvim",
|
"stevearc/aerial.nvim",
|
||||||
opts = {},
|
opts = {},
|
||||||
cmd = { "AerialToggle", "AerialOn" },
|
cmd = { "AerialToggle", "AerialOn" },
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = { { "<leader>so", ":AerialToggle<CR>", desc = "[S]symbols [O]utline" } },
|
keys = { { "<leader>so", ":AerialToggle<CR>", desc = "[S]symbols [O]utline" } },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"andrewferrier/debugprint.nvim",
|
"andrewferrier/debugprint.nvim",
|
||||||
opts = {},
|
opts = {},
|
||||||
-- Dependency only needed for NeoVim 0.8
|
-- Dependency only needed for NeoVim 0.8
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
},
|
},
|
||||||
-- Remove the following line to use development versions,
|
-- Remove the following line to use development versions,
|
||||||
-- not just the formal releases
|
-- not just the formal releases
|
||||||
version = "*",
|
version = "*",
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>dp", ":lua require('debugprint').debugprint()<cr>", desc = "Debug print" },
|
{ "<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})<cr>", desc = "Debug print" },
|
||||||
{ "<leader>dQ", ":lua require('debugprint').debugprint({variable = true, above = true})<cr>", desc = "Debug print", },
|
{ "<leader>dQ", ":lua require('debugprint').debugprint({variable = true, above = true})<cr>", desc = "Debug print", },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
17
vim/.vim/lua/plugins/bevy.lua
Normal file
17
vim/.vim/lua/plugins/bevy.lua
Normal 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", },
|
||||||
|
},
|
||||||
|
}
|
@ -2,117 +2,152 @@ local use_google = require("utils").use_google
|
|||||||
local flags = require("utils").flags
|
local flags = require("utils").flags
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"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
|
||||||
version = "*",
|
version = "*",
|
||||||
-- lazy.nvim will automatically load the plugin when it's required by blink.cmp
|
-- lazy.nvim will automatically load the plugin when it's required by blink.cmp
|
||||||
lazy = true,
|
lazy = true,
|
||||||
-- make sure to set opts so that lazy.nvim calls blink.compat's setup
|
cond = flags.blink,
|
||||||
opts = {},
|
-- make sure to set opts so that lazy.nvim calls blink.compat's setup
|
||||||
cond = flags.blink,
|
opts = {
|
||||||
},
|
impersonate_nvim_cmp = true,
|
||||||
{
|
debug = true,
|
||||||
"saghen/blink.cmp",
|
},
|
||||||
lazy = false, -- lazy loading handled internally
|
},
|
||||||
cond = flags.blink,
|
{
|
||||||
dependencies = {
|
"saghen/blink.cmp",
|
||||||
"Exafunction/codeium.nvim",
|
lazy = false, -- lazy loading handled internally
|
||||||
"mikavilpas/blink-ripgrep.nvim",
|
cond = flags.blink,
|
||||||
"hrsh7th/cmp-cmdline",
|
dependencies = {
|
||||||
-- "FelipeLema/cmp-async-path",
|
"Exafunction/codeium.nvim",
|
||||||
"chrisgrieser/cmp-nerdfont",
|
"chrisgrieser/cmp-nerdfont",
|
||||||
"hrsh7th/cmp-emoji",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
"rafamadriz/friendly-snippets", -- optional: provides snippets for the snippet source
|
"mikavilpas/blink-ripgrep.nvim",
|
||||||
},
|
"moyiz/blink-emoji.nvim",
|
||||||
version = "v0.*", -- use a release tag to download pre-built binaries
|
"rafamadriz/friendly-snippets", -- optional: provides snippets for the snippet source
|
||||||
-- build = 'cargo build --release',
|
"saghen/blink.compat",
|
||||||
|
},
|
||||||
|
version = "v0.*", -- use a release tag to download pre-built binaries
|
||||||
|
-- build = 'cargo build --release',
|
||||||
|
|
||||||
---@module 'blink.cmp'
|
---@module 'blink.cmp'
|
||||||
---@type blink.cmp.Config
|
---@type blink.cmp.Config
|
||||||
opts = {
|
opts = {
|
||||||
keymap = {
|
-- stylua: ignore
|
||||||
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
|
keymap = {
|
||||||
["<C-e>"] = { "hide", "fallback" },
|
preset = "none",
|
||||||
["<CR>"] = { "accept", "fallback" },
|
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
|
||||||
|
["<C-e>"] = { "hide", "fallback" },
|
||||||
|
["<CR>"] = { "accept", "fallback" },
|
||||||
|
|
||||||
["<Tab>"] = { "select_next", "snippet_forward", "accept", "fallback" },
|
["<Tab>"] = { "select_next", "snippet_forward", "accept", "fallback" },
|
||||||
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
|
["<S-Tab>"] = { "select_prev", "snippet_backward", "fallback" },
|
||||||
|
|
||||||
["<Up>"] = { "select_prev", "fallback" },
|
["<Up>"] = { "select_prev", "fallback" },
|
||||||
["<Down>"] = { "select_next", "fallback" },
|
["<Down>"] = { "select_next", "fallback" },
|
||||||
|
|
||||||
["<S-Up>"] = { "scroll_documentation_up", "fallback" },
|
["<S-Up>"] = { "scroll_documentation_up", "fallback" },
|
||||||
["<S-Down>"] = { "scroll_documentation_down", "fallback" },
|
["<S-Down>"] = { "scroll_documentation_down", "fallback" },
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
default = function(ctx)
|
default = function(ctx)
|
||||||
local providerToEnable = {
|
local providerToEnable = {
|
||||||
"lsp",
|
"lsp",
|
||||||
"path",
|
"path",
|
||||||
"crates",
|
"snippets",
|
||||||
"snippets",
|
"ripgrep",
|
||||||
"ripgrep",
|
"emoji",
|
||||||
"emoji",
|
"nerdfont",
|
||||||
"nerdfont",
|
"buffer",
|
||||||
"buffer",
|
}
|
||||||
}
|
if use_google() then
|
||||||
print(vim.inspect(providerToEnable))
|
table.insert(providerToEnable, "nvim_ciderlsp")
|
||||||
if use_google() then
|
table.insert(providerToEnable, "buganizer")
|
||||||
table.insert(providerToEnable, "nvim_ciderlsp")
|
else
|
||||||
table.insert(providerToEnable, "buganizer")
|
table.insert(providerToEnable, "codeium")
|
||||||
else
|
end
|
||||||
table.insert(providerToEnable, "codeium")
|
return providerToEnable
|
||||||
end
|
end,
|
||||||
return providerToEnable
|
-- default = { "lsp" },
|
||||||
end,
|
providers = {
|
||||||
},
|
lsp = { name = "LSP", module = "blink.cmp.sources.lsp", score_offset = 90 },
|
||||||
providers = {
|
-- dont show LuaLS require statements when lazydev has items
|
||||||
-- dont show LuaLS require statements when lazydev has items
|
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink", fallbacks = { "lsp" } },
|
||||||
lsp = { fallback_for = { "lazydev" } },
|
ripgrep = {
|
||||||
lazydev = { name = "LazyDev", module = "lazydev.integrations.blink" },
|
module = "blink-ripgrep",
|
||||||
ripgrep = {
|
name = "Ripgrep",
|
||||||
module = "blink-ripgrep",
|
-- the options below are optional, some default values are shown
|
||||||
name = "Ripgrep",
|
---@module "blink-ripgrep"
|
||||||
-- the options below are optional, some default values are shown
|
---@type blink-ripgrep.Options
|
||||||
---@module "blink-ripgrep"
|
opts = {
|
||||||
---@type blink-ripgrep.Options
|
prefix_min_len = 3,
|
||||||
opts = {
|
context_size = 5,
|
||||||
prefix_min_len = 3,
|
max_filesize = "1M",
|
||||||
context_size = 5,
|
additional_rg_options = {},
|
||||||
max_filesize = "1M",
|
},
|
||||||
additional_rg_options = {},
|
},
|
||||||
},
|
-- https://github.com/moyiz/blink-emoji.nvim
|
||||||
},
|
emoji = {
|
||||||
nvim_ciderlsp = {
|
module = "blink-emoji",
|
||||||
name = "nvim_ciderlsp",
|
name = "Emoji",
|
||||||
module = "blink.compat.source",
|
score_offset = 15, -- the higher the number, the higher the priority
|
||||||
},
|
opts = { insert = true }, -- Insert emoji (default) or complete its name
|
||||||
buganizer = {
|
},
|
||||||
name = "nvim_buganizer",
|
buffer = {
|
||||||
module = "blink.compat.source",
|
name = "Buffer",
|
||||||
},
|
enabled = true,
|
||||||
codeium = {
|
max_items = 3,
|
||||||
name = "codeium",
|
module = "blink.cmp.sources.buffer",
|
||||||
module = "blink.compat.source",
|
min_keyword_length = 4,
|
||||||
},
|
score_offset = 15, -- the higher the number, the higher the priority
|
||||||
},
|
},
|
||||||
-- experimental signature help support
|
-- compat sources
|
||||||
signature = { enabled = true },
|
nerdfont = {
|
||||||
completion = {
|
name = "nerdfont",
|
||||||
trigger = {
|
module = "blink.compat.source",
|
||||||
show_on_x_blocked_trigger_characters = { "'", '"', "(", "{" },
|
},
|
||||||
},
|
codeium = {
|
||||||
menu = {
|
name = "codeium",
|
||||||
draw = {
|
module = "blink.compat.source",
|
||||||
-- columns = { { "label", "label_description", gap = 1 }, { "kind_icon", "kind" } },
|
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
|
-- allows extending the providers array elsewhere in your config
|
||||||
-- without having to redefine it
|
-- without having to redefine it
|
||||||
opts_extend = { "sources.default" },
|
opts_extend = { "sources.default" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,42 +1,72 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"akinsho/bufferline.nvim",
|
"akinsho/bufferline.nvim",
|
||||||
version = "*",
|
version = "*",
|
||||||
dependencies = "nvim-tree/nvim-web-devicons",
|
cond = false,
|
||||||
config = function()
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
vim.opt.termguicolors = true
|
opts = {
|
||||||
require("bufferline").setup({
|
options = {
|
||||||
options = {
|
hover = {
|
||||||
hover = {
|
enabled = true,
|
||||||
enabled = true,
|
delay = 200,
|
||||||
delay = 200,
|
reveal = { "close" },
|
||||||
reveal = { "close" },
|
},
|
||||||
},
|
indicator = {
|
||||||
indicator = {
|
-- icon = "▎", -- this should be omitted if indicator style is not 'icon'
|
||||||
-- icon = "▎", -- this should be omitted if indicator style is not 'icon'
|
style = "icon", -- | 'underline' | 'none',
|
||||||
style = "icon", -- | 'underline' | 'none',
|
},
|
||||||
},
|
offsets = {
|
||||||
offsets = {
|
{
|
||||||
{
|
filetype = "NvimTree",
|
||||||
filetype = "NvimTree",
|
text = "File Explorer",
|
||||||
text = "File Explorer",
|
highlight = "Directory",
|
||||||
highlight = "Directory",
|
separator = true, -- use a "true" to enable the default, or set your own character
|
||||||
separator = true, -- use a "true" to enable the default, or set your own character
|
},
|
||||||
},
|
},
|
||||||
},
|
-- mode = "tabs",
|
||||||
mode = "tabs",
|
diagnostics = "nvim_lsp",
|
||||||
diagnostics = "nvim_lsp",
|
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
local symbols = { error = " ", warning = " ", info = " ", hint = " " }
|
||||||
local symbols = { error = " ", warning = " ", info = " ", hint = " " }
|
local icon = symbols[level] or level
|
||||||
local icon = symbols[level] or level
|
return "" .. icon .. count
|
||||||
return "" .. icon .. count
|
end,
|
||||||
end,
|
max_name_length = 30,
|
||||||
max_name_length = 30,
|
truncate_name = false,
|
||||||
truncate_name = false,
|
show_close_icon = false,
|
||||||
show_close_icon = false,
|
show_buffer_close_icons = 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
|
||||||
end,
|
},
|
||||||
},
|
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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@ -2,76 +2,76 @@ local use_google = require("utils").use_google
|
|||||||
|
|
||||||
vim.g.disable_autoformat = false
|
vim.g.disable_autoformat = false
|
||||||
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
vim.api.nvim_create_user_command("FormatDisable", function(args)
|
||||||
if args.bang then
|
if args.bang then
|
||||||
-- FormatDisable! will disable formatting just for this buffer
|
-- FormatDisable! will disable formatting just for this buffer
|
||||||
vim.b.disable_autoformat = true
|
vim.b.disable_autoformat = true
|
||||||
else
|
else
|
||||||
vim.g.disable_autoformat = true
|
vim.g.disable_autoformat = true
|
||||||
end
|
end
|
||||||
end, {
|
end, {
|
||||||
desc = "Disable autoformat-on-save",
|
desc = "Disable autoformat-on-save",
|
||||||
bang = true,
|
bang = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("FormatEnable", function()
|
vim.api.nvim_create_user_command("FormatEnable", function()
|
||||||
vim.b.disable_autoformat = false
|
vim.b.disable_autoformat = false
|
||||||
vim.g.disable_autoformat = false
|
vim.g.disable_autoformat = false
|
||||||
end, {
|
end, {
|
||||||
desc = "Re-enable autoformat-on-save",
|
desc = "Re-enable autoformat-on-save",
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
if vim.g.disable_autoformat or vim.b[args.buf].disable_autoformat then
|
if vim.g.disable_autoformat or vim.b[args.buf].disable_autoformat then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
require("conform").format({ bufnr = args.buf })
|
require("conform").format({ bufnr = args.buf })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
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", },
|
||||||
},
|
},
|
||||||
-- This will provide type hinting with LuaLS
|
-- This will provide type hinting with LuaLS
|
||||||
---@module "conform"
|
---@module "conform"
|
||||||
---@type conform.setupOpts
|
---@type conform.setupOpts
|
||||||
opts = {
|
opts = {
|
||||||
log_level = vim.log.levels.DEBUG,
|
log_level = vim.log.levels.DEBUG,
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
|
|
||||||
rust = { "rustfmt", lsp_format = "fallback" },
|
rust = { "rustfmt", lsp_format = "fallback" },
|
||||||
-- Conform will run multiple formatters sequentially
|
-- Conform will run multiple formatters sequentially
|
||||||
-- go = { "goimports", "gofmt" },
|
-- go = { "goimports", "gofmt" },
|
||||||
-- Use a sub-list to run only the first available formatter
|
-- Use a sub-list to run only the first available formatter
|
||||||
-- javascript = { { "prettierd", "prettier" } },
|
-- javascript = { { "prettierd", "prettier" } },
|
||||||
lua = { "stylua" },
|
lua = { "stylua" },
|
||||||
-- Conform will run multiple formatters sequentially
|
-- Conform will run multiple formatters sequentially
|
||||||
python = { "isort", "black" },
|
python = { "isort", "black" },
|
||||||
-- Use a sub-list to run only the first available formatter
|
-- Use a sub-list to run only the first available formatter
|
||||||
javascript = { { "prettierd", "prettier" } },
|
javascript = { { "prettierd", "prettier" } },
|
||||||
gdscript = { "gdformat" },
|
gdscript = { "gdformat" },
|
||||||
dashboard = {},
|
dashboard = {},
|
||||||
-- Use the "*" filetype to run formatters on all filetypes.
|
-- Use the "*" filetype to run formatters on all filetypes.
|
||||||
["*"] = { "codespell" },
|
-- ["*"] = { "codespell" },
|
||||||
-- Use the "_" filetype to run formatters on filetypes that don't
|
-- Use the "_" filetype to run formatters on filetypes that don't
|
||||||
-- have other formatters configured.
|
-- have other formatters configured.
|
||||||
["_"] = { "trim_whitespace" },
|
["_"] = { "trim_whitespace" },
|
||||||
},
|
},
|
||||||
format_on_save = function(bufnr)
|
format_on_save = function(bufnr)
|
||||||
-- Disable with a global or buffer-local variable
|
-- Disable with a global or buffer-local variable
|
||||||
end,
|
end,
|
||||||
formatters = {
|
formatters = {
|
||||||
gdformat = {
|
gdformat = {
|
||||||
prepend_args = { "-l", "100" },
|
prepend_args = { "-l", "100" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
6
vim/.vim/lua/plugins/dev.lua
Normal file
6
vim/.vim/lua/plugins/dev.lua
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
-- {
|
||||||
|
-- "squk/google3.nvim",
|
||||||
|
-- dev = true,
|
||||||
|
-- },
|
||||||
|
}
|
@ -1,6 +1,19 @@
|
|||||||
-- disable underline
|
-- disable underline
|
||||||
vim.diagnostic.handlers.underline.show = function() end
|
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 {
|
return {
|
||||||
{
|
{
|
||||||
"folke/trouble.nvim",
|
"folke/trouble.nvim",
|
||||||
@ -11,32 +24,46 @@ return {
|
|||||||
use_diagnostic_signs = true, -- enabling this will use the signs defined in your lsp client
|
use_diagnostic_signs = true, -- enabling this will use the signs defined in your lsp client
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>xt", "<cmd>:Telescope diagnostics<CR>" },
|
{ "<leader>xt", ":Telescope diagnostics<CR>" },
|
||||||
{ "gr", ":Telescope lsp_references<CR>" },
|
{ "gr", ":Telescope lsp_references<CR>" },
|
||||||
{ "<leader>xd", ":Trouble<CR>" },
|
{ "<leader>xd", ":Trouble diagnostics toggle <CR>" },
|
||||||
{ "[g", "<cmd>lua vim.diagnostic.goto_prev()<CR>" },
|
{ "<leader>xbd", ":Trouble diagnostics toggle filter.buf=0<CR>" },
|
||||||
{ "]g", "<cmd>lua vim.diagnostic.goto_next()<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" },
|
event = { "LspAttach" },
|
||||||
name = "lsp_lines.nvim",
|
name = "lsp_lines.nvim",
|
||||||
config = function()
|
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()
|
require("lsp_lines").setup()
|
||||||
|
|
||||||
-- vim.schedule(function()
|
-- vim.schedule(function()
|
||||||
|
@ -27,14 +27,9 @@ return {
|
|||||||
glug("googler", {
|
glug("googler", {
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
}),
|
}),
|
||||||
glug("core"),
|
|
||||||
glug("glaive"),
|
glug("glaive"),
|
||||||
glug("alert"),
|
glug("alert"),
|
||||||
glug("csearch"),
|
|
||||||
glug("languages"),
|
|
||||||
glug("googlespell"),
|
glug("googlespell"),
|
||||||
-- Enable logmsgs ASAP to avoid maktaba's log message queue filling up
|
|
||||||
glug("google-logo"),
|
|
||||||
-- Add support for google filetypes
|
-- Add support for google filetypes
|
||||||
glug("google-filetypes", { event = { "BufReadPre", "BufNewFile" }, dependencies = {} }),
|
glug("google-filetypes", { event = { "BufReadPre", "BufNewFile" }, dependencies = {} }),
|
||||||
|
|
||||||
@ -48,7 +43,6 @@ return {
|
|||||||
-- Set up syntax, indent, and core settings for various filetypes
|
-- Set up syntax, indent, and core settings for various filetypes
|
||||||
superlazy(glug("ft-cpp", { event = "BufRead,BufNewFile *.[ch],*.cc,*.cpp" })),
|
superlazy(glug("ft-cpp", { event = "BufRead,BufNewFile *.[ch],*.cc,*.cpp" })),
|
||||||
-- superlazy(glug("ft-go", { event = "BufRead,BufNewFile *.go" })),
|
-- superlazy(glug("ft-go", { event = "BufRead,BufNewFile *.go" })),
|
||||||
superlazy(glug("ft-gcl", { event = "BufRead,BufNewFile *.gcl" })),
|
|
||||||
superlazy(glug("ft-java", { event = "BufRead,BufNewFile *.java" })),
|
superlazy(glug("ft-java", { event = "BufRead,BufNewFile *.java" })),
|
||||||
superlazy(glug("ft-javascript", { event = "BufRead,BufNewFile *.js,*.jsx" })),
|
superlazy(glug("ft-javascript", { event = "BufRead,BufNewFile *.js,*.jsx" })),
|
||||||
superlazy(glug("ft-kotlin", { event = "BufRead,BufNewFile *.kt,*.kts" })),
|
superlazy(glug("ft-kotlin", { event = "BufRead,BufNewFile *.kt,*.kts" })),
|
||||||
@ -84,13 +78,13 @@ return {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
glug("relatedfiles", {
|
glug("relatedfiles", {
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>rb", ":exec relatedfiles#selector#JumpToBuild()<CR>" },
|
{ "<leader>rb", ":exec relatedfiles#selector#JumpToBuild()<CR>" },
|
||||||
{ "<leader>rt", ":exec relatedfiles#selector#JumpToTestFile()<CR>" },
|
{ "<leader>rt", ":exec relatedfiles#selector#JumpToTestFile()<CR>" },
|
||||||
{ "<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" } },
|
||||||
@ -182,9 +176,6 @@ return {
|
|||||||
"BlazeDebugFinish",
|
"BlazeDebugFinish",
|
||||||
"BlazeDepsUpdate",
|
"BlazeDepsUpdate",
|
||||||
},
|
},
|
||||||
config = function()
|
|
||||||
require("config.blaze")
|
|
||||||
end,
|
|
||||||
keys = function()
|
keys = function()
|
||||||
local function runCommandWithTarget(cmd)
|
local function runCommandWithTarget(cmd)
|
||||||
return function()
|
return function()
|
||||||
@ -251,17 +242,11 @@ return {
|
|||||||
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",
|
||||||
dependencies = {
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "ciderlsp-nvim",
|
name = "ciderlsp-nvim",
|
||||||
url = "sso://googler@user/kdark/ciderlsp-nvim",
|
url = "sso://googler@user/kdark/ciderlsp-nvim",
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
dependencies = {
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
-- {
|
-- {
|
||||||
-- name = "nvim_figtree",
|
-- name = "nvim_figtree",
|
||||||
@ -271,8 +256,7 @@ return {
|
|||||||
name = "telescope_codesearch",
|
name = "telescope_codesearch",
|
||||||
url = "sso://googler@user/vintharas/telescope-codesearch.nvim",
|
url = "sso://googler@user/vintharas/telescope-codesearch.nvim",
|
||||||
dependencies = { "nvim-telescope/telescope.nvim" },
|
dependencies = { "nvim-telescope/telescope.nvim" },
|
||||||
config = function()
|
config = function() end,
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "telescope_citc",
|
name = "telescope_citc",
|
||||||
|
@ -2,141 +2,148 @@ local use_google = require("utils").use_google
|
|||||||
local flags = require("utils").flags
|
local flags = require("utils").flags
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
-- {
|
||||||
"ray-x/lsp_signature.nvim",
|
-- "ray-x/lsp_signature.nvim",
|
||||||
event = "VeryLazy",
|
-- event = "VeryLazy",
|
||||||
opts = {
|
-- opts = {
|
||||||
floating_window = true,
|
-- floating_window = true,
|
||||||
hint_prefix = " ",
|
-- hint_prefix = " ",
|
||||||
},
|
-- },
|
||||||
config = function(_, opts)
|
-- config = function(_, opts)
|
||||||
require("lsp_signature").setup(opts)
|
-- require("lsp_signature").setup(opts)
|
||||||
end,
|
-- end,
|
||||||
},
|
-- },
|
||||||
{
|
{
|
||||||
"luozhiya/lsp-virtual-improved.nvim",
|
"kosayoda/nvim-lightbulb",
|
||||||
event = { "LspAttach" },
|
commit = "1cae7b7153ae98dcf1b11173a443ac1b6d8e3d49",
|
||||||
config = function()
|
event = { "LspAttach" },
|
||||||
require("lsp-virtual-improved").setup()
|
opts = {
|
||||||
end,
|
autocmd = { enabled = true },
|
||||||
},
|
virtual_text = {
|
||||||
{
|
enabled = true,
|
||||||
"kosayoda/nvim-lightbulb",
|
text = " ",
|
||||||
commit = "1cae7b7153ae98dcf1b11173a443ac1b6d8e3d49",
|
hl = "DiagnosticWarn",
|
||||||
event = { "LspAttach" },
|
},
|
||||||
opts = {
|
sign = { enabled = false },
|
||||||
autocmd = { enabled = true },
|
},
|
||||||
virtual_text = {
|
},
|
||||||
enabled = true,
|
{
|
||||||
text = " ",
|
"L3MON4D3/LuaSnip",
|
||||||
hl = "DiagnosticWarn",
|
build = "make install_jsregexp",
|
||||||
},
|
config = function()
|
||||||
sign = { enabled = false },
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
},
|
end,
|
||||||
},
|
dependencies = { "rafamadriz/friendly-snippets" },
|
||||||
{
|
},
|
||||||
"L3MON4D3/LuaSnip",
|
{
|
||||||
build = "make install_jsregexp",
|
"hinell/lsp-timeout.nvim",
|
||||||
config = function()
|
event = { "LspAttach" },
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
dependencies = { "neovim/nvim-lspconfig" },
|
||||||
end,
|
-- cond = not use_google(),
|
||||||
dependencies = { "rafamadriz/friendly-snippets" },
|
config = function()
|
||||||
},
|
vim.g.lspTimeoutConfig = {
|
||||||
{
|
filetypes = {
|
||||||
"hinell/lsp-timeout.nvim",
|
ignore = { -- filetypes to ignore; empty by default
|
||||||
event = { "LspAttach" },
|
"gdscript",
|
||||||
dependencies = { "neovim/nvim-lspconfig" },
|
"rust",
|
||||||
-- cond = not use_google(),
|
}, -- for these filetypes
|
||||||
config = function()
|
},
|
||||||
vim.g.lspTimeoutConfig = {
|
}
|
||||||
filetypes = {
|
end,
|
||||||
ignore = { -- filetypes to ignore; empty by default
|
},
|
||||||
"gdscript",
|
{
|
||||||
"rust",
|
"ray-x/go.nvim",
|
||||||
}, -- for these filetypes
|
dependencies = { -- optional packages
|
||||||
},
|
"ray-x/guihua.lua",
|
||||||
}
|
"neovim/nvim-lspconfig",
|
||||||
end,
|
"nvim-treesitter/nvim-treesitter",
|
||||||
},
|
},
|
||||||
{
|
-- cond = not use_google(),
|
||||||
"ray-x/go.nvim",
|
config = function()
|
||||||
dependencies = { -- optional packages
|
local capabilities = flags.blink
|
||||||
"ray-x/guihua.lua",
|
and require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
"neovim/nvim-lspconfig",
|
or require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
"nvim-treesitter/nvim-treesitter",
|
capabilities.offsetEncoding = { "utf-16" }
|
||||||
},
|
require("go").setup({
|
||||||
-- cond = not use_google(),
|
lsp_cfg = { capabilities = capabilities },
|
||||||
config = function()
|
lsp_keymaps = false,
|
||||||
local capabilities = flags.blink
|
lsp_inlay_hints = {
|
||||||
and require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
|
enable = not use_google(), -- doesn't work with ciderlsp
|
||||||
or require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
},
|
||||||
capabilities.offsetEncoding = { "utf-16" }
|
})
|
||||||
require("go").setup({
|
-- Run gofmt + goimports on save
|
||||||
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", {})
|
local format_sync_grp = vim.api.nvim_create_augroup("goimports", {})
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
pattern = "*.go",
|
pattern = "*.go",
|
||||||
callback = function()
|
callback = function()
|
||||||
require("go.format").goimports()
|
require("go.format").goimports()
|
||||||
end,
|
end,
|
||||||
group = format_sync_grp,
|
group = format_sync_grp,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
ft = { "go", "gomod" },
|
ft = { "go", "gomod" },
|
||||||
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
|
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
"nvim-lua/lsp-status.nvim",
|
"saghen/blink.cmp",
|
||||||
"VonHeikemen/lsp-zero.nvim",
|
"saghen/blink.compat",
|
||||||
},
|
"nvim-lua/lsp-status.nvim",
|
||||||
-- stylua: ignore
|
"VonHeikemen/lsp-zero.nvim",
|
||||||
keys = {
|
},
|
||||||
{ "<leader>F", "<cmd>lua vim.lsp.buf.format()<CR>" },
|
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>" },
|
local capabilities = flags.blink
|
||||||
{ "L", "<cmd>lua vim.lsp.buf.hover()<CR>" },
|
and require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
{ "gr", "<Cmd>Telescope lsp_references<CR>" },
|
or require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
{ "gd", "<cmd>Telescope lsp_definitions<CR>" },
|
capabilities = vim.tbl_extend("keep", capabilities or {}, lsp_status.capabilities)
|
||||||
{ "gD", "<cmd>tab split | lua vim.lsp.buf.definition()<CR>" },
|
capabilities.offsetEncoding = { "utf-16" }
|
||||||
{ "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
|
local lspconfig = require("lspconfig")
|
||||||
and require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities())
|
local configs = require("lspconfig.configs")
|
||||||
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 nvim_lspconfig = require("lspconfig")
|
||||||
local configs = require("lspconfig.configs")
|
local lsp_configs = require("lspconfig.configs")
|
||||||
require("config.lsp-google").setup(capabilities)
|
|
||||||
|
|
||||||
-- Godot
|
lsp_configs.ciderlsp = {
|
||||||
lspconfig.gdscript.setup({
|
default_config = {
|
||||||
-- flags = {
|
cmd = { '/google/bin/releases/cider/ciderlsp/ciderlsp', '--tooltag=nvim-lsp', '--noforward_sync_responses' },
|
||||||
-- debounce_text_changes = 2000, -- Wait 5 seconds before sending didChange
|
filetypes = { "c", "cpp", "java", "kotlin", "objc", "proto", "textproto", "go", "python", "bzl", "typescript" },
|
||||||
-- },
|
offset_encoding = 'utf-8',
|
||||||
})
|
root_dir = nvim_lspconfig.util.root_pattern('.citc'),
|
||||||
vim.cmd([[autocmd FileType gdscript setlocal commentstring=#\ %s]])
|
settings = {},
|
||||||
vim.cmd([[autocmd FileType gdscript setlocal autoindent noexpandtab tabstop=4 shiftwidth=4]])
|
}
|
||||||
end,
|
}
|
||||||
},
|
|
||||||
|
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,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
return {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
config = function()
|
config = function()
|
||||||
local lsp_status = require("lsp-status")
|
local lsp_status = require("lsp-status")
|
||||||
|
|
||||||
require("lualine").setup({
|
require("lualine").setup({
|
||||||
options = {
|
options = {
|
||||||
theme = "auto",
|
theme = "auto",
|
||||||
globalstatus = false,
|
globalstatus = false,
|
||||||
refresh = {
|
refresh = {
|
||||||
statusline = 1000,
|
statusline = 100,
|
||||||
-- tabline = 1000,
|
tabline = 100,
|
||||||
winbar = 1000,
|
winbar = 100,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = { "mode" },
|
lualine_a = { "mode" },
|
||||||
lualine_b = { "branch", "diff", getCitc, isCiderLspAttached },
|
lualine_b = { "branch", "diff" },
|
||||||
lualine_c = {
|
lualine_c = {
|
||||||
getLightbulb,
|
require("nvim-lightbulb").get_status_text,
|
||||||
{
|
{
|
||||||
"filename",
|
"filename",
|
||||||
path = 4, -- 0 = just filename, 1 = relative path, 2 = absolute path
|
path = 4, -- 0 = just filename, 1 = relative path, 2 = absolute path
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lualine_x = {
|
lualine_x = {
|
||||||
"",
|
"",
|
||||||
{
|
{
|
||||||
"diagnostics",
|
"diagnostics",
|
||||||
sources = { "nvim_lsp" },
|
sources = { "nvim_lsp" },
|
||||||
symbols = { error = " ", warn = " ", info = " ", hint = " " },
|
symbols = { error = " ", warn = " ", info = " ", hint = " " },
|
||||||
},
|
},
|
||||||
"filetype",
|
"filetype",
|
||||||
},
|
},
|
||||||
lualine_y = { "progress" },
|
lualine_y = { "progress" },
|
||||||
lualine_z = { "location" },
|
lualine_z = { "location" },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -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,
|
|
||||||
}
|
|
@ -10,7 +10,7 @@ return {
|
|||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"MunifTanjim/nui.nvim",
|
"MunifTanjim/nui.nvim",
|
||||||
-- "~/cmdtree",
|
-- "~/cmdtree",
|
||||||
},
|
},
|
||||||
cmd = {
|
cmd = {
|
||||||
"Neotree",
|
"Neotree",
|
||||||
@ -47,10 +47,8 @@ return {
|
|||||||
-- return { "<C-n>.", ":Neotree toggle reveal_force_cwd<CR>", desc = "Open NeoTree CWD float" }
|
-- 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" }
|
return { "<C-n>m", ":Neotree float git_status<CR>", desc = "Open NeoTree CWD float" }
|
||||||
end)(),
|
end)(),
|
||||||
-- { "<C-n>b", ":Neotree float buffers<CR>" },
|
{ "<C-n>", ":Neotree toggle left dir=%:p:h<cr>" },
|
||||||
{ "<C-n>f", ":Neotree float dir=%:p:h<cr>" },
|
{ "<leader>e", ":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" },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,9 @@ return {
|
|||||||
"mrcjkb/rustaceanvim",
|
"mrcjkb/rustaceanvim",
|
||||||
version = "^5", -- Recommended
|
version = "^5", -- Recommended
|
||||||
lazy = false, -- This plugin is already lazy
|
lazy = false, -- This plugin is already lazy
|
||||||
|
keys = {
|
||||||
|
-- { "" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"saecki/crates.nvim",
|
"saecki/crates.nvim",
|
||||||
|
@ -65,19 +65,18 @@ return {
|
|||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
vim.g.signify_vcs_list = { "hg", "git" }
|
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_disable_by_default = 0
|
||||||
vim.g.signify_sign_add = one_quarter
|
-- vim.g.signify_number_highlight = 1
|
||||||
vim.g.signify_sign_delete = one_quarter
|
local s = "▕"
|
||||||
vim.g.signify_sign_change = one_quarter
|
vim.g.signify_sign_add = s
|
||||||
local red = "#f8a6a0"
|
vim.g.signify_sign_delete = s
|
||||||
vim.api.nvim_set_hl(0, "SignifySignAdd", { fg = "#9cc9b8" })
|
vim.g.signify_sign_change = s
|
||||||
vim.api.nvim_set_hl(0, "SignifySignChange", { fg = "#84cee3" })
|
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, "SignifySignChangeDelete", { fg = red })
|
||||||
vim.api.nvim_set_hl(0, "SignifySignDelete", { fg = red })
|
vim.api.nvim_set_hl(0, "SignifySignDelete", { fg = red })
|
||||||
vim.api.nvim_set_hl(0, "SignifySignDeleteDeleteFirstLine", { fg = red })
|
vim.api.nvim_set_hl(0, "SignifySignDeleteDeleteFirstLine", { fg = red })
|
||||||
-- vim.cmd("highlight SignColumn ctermbg=NONE cterm=NONE guibg=NONE gui=NONE")
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -3,43 +3,44 @@ local exec = require("utils").exec
|
|||||||
local TableConcat = require("utils").TableConcat
|
local TableConcat = require("utils").TableConcat
|
||||||
|
|
||||||
_G.find_files = function(search_dirs)
|
_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
|
end
|
||||||
-- Helper functions to fetch the current scope and set `search_dirs`
|
-- Helper functions to fetch the current scope and set `search_dirs`
|
||||||
_G.find_dotfiles = function() end
|
_G.find_dotfiles = function() end
|
||||||
|
|
||||||
_G.search_cwd = function()
|
_G.search_cwd = function()
|
||||||
local builtin = require("telescope.builtin")
|
local builtin = require("telescope.builtin")
|
||||||
local utils = require("telescope.utils")
|
local utils = require("telescope.utils")
|
||||||
builtin.find_files({ cwd = utils.buffer_dir() })
|
builtin.find_files({ cwd = utils.buffer_dir() })
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.live_grep = function(search_dirs)
|
_G.live_grep = function(search_dirs)
|
||||||
require("telescope.builtin").live_grep({
|
require("telescope.builtin").live_grep({
|
||||||
search_dirs = search_dirs,
|
search_dirs = search_dirs,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.live_grep_cword = function(search_dirs)
|
_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
|
end
|
||||||
|
|
||||||
local function exe(cmd)
|
local function exe(cmd)
|
||||||
return vim.split(vim.fn.system(cmd), "\n")
|
return vim.split(vim.fn.system(cmd), "\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
function fig_modified()
|
function fig_modified()
|
||||||
return exe("hg pstatus -ma -n --no-status --template= | sort")
|
return exe("hg pstatus -ma -n --no-status --template= | sort")
|
||||||
end
|
end
|
||||||
|
|
||||||
function fig_all_modified()
|
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
|
end
|
||||||
|
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
local keys = {
|
local keys = {
|
||||||
{ "<leader>e", ":lua search_cwd()<CR>", desc = "Find Files in Buffer Directory" },
|
-- { "<leader>e", ":lua search_cwd()<CR>", desc = "Find Files in Buffer Directory" },
|
||||||
{ "<leader>ts", require('telescope.builtin').live_grep },
|
{ "<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>TS", function() require('telescope.builtin').live_grep { default_text = vim.fn.expand("<cword>") } end, },
|
||||||
{
|
{
|
||||||
"<leader>t.",
|
"<leader>t.",
|
||||||
@ -61,8 +62,8 @@ local keys = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if use_google() then
|
if use_google() then
|
||||||
local find_files = require("telescope.builtin").find_files
|
local find_files = require("telescope.builtin").find_files
|
||||||
local cs_query = require("telescope").extensions.codesearch.find_query
|
local cs_query = require("telescope").extensions.codesearch.find_query
|
||||||
-- stylua: ignore
|
-- stylua: ignore
|
||||||
TableConcat(keys, {
|
TableConcat(keys, {
|
||||||
{ "<leader>tm", function() find_files({ search_dirs = fig_modified() }) end, desc = "list modified Fig files." },
|
{ "<leader>tm", function() find_files({ search_dirs = fig_modified() }) end, desc = "list modified Fig files." },
|
||||||
@ -77,144 +78,144 @@ if use_google() then
|
|||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"aznhe21/actions-preview.nvim",
|
"aznhe21/actions-preview.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("actions-preview").setup({
|
require("actions-preview").setup({
|
||||||
telescope = {
|
telescope = {
|
||||||
sorting_strategy = "ascending",
|
sorting_strategy = "ascending",
|
||||||
layout_strategy = "vertical",
|
layout_strategy = "vertical",
|
||||||
layout_config = {
|
layout_config = {
|
||||||
width = 0.8,
|
width = 0.8,
|
||||||
height = 0.9,
|
height = 0.9,
|
||||||
prompt_position = "top",
|
prompt_position = "top",
|
||||||
preview_cutoff = 20,
|
preview_cutoff = 20,
|
||||||
preview_height = function(_, _, max_lines)
|
preview_height = function(_, _, max_lines)
|
||||||
return max_lines - 15
|
return max_lines - 15
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
{ "?", "<cmd>lua require('actions-preview').code_actions()<cr>" },
|
{ "?", "<cmd>lua require('actions-preview').code_actions()<cr>" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"smartpde/telescope-recent-files",
|
"smartpde/telescope-recent-files",
|
||||||
config = function()
|
config = function()
|
||||||
require("telescope").load_extension("recent_files")
|
require("telescope").load_extension("recent_files")
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>to", [[<cmd>lua require('telescope').extensions.recent_files.pick()<CR>]] },
|
{ "<leader>to", [[<cmd>lua require('telescope').extensions.recent_files.pick()<CR>]] },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"piersolenski/telescope-import.nvim",
|
"piersolenski/telescope-import.nvim",
|
||||||
dependencies = "nvim-telescope/telescope.nvim",
|
dependencies = "nvim-telescope/telescope.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("telescope").load_extension("import")
|
require("telescope").load_extension("import")
|
||||||
end,
|
end,
|
||||||
keys = function()
|
keys = function()
|
||||||
if not use_google() then
|
if not use_google() then
|
||||||
return {
|
return {
|
||||||
{ "<leader>i", ":Telescope import<CR>" },
|
{ "<leader>i", ":Telescope import<CR>" },
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
"smartpde/telescope-recent-files",
|
"smartpde/telescope-recent-files",
|
||||||
"rcarriga/nvim-dap-ui",
|
"rcarriga/nvim-dap-ui",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("telescope").setup({
|
require("telescope").setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
-- The vertical layout strategy is good to handle long paths like those in
|
-- The vertical layout strategy is good to handle long paths like those in
|
||||||
-- google3 repos because you have nearly the full screen to display a file path.
|
-- google3 repos because you have nearly the full screen to display a file path.
|
||||||
-- The caveat is that the preview area is smaller.
|
-- The caveat is that the preview area is smaller.
|
||||||
layout_strategy = "vertical",
|
layout_strategy = "vertical",
|
||||||
-- Common paths in google3 repos are collapsed following the example of Cider
|
-- Common paths in google3 repos are collapsed following the example of Cider
|
||||||
-- It is nice to keep this as a user config rather than part of
|
-- It is nice to keep this as a user config rather than part of
|
||||||
-- telescope-codesearch because it can be reused by other telescope pickers.
|
-- telescope-codesearch because it can be reused by other telescope pickers.
|
||||||
path_display = function(opts, path)
|
path_display = function(opts, path)
|
||||||
-- Do common substitutions
|
-- Do common substitutions
|
||||||
path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1)
|
path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1)
|
||||||
path = path:gsub("^google3/java/com/google/", "//j/c/g/", 1)
|
path = path:gsub("^google3/java/com/google/", "//j/c/g/", 1)
|
||||||
path = path:gsub("^google3/javatests/com/google/", "//jt/c/g/", 1)
|
path = path:gsub("^google3/javatests/com/google/", "//jt/c/g/", 1)
|
||||||
path = path:gsub("^google3/third_party/", "//3p/", 1)
|
path = path:gsub("^google3/third_party/", "//3p/", 1)
|
||||||
path = path:gsub("^google3/", "//", 1)
|
path = path:gsub("^google3/", "//", 1)
|
||||||
|
|
||||||
-- Do truncation. This allows us to combine our custom display formatter
|
-- Do truncation. This allows us to combine our custom display formatter
|
||||||
-- with the built-in truncation.
|
-- with the built-in truncation.
|
||||||
-- `truncate` handler in transform_path memoizes computed truncation length in opts.__length.
|
-- `truncate` handler in transform_path memoizes computed truncation length in opts.__length.
|
||||||
-- Here we are manually propagating this value between new_opts and opts.
|
-- Here we are manually propagating this value between new_opts and opts.
|
||||||
-- We can make this cleaner and more complicated using metatables :)
|
-- We can make this cleaner and more complicated using metatables :)
|
||||||
local new_opts = {
|
local new_opts = {
|
||||||
path_display = {
|
path_display = {
|
||||||
truncate = true,
|
truncate = true,
|
||||||
},
|
},
|
||||||
__length = opts.__length,
|
__length = opts.__length,
|
||||||
}
|
}
|
||||||
path = require("telescope.utils").transform_path(new_opts, path)
|
path = require("telescope.utils").transform_path(new_opts, path)
|
||||||
opts.__length = new_opts.__length
|
opts.__length = new_opts.__length
|
||||||
return path
|
return path
|
||||||
end,
|
end,
|
||||||
mappings = {
|
mappings = {
|
||||||
n = {
|
n = {
|
||||||
["<C-c>"] = "close",
|
["<C-c>"] = "close",
|
||||||
["<Esc>"] = "close",
|
["<Esc>"] = "close",
|
||||||
},
|
},
|
||||||
i = {
|
i = {
|
||||||
-- ["<cr>"] = function(bufnr)
|
-- ["<cr>"] = function(bufnr)
|
||||||
-- require("telescope.actions.set").edit(bufnr, "tab drop")
|
-- require("telescope.actions.set").edit(bufnr, "tab drop")
|
||||||
-- end,
|
-- end,
|
||||||
["<C-c>"] = "close",
|
["<C-c>"] = "close",
|
||||||
["<Esc>"] = "close",
|
["<Esc>"] = "close",
|
||||||
["<S-Down>"] = "cycle_history_next",
|
["<S-Down>"] = "cycle_history_next",
|
||||||
["<S-Up>"] = "cycle_history_prev",
|
["<S-Up>"] = "cycle_history_prev",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
extensions = {
|
extensions = {
|
||||||
codesearch = {
|
codesearch = {
|
||||||
experimental = true, -- enable results from google3/experimental
|
experimental = true, -- enable results from google3/experimental
|
||||||
},
|
},
|
||||||
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
|
||||||
-- /google/.../w1/google3/my_file.cc becomes /google/.../w2/google3/my_file.cc,
|
-- /google/.../w1/google3/my_file.cc becomes /google/.../w2/google3/my_file.cc,
|
||||||
transform_file_path = function(path)
|
transform_file_path = function(path)
|
||||||
local neocitc = require("neocitc")
|
local neocitc = require("neocitc")
|
||||||
local path_func = neocitc.path_in_current_workspace_or_head
|
local path_func = neocitc.path_in_current_workspace_or_head
|
||||||
or neocitc.path_in_current_workspace
|
or neocitc.path_in_current_workspace
|
||||||
return path_func(path)
|
return path_func(path)
|
||||||
end,
|
end,
|
||||||
-- This is a useful option to speed up Telescope by avoiding the check
|
-- This is a useful option to speed up Telescope by avoiding the check
|
||||||
-- for file existence.
|
-- for file existence.
|
||||||
stat_files = false,
|
stat_files = false,
|
||||||
-- Ignore common patterns that can show up from other google plugins
|
-- Ignore common patterns that can show up from other google plugins
|
||||||
ignore_patterns = {
|
ignore_patterns = {
|
||||||
"/%.git/COMMIT_EDITING$",
|
"/%.git/COMMIT_EDITING$",
|
||||||
"/%.git/COMMIT_EDITMSG$",
|
"/%.git/COMMIT_EDITMSG$",
|
||||||
"/%.git/MERGE_MSG$",
|
"/%.git/MERGE_MSG$",
|
||||||
"^/tmp/%.pipertmp-",
|
"^/tmp/%.pipertmp-",
|
||||||
"/Related_Files$",
|
"/Related_Files$",
|
||||||
"^term:",
|
"^term:",
|
||||||
";#toggleterm#",
|
";#toggleterm#",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
persisted = {},
|
persisted = {},
|
||||||
import = {
|
import = {
|
||||||
-- Add imports to the top of the file keeping the cursor in place
|
-- Add imports to the top of the file keeping the cursor in place
|
||||||
insert_at_top = true,
|
insert_at_top = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
keys = keys,
|
keys = keys,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,23 @@
|
|||||||
local use_google = require("utils").use_google
|
local use_google = require("utils").use_google
|
||||||
|
|
||||||
return {
|
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",
|
"bluz71/vim-moonfly-colors",
|
||||||
name = "moonfly",
|
name = "moonfly",
|
||||||
cond = not use_google(),
|
-- cond = not use_google(),
|
||||||
|
cond = false,
|
||||||
lazy = false,
|
lazy = false,
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
@ -26,11 +39,12 @@ return {
|
|||||||
group = custom_highlight,
|
group = custom_highlight,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.cmd("colorscheme moonfly")
|
|
||||||
vim.g.moonflyCursorColor = true
|
vim.g.moonflyCursorColor = true
|
||||||
vim.g.moonflyItalics = true
|
vim.g.moonflyItalics = true
|
||||||
vim.g.moonflyUnderlineMatchParen = true
|
vim.g.moonflyUnderlineMatchParen = true
|
||||||
vim.g.moonflyVirtualTextColor = true
|
vim.g.moonflyVirtualTextColor = true
|
||||||
|
|
||||||
|
vim.cmd("colorscheme moonfly")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
-- {
|
-- {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
return {
|
return {
|
||||||
"preservim/vimux",
|
"preservim/vimux",
|
||||||
"tmux-plugins/vim-tmux",
|
"tmux-plugins/vim-tmux",
|
||||||
"christoomey/vim-tmux-navigator",
|
"christoomey/vim-tmux-navigator",
|
||||||
"whatyouhide/vim-tmux-syntax",
|
"whatyouhide/vim-tmux-syntax",
|
||||||
"tmux-plugins/vim-tmux-focus-events",
|
"tmux-plugins/vim-tmux-focus-events",
|
||||||
-- 'jabirali/vim-tmux-yank',
|
-- 'jabirali/vim-tmux-yank',
|
||||||
"skywind3000/asyncrun.vim",
|
"skywind3000/asyncrun.vim",
|
||||||
}
|
}
|
||||||
|
@ -1,102 +1,100 @@
|
|||||||
local M = {
|
local M = {
|
||||||
use_google_cache = nil,
|
use_google_cache = nil,
|
||||||
flags = {
|
flags = { blink = true },
|
||||||
blink = true,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function M.exec(command, args)
|
function M.exec(command, args)
|
||||||
local Job = require("plenary.job")
|
local Job = require("plenary.job")
|
||||||
local job = Job:new({
|
local job = Job:new({
|
||||||
command = command,
|
command = command,
|
||||||
args = args,
|
args = args,
|
||||||
})
|
})
|
||||||
job:sync()
|
job:sync()
|
||||||
job:wait()
|
job:wait()
|
||||||
return job:result()
|
return job:result()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.map(mode, lhs, rhs, opts)
|
function M.map(mode, lhs, rhs, opts)
|
||||||
local options = { noremap = true }
|
local options = { noremap = true }
|
||||||
if opts then
|
if opts then
|
||||||
options = vim.tbl_extend("force", options, opts)
|
options = vim.tbl_extend("force", options, opts)
|
||||||
end
|
end
|
||||||
-- vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
-- vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||||
vim.keymap.set(mode, lhs, rhs, options)
|
vim.keymap.set(mode, lhs, rhs, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.use_google()
|
function M.use_google()
|
||||||
if M.use_google_cache == nil then
|
if M.use_google_cache == nil then
|
||||||
M.use_google_cache = M.file_exists(os.getenv("HOME") .. "/use_google")
|
M.use_google_cache = M.file_exists(os.getenv("HOME") .. "/use_google")
|
||||||
end
|
end
|
||||||
return M.use_google_cache
|
return M.use_google_cache
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.file_exists(name)
|
function M.file_exists(name)
|
||||||
local f = io.open(name, "r")
|
local f = io.open(name, "r")
|
||||||
if f ~= nil then
|
if f ~= nil then
|
||||||
io.close(f)
|
io.close(f)
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.dump(o)
|
function M.dump(o)
|
||||||
if type(o) == "table" then
|
if type(o) == "table" then
|
||||||
local s = "{ "
|
local s = "{ "
|
||||||
for k, v in pairs(o) do
|
for k, v in pairs(o) do
|
||||||
if type(k) ~= "number" then
|
if type(k) ~= "number" then
|
||||||
k = '"' .. k .. '"'
|
k = '"' .. k .. '"'
|
||||||
end
|
end
|
||||||
s = s .. "[" .. k .. "] = " .. M.dump(v) .. ","
|
s = s .. "[" .. k .. "] = " .. M.dump(v) .. ","
|
||||||
end
|
end
|
||||||
return s .. "} "
|
return s .. "} "
|
||||||
else
|
else
|
||||||
return tostring(o)
|
return tostring(o)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.tprint(tbl, indent)
|
function M.tprint(tbl, indent)
|
||||||
if not indent then
|
if not indent then
|
||||||
indent = 0
|
indent = 0
|
||||||
end
|
end
|
||||||
local toprint = string.rep(" ", indent) .. "{\r\n"
|
local toprint = string.rep(" ", indent) .. "{\r\n"
|
||||||
indent = indent + 2
|
indent = indent + 2
|
||||||
for k, v in pairs(tbl) do
|
for k, v in pairs(tbl) do
|
||||||
toprint = toprint .. string.rep(" ", indent)
|
toprint = toprint .. string.rep(" ", indent)
|
||||||
if type(k) == "number" then
|
if type(k) == "number" then
|
||||||
toprint = toprint .. "[" .. k .. "] = "
|
toprint = toprint .. "[" .. k .. "] = "
|
||||||
elseif type(k) == "string" then
|
elseif type(k) == "string" then
|
||||||
toprint = toprint .. k .. "= "
|
toprint = toprint .. k .. "= "
|
||||||
end
|
end
|
||||||
if type(v) == "number" then
|
if type(v) == "number" then
|
||||||
toprint = toprint .. v .. ",\r\n"
|
toprint = toprint .. v .. ",\r\n"
|
||||||
elseif type(v) == "string" then
|
elseif type(v) == "string" then
|
||||||
toprint = toprint .. '"' .. v .. '",\r\n'
|
toprint = toprint .. '"' .. v .. '",\r\n'
|
||||||
elseif type(v) == "table" then
|
elseif type(v) == "table" then
|
||||||
toprint = toprint .. M.tprint(v, indent + 2) .. ",\r\n"
|
toprint = toprint .. M.tprint(v, indent + 2) .. ",\r\n"
|
||||||
else
|
else
|
||||||
toprint = toprint .. '"' .. tostring(v) .. '",\r\n'
|
toprint = toprint .. '"' .. tostring(v) .. '",\r\n'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
toprint = toprint .. string.rep(" ", indent - 2) .. "}"
|
toprint = toprint .. string.rep(" ", indent - 2) .. "}"
|
||||||
return toprint
|
return toprint
|
||||||
end
|
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")
|
||||||
io.output(log_file)
|
io.output(log_file)
|
||||||
io.write(message .. "\n")
|
io.write(message .. "\n")
|
||||||
io.close(log_file)
|
io.close(log_file)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.TableConcat(t1, t2)
|
function M.TableConcat(t1, t2)
|
||||||
for i = 1, #t2 do
|
for i = 1, #t2 do
|
||||||
t1[#t1 + 1] = t2[i]
|
t1[#t1 + 1] = t2[i]
|
||||||
end
|
end
|
||||||
return t1
|
return t1
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -15,7 +15,7 @@ map <leader>` ysiw`
|
|||||||
vmap <leader>` c`<C-R>"`<ESC>
|
vmap <leader>` c`<C-R>"`<ESC>
|
||||||
|
|
||||||
" --------- SEARCH MAPPINGS ---------
|
" --------- SEARCH MAPPINGS ---------
|
||||||
" unhilight search
|
" unhighlight search
|
||||||
nnoremap <leader><space> :nohlsearch<CR>
|
nnoremap <leader><space> :nohlsearch<CR>
|
||||||
|
|
||||||
" --------- CLIPBOARD MAPPINGS ---------
|
" --------- CLIPBOARD MAPPINGS ---------
|
||||||
@ -46,4 +46,5 @@ nmap <leader>yf :let @+ = expand("%") \| let @" = expand("%")<cr>
|
|||||||
" replace currently selected text with default register
|
" replace currently selected text with default register
|
||||||
" without yanking it
|
" without yanking it
|
||||||
vnoremap <leader>p "_dP
|
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>
|
||||||
|
@ -152,3 +152,9 @@ source /google/bin/releases/gmscore-tools/cli/prod/setup_prod_gms.sh
|
|||||||
abbr bq="blaze query"
|
abbr bq="blaze query"
|
||||||
abbr br="blaze run"
|
abbr br="blaze run"
|
||||||
abbr bb="blaze build"
|
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"
|
||||||
|
@ -13,7 +13,7 @@ autoload -Uz add-zsh-hook
|
|||||||
add-zsh-hook chpwd g3path::hook
|
add-zsh-hook chpwd g3path::hook
|
||||||
|
|
||||||
g3path::zle::accept-line () {
|
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\/}
|
BUFFER=${BUFFER// \/\// $GOOGLE3_ROOT\/}
|
||||||
fi
|
fi
|
||||||
zle .accept-line
|
zle .accept-line
|
||||||
|
Reference in New Issue
Block a user