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

@ -3,11 +3,11 @@
"asyncrun.vim": { "branch": "master", "commit": "7191d0c30dd105e5d7f897b9a6ee19cabe734466" }, "asyncrun.vim": { "branch": "master", "commit": "7191d0c30dd105e5d7f897b9a6ee19cabe734466" },
"auto-session": { "branch": "main", "commit": "21033c6815f249a7839c3a85fc8a6b44d74925c9" }, "auto-session": { "branch": "main", "commit": "21033c6815f249a7839c3a85fc8a6b44d74925c9" },
"calendar-vim": { "branch": "master", "commit": "a7e73e02c92566bf427b2a1d6a61a8f23542cc21" }, "calendar-vim": { "branch": "master", "commit": "a7e73e02c92566bf427b2a1d6a61a8f23542cc21" },
"catppuccin": { "branch": "main", "commit": "ad6305594737e16155c41c176c611e865c26bb6d" }, "catppuccin": { "branch": "main", "commit": "506a4aa13443e0104ea49b99947cc09488d0791d" },
"ciderlsp_nvim": { "branch": "main", "commit": "7007e1881eb421a4d6f7ef1f31e973f7cc0b4d8d" }, "ciderlsp_nvim": { "branch": "main", "commit": "7007e1881eb421a4d6f7ef1f31e973f7cc0b4d8d" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f0f53f704c08ea501f9d222b23491b0d354644b0" }, "cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f0f53f704c08ea501f9d222b23491b0d354644b0" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
@ -20,44 +20,43 @@
"cmp_nvim_ciderlsp": { "branch": "main", "commit": "e1b0015a0c090e20d1cbb34e5639e6dd145d3f3e" }, "cmp_nvim_ciderlsp": { "branch": "main", "commit": "e1b0015a0c090e20d1cbb34e5639e6dd145d3f3e" },
"conflict-marker.vim": { "branch": "master", "commit": "11a4d42244755505b66b15cd4496a150432eb5e3" }, "conflict-marker.vim": { "branch": "master", "commit": "11a4d42244755505b66b15cd4496a150432eb5e3" },
"crates.nvim": { "branch": "main", "commit": "1dffccc0a95f656ebe00cacb4de282473430c5a1" }, "crates.nvim": { "branch": "main", "commit": "1dffccc0a95f656ebe00cacb4de282473430c5a1" },
"factorus": { "branch": "master", "commit": "19816e370df82fe96ca96856cf2be4d1c82302da" }, "formatter.nvim": { "branch": "master", "commit": "fa4f2729cc2909db599169f22d8e55632d4c8d59" },
"fidget.nvim": { "branch": "main", "commit": "f1c375ba68839eaa4a65efdf2aa078c0da0548fe" }, "fzf": { "branch": "master", "commit": "01302d097c39c3429de65424c6adb75fcac82187" },
"fzf": { "branch": "master", "commit": "d471067e3f46f64e6401d1c5717424535fe4c96c" },
"fzf.vim": { "branch": "master", "commit": "1dcdb21db618055134cd611f4f5918f6d00a5df0" }, "fzf.vim": { "branch": "master", "commit": "1dcdb21db618055134cd611f4f5918f6d00a5df0" },
"git-conflict.nvim": { "branch": "main", "commit": "8d962d83cae924a314965f738ed1e05a4000d682" }, "git-conflict.nvim": { "branch": "main", "commit": "8d962d83cae924a314965f738ed1e05a4000d682" },
"gitsigns.nvim": { "branch": "main", "commit": "f1c5aa10509e8e109f449499b69567191d25320f" }, "gitsigns.nvim": { "branch": "main", "commit": "a36bc3360d584d39b4fb076d855c4180842d4444" },
"go.nvim": { "branch": "master", "commit": "a8095eb334495caec3099b717cc7f5b1fbc3e628" }, "go.nvim": { "branch": "master", "commit": "97b76f3188c64d4dacfc17c7c1543f775a3fb8e8" },
"google_comments": { "branch": "main", "commit": "ad50cd3c71a7553c92a966dba6a03232a81e3812" }, "google_comments": { "branch": "main", "commit": "ad50cd3c71a7553c92a966dba6a03232a81e3812" },
"guihua.lua": { "branch": "master", "commit": "ab8b1f09603cc268770efd057115035dc6cfa83d" }, "guihua.lua": { "branch": "master", "commit": "ab8b1f09603cc268770efd057115035dc6cfa83d" },
"hg": { "branch": "main", "commit": "1c4bdf80174ec840ba76c4dc7032c4313db62199" }, "hg": { "branch": "main", "commit": "1c4bdf80174ec840ba76c4dc7032c4313db62199" },
"java-syntax.vim": { "branch": "master", "commit": "9a3d76a8c6cd7765ba93a7bdd9280594167e3f1b" }, "java-syntax.vim": { "branch": "master", "commit": "9a3d76a8c6cd7765ba93a7bdd9280594167e3f1b" },
"kotlin-vim": { "branch": "master", "commit": "53fe045906df8eeb07cb77b078fc93acda6c90b8" }, "kotlin-vim": { "branch": "master", "commit": "53fe045906df8eeb07cb77b078fc93acda6c90b8" },
"lazy.nvim": { "branch": "main", "commit": "10d4371745f88837c78c8daab00c5be6e48abea4" }, "lazy.nvim": { "branch": "main", "commit": "b7043f2983d7aead78ca902f3f2053907081859a" },
"libp.nvim": { "branch": "main", "commit": "636b1748e92f66022c1763f32b2ded6b8606eda5" }, "libp.nvim": { "branch": "main", "commit": "636b1748e92f66022c1763f32b2ded6b8606eda5" },
"lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" },
"lsp-zero.nvim": { "branch": "v2.x", "commit": "cf38e6034f2d776ebd16304a334b79543d1ffa60" }, "lsp-zero.nvim": { "branch": "v2.x", "commit": "52582fc91efb40ee347c20570ff7d32849ef4a89" },
"lsp_lines.nvim": { "branch": "main", "commit": "3b57922d2d79762e6baedaf9d66d8ba71f822816" }, "lsp_lines.nvim": { "branch": "main", "commit": "3b57922d2d79762e6baedaf9d66d8ba71f822816" },
"lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
"lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" },
"markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "d381fcb78d7a562c3244e1c8f76406954649db36" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "d381fcb78d7a562c3244e1c8f76406954649db36" },
"mason.nvim": { "branch": "main", "commit": "4be1226f48bc2011024110f37b17f5ee468df58f" }, "mason.nvim": { "branch": "main", "commit": "664c987c3b14d2262a4e580f993a3e5045baded0" },
"mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
"neo-tree.nvim": { "branch": "v2.x", "commit": "d883632bf8f92f1d5abea4a9c28fb2f90aa795aa" }, "neo-tree.nvim": { "branch": "v2.x", "commit": "8324fd52f7880bf17142f56b45f544d64eff5ac9" },
"nerdcommenter": { "branch": "master", "commit": "b0b09ea46c9f0509556257bd8b838b40f493d6a0" }, "nerdcommenter": { "branch": "master", "commit": "b0b09ea46c9f0509556257bd8b838b40f493d6a0" },
"nui.nvim": { "branch": "main", "commit": "e916f67b6bae1d290efa7c824ae4e04023cdfb20" }, "nui.nvim": { "branch": "main", "commit": "d146966a423e60699b084eeb28489fe3b6427599" },
"null-ls.nvim": { "branch": "main", "commit": "a138b14099e9623832027ea12b4631ddd2a49256" }, "null-ls.nvim": { "branch": "main", "commit": "bbaf5a96913aa92281f154b08732be2f57021c45" },
"nvim-cmp": { "branch": "main", "commit": "b8c2a62b3bd3827aa059b43be3dd4b5c45037d65" }, "nvim-cmp": { "branch": "main", "commit": "e1f1b40790a8cb7e64091fb12cc5ffe350363aa0" },
"nvim-lightbulb": { "branch": "master", "commit": "ca5b44a8efffb5fec1963ccd21f25ec04cc778b7" }, "nvim-lightbulb": { "branch": "master", "commit": "ca5b44a8efffb5fec1963ccd21f25ec04cc778b7" },
"nvim-lspconfig": { "branch": "master", "commit": "295c646488d5baa63c6c4da68fe61171b9257375" }, "nvim-lspconfig": { "branch": "master", "commit": "b6b34b9acf84949f0ac1c00747765e62b81fb38d" },
"nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" },
"nvim-osc52": { "branch": "main", "commit": "3e96035d62290183fe7a11418db2b254fcfcaee3" }, "nvim-osc52": { "branch": "main", "commit": "3e96035d62290183fe7a11418db2b254fcfcaee3" },
"nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" },
"nvim-treesitter": { "branch": "master", "commit": "5822a8c6886f0238a315b57e5e96acdd74d04448" }, "nvim-treesitter": { "branch": "master", "commit": "f26596386f31d5bd74b85b7d1ab0fd90c5b98608" },
"nvim-web-devicons": { "branch": "master", "commit": "2a125024a137677930efcfdf720f205504c97268" }, "nvim-web-devicons": { "branch": "master", "commit": "14b3a5ba63b82b60cde98d0a40319d80f25e8301" },
"nvim_figtree": { "branch": "main", "commit": "9bc3025f46e34732382da1019e256a9d8bec1e55" }, "nvim_figtree": { "branch": "main", "commit": "9bc3025f46e34732382da1019e256a9d8bec1e55" },
"plenary.nvim": { "branch": "master", "commit": "36aaceb6e93addd20b1b18f94d86aecc552f30c4" }, "plenary.nvim": { "branch": "master", "commit": "36aaceb6e93addd20b1b18f94d86aecc552f30c4" },
"refactoring.nvim": { "branch": "master", "commit": "08bcc40638cd4debd5184f934971858e1c5acff4" }, "refactoring.nvim": { "branch": "master", "commit": "9f28801ed1803306ddbe5b8058849da412a90648" },
"registers.nvim": { "branch": "main", "commit": "2ab8372bb837f05fae6b43091f10a0b725d113ca" }, "registers.nvim": { "branch": "main", "commit": "2ab8372bb837f05fae6b43091f10a0b725d113ca" },
"rust-tools.nvim": { "branch": "master", "commit": "71d2cf67b5ed120a0e31b2c8adb210dd2834242f" }, "rust-tools.nvim": { "branch": "master", "commit": "71d2cf67b5ed120a0e31b2c8adb210dd2834242f" },
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" }, "symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
@ -67,14 +66,14 @@
"telescope_citc": { "branch": "main", "commit": "d6421d5bfe058915ece0daec55e488f8ea05f207" }, "telescope_citc": { "branch": "main", "commit": "d6421d5bfe058915ece0daec55e488f8ea05f207" },
"telescope_codesearch": { "branch": "main", "commit": "a26077ad3c68cf897ae1c31da903d6516ebb9c92" }, "telescope_codesearch": { "branch": "main", "commit": "a26077ad3c68cf897ae1c31da903d6516ebb9c92" },
"telescope_fig": { "branch": "main", "commit": "90150e1aa368b49a5125689b3a6da573a99e2bda" }, "telescope_fig": { "branch": "main", "commit": "90150e1aa368b49a5125689b3a6da573a99e2bda" },
"trouble.nvim": { "branch": "main", "commit": "2af0dd9767526410c88c628f1cbfcb6cf22dd683" }, "trouble.nvim": { "branch": "main", "commit": "a3372bd2ba3a91882a6e54ed35da13a441d7c167" },
"undotree": { "branch": "master", "commit": "485f01efde4e22cb1ce547b9e8c9238f36566f21" }, "undotree": { "branch": "master", "commit": "485f01efde4e22cb1ce547b9e8c9238f36566f21" },
"vcscommand.vim": { "branch": "master", "commit": "2fb32681361f37533455d20aaa7fc6eb11b0fa4b" }, "vcscommand.vim": { "branch": "master", "commit": "2fb32681361f37533455d20aaa7fc6eb11b0fa4b" },
"vim-better-whitespace": { "branch": "master", "commit": "1b22dc57a2751c7afbc6025a7da39b7c22db635d" }, "vim-better-whitespace": { "branch": "master", "commit": "1b22dc57a2751c7afbc6025a7da39b7c22db635d" },
"vim-dirdiff": { "branch": "master", "commit": "84bc8999fde4b3c2d8b228b560278ab30c7ea4c9" }, "vim-dirdiff": { "branch": "master", "commit": "84bc8999fde4b3c2d8b228b560278ab30c7ea4c9" },
"vim-imp": { "branch": "main", "commit": "394e926ce62010443731f3923031e5afa1279f3e" }, "vim-imp": { "branch": "main", "commit": "394e926ce62010443731f3923031e5afa1279f3e" },
"vim-indent-guides": { "branch": "master", "commit": "a1e1390c0136e63e813d051de2003bf0ee18ae30" }, "vim-indent-guides": { "branch": "master", "commit": "a1e1390c0136e63e813d051de2003bf0ee18ae30" },
"vim-matchup": { "branch": "master", "commit": "3625e099b09bff2db5f04082cb09ba679525980c" }, "vim-matchup": { "branch": "master", "commit": "3a17944bfa3942da805a381750a1be4b314c64d2" },
"vim-ripgrep": { "branch": "master", "commit": "2bb2425387b449a0cd65a54ceb85e123d7a320b8" }, "vim-ripgrep": { "branch": "master", "commit": "2bb2425387b449a0cd65a54ceb85e123d7a320b8" },
"vim-searchindex": { "branch": "master", "commit": "b0788c8213210b3bd23b62847dd5a9ebbe4ad648" }, "vim-searchindex": { "branch": "master", "commit": "b0788c8213210b3bd23b62847dd5a9ebbe4ad648" },
"vim-signify": { "branch": "master", "commit": "7d538b77a5a8806e344b057f8846f6d0c035efa9" }, "vim-signify": { "branch": "master", "commit": "7d538b77a5a8806e344b057f8846f6d0c035efa9" },
@ -87,5 +86,5 @@
"vim-vsnip": { "branch": "master", "commit": "7753ba9c10429c29d25abfd11b4c60b76718c438" }, "vim-vsnip": { "branch": "master", "commit": "7753ba9c10429c29d25abfd11b4c60b76718c438" },
"vim-windowswap": { "branch": "master", "commit": "15db3f697aa1fa696d99fcdc920c90cd2cec855e" }, "vim-windowswap": { "branch": "master", "commit": "15db3f697aa1fa696d99fcdc920c90cd2cec855e" },
"vimux": { "branch": "master", "commit": "616fcb4799674a7a809b14ca2dc155bb6ba25788" }, "vimux": { "branch": "master", "commit": "616fcb4799674a7a809b14ca2dc155bb6ba25788" },
"which-key.nvim": { "branch": "main", "commit": "e271c28118998c93a14d189af3395812a1aa646c" } "which-key.nvim": { "branch": "main", "commit": "d871f2b664afd5aed3dc1d1573bef2fb24ce0484" }
} }

View File

@ -1,5 +1,5 @@
local M = {} local M = {}
local notify = require 'notify' local notify = require("notify")
local lsp_util = vim.lsp.util local lsp_util = vim.lsp.util
@ -7,8 +7,8 @@ function M.code_action_listener()
local context = { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() } local context = { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() }
local params = lsp_util.make_range_params() local params = lsp_util.make_range_params()
params.context = context params.context = context
vim.lsp.buf_request(0, 'textDocument/codeAction', params, function(err, _, result) vim.lsp.buf_request(0, "textDocument/codeAction", params, function(err, _, result)
notify('codeAction '..result, 'info', {timeout=500}) notify("codeAction " .. result, "info", { timeout = 500 })
end) end)
end end

View File

@ -68,4 +68,4 @@ require("catppuccin").setup({
}, },
}) })
vim.api.nvim_command "colorscheme catppuccin" vim.api.nvim_command("colorscheme catppuccin")

View File

@ -6,9 +6,9 @@ map("n", "<leader>dso", ":lua require'dap'.step_over()<CR>")
map("n", "<leader>di", ":lua require'dap'.repl.open()<CR>") map("n", "<leader>di", ":lua require'dap'.repl.open()<CR>")
local on_attach = function(client, bufnr) local on_attach = function(client, bufnr)
require'jdtls.setup'.add_commands() require("jdtls.setup").add_commands()
require'jdtls'.setup_dap() require("jdtls").setup_dap()
require'lsp-status'.register_progress() require("lsp-status").register_progress()
-- require'lspkind'.init() -- require'lspkind'.init()
-- require'lspsaga'.init_lsp_saga() -- require'lspsaga'.init_lsp_saga()
@ -16,17 +16,24 @@ local on_attach = function(client, bufnr)
vim.api.nvim_set_keymap("n", "<leader>/", "<plug>kommentary_line_default", {}) vim.api.nvim_set_keymap("n", "<leader>/", "<plug>kommentary_line_default", {})
vim.api.nvim_set_keymap("v", "<leader>/", "<plug>kommentary_visual_default", {}) vim.api.nvim_set_keymap("v", "<leader>/", "<plug>kommentary_visual_default", {})
vim.api.nvim_exec([[ vim.api.nvim_exec(
[[
augroup FormatAutogroup augroup FormatAutogroup
autocmd! autocmd!
autocmd BufWritePost *.java FormatWrite autocmd BufWritePost *.java FormatWrite
augroup end augroup end
]], true) ]],
true
)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end local function buf_set_keymap(...)
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end vim.api.nvim_buf_set_keymap(bufnr, ...)
end
local function buf_set_option(...)
vim.api.nvim_buf_set_option(bufnr, ...)
end
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
-- Mappings. -- Mappings.
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
@ -49,7 +56,8 @@ local on_attach = function(client, bufnr)
buf_set_keymap("n", "<leader>de", "<Cmd>lua require('jdtls').extract_variable()<CR>", opts) buf_set_keymap("n", "<leader>de", "<Cmd>lua require('jdtls').extract_variable()<CR>", opts)
buf_set_keymap("v", "<leader>dm", "<Esc><Cmd>lua require('jdtls').extract_method(true)<CR>", opts) buf_set_keymap("v", "<leader>dm", "<Esc><Cmd>lua require('jdtls').extract_method(true)<CR>", opts)
vim.api.nvim_exec([[ vim.api.nvim_exec(
[[
hi LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow hi LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow
hi LspReferenceText cterm=bold ctermbg=red guibg=LightYellow hi LspReferenceText cterm=bold ctermbg=red guibg=LightYellow
hi LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow hi LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow
@ -58,42 +66,43 @@ local on_attach = function(client, bufnr)
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight() autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references() autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END augroup END
]], false) ]],
false
)
end end
local root_markers = {'gradlew', 'pom.xml','BUILD'} local root_markers = { "gradlew", "pom.xml", "BUILD" }
local root_dir = require('jdtls.setup').find_root(root_markers) local root_dir = require("jdtls.setup").find_root(root_markers)
local home = os.getenv('HOME') local home = os.getenv("HOME")
local capabilities = { local capabilities = {
workspace = { workspace = {
configuration = true configuration = true,
}, },
textDocument = { textDocument = {
completion = { completion = {
completionItem = { completionItem = {
snippetSupport = true snippetSupport = true,
} },
} },
} },
} }
local workspace_folder = home .. "/.workspace" .. vim.fn.fnamemodify(root_dir, ":p:h:t") local workspace_folder = home .. "/.workspace" .. vim.fn.fnamemodify(root_dir, ":p:h:t")
local config = { local config = {
flags = { flags = {
allow_incremental_sync = true, allow_incremental_sync = true,
}; },
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach, on_attach = on_attach,
} }
config.settings = { config.settings = {
['java.format.settings.url'] = home .. "/.config/nvim/language-servers/java-google-formatter.xml", ["java.format.settings.url"] = home .. "/.config/nvim/language-servers/java-google-formatter.xml",
['java.format.settings.profile'] = "GoogleStyle", ["java.format.settings.profile"] = "GoogleStyle",
java = { java = {
signatureHelp = { enabled = true }; signatureHelp = { enabled = true },
contentProvider = { preferred = 'fernflower' }; contentProvider = { preferred = "fernflower" },
completion = { completion = {
favoriteStaticMembers = { favoriteStaticMembers = {
"org.hamcrest.MatcherAssert.assertThat", "org.hamcrest.MatcherAssert.assertThat",
@ -102,20 +111,20 @@ config.settings = {
"org.junit.jupiter.api.Assertions.*", "org.junit.jupiter.api.Assertions.*",
"java.util.Objects.requireNonNull", "java.util.Objects.requireNonNull",
"java.util.Objects.requireNonNullElse", "java.util.Objects.requireNonNullElse",
"org.mockito.Mockito.*" "org.mockito.Mockito.*",
} },
}; },
sources = { sources = {
organizeImports = { organizeImports = {
starThreshold = 9999; starThreshold = 9999,
staticStarThreshold = 9999; staticStarThreshold = 9999,
}; },
}; },
codeGeneration = { codeGeneration = {
toString = { toString = {
template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}" template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}",
} },
}; },
configuration = { configuration = {
runtimes = { runtimes = {
{ {
@ -130,33 +139,34 @@ config.settings = {
name = "JavaSE-15", name = "JavaSE-15",
path = home .. "/.sdkman/candidates/java/15.0.1-open/", path = home .. "/.sdkman/candidates/java/15.0.1-open/",
}, },
},
},
},
} }
}; config.cmd = { "javalsp", workspace_folder }
};
}
config.cmd = {'javalsp', workspace_folder}
config.on_attach = on_attach config.on_attach = on_attach
config.on_init = function(client, _) config.on_init = function(client, _)
client.notify('workspace/didChangeConfiguration', { settings = config.settings }) client.notify("workspace/didChangeConfiguration", { settings = config.settings })
end end
local extendedClientCapabilities = require'jdtls'.extendedClientCapabilities local extendedClientCapabilities = require("jdtls").extendedClientCapabilities
extendedClientCapabilities.resolveAdditionalTextEditsSupport = true extendedClientCapabilities.resolveAdditionalTextEditsSupport = true
config.init_options = { config.init_options = {
-- bundles = bundles; -- bundles = bundles;
extendedClientCapabilities = extendedClientCapabilities; extendedClientCapabilities = extendedClientCapabilities,
} }
-- UI -- UI
local finders = require'telescope.finders' local finders = require("telescope.finders")
local sorters = require'telescope.sorters' local sorters = require("telescope.sorters")
local actions = require'telescope.actions' local actions = require("telescope.actions")
local pickers = require'telescope.pickers' local pickers = require("telescope.pickers")
require('jdtls.ui').pick_one_async = function(items, prompt, label_fn, cb) require("jdtls.ui").pick_one_async = function(items, prompt, label_fn, cb)
local opts = {} local opts = {}
pickers.new(opts, { pickers
.new(opts, {
prompt_title = prompt, prompt_title = prompt,
finder = finders.new_table { finder = finders.new_table({
results = items, results = items,
entry_maker = function(entry) entry_maker = function(entry)
return { return {
@ -165,7 +175,7 @@ require('jdtls.ui').pick_one_async = function(items, prompt, label_fn, cb)
ordinal = label_fn(entry), ordinal = label_fn(entry),
} }
end, end,
}, }),
sorter = sorters.get_generic_fuzzy_sorter(), sorter = sorters.get_generic_fuzzy_sorter(),
attach_mappings = function(prompt_bufnr) attach_mappings = function(prompt_bufnr)
actions.goto_file_selection_edit:replace(function() actions.goto_file_selection_edit:replace(function()
@ -177,19 +187,20 @@ require('jdtls.ui').pick_one_async = function(items, prompt, label_fn, cb)
return true return true
end, end,
}):find() })
:find()
end end
local dap = require('dap') local dap = require("dap")
dap.configurations.java = { dap.configurations.java = {
{ {
type = 'java'; type = "java",
request = 'attach'; request = "attach",
name = "Debug (Attach) - Remote"; name = "Debug (Attach) - Remote",
hostName = "127.0.0.1"; hostName = "127.0.0.1",
port = 5005; port = 5005,
}, },
} }
-- Server -- Server
require('jdtls').start_or_attach(config) require("jdtls").start_or_attach(config)

View File

@ -6,28 +6,28 @@ if use_google() then
map("n", "<leader>tb", ":Telescope file_browser<CR>") map("n", "<leader>tb", ":Telescope file_browser<CR>")
-- [F]ig [S]tatus -- [F]ig [S]tatus
map('n', '<leader>fs', [[<cmd>lua require('telescope').extensions.fig.status{}<CR>]]) map("n", "<leader>fs", [[<cmd>lua require('telescope').extensions.fig.status{}<CR>]])
-- [F]ig [X]l -- [F]ig [X]l
map('n', '<leader>fx', [[<cmd>lua require('telescope').extensions.fig.xl{}<CR>]]) map("n", "<leader>fx", [[<cmd>lua require('telescope').extensions.fig.xl{}<CR>]])
-- [F]ig [W]hatsout -- [F]ig [W]hatsout
map('n', '<leader>fw', [[<cmd>lua require('telescope').extensions.fig.status{whatsout=true}<CR>]]) map("n", "<leader>fw", [[<cmd>lua require('telescope').extensions.fig.status{whatsout=true}<CR>]])
-- [F]ig [A]mend -- [F]ig [A]mend
map('n', '<leader>fa', [[<cmd>Hg amend<CR>]]) map("n", "<leader>fa", [[<cmd>Hg amend<CR>]])
-- [F]ig [A]mend -- [F]ig [A]mend
map('n', '<leader>fe', [[<cmd>Hg evolve<CR>]]) map("n", "<leader>fe", [[<cmd>Hg evolve<CR>]])
-- [F]ig [N]ext -- [F]ig [N]ext
map('n', '<leader>fn', [[<cmd>Hg next<CR>]]) map("n", "<leader>fn", [[<cmd>Hg next<CR>]])
-- --
-- [F]ig [P]rev -- [F]ig [P]rev
map('n', '<leader>fp', [[<cmd>Hg prev<CR>]]) map("n", "<leader>fp", [[<cmd>Hg prev<CR>]])
-- --
-- [F]ig [U]pload -- [F]ig [U]pload
map('n', '<leader>fu', [[<cmd>Hg upload tree<CR>]]) map("n", "<leader>fu", [[<cmd>Hg upload tree<CR>]])
-- map('n', '<Leader>f', ':Figtree<CR>', { silent = true }) -- map('n', '<Leader>f', ':Figtree<CR>', { silent = true })
end end

View File

@ -1,14 +1,21 @@
-- Here are all the options and their default values: -- Here are all the options and their default values:
require('google.comments').setup { require("google.comments").setup({
-- command = {'/google/bin/releases/editor-devtools/get_comments.par', '--full', '--json', "-x=''"}, -- command = {'/google/bin/releases/editor-devtools/get_comments.par', '--full', '--json', "-x=''"},
-- stubby = true, -- stubby = true,
command = {'/google/bin/releases/editor-devtools/get_comments.par', '--json', '--full', '--noresolved', '--cl_comments', '--file_comments'}, command = {
"/google/bin/releases/editor-devtools/get_comments.par",
"--json",
"--full",
"--noresolved",
"--cl_comments",
"--file_comments",
},
-- command = {'stubby --output_json call blade:codereview-rpc CodereviewRpcService.GetComments "changelist_number: $(/google/data/ro/teams/fig/bin/vcstool pending-change-number)"'}, -- command = {'stubby --output_json call blade:codereview-rpc CodereviewRpcService.GetComments "changelist_number: $(/google/data/ro/teams/fig/bin/vcstool pending-change-number)"'},
-- Define your own icon by `vim.fn.sign_define('ICON_NAME', {text = ' '})`. -- Define your own icon by `vim.fn.sign_define('ICON_NAME', {text = ' '})`.
-- See :help sign_define -- See :help sign_define
-- The sign property passed to setup should be the 'ICON_NAME' in the define -- The sign property passed to setup should be the 'ICON_NAME' in the define
-- example above. -- example above.
sign = 'COMMENT_ICON', sign = "COMMENT_ICON",
-- Fetch the comments after calling `setup`. -- Fetch the comments after calling `setup`.
auto_fetch = true, auto_fetch = true,
display = { display = {
@ -19,35 +26,34 @@ require('google.comments').setup {
--- Enable viewing comments through floating window --- Enable viewing comments through floating window
floating = true, floating = true,
--- Options used when creating the floating window. --- Options used when creating the floating window.
floating_window_options = floating_window_options floating_window_options = floating_window_options,
}, },
} })
function floating_window_options(parent_win_id) function floating_window_options(parent_win_id)
local parent_width = vim.api.nvim_win_get_width(parent_win_id) local parent_width = vim.api.nvim_win_get_width(parent_win_id)
local parent_height = vim.api.nvim_win_get_height(parent_win_id) local parent_height = vim.api.nvim_win_get_height(parent_win_id)
return { return {
relative = 'win', relative = "win",
anchor = 'NW', anchor = "NW",
width = math.floor(parent_width * 0.5), width = math.floor(parent_width * 0.5),
height = math.floor(parent_height * 0.3), height = math.floor(parent_height * 0.3),
row = vim.api.nvim_win_get_cursor(parent_win_id)[1], row = vim.api.nvim_win_get_cursor(parent_win_id)[1],
col = math.floor(parent_width * 0.25), col = math.floor(parent_width * 0.25),
border = 'rounded', border = "rounded",
} }
end end
local map = require("utils").map local map = require("utils").map
-- here are some mappings you might want: -- here are some mappings you might want:
map('n', ']c', [[<Cmd>GoogleCommentsGotoNextComment<CR>]]) map("n", "]c", [[<Cmd>GoogleCommentsGotoNextComment<CR>]])
map('n', '[c', [[<Cmd>GoogleCommentsGotoPrevComment<CR>]]) map("n", "[c", [[<Cmd>GoogleCommentsGotoPrevComment<CR>]])
map('n', '<Leader>nc', [[<Cmd>GoogleCommentsGotoNextComment<CR>]]) map("n", "<Leader>nc", [[<Cmd>GoogleCommentsGotoNextComment<CR>]])
map('n', '<Leader>pc', [[<Cmd>GoogleCommentsGotoPrevComment<CR>]]) map("n", "<Leader>pc", [[<Cmd>GoogleCommentsGotoPrevComment<CR>]])
map('n', '<Leader>lc', [[<Cmd>GoogleCommentsToggleLineComments<CR>]]) map("n", "<Leader>lc", [[<Cmd>GoogleCommentsToggleLineComments<CR>]])
map('n', '<Leader>ac', [[<Cmd>GoogleCommentsToggleAllComments<CR>]]) map("n", "<Leader>ac", [[<Cmd>GoogleCommentsToggleAllComments<CR>]])
map('n', '<Leader>fc', [[<Cmd>GoogleCommentsFetchComments<CR>]]) map("n", "<Leader>fc", [[<Cmd>GoogleCommentsFetchComments<CR>]])
vim.fn.sign_define('COMMENT_ICON', {text = ''}) vim.fn.sign_define("COMMENT_ICON", { text = "" })

View File

@ -1,13 +1,13 @@
local use_google = require("utils").use_google local use_google = require("utils").use_google
local log = require("utils").log local log = require("utils").log
local notify = require 'notify' local notify = require("notify")
local lsp_status = require('lsp-status') local lsp_status = require("lsp-status")
lsp_status.register_progress() lsp_status.register_progress()
require("mason").setup() require("mason").setup()
require("mason-lspconfig").setup({ require("mason-lspconfig").setup({
ensure_installed = { "lua_ls", "rust_analyzer" } ensure_installed = { "lua_ls", "rust_analyzer" },
}) })
-- CiderLSP -- CiderLSP
@ -16,7 +16,7 @@ vim.opt.completeopt = { "menu", "menuone", "noselect" }
vim.opt.shortmess:append("c") vim.opt.shortmess:append("c")
vim.opt.spell = true vim.opt.spell = true
vim.opt.spelllang = { 'en_us' } vim.opt.spelllang = { "en_us" }
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
local configs = require("lspconfig.configs") local configs = require("lspconfig.configs")
@ -24,8 +24,20 @@ local configs = require("lspconfig.configs")
if use_google() then if use_google() then
configs.ciderlsp = { configs.ciderlsp = {
default_config = { default_config = {
cmd = { "/google/bin/releases/cider/ciderlsp/ciderlsp", "--tooltag=nvim-cmp", "--forward_sync_responses", "--merge_diagnostic_layers" }, cmd = { "/google/bin/releases/cider/ciderlsp/ciderlsp", "--tooltag=nvim-cmp", "--forward_sync_responses" },
filetypes = { "c", "cpp", "java", "kotlin", "objc", "proto", "textproto", "go", "python", "bzl", "typescript"}, filetypes = {
"c",
"cpp",
"java",
"kotlin",
"objc",
"proto",
"textproto",
"go",
"python",
"bzl",
"typescript",
},
root_dir = lspconfig.util.root_pattern("BUILD"), root_dir = lspconfig.util.root_pattern("BUILD"),
-- root_dir = function(fname) -- root_dir = function(fname)
-- return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$') -- return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$')
@ -36,9 +48,23 @@ if use_google() then
configs.analysislsp = { configs.analysislsp = {
default_config = { default_config = {
cmd = { '/google/bin/users/lerm/glint-ale/analysis_lsp/server', '--lint_on_save=false', '--max_qps=10' }, cmd = { "/google/bin/users/lerm/glint-ale/analysis_lsp/server", "--lint_on_save=false", "--max_qps=10" },
filetypes = { "c", "cpp", "java", "kotlin", "objc", "proto", "textproto", "go", "python", "bzl", "markdown","typescript", "javascript"}, filetypes = {
root_dir = lspconfig.util.root_pattern('BUILD'), "c",
"cpp",
"java",
"kotlin",
"objc",
"proto",
"textproto",
"go",
"python",
"bzl",
"markdown",
"typescript",
"javascript",
},
root_dir = lspconfig.util.root_pattern("BUILD"),
-- root_dir = function(fname) -- root_dir = function(fname)
-- return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$') -- return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$')
-- end; -- end;
@ -49,8 +75,8 @@ end
-- 3. Set up CiderLSP -- 3. Set up CiderLSP
local on_attach = function(client, bufnr) local on_attach = function(client, bufnr)
vim.b['is_cider_lsp_attached'] = 'no' vim.b["is_cider_lsp_attached"] = "no"
require('lualine').refresh() require("lualine").refresh()
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
if vim.lsp.formatexpr then -- Neovim v0.6.0+ only. if vim.lsp.formatexpr then -- Neovim v0.6.0+ only.
@ -86,24 +112,23 @@ local on_attach = function(client, bufnr)
vim.api.nvim_set_keymap("n", "gt", "<cmd>lua vim.lsp.buf.type_definition()<CR>", opts) vim.api.nvim_set_keymap("n", "gt", "<cmd>lua vim.lsp.buf.type_definition()<CR>", opts)
end end
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()) capabilities["codeLens"] = { dynamicRegistration = false }
capabilities['codeLens'] = {dynamicRegistration=false}
capabilities.textDocument.publishDiagnostics = { capabilities.textDocument.publishDiagnostics = {
relatedInformation = true, relatedInformation = true,
versionSupport = false, versionSupport = false,
tagSupport = { tagSupport = {
valueSet = { valueSet = {
1, 1,
2 2,
} },
}, },
codeDescriptionSupport = true, codeDescriptionSupport = true,
dataSupport = true, dataSupport = true,
layeredDiagnostics=true layeredDiagnostics = true,
} }
capabilities = vim.tbl_extend('keep', capabilities or {}, lsp_status.capabilities) capabilities = vim.tbl_extend("keep", capabilities or {}, lsp_status.capabilities)
local runtime_path = vim.split(package.path, ";") local runtime_path = vim.split(package.path, ";")
table.insert(runtime_path, "lua/?.lua") table.insert(runtime_path, "lua/?.lua")
@ -123,36 +148,36 @@ local feedkey = function(key, mode)
end end
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, { cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = { sources = {
{ name = 'buffer', max_item_count = 5 } { name = "buffer", max_item_count = 5 },
} },
}) })
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', { cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp_document_symbol' } { name = "nvim_lsp_document_symbol" },
}, { }, {
{ name = 'path' } { name = "path" },
}, { }, {
{ name = 'cmdline' } { name = "cmdline" },
}) }),
}) })
local conditionalSources = { local conditionalSources = {
{ name = "nvim_lua" }, { name = "nvim_lua" },
{ name = "nvim_lsp" }, { name = "nvim_lsp" },
{ name = 'nvim_lsp_signature_help', priority = 5 }, { name = "nvim_lsp_signature_help", priority = 5 },
{ name = "path" }, { name = "path" },
{ name = "treesitter" }, { name = "treesitter" },
{ name = "crates" }, { name = "crates" },
{ name = "vim_vsnip" }, { name = "vim_vsnip" },
{ name = "buffer", max_item_count = 5, keyword_length = 5, group_index = 2 }, { name = "buffer", max_item_count = 5, keyword_length = 5, group_index = 2 },
{ {
name = 'spell', name = "spell",
option = { option = {
keep_all_entries = false, keep_all_entries = false,
enable_in_context = function() enable_in_context = function()
@ -163,49 +188,48 @@ local conditionalSources = {
} }
if use_google() then if use_google() then
require('cmp_nvim_ciderlsp').setup() require("cmp_nvim_ciderlsp").setup()
local cider_lsp_handlers = { local cider_lsp_handlers = {
["textDocument/publishDiagnostics"] = vim.lsp.with( ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
vim.lsp.diagnostic.on_publish_diagnostics, {
underline = true, underline = true,
}) }),
} }
cider_lsp_handlers["$/syncResponse"] = function(_, result, ctx) cider_lsp_handlers["$/syncResponse"] = function(_, result, ctx)
-- is_cider_lsp_attached has been setup via on_init, but hasn't received -- is_cider_lsp_attached has been setup via on_init, but hasn't received
-- sync response yet. -- sync response yet.
local first_fire = vim.b['is_cider_lsp_attached'] == 'no' local first_fire = vim.b["is_cider_lsp_attached"] == "no"
vim.b['is_cider_lsp_attached'] = 'yes' vim.b["is_cider_lsp_attached"] = "yes"
if first_fire then if first_fire then
notify('CiderLSP attached', 'info', {timeout=500}) notify("CiderLSP attached", "info", { timeout = 500 })
require('lualine').refresh() require("lualine").refresh()
end end
end end
cider_lsp_handlers["workspace/diagnostic/refresh"] = function(_, result, ctx) cider_lsp_handlers["workspace/diagnostic/refresh"] = function(_, result, ctx)
notify('result:'..result, 'info', {timeout=900}) notify("result:" .. result, "info", { timeout = 900 })
notify('ctx:'..ctx, 'info', {timeout=900}) notify("ctx:" .. ctx, "info", { timeout = 900 })
end end
cider_lsp_handlers['window/showMessage'] = function(_, result, ctx) cider_lsp_handlers["window/showMessage"] = function(_, result, ctx)
local client = vim.lsp.get_client_by_id(ctx.client_id) local client = vim.lsp.get_client_by_id(ctx.client_id)
local lvl = ({ local lvl = ({
'ERROR', "ERROR",
'WARN', "WARN",
'INFO', "INFO",
'DEBUG', "DEBUG",
})[result.type] })[result.type]
notify({ result.message }, lvl, { notify({ result.message }, lvl, {
title = 'LSP | ' .. client.name, title = "LSP | " .. client.name,
timeout = 1000, timeout = 1000,
keep = function() keep = function()
return lvl == 'ERROR' or lvl == 'WARN' return lvl == "ERROR" or lvl == "WARN"
end, end,
}) })
end end
capabilities = require('cmp_nvim_ciderlsp').update_capabilities(capabilities) capabilities = require("cmp_nvim_ciderlsp").update_capabilities(capabilities)
capabilities.workspace.codeLens = { refreshSupport = true } capabilities.workspace.codeLens = { refreshSupport = true }
capabilities.workspace.diagnostics = { refreshSupport = true } capabilities.workspace.diagnostics = { refreshSupport = true }
lspconfig.ciderlsp.setup({ lspconfig.ciderlsp.setup({
@ -217,10 +241,10 @@ if use_google() then
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach, on_attach = on_attach,
}) })
table.insert(conditionalSources, { name = 'nvim_ciderlsp', priority = 9 }) table.insert(conditionalSources, { name = "nvim_ciderlsp", priority = 9 })
table.insert(conditionalSources, { name = 'analysislsp' }) table.insert(conditionalSources, { name = "analysislsp" })
else else
table.insert(conditionalSources, {name = 'cmp_tabnine'}) table.insert(conditionalSources, { name = "cmp_tabnine" })
end end
cmp.setup({ cmp.setup({
@ -274,13 +298,12 @@ cmp.setup({
sources = conditionalSources, sources = conditionalSources,
sorting = { sorting = {
comparators = { comparators = {
cmp.config.compare.offset, cmp.config.compare.offset,
cmp.config.compare.exact, cmp.config.compare.exact,
cmp.config.compare.score, cmp.config.compare.score,
require "cmp-under-comparator".under, require("cmp-under-comparator").under,
cmp.config.compare.kind, cmp.config.compare.kind,
cmp.config.compare.sort_text, cmp.config.compare.sort_text,
cmp.config.compare.length, cmp.config.compare.length,
@ -318,4 +341,6 @@ cmp.setup({
}, },
}) })
vim.cmd([[ augroup CmpZsh au! autocmd Filetype zsh lua require'cmp'.setup.buffer { sources = { { name = "zsh" }, } } augroup END ]]) vim.cmd(
[[ augroup CmpZsh au! autocmd Filetype zsh lua require'cmp'.setup.buffer { sources = { { name = "zsh" }, } } augroup END ]]
)

View File

@ -7,25 +7,25 @@ local split = function (inputstr, sep)
end end
local function getCitc() local function getCitc()
local fname = vim.api.nvim_buf_get_name(0) local fname = vim.api.nvim_buf_get_name(0)
if string.find(fname, '/google/src/cloud/', 1, true) then if string.find(fname, "/google/src/cloud/", 1, true) then
local parts = split(fname, '/') local parts = split(fname, "/")
return parts[5] return parts[5]
end end
end end
local function isCiderLspAttached() local function isCiderLspAttached()
if vim.b['is_cider_lsp_attached'] then if vim.b["is_cider_lsp_attached"] then
if vim.b['is_cider_lsp_attached'] == 'yes' then if vim.b["is_cider_lsp_attached"] == "yes" then
return '' return ""
else else
return 'x' return "x"
end end
else else
return '' return ""
end end
end end
local function getLightbulb() local function getLightbulb()
return require('nvim-lightbulb').get_status_text() return require("nvim-lightbulb").get_status_text()
end end
local function getLGTMs() local function getLGTMs()
@ -41,34 +41,38 @@ local function getLGTMs()
return "LGTM:" .. table.concat(lgtm, ",") .. " Approval:" .. table.concat(appr, ",") return "LGTM:" .. table.concat(lgtm, ",") .. " Approval:" .. table.concat(appr, ",")
end end
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 = 1000,
tabline = 1000, tabline = 1000,
winbar = 1000, winbar = 1000,
} },
}, },
sections = { sections = {
lualine_a = {'mode'}, lualine_a = { "mode" },
lualine_b = {'branch', 'diff', getCitc, isCiderLspAttached}, lualine_b = { "branch", "diff", getCitc, isCiderLspAttached },
lualine_c = {getLightbulb, 'filename'}, lualine_c = { getLightbulb, "filename" },
lualine_x = { lualine_x = {
{ 'diagnostics', sources = {"nvim_lsp"}, symbols = {error = '', warn = '', info = '', hint = ''} }, {
'encoding', "diagnostics",
'filetype' sources = { "nvim_lsp" },
symbols = { error = "", warn = "", info = "", hint = "" },
}, },
lualine_y = {'searchcount'}, "encoding",
lualine_z = {'location'} "filetype",
},
lualine_y = { "searchcount" },
lualine_z = { "location" },
}, },
tabline = { tabline = {
lualine_a = { lualine_a = {
{ {
'tabs', "tabs",
mode = 1, mode = 1,
max_length = (vim.o.columns / 5) * 4, max_length = (vim.o.columns / 5) * 4,
fmt = function(name, context) fmt = function(name, context)
@ -76,17 +80,21 @@ require('lualine').setup {
local buflist = vim.fn.tabpagebuflist(context.tabnr) local buflist = vim.fn.tabpagebuflist(context.tabnr)
local winnr = vim.fn.tabpagewinnr(context.tabnr) local winnr = vim.fn.tabpagewinnr(context.tabnr)
local bufnr = buflist[winnr] local bufnr = buflist[winnr]
local mod = vim.fn.getbufvar(bufnr, '&mod') local mod = vim.fn.getbufvar(bufnr, "&mod")
return name .. (mod == 1 and ' +' or '') return name .. (mod == 1 and " +" or "")
end end,
}, },
}, },
lualine_b = {'branch'}, lualine_b = { "branch" },
lualine_c = {'filename'}, lualine_c = { "filename" },
lualine_c = { lualine_c = {
{ 'diagnostics', sources = {"nvim_lsp", "nvim_workspace_diagnostic"}, symbols = {error = '', warn = '', info = '', hint = ''} }, {
"diagnostics",
sources = { "nvim_lsp", "nvim_workspace_diagnostic" },
symbols = { error = "", warn = "", info = "", hint = "" },
},
}, },
-- lualine_y = { getLGTMs } -- lualine_y = { getLGTMs }
}, },
} })

View File

@ -1,7 +1,6 @@
local map = require("utils").map local map = require("utils").map
require("neo-tree").setup({ require("neo-tree").setup({
hijack_netrw_behavior = "open_current" hijack_netrw_behavior = "open_current",
}) })
map("n", "<C-n>", ":Neotree filesystem reveal toggle reveal_force_cwd<cr>")
map('n', '<C-n>', ':Neotree filesystem reveal toggle reveal_force_cwd<cr>')

View File

@ -9,7 +9,7 @@ vim.g.NERDSpaceDelims = 1
vim.g.NERDCompactSexyComs = 1 vim.g.NERDCompactSexyComs = 1
-- Align line-wise comment delimiters flush left instead of following code indentation -- Align line-wise comment delimiters flush left instead of following code indentation
vim.g.NERDDefaultAlign = 'left' vim.g.NERDDefaultAlign = "left"
-- Set a language to use its alternate delimiters by default -- Set a language to use its alternate delimiters by default
vim.g.NERDAltDelims_java = 1 vim.g.NERDAltDelims_java = 1

View File

@ -1,4 +1,4 @@
local map = require("utils").map local map = require("utils").map
map('n', '<C-n>', ':NERDTreeToggle<cr>') map("n", "<C-n>", ":NERDTreeToggle<cr>")
map('n', '<C-f>', ':NERDTreeFind<cr>') map("n", "<C-f>", ":NERDTreeFind<cr>")

View File

@ -15,11 +15,9 @@ local sources = {
null_ls.builtins.code_actions.proselint, null_ls.builtins.code_actions.proselint,
-- Reformats Java source code according to Google Java Style. -- Reformats Java source code according to Google Java Style.
null_ls.builtins.formatting.google_java_format null_ls.builtins.formatting.google_java_format,
} }
null_ls.setup({ null_ls.setup({
sources = sources, sources = sources,
}) })

View File

@ -3,63 +3,63 @@ local map = require("utils").map
local api = require("nvim-tree.api") local api = require("nvim-tree.api")
local function opts(desc) local function opts(desc)
return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
end end
function on_attach(bufnr) function on_attach(bufnr)
vim.keymap.set('n', 'O', api.tree.change_root_to_node, opts('CD')) vim.keymap.set("n", "O", api.tree.change_root_to_node, opts("CD"))
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help')) vim.keymap.set("n", "?", api.tree.toggle_help, opts("Help"))
-- put some default mappings here -- put some default mappings here
vim.keymap.set('n', '<C-e>', api.node.open.replace_tree_buffer, opts('Open: In Place')) vim.keymap.set("n", "<C-e>", api.node.open.replace_tree_buffer, opts("Open: In Place"))
vim.keymap.set('n', '<C-k>', api.node.show_info_popup, opts('Info')) vim.keymap.set("n", "<C-k>", api.node.show_info_popup, opts("Info"))
vim.keymap.set('n', '<C-r>', api.fs.rename_sub, opts('Rename: Omit Filename')) vim.keymap.set("n", "<C-r>", api.fs.rename_sub, opts("Rename: Omit Filename"))
vim.keymap.set('n', '<C-t>', api.node.open.tab, opts('Open: New Tab')) vim.keymap.set("n", "<C-t>", api.node.open.tab, opts("Open: New Tab"))
vim.keymap.set('n', '<C-v>', api.node.open.vertical, opts('Open: Vertical Split')) vim.keymap.set("n", "<C-v>", api.node.open.vertical, opts("Open: Vertical Split"))
vim.keymap.set('n', '<C-x>', api.node.open.horizontal, opts('Open: Horizontal Split')) vim.keymap.set("n", "<C-x>", api.node.open.horizontal, opts("Open: Horizontal Split"))
vim.keymap.set('n', '<BS>', api.node.navigate.parent_close, opts('Close Directory')) vim.keymap.set("n", "<BS>", api.node.navigate.parent_close, opts("Close Directory"))
vim.keymap.set('n', '<CR>', api.node.open.edit, opts('Open')) vim.keymap.set("n", "<CR>", api.node.open.edit, opts("Open"))
vim.keymap.set('n', '<Tab>', api.node.open.preview, opts('Open Preview')) vim.keymap.set("n", "<Tab>", api.node.open.preview, opts("Open Preview"))
vim.keymap.set('n', '>', api.node.navigate.sibling.next, opts('Next Sibling')) vim.keymap.set("n", ">", api.node.navigate.sibling.next, opts("Next Sibling"))
vim.keymap.set('n', '<', api.node.navigate.sibling.prev, opts('Previous Sibling')) vim.keymap.set("n", "<", api.node.navigate.sibling.prev, opts("Previous Sibling"))
vim.keymap.set('n', '.', api.node.run.cmd, opts('Run Command')) vim.keymap.set("n", ".", api.node.run.cmd, opts("Run Command"))
vim.keymap.set('n', '-', api.tree.change_root_to_parent, opts('Up')) vim.keymap.set("n", "-", api.tree.change_root_to_parent, opts("Up"))
vim.keymap.set('n', 'a', api.fs.create, opts('Create')) vim.keymap.set("n", "a", api.fs.create, opts("Create"))
vim.keymap.set('n', 'bmv', api.marks.bulk.move, opts('Move Bookmarked')) vim.keymap.set("n", "bmv", api.marks.bulk.move, opts("Move Bookmarked"))
vim.keymap.set('n', 'B', api.tree.toggle_no_buffer_filter, opts('Toggle No Buffer')) vim.keymap.set("n", "B", api.tree.toggle_no_buffer_filter, opts("Toggle No Buffer"))
vim.keymap.set('n', 'c', api.fs.copy.node, opts('Copy')) vim.keymap.set("n", "c", api.fs.copy.node, opts("Copy"))
-- vim.keymap.set('n', 'C', api.tree.toggle_git_clean_filter, opts('Toggle Git Clean')) -- vim.keymap.set('n', 'C', api.tree.toggle_git_clean_filter, opts('Toggle Git Clean'))
-- vim.keymap.set('n', '[c', api.node.navigate.git.prev, opts('Prev Git')) -- vim.keymap.set('n', '[c', api.node.navigate.git.prev, opts('Prev Git'))
-- vim.keymap.set('n', ']c', api.node.navigate.git.next, opts('Next Git')) -- vim.keymap.set('n', ']c', api.node.navigate.git.next, opts('Next Git'))
vim.keymap.set('n', 'd', api.fs.remove, opts('Delete')) vim.keymap.set("n", "d", api.fs.remove, opts("Delete"))
vim.keymap.set('n', 'D', api.fs.trash, opts('Trash')) vim.keymap.set("n", "D", api.fs.trash, opts("Trash"))
vim.keymap.set('n', 'E', api.tree.expand_all, opts('Expand All')) vim.keymap.set("n", "E", api.tree.expand_all, opts("Expand All"))
vim.keymap.set('n', 'e', api.fs.rename_basename, opts('Rename: Basename')) vim.keymap.set("n", "e", api.fs.rename_basename, opts("Rename: Basename"))
vim.keymap.set('n', ']e', api.node.navigate.diagnostics.next, opts('Next Diagnostic')) vim.keymap.set("n", "]e", api.node.navigate.diagnostics.next, opts("Next Diagnostic"))
vim.keymap.set('n', '[e', api.node.navigate.diagnostics.prev, opts('Prev Diagnostic')) vim.keymap.set("n", "[e", api.node.navigate.diagnostics.prev, opts("Prev Diagnostic"))
vim.keymap.set('n', 'F', api.live_filter.clear, opts('Clean Filter')) vim.keymap.set("n", "F", api.live_filter.clear, opts("Clean Filter"))
vim.keymap.set('n', 'f', api.live_filter.start, opts('Filter')) vim.keymap.set("n", "f", api.live_filter.start, opts("Filter"))
vim.keymap.set('n', 'g?', api.tree.toggle_help, opts('Help')) vim.keymap.set("n", "g?", api.tree.toggle_help, opts("Help"))
vim.keymap.set('n', 'gy', api.fs.copy.absolute_path, opts('Copy Absolute Path')) vim.keymap.set("n", "gy", api.fs.copy.absolute_path, opts("Copy Absolute Path"))
vim.keymap.set('n', 'H', api.tree.toggle_hidden_filter, opts('Toggle Dotfiles')) vim.keymap.set("n", "H", api.tree.toggle_hidden_filter, opts("Toggle Dotfiles"))
vim.keymap.set('n', 'I', api.tree.toggle_gitignore_filter, opts('Toggle Git Ignore')) vim.keymap.set("n", "I", api.tree.toggle_gitignore_filter, opts("Toggle Git Ignore"))
vim.keymap.set('n', 'J', api.node.navigate.sibling.last, opts('Last Sibling')) vim.keymap.set("n", "J", api.node.navigate.sibling.last, opts("Last Sibling"))
vim.keymap.set('n', 'K', api.node.navigate.sibling.first, opts('First Sibling')) vim.keymap.set("n", "K", api.node.navigate.sibling.first, opts("First Sibling"))
vim.keymap.set('n', 'm', api.marks.toggle, opts('Toggle Bookmark')) vim.keymap.set("n", "m", api.marks.toggle, opts("Toggle Bookmark"))
vim.keymap.set('n', 'o', api.node.open.edit, opts('Open')) vim.keymap.set("n", "o", api.node.open.edit, opts("Open"))
-- vim.keymap.set('n', 'O', api.node.open.no_window_picker, opts('Open: No Window Picker')) -- vim.keymap.set('n', 'O', api.node.open.no_window_picker, opts('Open: No Window Picker'))
vim.keymap.set('n', 'p', api.fs.paste, opts('Paste')) vim.keymap.set("n", "p", api.fs.paste, opts("Paste"))
vim.keymap.set('n', 'P', api.node.navigate.parent, opts('Parent Directory')) vim.keymap.set("n", "P", api.node.navigate.parent, opts("Parent Directory"))
vim.keymap.set('n', 'q', api.tree.close, opts('Close')) vim.keymap.set("n", "q", api.tree.close, opts("Close"))
vim.keymap.set('n', 'r', api.fs.rename, opts('Rename')) vim.keymap.set("n", "r", api.fs.rename, opts("Rename"))
vim.keymap.set('n', 'R', api.tree.reload, opts('Refresh')) vim.keymap.set("n", "R", api.tree.reload, opts("Refresh"))
vim.keymap.set('n', 's', api.node.run.system, opts('Run System')) vim.keymap.set("n", "s", api.node.run.system, opts("Run System"))
vim.keymap.set('n', 'S', api.tree.search_node, opts('Search')) vim.keymap.set("n", "S", api.tree.search_node, opts("Search"))
vim.keymap.set('n', 'U', api.tree.toggle_custom_filter, opts('Toggle Hidden')) vim.keymap.set("n", "U", api.tree.toggle_custom_filter, opts("Toggle Hidden"))
vim.keymap.set('n', 'W', api.tree.collapse_all, opts('Collapse')) vim.keymap.set("n", "W", api.tree.collapse_all, opts("Collapse"))
vim.keymap.set('n', 'x', api.fs.cut, opts('Cut')) vim.keymap.set("n", "x", api.fs.cut, opts("Cut"))
vim.keymap.set('n', 'y', api.fs.copy.filename, opts('Copy Name')) vim.keymap.set("n", "y", api.fs.copy.filename, opts("Copy Name"))
vim.keymap.set('n', 'Y', api.fs.copy.relative_path, opts('Copy Relative Path')) vim.keymap.set("n", "Y", api.fs.copy.relative_path, opts("Copy Relative Path"))
end end
require("nvim-tree").setup({ require("nvim-tree").setup({

View File

@ -1,4 +1,4 @@
require('nvim-treesitter.configs').setup { require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all" -- A list of parser names, or "all"
-- ensure_installed = { "c", "lua", "vim", "java", "kotlin"}, -- ensure_installed = { "c", "lua", "vim", "java", "kotlin"},
ensure_installed = "all", ensure_installed = "all",
@ -10,7 +10,7 @@ sync_install = false,
-- `false` will disable the whole extension -- `false` will disable the whole extension
enable = true, enable = true,
indent = { indent = {
enable = true enable = true,
}, },
-- disable = {"java"}, -- disable = {"java"},
-- --
@ -25,4 +25,4 @@ sync_install = false,
-- enable = true, -- enable = true,
-- extended_mode = true, -- extended_mode = true,
-- } -- }
} })

View File

@ -1,2 +1,2 @@
vim.keymap.set('n', '<leader>y', require('osc52').copy_operator, {expr = true}) vim.keymap.set("n", "<leader>y", require("osc52").copy_operator, { expr = true })
vim.keymap.set('v', '<leader>y', require('osc52').copy_visual) vim.keymap.set("v", "<leader>y", require("osc52").copy_visual)

View File

@ -1,4 +1,4 @@
require('refactoring').setup({}) require("refactoring").setup({})
-- load refactoring Telescope extension -- load refactoring Telescope extension
require("telescope").load_extension("refactoring") require("telescope").load_extension("refactoring")
@ -12,15 +12,55 @@ vim.api.nvim_set_keymap(
) )
-- Remaps for the refactoring operations currently offered by the plugin -- Remaps for the refactoring operations currently offered by the plugin
vim.api.nvim_set_keymap("v", "<leader>rx", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]], {noremap = true, silent = true, expr = false}) vim.api.nvim_set_keymap(
vim.api.nvim_set_keymap("v", "<leader>rxf", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]], {noremap = true, silent = true, expr = false}) "v",
vim.api.nvim_set_keymap("v", "<leader>rxv", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]], {noremap = true, silent = true, expr = false}) "<leader>rx",
vim.api.nvim_set_keymap("v", "<leader>ri", [[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], {noremap = true, silent = true, expr = false}) [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]],
{ noremap = true, silent = true, expr = false }
)
vim.api.nvim_set_keymap(
"v",
"<leader>rxf",
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]],
{ noremap = true, silent = true, expr = false }
)
vim.api.nvim_set_keymap(
"v",
"<leader>rxv",
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]],
{ noremap = true, silent = true, expr = false }
)
vim.api.nvim_set_keymap(
"v",
"<leader>ri",
[[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]],
{ noremap = true, silent = true, expr = false }
)
-- Extract block doesn't need visual mode -- Extract block doesn't need visual mode
vim.api.nvim_set_keymap("n", "<leader>rxb", [[ <Cmd>lua require('refactoring').refactor('Extract Block')<CR>]], {noremap = true, silent = true, expr = false}) vim.api.nvim_set_keymap(
vim.api.nvim_set_keymap("n", "<leader>rxbf", [[ <Cmd>lua require('refactoring').refactor('Extract Block To File')<CR>]], {noremap = true, silent = true, expr = false}) "n",
"<leader>rxb",
[[ <Cmd>lua require('refactoring').refactor('Extract Block')<CR>]],
{ noremap = true, silent = true, expr = false }
)
vim.api.nvim_set_keymap(
"n",
"<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 -- Inline variable can also pick up the identifier currently under the cursor without visual mode
vim.api.nvim_set_keymap("n", "<leader>ri", [[ <Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], {noremap = true, silent = true, expr = false}) vim.api.nvim_set_keymap(
vim.api.nvim_set_keymap("n", "<leader>rx", [[ <Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]], {noremap = true, silent = true, expr = false}) "n",
"<leader>ri",
[[ <Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]],
{ noremap = true, silent = true, expr = false }
)
vim.api.nvim_set_keymap(
"n",
"<leader>rx",
[[ <Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]],
{ noremap = true, silent = true, expr = false }
)

View File

@ -1,8 +0,0 @@
local map = require("utils").map
-- vim.g.signify_vcs_cmds = {
-- hg = 'hg cat %f -r p4base',
-- }
map('n', ']d', '<plug>(signify-next-hunk)')
map('n', '[d', '<plug>(signify-prev-hunk)')

View File

@ -1,5 +1,4 @@
require("symbols-outline").setup( require("symbols-outline").setup({
{
show_relative_numbers = true, show_relative_numbers = true,
keymaps = { -- These keymaps can be a string or a table for multiple keys keymaps = { -- These keymaps can be a string or a table for multiple keys
-- close = {"<Esc>", "q"}, -- close = {"<Esc>", "q"},
@ -15,9 +14,8 @@ require("symbols-outline").setup(
unfold_all = "L", unfold_all = "L",
fold_reset = "R", fold_reset = "R",
}, },
} })
)
local map = require("utils").map local map = require("utils").map
map('n', '<leader>so', ':SymbolsOutline<cr>') map("n", "<leader>so", ":SymbolsOutline<cr>")

View File

@ -1,6 +1,6 @@
local home = vim.fn.expand("~/zettelkasten") local home = vim.fn.expand("~/zettelkasten")
require('telekasten').setup({ require("telekasten").setup({
home = home, home = home,
}) })

View File

@ -8,10 +8,10 @@ vim.diagnostic.config({
require("trouble").setup({ require("trouble").setup({
signs = { signs = {
-- icons / text used for a diagnostic -- icons / text used for a diagnostic
error = '', error = "",
warning = '', warning = "",
hint = '', hint = "",
information = '', information = "",
other = "?﫠", other = "?﫠",
}, },
use_diagnostic_signs = false, -- enabling this will use the signs defined in your lsp client use_diagnostic_signs = false, -- enabling this will use the signs defined in your lsp client

View File

@ -1,5 +1,5 @@
require("which-key").setup { require("which-key").setup({
-- your configuration comes here -- your configuration comes here
-- or leave it empty to use the default settings -- or leave it empty to use the default settings
-- refer to the configuration section below -- refer to the configuration section below
} })

View File

@ -14,7 +14,6 @@ if not vim.loop.fs_stat(lazypath) then
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
package.path = package.path .. ';' .. vim.env.HOME .. "/.vim/lua/?.lua" package.path = package.path .. ";" .. vim.env.HOME .. "/.vim/lua/?.lua"
require("lazy").setup("plugins") require("lazy").setup("plugins")

View File

@ -1,44 +1,43 @@
local use_google = require("utils").use_google local use_google = require("utils").use_google
return return {
{
-- Pretty symbols -- Pretty symbols
'kyazdani42/nvim-web-devicons', "kyazdani42/nvim-web-devicons",
'jghauser/mkdir.nvim', "jghauser/mkdir.nvim",
'will133/vim-dirdiff', "will133/vim-dirdiff",
'renerocksai/calendar-vim', "renerocksai/calendar-vim",
'google/vim-searchindex', "google/vim-searchindex",
-- 'apalmer1377/factorus', -- 'apalmer1377/factorus',
'hrsh7th/vim-vsnip', "hrsh7th/vim-vsnip",
'kosayoda/nvim-lightbulb', "kosayoda/nvim-lightbulb",
'tpope/vim-surround', "tpope/vim-surround",
'ntpeters/vim-better-whitespace', "ntpeters/vim-better-whitespace",
'junegunn/fzf.vim', "junegunn/fzf.vim",
'nathanaelkane/vim-indent-guides', "nathanaelkane/vim-indent-guides",
'tversteeg/registers.nvim', "tversteeg/registers.nvim",
'jremmen/vim-ripgrep', "jremmen/vim-ripgrep",
'nvim-lua/plenary.nvim', "nvim-lua/plenary.nvim",
{ {
'preservim/nerdcommenter', "preservim/nerdcommenter",
init = function() init = function()
require("config.nerdcommenter") require("config.nerdcommenter")
end, end,
keys = { keys = {
{ "<leader>c<Space>", ":call nerdcommenter#Comment(0, 'toggle')<CR>" }, { "<leader>c<Space>", ":call nerdcommenter#Comment(0, 'toggle')<CR>" },
{ "<leader>c<Space>", ":call nerdcommenter#Comment(0, 'toggle')<CR>", mode='v' }, { "<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>" },
{ "<leader>cS", ":call nerdcommenter#Comment(0, 'sexy')<CR>", mode='v' }, { "<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>" },
{ "<leader>c$", ":call nerdcommenter#Comment(0, 'ToEOL')<CR>", mode='v' }, { "<leader>c$", ":call nerdcommenter#Comment(0, 'ToEOL')<CR>", mode = "v" },
} },
}, },
{ {
'nvim-treesitter/nvim-treesitter', "nvim-treesitter/nvim-treesitter",
build = ':TSUpdate', build = ":TSUpdate",
config = function() config = function()
require("config.nvim-treesitter") require("config.nvim-treesitter")
end, end,
@ -62,15 +61,15 @@ return
-- Undo tree -- Undo tree
{ {
'mbbill/undotree', "mbbill/undotree",
cmd = 'UndotreeToggle', cmd = "UndotreeToggle",
config = function() config = function()
vim.g.undotree_SetFocusWhenToggle = 1 vim.g.undotree_SetFocusWhenToggle = 1
end end,
}, },
{ {
'renerocksai/telekasten.nvim', "renerocksai/telekasten.nvim",
config = function() config = function()
require("config.telekasten") require("config.telekasten")
end, end,
@ -78,100 +77,80 @@ return
{ "<leader>zf", ":lua require('telekasten').find_notes()<CR>", desc = "Find Notes" }, { "<leader>zf", ":lua require('telekasten').find_notes()<CR>", desc = "Find Notes" },
}, },
}, },
{ 'ray-x/go.nvim',ft='go' }, { "ray-x/go.nvim", ft = "go" },
{ 'ray-x/guihua.lua',ft='go' }, { "ray-x/guihua.lua", ft = "go" },
"williamboman/mason.nvim", "williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
'nvim-lua/lsp-status.nvim', "nvim-lua/lsp-status.nvim",
'VonHeikemen/lsp-zero.nvim', "VonHeikemen/lsp-zero.nvim",
-- Completion and linting -- Completion and linting
{ {
'hrsh7th/nvim-cmp', "hrsh7th/nvim-cmp",
event = "VimEnter", event = "VimEnter",
dependencies = { dependencies = {
'onsails/lspkind.nvim', "onsails/lspkind.nvim",
'neovim/nvim-lspconfig', "neovim/nvim-lspconfig",
'hrsh7th/cmp-nvim-lsp', "hrsh7th/cmp-nvim-lsp",
'hrsh7th/cmp-buffer', "hrsh7th/cmp-buffer",
'lukas-reineke/cmp-under-comparator', "lukas-reineke/cmp-under-comparator",
'hrsh7th/cmp-cmdline', "hrsh7th/cmp-cmdline",
'f3fora/cmp-spell', "f3fora/cmp-spell",
'hrsh7th/cmp-nvim-lsp-document-symbol', "hrsh7th/cmp-nvim-lsp-document-symbol",
'hrsh7th/cmp-nvim-lsp-signature-help', "hrsh7th/cmp-nvim-lsp-signature-help",
'hrsh7th/cmp-nvim-lua', "hrsh7th/cmp-nvim-lua",
'hrsh7th/cmp-path', "hrsh7th/cmp-path",
'hrsh7th/cmp-vsnip', "hrsh7th/cmp-vsnip",
'ray-x/cmp-treesitter', "ray-x/cmp-treesitter",
}, },
config = function() config = function()
require("config.lsp") require("config.lsp")
end end,
}, },
{ {
"tzachar/cmp-tabnine", build = "./install.sh", "tzachar/cmp-tabnine",
event = 'InsertEnter', build = "./install.sh",
event = "InsertEnter",
cond = not use_google(), cond = not use_google(),
}, },
{ {
'ErichDonGubler/lsp_lines.nvim', "ErichDonGubler/lsp_lines.nvim",
event = "VimEnter", event = "VimEnter",
keys = { keys = {
{ "<leader>l", function() require("lsp_lines").toggle() end, desc = "Toggle LSP Lines" }, {
"<leader>l",
function()
require("lsp_lines").toggle()
end,
desc = "Toggle LSP Lines",
},
}, },
}, },
{ {
'jose-elias-alvarez/null-ls.nvim', "jose-elias-alvarez/null-ls.nvim",
event = "VimEnter", event = "VimEnter",
config = function() config = function()
require("config.null-ls") require("config.null-ls")
end
},
{
'nvim-telescope/telescope.nvim',
branch = '0.1.x',
config = function()
require("config.telescope")
end, 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 -- Rust
{ {
'saecki/crates.nvim', "saecki/crates.nvim",
ft = 'rust', ft = "rust",
version = 'v0.3.0', version = "v0.3.0",
dependencies = { 'nvim-lua/plenary.nvim' }, dependencies = { "nvim-lua/plenary.nvim" },
config = function() config = function()
require('crates').setup() require("crates").setup()
end end,
}, },
{'simrat39/rust-tools.nvim', ft = 'rust'}, { "simrat39/rust-tools.nvim", ft = "rust" },
{ {
'folke/trouble.nvim', "folke/trouble.nvim",
event = "VimEnter", event = "VimEnter",
config = function() config = function()
require("config.trouble") require("config.trouble")
@ -179,42 +158,83 @@ return
}, },
{ {
'ThePrimeagen/refactoring.nvim', "ThePrimeagen/refactoring.nvim",
dependencies = { dependencies = {
{ "nvim-lua/plenary.nvim" }, { "nvim-lua/plenary.nvim" },
{"nvim-treesitter/nvim-treesitter"} { "nvim-treesitter/nvim-treesitter" },
}, },
config = function() config = function()
require("config.refactoring") require("config.refactoring")
end, end,
keys = { keys = {
-- remap to open the Telescope refactoring menu in visual mode -- remap to open the Telescope refactoring menu in visual mode
{"<leader>rr", "<Esc><cmd>lua require('telescope').extensions.refactoring.refactors()<CR>", { noremap = true }}, {
"<leader>rr",
"<Esc><cmd>lua require('telescope').extensions.refactoring.refactors()<CR>",
{ noremap = true },
},
-- Remaps for the refactoring operations currently offered by the plugin -- 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>rx",
{ "<leader>rxv", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]], mode ="v" , {noremap = true, silent = true, expr = false}}, [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]],
{ "<leader>ri", [[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], mode ="v", {noremap = true, silent = true, expr = false}}, 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}},
-- 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', "<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 },
},
-- 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() config = function()
require("scrollbar").setup() require("scrollbar").setup()
end, end,
@ -222,13 +242,13 @@ return
}, },
{ {
'rmagatti/auto-session', "rmagatti/auto-session",
config = function() config = function()
require("auto-session").setup { require("auto-session").setup({
log_level = "error", log_level = "error",
auto_session_suppress_dirs = { "~/", "~/Downloads", "/", os.getenv("HOME")}, -- auto_session_suppress_dirs = { "~/", "~/Downloads", "/", os.getenv("HOME")},
} })
end end,
}, },
{ {
@ -239,19 +259,18 @@ return
}, },
{ {
'nvim-lualine/lualine.nvim', "nvim-lualine/lualine.nvim",
lazy = false, lazy = false,
config = function() config = function()
require("config.lualine") require("config.lualine")
end end,
}, },
{ {
'rcarriga/nvim-notify', "rcarriga/nvim-notify",
config = function() config = function()
require("config.notify") require("config.notify")
end end,
}, },
{ {
"catppuccin/nvim", "catppuccin/nvim",
name = "catppuccin", name = "catppuccin",
@ -259,18 +278,18 @@ return
priority = 1000, -- make sure to load this before all the other start plugins priority = 1000, -- make sure to load this before all the other start plugins
config = function() config = function()
require("config.catppuccin") require("config.catppuccin")
end end,
}, },
{ {
'ojroques/nvim-osc52', "ojroques/nvim-osc52",
config = function() config = function()
require("config.oscyank") require("config.oscyank")
end end,
}, },
-- mine -- mine
{ {
'squk/java-syntax.vim', "squk/java-syntax.vim",
lazy = false, lazy = false,
}, },
@ -278,30 +297,24 @@ return
"folke/which-key.nvim", "folke/which-key.nvim",
config = function() config = function()
require("config.whichkey") require("config.whichkey")
end end,
}, },
{ 'junegunn/fzf', build = ":call fzf#install()" }, { "junegunn/fzf", build = ":call fzf#install()" },
{ "udalov/kotlin-vim", ft = "kotin" },
{ 'udalov/kotlin-vim', ft='kotin' },
{ {
'wesQ3/vim-windowswap', "wesQ3/vim-windowswap",
init = function() init = function()
vim.g.windowswap_map_keys = 0 vim.g.windowswap_map_keys = 0
end, end,
}, },
{ "vim-scripts/vcscommand.vim" },
{ 'vim-scripts/vcscommand.vim' },
{ {
'mhinz/vim-signify', "mhinz/vim-signify",
config= function() event = "VimEnter",
require('config.signify') keys = {
end { "]d", "<plug>(signify-next-hunk)" },
{ "[d", "<plug>(signify-prev-hunk)" },
}, },
{
'j-hui/fidget.nvim',
init = function() require("fidget").setup() end
}, },
{ {
"iamcco/markdown-preview.nvim", "iamcco/markdown-preview.nvim",
@ -309,6 +322,6 @@ return
init = function() init = function()
vim.g.mkdp_filetypes = { "markdown" } vim.g.mkdp_filetypes = { "markdown" }
end, end,
ft = { "markdown" } 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 { return {
-- Git -- Git
{ {
'lewis6991/gitsigns.nvim', "lewis6991/gitsigns.nvim",
dependencies = 'nvim-lua/plenary.nvim', dependencies = "nvim-lua/plenary.nvim",
event = 'User ActuallyEditing', event = "User ActuallyEditing",
}, },
{ {
'akinsho/git-conflict.nvim', "akinsho/git-conflict.nvim",
version = '*', version = "*",
config = function() config = function()
require('git-conflict').setup() require("git-conflict").setup()
end, end,
}, },
{ 'rhysd/conflict-marker.vim' } { "rhysd/conflict-marker.vim" },
} }

View File

@ -36,10 +36,17 @@ if use_google() then
goog("gtimporter"), goog("gtimporter"),
goog("blaze"), goog("blaze"),
goog("buganizer"), goog("buganizer"),
goog("relatedfiles"),
goog("g4"), goog("g4"),
goog("outline-window"), goog("outline-window"),
goog("fzf-query"), 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", name = "codefmt",
dir = "/usr/share/vim/google/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 },
},
},
}

View File

@ -112,5 +112,5 @@ function! CopyYank() abort
endfunction endfunction
" autocmd TextYankPost * call CopyYank() " autocmd TextYankPost * call CopyYank()
noremap <leader>y call CopyYank() noremap <leader>y :call CopyYank()
vnoremap <leader>y call CopyYank() vnoremap <leader>y :call CopyYank()

View File

@ -7,6 +7,8 @@ export PATH=$PATH:$GOPATH/bin
export GO111MODULE=auto export GO111MODULE=auto
export CLOUDSDK_PYTHON=python2 export CLOUDSDK_PYTHON=python2
export PATH=$PATH:$HOME/.cargo/bin
export PATH="/opt/local/bin:/opt/local/sbin:$PATH" export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
HISTCONTROL=ignoreboth HISTCONTROL=ignoreboth

View File

@ -9,6 +9,7 @@ export XAUTHORITY=~/.Xauthority
export GOROOT=/usr/lib/google-golang export GOROOT=/usr/lib/google-golang
export PATH=$GOROOT/bin:$PATH export PATH=$GOROOT/bin:$PATH
export JAVA_HOME=$(readlink -ne /usr/local/buildtools/java/jdk) export JAVA_HOME=$(readlink -ne /usr/local/buildtools/java/jdk)
export CARGO_NET_GIT_FETCH_WITH_CLI=true
source /google/bin/releases/knock/knock.sh source /google/bin/releases/knock/knock.sh
function gcert() { function gcert() {