format and stuff

This commit is contained in:
Christian Nieves
2023-06-23 15:03:45 -05:00
parent 7fff3e8486
commit 2ce85a8584
30 changed files with 1284 additions and 1044 deletions

View File

@ -1,314 +1,327 @@
local use_google = require("utils").use_google
return
{
-- Pretty symbols
'kyazdani42/nvim-web-devicons',
return {
-- Pretty symbols
"kyazdani42/nvim-web-devicons",
'jghauser/mkdir.nvim',
'will133/vim-dirdiff',
'renerocksai/calendar-vim',
'google/vim-searchindex',
-- 'apalmer1377/factorus',
'hrsh7th/vim-vsnip',
'kosayoda/nvim-lightbulb',
'tpope/vim-surround',
'ntpeters/vim-better-whitespace',
'junegunn/fzf.vim',
'nathanaelkane/vim-indent-guides',
'tversteeg/registers.nvim',
'jremmen/vim-ripgrep',
'nvim-lua/plenary.nvim',
"jghauser/mkdir.nvim",
"will133/vim-dirdiff",
"renerocksai/calendar-vim",
"google/vim-searchindex",
-- 'apalmer1377/factorus',
"hrsh7th/vim-vsnip",
"kosayoda/nvim-lightbulb",
"tpope/vim-surround",
"ntpeters/vim-better-whitespace",
"junegunn/fzf.vim",
"nathanaelkane/vim-indent-guides",
"tversteeg/registers.nvim",
"jremmen/vim-ripgrep",
"nvim-lua/plenary.nvim",
{
'preservim/nerdcommenter',
init = function()
require("config.nerdcommenter")
end,
keys = {
{ "<leader>c<Space>", ":call nerdcommenter#Comment(0, 'toggle')<CR>" },
{ "<leader>c<Space>", ":call nerdcommenter#Comment(0, 'toggle')<CR>", mode='v' },
{
"preservim/nerdcommenter",
init = function()
require("config.nerdcommenter")
end,
keys = {
{ "<leader>c<Space>", ":call nerdcommenter#Comment(0, 'toggle')<CR>" },
{ "<leader>c<Space>", ":call nerdcommenter#Comment(0, 'toggle')<CR>", mode = "v" },
{ "<leader>cS", ":call nerdcommenter#Comment(0, 'sexy')<CR>" },
{ "<leader>cS", ":call nerdcommenter#Comment(0, 'sexy')<CR>", mode='v' },
{ "<leader>cS", ":call nerdcommenter#Comment(0, 'sexy')<CR>" },
{ "<leader>cS", ":call nerdcommenter#Comment(0, 'sexy')<CR>", mode = "v" },
{ "<leader>c$", ":call nerdcommenter#Comment(0, 'ToEOL')<CR>" },
{ "<leader>c$", ":call nerdcommenter#Comment(0, 'ToEOL')<CR>", mode='v' },
}
},
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
config = function()
require("config.nvim-treesitter")
end,
lazy = false,
},
{ "<leader>c$", ":call nerdcommenter#Comment(0, 'ToEOL')<CR>" },
{ "<leader>c$", ":call nerdcommenter#Comment(0, 'ToEOL')<CR>", mode = "v" },
},
},
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require("config.nvim-treesitter")
end,
lazy = false,
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
config = function()
require("config.neotree")
end,
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
},
keys = {
{ "<C-n>", ":Neotree filesystem reveal toggle reveal_force_cwd<cr>", desc = "Open NeoTree" },
},
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
config = function()
require("config.neotree")
end,
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
},
keys = {
{ "<C-n>", ":Neotree filesystem reveal toggle reveal_force_cwd<cr>", desc = "Open NeoTree" },
},
},
-- Undo tree
{
'mbbill/undotree',
cmd = 'UndotreeToggle',
config = function()
vim.g.undotree_SetFocusWhenToggle = 1
end
},
-- Undo tree
{
"mbbill/undotree",
cmd = "UndotreeToggle",
config = function()
vim.g.undotree_SetFocusWhenToggle = 1
end,
},
{
'renerocksai/telekasten.nvim',
config = function()
require("config.telekasten")
end,
keys = {
{ "<leader>zf", ":lua require('telekasten').find_notes()<CR>", desc = "Find Notes" },
},
},
{ 'ray-x/go.nvim',ft='go' },
{ 'ray-x/guihua.lua',ft='go' },
{
"renerocksai/telekasten.nvim",
config = function()
require("config.telekasten")
end,
keys = {
{ "<leader>zf", ":lua require('telekasten').find_notes()<CR>", desc = "Find Notes" },
},
},
{ "ray-x/go.nvim", ft = "go" },
{ "ray-x/guihua.lua", ft = "go" },
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
'nvim-lua/lsp-status.nvim',
'VonHeikemen/lsp-zero.nvim',
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"nvim-lua/lsp-status.nvim",
"VonHeikemen/lsp-zero.nvim",
-- Completion and linting
{
'hrsh7th/nvim-cmp',
event = "VimEnter",
-- Completion and linting
{
"hrsh7th/nvim-cmp",
event = "VimEnter",
dependencies = {
'onsails/lspkind.nvim',
'neovim/nvim-lspconfig',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'lukas-reineke/cmp-under-comparator',
'hrsh7th/cmp-cmdline',
'f3fora/cmp-spell',
'hrsh7th/cmp-nvim-lsp-document-symbol',
'hrsh7th/cmp-nvim-lsp-signature-help',
'hrsh7th/cmp-nvim-lua',
'hrsh7th/cmp-path',
'hrsh7th/cmp-vsnip',
'ray-x/cmp-treesitter',
},
config = function()
require("config.lsp")
end
},
{
"tzachar/cmp-tabnine", build = "./install.sh",
event = 'InsertEnter',
cond = not use_google(),
},
{
'ErichDonGubler/lsp_lines.nvim',
event = "VimEnter",
keys = {
{ "<leader>l", function() require("lsp_lines").toggle() end, desc = "Toggle LSP Lines" },
},
},
{
'jose-elias-alvarez/null-ls.nvim',
event = "VimEnter",
config = function()
require("config.null-ls")
end
},
dependencies = {
"onsails/lspkind.nvim",
"neovim/nvim-lspconfig",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"lukas-reineke/cmp-under-comparator",
"hrsh7th/cmp-cmdline",
"f3fora/cmp-spell",
"hrsh7th/cmp-nvim-lsp-document-symbol",
"hrsh7th/cmp-nvim-lsp-signature-help",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-path",
"hrsh7th/cmp-vsnip",
"ray-x/cmp-treesitter",
},
config = function()
require("config.lsp")
end,
},
{
"tzachar/cmp-tabnine",
build = "./install.sh",
event = "InsertEnter",
cond = not use_google(),
},
{
"ErichDonGubler/lsp_lines.nvim",
event = "VimEnter",
keys = {
{
"<leader>l",
function()
require("lsp_lines").toggle()
end,
desc = "Toggle LSP Lines",
},
},
},
{
"jose-elias-alvarez/null-ls.nvim",
event = "VimEnter",
config = function()
require("config.null-ls")
end,
},
{
'nvim-telescope/telescope.nvim',
branch = '0.1.x',
config = function()
require("config.telescope")
end,
dependencies = {
"telescope_codesearch",
"telescope_citc",
"telescope_fig",
'nvim-telescope/telescope-file-browser.nvim',
},
keys = {
{ '<leader>tb', ":Telescope file_buffers", desc = '[T]elescope [B]uffers' } ,
{ '<leader>tf', [[:lua require "telescope".extensions.file_browser.file_browser{}<cr>]], desc = '[T]elescope [F]iles' },
{ '<leader>th', [[:lua require('telescope.builtin').help_tags<cr>]], desc = '[T]elescope [H]elp' },
{ '<leader>tw', [[:lua require('telescope.builtin').grep_string<cr>]], desc = '[T]elescope current [W]ord' },
{ '<leader>tg', [[:lua require('telescope.builtin').live_grep<cr>]], desc = '[T]elescope by [G]rep' },
-- Google mappings
{ '<C-P>', [[:lua require('telescope').extensions.codesearch.find_files{}<CR>]],'n', { noremap = true, silent=true }},
{ '<C-Space>', [[:lua require('telescope').extensions.codesearch.find_query{}<CR>]], { noremap = true, silent = true }},
{ '<leader>cs', [[:lua require('telescope').extensions.codesearch.find_query{}<CR>]], { noremap = true, silent = true }},
{ '<leader>cs', [[:lua require('telescope').extensions.codesearch.find_query{}<CR>]], mode='v', { noremap = true, silent = true }},
{ '<leader>CS', [[:lua require('telescope').extensions.codesearch.find_query{default_text_expand='<cword>'}<CR>]], { noremap = true, silent = true } },
},
},
-- Rust
{
"saecki/crates.nvim",
ft = "rust",
version = "v0.3.0",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("crates").setup()
end,
},
-- Rust
{
'saecki/crates.nvim',
ft = 'rust',
version = 'v0.3.0',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
require('crates').setup()
end
},
{ "simrat39/rust-tools.nvim", ft = "rust" },
{'simrat39/rust-tools.nvim', ft = 'rust'},
{
"folke/trouble.nvim",
event = "VimEnter",
config = function()
require("config.trouble")
end,
},
{
'folke/trouble.nvim',
event = "VimEnter",
config = function()
require("config.trouble")
end,
},
{
"ThePrimeagen/refactoring.nvim",
dependencies = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-treesitter/nvim-treesitter" },
},
config = function()
require("config.refactoring")
end,
keys = {
-- remap to open the Telescope refactoring menu in visual mode
{
"<leader>rr",
"<Esc><cmd>lua require('telescope').extensions.refactoring.refactors()<CR>",
{ noremap = true },
},
{
'ThePrimeagen/refactoring.nvim',
dependencies = {
{"nvim-lua/plenary.nvim"},
{"nvim-treesitter/nvim-treesitter"}
},
config = function()
require("config.refactoring")
end,
keys = {
-- remap to open the Telescope refactoring menu in visual mode
{"<leader>rr", "<Esc><cmd>lua require('telescope').extensions.refactoring.refactors()<CR>", { noremap = true }},
-- Remaps for the refactoring operations currently offered by the plugin
{
"<leader>rx",
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]],
mode = "v",
{ noremap = true, silent = true, expr = false },
},
{
"<leader>rxf",
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]],
mode = "v",
{ noremap = true, silent = true, expr = false },
},
{
"<leader>rxv",
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]],
mode = "v",
{ noremap = true, silent = true, expr = false },
},
{
"<leader>ri",
[[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]],
mode = "v",
{ noremap = true, silent = true, expr = false },
},
-- Remaps for the refactoring operations currently offered by the plugin
{ "<leader>rx", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]], mode ="v", {noremap = true, silent = true, expr = false}},
{ "<leader>rxf", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]],mode ="v", {noremap = true, silent = true, expr = false}},
{ "<leader>rxv", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]], mode ="v" , {noremap = true, silent = true, expr = false}},
{ "<leader>ri", [[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], mode ="v", {noremap = true, silent = true, expr = false}},
-- Extract block doesn't need visual mode
{
"<leader>rxb",
[[ <Cmd>lua require('refactoring').refactor('Extract Block')<CR>]],
{ noremap = true, silent = true, expr = false },
},
{
"<leader>rxbf",
[[ <Cmd>lua require('refactoring').refactor('Extract Block To File')<CR>]],
{ noremap = true, silent = true, expr = false },
},
-- Extract block doesn't need visual mode
{ "<leader>rxb", [[ <Cmd>lua require('refactoring').refactor('Extract Block')<CR>]], {noremap = true, silent = true, expr = false}},
{ "<leader>rxbf", [[ <Cmd>lua require('refactoring').refactor('Extract Block To File')<CR>]], {noremap = true, silent = true, expr = false}},
-- Inline variable can also pick up the identifier currently under the cursor without visual mode
{
"<leader>ri",
[[ <Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]],
{ noremap = true, silent = true, expr = false },
},
{
"<leader>rx",
[[ <Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]],
{ noremap = true, silent = true, expr = false },
},
},
},
{ "andymass/vim-matchup", event = "VimEnter" },
-- Inline variable can also pick up the identifier currently under the cursor without visual mode
{ "<leader>ri", [[ <Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], {noremap = true, silent = true, expr = false}},
{ "<leader>rx", [[ <Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]], {noremap = true, silent = true, expr = false}},
}
},
{'andymass/vim-matchup', event = 'VimEnter'},
{
"simrat39/symbols-outline.nvim",
config = function()
require("config.symbols-outline")
end,
},
{
"petertriho/nvim-scrollbar",
config = function()
require("scrollbar").setup()
end,
lazy = false,
},
{ 'simrat39/symbols-outline.nvim',
config = function()
require("config.symbols-outline")
end
},
{
'petertriho/nvim-scrollbar',
config = function()
require("scrollbar").setup()
end,
lazy = false,
},
{
"rmagatti/auto-session",
config = function()
require("auto-session").setup({
log_level = "error",
-- auto_session_suppress_dirs = { "~/", "~/Downloads", "/", os.getenv("HOME")},
})
end,
},
{
'rmagatti/auto-session',
config = function()
require("auto-session").setup {
log_level = "error",
auto_session_suppress_dirs = { "~/", "~/Downloads", "/", os.getenv("HOME")},
}
end
},
{
"ipod825/libp.nvim",
config = function()
require("libp").setup()
end,
},
{
"ipod825/libp.nvim",
config = function()
require("libp").setup()
end,
},
{
"nvim-lualine/lualine.nvim",
lazy = false,
config = function()
require("config.lualine")
end,
},
{
"rcarriga/nvim-notify",
config = function()
require("config.notify")
end,
},
{
"catppuccin/nvim",
name = "catppuccin",
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
require("config.catppuccin")
end,
},
{
"ojroques/nvim-osc52",
config = function()
require("config.oscyank")
end,
},
{
'nvim-lualine/lualine.nvim',
lazy = false,
config = function()
require("config.lualine")
end
},
{
'rcarriga/nvim-notify',
config = function()
require("config.notify")
end
},
-- mine
{
"squk/java-syntax.vim",
lazy = false,
},
{
"catppuccin/nvim",
name = "catppuccin",
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other start plugins
config = function()
require("config.catppuccin")
end
},
{
'ojroques/nvim-osc52',
config = function()
require("config.oscyank")
end
},
-- mine
{
'squk/java-syntax.vim',
lazy = false,
},
{
"folke/which-key.nvim",
config = function()
require("config.whichkey")
end
},
{ 'junegunn/fzf', build = ":call fzf#install()" },
{ 'udalov/kotlin-vim', ft='kotin' },
{
'wesQ3/vim-windowswap',
init = function()
vim.g.windowswap_map_keys = 0
end,
},
{ 'vim-scripts/vcscommand.vim' },
{
'mhinz/vim-signify',
config= function()
require('config.signify')
end
},
{
'j-hui/fidget.nvim',
init = function() require("fidget").setup() end
},
{
"iamcco/markdown-preview.nvim",
build = "cd app && npm install",
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" }
},
{
"folke/which-key.nvim",
config = function()
require("config.whichkey")
end,
},
{ "junegunn/fzf", build = ":call fzf#install()" },
{ "udalov/kotlin-vim", ft = "kotin" },
{
"wesQ3/vim-windowswap",
init = function()
vim.g.windowswap_map_keys = 0
end,
},
{ "vim-scripts/vcscommand.vim" },
{
"mhinz/vim-signify",
event = "VimEnter",
keys = {
{ "]d", "<plug>(signify-next-hunk)" },
{ "[d", "<plug>(signify-prev-hunk)" },
},
},
{
"iamcco/markdown-preview.nvim",
build = "cd app && npm install",
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" },
},
}

View File

@ -0,0 +1,39 @@
return {
"mhartington/formatter.nvim",
config = function()
-- Utilities for creating configurations
local util = require("formatter.util")
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
require("formatter").setup({
-- Enable or disable logging
logging = true,
-- Set the log level
log_level = vim.log.levels.WARN,
-- All formatter configurations are opt-in
filetype = {
-- Formatter configurations for filetype "lua" go here
-- and will be executed in order
lua = {
-- "formatter.filetypes.lua" defines default configurations for the
-- "lua" filetype
require("formatter.filetypes.lua").stylua,
},
-- Use the special "*" filetype for defining formatter configurations on
-- any filetype
["*"] = {
-- "formatter.filetypes.any" defines default configurations for any
-- filetype
require("formatter.filetypes.any").remove_trailing_whitespace,
},
},
})
vim.cmd([[
augroup FormatAutogroup
autocmd!
autocmd BufWritePost * FormatWrite
augroup END
]])
end,
}

View File

@ -1,16 +1,16 @@
return {
-- Git
{
'lewis6991/gitsigns.nvim',
dependencies = 'nvim-lua/plenary.nvim',
event = 'User ActuallyEditing',
},
{
'akinsho/git-conflict.nvim',
version = '*',
config = function()
require('git-conflict').setup()
end,
},
{ 'rhysd/conflict-marker.vim' }
-- Git
{
"lewis6991/gitsigns.nvim",
dependencies = "nvim-lua/plenary.nvim",
event = "User ActuallyEditing",
},
{
"akinsho/git-conflict.nvim",
version = "*",
config = function()
require("git-conflict").setup()
end,
},
{ "rhysd/conflict-marker.vim" },
}

View File

@ -36,10 +36,17 @@ if use_google() then
goog("gtimporter"),
goog("blaze"),
goog("buganizer"),
goog("relatedfiles"),
goog("g4"),
goog("outline-window"),
goog("fzf-query"),
{
name = "relatedfiles",
dir = "/usr/share/vim/google/relatedfiles",
dependencies = { "maktaba", "glaive" },
config = function()
vim.cmd([[ Glaive relatedfiles plugin[mappings] ]])
end
},
{
name = "codefmt",
dir = "/usr/share/vim/google/codefmt",

View File

@ -0,0 +1,103 @@
return {
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
config = function()
require("telescope").setup({
defaults = {
-- The vertical layout strategy is good to handle long paths like those in
-- google3 repos because you have nearly the full screen to display a file path.
-- The caveat is that the preview area is smaller.
layout_strategy = "vertical",
-- Common paths in google3 repos are collapsed following the example of Cider
-- It is nice to keep this as a user config rather than part of
-- telescope-codesearch because it can be reused by other telescope pickers.
path_display = function(opts, path)
-- Do common substitutions
path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1)
path = path:gsub("^google3/java/com/google/", "g3/j/c/g/", 1)
path = path:gsub("^google3/javatests/com/google/", "g3/jt/c/g/", 1)
path = path:gsub("^google3/third_party/", "g3/3rdp/", 1)
path = path:gsub("^google3/", "g3/", 1)
-- Do truncation. This allows us to combine our custom display formatter
-- with the built-in truncation.
-- `truncate` handler in transform_path memoizes computed truncation length in opts.__length.
-- Here we are manually propagating this value between new_opts and opts.
-- We can make this cleaner and more complicated using metatables :)
local new_opts = {
path_display = {
truncate = true,
},
__length = opts.__length,
}
path = require("telescope.utils").transform_path(new_opts, path)
opts.__length = new_opts.__length
return path
end,
},
extensions = { -- this block is optional, and if omitted, defaults will be used
file_browser = {
-- disables netrw and use telescope-file-browser in its place
hijack_netrw = false,
},
codesearch = {
experimental = true, -- enable results from google3/experimental
},
},
})
require("telescope").load_extension("file_browser")
end,
dependencies = {
"telescope_codesearch",
"telescope_citc",
"telescope_fig",
"nvim-telescope/telescope-file-browser.nvim",
},
keys = {
{
"<leader>fb",
":Telescope file_browser path=%:p:h select_buffer=true<CR>",
{ noremap = true },
desc = "[F]ile [B]rowser",
},
{
"<leader>tf",
":Telescope file_browser",
{ noremap = true },
desc = "[T]elescope [F]ilebrowser",
},
{ "<leader>tb", ":Telescope file_buffers", desc = "[T]elescope [B]uffers" },
{ "<leader>th", [[:lua require('telescope.builtin').help_tags<cr>]], desc = "[T]elescope [H]elp" },
{ "<leader>tw", [[:lua require('telescope.builtin').grep_string<cr>]], desc = "[T]elescope current [W]ord" },
{ "<leader>tg", [[:lua require('telescope.builtin').live_grep<cr>]], desc = "[T]elescope by [G]rep" },
-- Google mappings
{
"<C-P>",
[[:lua require('telescope').extensions.codesearch.find_files{}<CR>]],
"n",
{ noremap = true, silent = true },
},
{
"<C-Space>",
[[:lua require('telescope').extensions.codesearch.find_query{}<CR>]],
{ noremap = true, silent = true },
},
{
"<leader>cs",
[[:lua require('telescope').extensions.codesearch.find_query{}<CR>]],
{ noremap = true, silent = true },
},
{
"<leader>cs",
[[:lua require('telescope').extensions.codesearch.find_query{}<CR>]],
mode = "v",
{ noremap = true, silent = true },
},
{
"<leader>CS",
[[:lua require('telescope').extensions.codesearch.find_query{default_text_expand='<cword>'}<CR>]],
{ noremap = true, silent = true },
},
},
}