format and stuff
This commit is contained in:
@ -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" }
|
||||||
}
|
}
|
@ -1,15 +1,15 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
local notify = require 'notify'
|
local notify = require("notify")
|
||||||
|
|
||||||
local lsp_util = vim.lsp.util
|
local lsp_util = vim.lsp.util
|
||||||
|
|
||||||
function M.code_action_listener()
|
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
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -2,7 +2,7 @@ vim.g.catppuccin_flavour = "macchiato" -- latte, frappe, macchiato, mocha
|
|||||||
local colors = require("catppuccin.palettes").get_palette()
|
local colors = require("catppuccin.palettes").get_palette()
|
||||||
|
|
||||||
require("catppuccin").setup({
|
require("catppuccin").setup({
|
||||||
flavour = "macchiato",
|
flavour = "macchiato",
|
||||||
integrations = {
|
integrations = {
|
||||||
cmp = true,
|
cmp = true,
|
||||||
-- coc_nvim = false,
|
-- coc_nvim = false,
|
||||||
@ -17,23 +17,23 @@ require("catppuccin").setup({
|
|||||||
-- lightspeed = false,
|
-- lightspeed = false,
|
||||||
-- lsp_saga = false,
|
-- lsp_saga = false,
|
||||||
lsp_trouble = true,
|
lsp_trouble = true,
|
||||||
mason = true,
|
mason = true,
|
||||||
markdown = true,
|
markdown = true,
|
||||||
-- neogit = false,
|
-- neogit = false,
|
||||||
-- neotest = false,
|
-- neotest = false,
|
||||||
neotree = true,
|
neotree = true,
|
||||||
notify = true,
|
notify = true,
|
||||||
-- nvimtree = true,
|
-- nvimtree = true,
|
||||||
-- overseer = false,
|
-- overseer = false,
|
||||||
-- pounce = false,
|
-- pounce = false,
|
||||||
symbols_outline = true,
|
symbols_outline = true,
|
||||||
telescope = true,
|
telescope = true,
|
||||||
treesitter = true,
|
treesitter = true,
|
||||||
treesitter_context = false,
|
treesitter_context = false,
|
||||||
-- ts_rainbow = false,
|
-- ts_rainbow = false,
|
||||||
-- vim_sneak = false,
|
-- vim_sneak = false,
|
||||||
-- vimwiki = false,
|
-- vimwiki = false,
|
||||||
which_key = true,
|
which_key = true,
|
||||||
|
|
||||||
-- Special integrations, see https://github.com/catppuccin/nvim#special-integrations
|
-- Special integrations, see https://github.com/catppuccin/nvim#special-integrations
|
||||||
dap = {
|
dap = {
|
||||||
@ -60,12 +60,12 @@ require("catppuccin").setup({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
custom_highlights = {
|
custom_highlights = {
|
||||||
Identifier = { fg = colors.lavender },
|
Identifier = { fg = colors.lavender },
|
||||||
Statement = { fg = colors.rosewater },
|
Statement = { fg = colors.rosewater },
|
||||||
-- Identifier = { fg = colors.sapphire },
|
-- Identifier = { fg = colors.sapphire },
|
||||||
Function = { fg = colors.mauve },
|
Function = { fg = colors.mauve },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_command "colorscheme catppuccin"
|
vim.api.nvim_command("colorscheme catppuccin")
|
||||||
|
@ -6,50 +6,58 @@ 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()
|
||||||
|
|
||||||
-- Kommentary
|
-- Kommentary
|
||||||
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 }
|
||||||
-- buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
-- buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||||
-- buf_set_keymap('n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
-- buf_set_keymap('n', '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||||
-- buf_set_keymap('n', '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
-- buf_set_keymap('n', '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||||
-- buf_set_keymap('n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
-- buf_set_keymap('n', '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||||
-- buf_set_keymap('n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
-- buf_set_keymap('n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||||
-- buf_set_keymap('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
-- buf_set_keymap('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||||
-- buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references() && vim.cmd("copen")<CR>', opts)
|
-- buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references() && vim.cmd("copen")<CR>', opts)
|
||||||
-- buf_set_keymap('n', '<leader>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
|
-- buf_set_keymap('n', '<leader>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
|
||||||
-- buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
-- buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
||||||
-- buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
|
-- buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
|
||||||
-- buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
-- buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
||||||
-- Java specific
|
-- Java specific
|
||||||
-- buf_set_keymap("n", "<leader>di", "<Cmd>lua require'jdtls'.organize_imports()<CR>", opts)
|
-- buf_set_keymap("n", "<leader>di", "<Cmd>lua require'jdtls'.organize_imports()<CR>", opts)
|
||||||
-- buf_set_keymap("n", "<leader>dt", "<Cmd>lua require'jdtls'.test_class()<CR>", opts)
|
-- buf_set_keymap("n", "<leader>dt", "<Cmd>lua require'jdtls'.test_class()<CR>", opts)
|
||||||
-- buf_set_keymap("n", "<leader>dn", "<Cmd>lua require'jdtls'.test_nearest_method()<CR>", opts)
|
-- buf_set_keymap("n", "<leader>dn", "<Cmd>lua require'jdtls'.test_nearest_method()<CR>", opts)
|
||||||
buf_set_keymap("v", "<leader>de", "<Esc><Cmd>lua require('jdtls').extract_variable(true)<CR>", opts)
|
buf_set_keymap("v", "<leader>de", "<Esc><Cmd>lua require('jdtls').extract_variable(true)<CR>", opts)
|
||||||
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,138 +66,141 @@ 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",
|
||||||
"org.hamcrest.Matchers.*",
|
"org.hamcrest.Matchers.*",
|
||||||
"org.hamcrest.CoreMatchers.*",
|
"org.hamcrest.CoreMatchers.*",
|
||||||
"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 = {
|
||||||
{
|
{
|
||||||
name = "JavaSE-11",
|
name = "JavaSE-11",
|
||||||
path = home .. "/.sdkman/candidates/java/11.0.10-open/",
|
path = home .. "/.sdkman/candidates/java/11.0.10-open/",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "JavaSE-14",
|
name = "JavaSE-14",
|
||||||
path = home .. "/.sdkman/candidates/java/14.0.2-open/",
|
path = home .. "/.sdkman/candidates/java/14.0.2-open/",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
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
|
||||||
prompt_title = prompt,
|
.new(opts, {
|
||||||
finder = finders.new_table {
|
prompt_title = prompt,
|
||||||
results = items,
|
finder = finders.new_table({
|
||||||
entry_maker = function(entry)
|
results = items,
|
||||||
return {
|
entry_maker = function(entry)
|
||||||
value = entry,
|
return {
|
||||||
display = label_fn(entry),
|
value = entry,
|
||||||
ordinal = label_fn(entry),
|
display = label_fn(entry),
|
||||||
}
|
ordinal = label_fn(entry),
|
||||||
end,
|
}
|
||||||
},
|
end,
|
||||||
sorter = sorters.get_generic_fuzzy_sorter(),
|
}),
|
||||||
attach_mappings = function(prompt_bufnr)
|
sorter = sorters.get_generic_fuzzy_sorter(),
|
||||||
actions.goto_file_selection_edit:replace(function()
|
attach_mappings = function(prompt_bufnr)
|
||||||
local selection = actions.get_selected_entry(prompt_bufnr)
|
actions.goto_file_selection_edit:replace(function()
|
||||||
actions.close(prompt_bufnr)
|
local selection = actions.get_selected_entry(prompt_bufnr)
|
||||||
|
actions.close(prompt_bufnr)
|
||||||
|
|
||||||
cb(selection.value)
|
cb(selection.value)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
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)
|
||||||
|
@ -2,32 +2,32 @@ local map = require("utils").map
|
|||||||
local use_google = require("utils").use_google
|
local use_google = require("utils").use_google
|
||||||
|
|
||||||
if use_google() then
|
if use_google() then
|
||||||
map("n", "<leader>tm", ":Telescope citc modified<CR>")
|
map("n", "<leader>tm", ":Telescope citc modified<CR>")
|
||||||
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
|
||||||
|
@ -1,53 +1,59 @@
|
|||||||
-- 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 = {
|
||||||
-- command = {'stubby --output_json call blade:codereview-rpc CodereviewRpcService.GetComments "changelist_number: $(/google/data/ro/teams/fig/bin/vcstool pending-change-number)"'},
|
"/google/bin/releases/editor-devtools/get_comments.par",
|
||||||
-- Define your own icon by `vim.fn.sign_define('ICON_NAME', {text = ' '})`.
|
"--json",
|
||||||
-- See :help sign_define
|
"--full",
|
||||||
-- The sign property passed to setup should be the 'ICON_NAME' in the define
|
"--noresolved",
|
||||||
-- example above.
|
"--cl_comments",
|
||||||
sign = 'COMMENT_ICON',
|
"--file_comments",
|
||||||
-- Fetch the comments after calling `setup`.
|
},
|
||||||
auto_fetch = true,
|
-- command = {'stubby --output_json call blade:codereview-rpc CodereviewRpcService.GetComments "changelist_number: $(/google/data/ro/teams/fig/bin/vcstool pending-change-number)"'},
|
||||||
display = {
|
-- Define your own icon by `vim.fn.sign_define('ICON_NAME', {text = ' '})`.
|
||||||
-- The width of the comment display window.
|
-- See :help sign_define
|
||||||
width = 50,
|
-- The sign property passed to setup should be the 'ICON_NAME' in the define
|
||||||
-- When showing file paths, use relative paths or not.
|
-- example above.
|
||||||
relative_path = true,
|
sign = "COMMENT_ICON",
|
||||||
--- Enable viewing comments through floating window
|
-- Fetch the comments after calling `setup`.
|
||||||
floating = true,
|
auto_fetch = true,
|
||||||
--- Options used when creating the floating window.
|
display = {
|
||||||
floating_window_options = floating_window_options
|
-- The width of the comment display window.
|
||||||
},
|
width = 50,
|
||||||
}
|
-- When showing file paths, use relative paths or not.
|
||||||
|
relative_path = true,
|
||||||
|
--- Enable viewing comments through floating window
|
||||||
|
floating = true,
|
||||||
|
--- Options used when creating the floating window.
|
||||||
|
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 = "" })
|
||||||
|
@ -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,94 +16,119 @@ 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")
|
||||||
|
|
||||||
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 = {
|
||||||
root_dir = lspconfig.util.root_pattern("BUILD"),
|
"c",
|
||||||
-- root_dir = function(fname)
|
"cpp",
|
||||||
-- return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$')
|
"java",
|
||||||
-- end;
|
"kotlin",
|
||||||
settings = {},
|
"objc",
|
||||||
},
|
"proto",
|
||||||
}
|
"textproto",
|
||||||
|
"go",
|
||||||
|
"python",
|
||||||
|
"bzl",
|
||||||
|
"typescript",
|
||||||
|
},
|
||||||
|
root_dir = lspconfig.util.root_pattern("BUILD"),
|
||||||
|
-- root_dir = function(fname)
|
||||||
|
-- return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$')
|
||||||
|
-- end;
|
||||||
|
settings = {},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
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",
|
||||||
-- root_dir = function(fname)
|
"cpp",
|
||||||
-- return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$')
|
"java",
|
||||||
-- end;
|
"kotlin",
|
||||||
settings = {},
|
"objc",
|
||||||
},
|
"proto",
|
||||||
}
|
"textproto",
|
||||||
|
"go",
|
||||||
|
"python",
|
||||||
|
"bzl",
|
||||||
|
"markdown",
|
||||||
|
"typescript",
|
||||||
|
"javascript",
|
||||||
|
},
|
||||||
|
root_dir = lspconfig.util.root_pattern("BUILD"),
|
||||||
|
-- root_dir = function(fname)
|
||||||
|
-- return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$')
|
||||||
|
-- end;
|
||||||
|
settings = {},
|
||||||
|
},
|
||||||
|
}
|
||||||
end
|
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.
|
||||||
vim.api.nvim_buf_set_option(bufnr, "formatexpr", "v:lua.vim.lsp.formatexpr")
|
vim.api.nvim_buf_set_option(bufnr, "formatexpr", "v:lua.vim.lsp.formatexpr")
|
||||||
end
|
end
|
||||||
if vim.lsp.tagfunc then
|
if vim.lsp.tagfunc then
|
||||||
vim.api.nvim_buf_set_option(bufnr, "tagfunc", "v:lua.vim.lsp.tagfunc")
|
vim.api.nvim_buf_set_option(bufnr, "tagfunc", "v:lua.vim.lsp.tagfunc")
|
||||||
end
|
end
|
||||||
|
|
||||||
if client.server_capabilities.document_highlight then
|
if client.server_capabilities.document_highlight then
|
||||||
vim.api.nvim_command("autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()")
|
vim.api.nvim_command("autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()")
|
||||||
vim.api.nvim_command("autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()")
|
vim.api.nvim_command("autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()")
|
||||||
vim.api.nvim_command("autocmd CursorMoved <buffer> lua vim.lsp.util.buf_clear_references()")
|
vim.api.nvim_command("autocmd CursorMoved <buffer> lua vim.lsp.util.buf_clear_references()")
|
||||||
end
|
end
|
||||||
|
|
||||||
lsp_status.on_attach(client)
|
lsp_status.on_attach(client)
|
||||||
|
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
vim.api.nvim_set_keymap("n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "L", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
vim.api.nvim_set_keymap("n", "L", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "g0", "<cmd>lua vim.lsp.buf.document_symbol()<CR>", opts)
|
vim.api.nvim_set_keymap("n", "g0", "<cmd>lua vim.lsp.buf.document_symbol()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "gW", "<cmd>lua vim.lsp.buf.workspace_symbol()<CR>", opts)
|
vim.api.nvim_set_keymap("n", "gW", "<cmd>lua vim.lsp.buf.workspace_symbol()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
vim.api.nvim_set_keymap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "gD", "<cmd>tab split | lua vim.lsp.buf.definition()<CR>", opts)
|
vim.api.nvim_set_keymap("n", "gD", "<cmd>tab split | lua vim.lsp.buf.definition()<CR>", opts)
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
-- vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
vim.api.nvim_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "gI", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
vim.api.nvim_set_keymap("n", "gI", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "gR", "<cmd>lua vim.lsp.buf.references()<CR>", opts) -- diagnostics controls references
|
vim.api.nvim_set_keymap("n", "gR", "<cmd>lua vim.lsp.buf.references()<CR>", opts) -- diagnostics controls references
|
||||||
vim.api.nvim_set_keymap("n", "<C-g>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<C-g>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("i", "<C-g>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
vim.api.nvim_set_keymap("i", "<C-g>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||||
|
|
||||||
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")
|
||||||
@ -114,208 +139,208 @@ lspkind.init()
|
|||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
|
|
||||||
local has_words_before = function()
|
local has_words_before = function()
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local feedkey = function(key, mode)
|
local feedkey = function(key, mode)
|
||||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
|
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
|
||||||
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()
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
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({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
handlers = cider_lsp_handlers,
|
handlers = cider_lsp_handlers,
|
||||||
})
|
})
|
||||||
lspconfig.analysislsp.setup({
|
lspconfig.analysislsp.setup({
|
||||||
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({
|
||||||
mapping = {
|
mapping = {
|
||||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||||
["<C-u>"] = cmp.mapping.scroll_docs(4),
|
["<C-u>"] = cmp.mapping.scroll_docs(4),
|
||||||
["<C-e>"] = cmp.mapping.close(),
|
["<C-e>"] = cmp.mapping.close(),
|
||||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||||
["<C-m>"] = cmp.mapping.confirm({ select = true }),
|
["<C-m>"] = cmp.mapping.confirm({ select = true }),
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
elseif vim.fn["vsnip#available"](1) == 1 then
|
elseif vim.fn["vsnip#available"](1) == 1 then
|
||||||
feedkey("<Plug>(vsnip-expand-or-jump)", "")
|
feedkey("<Plug>(vsnip-expand-or-jump)", "")
|
||||||
elseif has_words_before() then
|
elseif has_words_before() then
|
||||||
cmp.complete()
|
cmp.complete()
|
||||||
else
|
else
|
||||||
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
|
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
|
|
||||||
["<S-Tab>"] = cmp.mapping(function()
|
["<S-Tab>"] = cmp.mapping(function()
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
|
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
|
||||||
feedkey("<Plug>(vsnip-jump-prev)", "")
|
feedkey("<Plug>(vsnip-jump-prev)", "")
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
|
|
||||||
["<Up>"] = cmp.mapping(function(fallback)
|
["<Up>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
elseif vim.fn["vsnip#available"](1) == 1 then
|
elseif vim.fn["vsnip#available"](1) == 1 then
|
||||||
feedkey("<Plug>(vsnip-jump-prev)", "")
|
feedkey("<Plug>(vsnip-jump-prev)", "")
|
||||||
else
|
else
|
||||||
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
|
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
|
||||||
end
|
end
|
||||||
end),
|
end),
|
||||||
|
|
||||||
["<Down>"] = cmp.mapping(function(fallback)
|
["<Down>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
elseif vim.fn["vsnip#available"](1) == 1 then
|
elseif vim.fn["vsnip#available"](1) == 1 then
|
||||||
feedkey("<Plug>(vsnip-expand-or-jump)", "")
|
feedkey("<Plug>(vsnip-expand-or-jump)", "")
|
||||||
else
|
else
|
||||||
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
|
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
|
||||||
end
|
end
|
||||||
end),
|
end),
|
||||||
},
|
},
|
||||||
|
|
||||||
sources = conditionalSources,
|
sources = conditionalSources,
|
||||||
|
|
||||||
|
sorting = {
|
||||||
|
comparators = {
|
||||||
|
cmp.config.compare.offset,
|
||||||
|
cmp.config.compare.exact,
|
||||||
|
cmp.config.compare.score,
|
||||||
|
require("cmp-under-comparator").under,
|
||||||
|
cmp.config.compare.kind,
|
||||||
|
cmp.config.compare.sort_text,
|
||||||
|
cmp.config.compare.length,
|
||||||
|
cmp.config.compare.order,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
sorting = {
|
snippet = {
|
||||||
comparators = {
|
expand = function(args)
|
||||||
cmp.config.compare.offset,
|
vim.fn["vsnip#anonymous"](args.body)
|
||||||
cmp.config.compare.exact,
|
end,
|
||||||
cmp.config.compare.score,
|
},
|
||||||
require "cmp-under-comparator".under,
|
|
||||||
cmp.config.compare.kind,
|
|
||||||
cmp.config.compare.sort_text,
|
|
||||||
cmp.config.compare.length,
|
|
||||||
cmp.config.compare.order,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
snippet = {
|
formatting = {
|
||||||
expand = function(args)
|
format = lspkind.cmp_format({
|
||||||
vim.fn["vsnip#anonymous"](args.body)
|
with_text = true,
|
||||||
end,
|
maxwidth = 40, -- half max width
|
||||||
},
|
menu = {
|
||||||
|
nvim_ciderlsp = "",
|
||||||
|
buffer = "",
|
||||||
|
crates = "📦",
|
||||||
|
nvim_lsp = "[CiderLSP]",
|
||||||
|
cmp_tabnine = "[TabNine]",
|
||||||
|
nvim_lua = "[API]",
|
||||||
|
path = "[path]",
|
||||||
|
tmux = "[TMUX]",
|
||||||
|
vim_vsnip = "[snip]",
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
|
||||||
formatting = {
|
experimental = {
|
||||||
format = lspkind.cmp_format({
|
native_menu = false,
|
||||||
with_text = true,
|
ghost_text = true,
|
||||||
maxwidth = 40, -- half max width
|
},
|
||||||
menu = {
|
|
||||||
nvim_ciderlsp = "",
|
|
||||||
buffer = "",
|
|
||||||
crates = "📦",
|
|
||||||
nvim_lsp = "[CiderLSP]",
|
|
||||||
cmp_tabnine = "[TabNine]",
|
|
||||||
nvim_lua = "[API]",
|
|
||||||
path = "[path]",
|
|
||||||
tmux = "[TMUX]",
|
|
||||||
vim_vsnip = "[snip]",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
|
|
||||||
experimental = {
|
|
||||||
native_menu = false,
|
|
||||||
ghost_text = true,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
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 ]]
|
||||||
|
)
|
||||||
|
@ -1,92 +1,100 @@
|
|||||||
local split = function (inputstr, sep)
|
local split = function(inputstr, sep)
|
||||||
local t={}
|
local t = {}
|
||||||
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
|
for str in string.gmatch(inputstr, "([^" .. sep .. "]+)") do
|
||||||
table.insert(t, str)
|
table.insert(t, str)
|
||||||
end
|
end
|
||||||
return t
|
return t
|
||||||
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()
|
||||||
local comments = require("google.comments")
|
local comments = require("google.comments")
|
||||||
local tracker = require("google.comments.tracker")
|
local tracker = require("google.comments.tracker")
|
||||||
local dump = require("utils").dump
|
local dump = require("utils").dump
|
||||||
|
|
||||||
print(dump(tracker.get_all_comments()))
|
print(dump(tracker.get_all_comments()))
|
||||||
local lgtm = comments.get_lgtms()
|
local lgtm = comments.get_lgtms()
|
||||||
local appr = comments.get_approvals()
|
local appr = comments.get_approvals()
|
||||||
print("lgtms"..dump(lgtm))
|
print("lgtms" .. dump(lgtm))
|
||||||
print("approvals"..dump(appr))
|
print("approvals" .. dump(appr))
|
||||||
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'},
|
},
|
||||||
lualine_z = {'location'}
|
"encoding",
|
||||||
},
|
"filetype",
|
||||||
tabline = {
|
},
|
||||||
lualine_a = {
|
lualine_y = { "searchcount" },
|
||||||
{
|
lualine_z = { "location" },
|
||||||
'tabs',
|
},
|
||||||
mode = 1,
|
tabline = {
|
||||||
max_length = (vim.o.columns / 5) * 4,
|
lualine_a = {
|
||||||
fmt = function(name, context)
|
{
|
||||||
-- Show + if buffer is modified in tab
|
"tabs",
|
||||||
local buflist = vim.fn.tabpagebuflist(context.tabnr)
|
mode = 1,
|
||||||
local winnr = vim.fn.tabpagewinnr(context.tabnr)
|
max_length = (vim.o.columns / 5) * 4,
|
||||||
local bufnr = buflist[winnr]
|
fmt = function(name, context)
|
||||||
local mod = vim.fn.getbufvar(bufnr, '&mod')
|
-- Show + if buffer is modified in tab
|
||||||
|
local buflist = vim.fn.tabpagebuflist(context.tabnr)
|
||||||
|
local winnr = vim.fn.tabpagewinnr(context.tabnr)
|
||||||
|
local bufnr = buflist[winnr]
|
||||||
|
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",
|
||||||
-- lualine_y = { getLGTMs }
|
sources = { "nvim_lsp", "nvim_workspace_diagnostic" },
|
||||||
},
|
symbols = { error = " ", warn = " ", info = " ", hint = " " },
|
||||||
}
|
},
|
||||||
|
},
|
||||||
|
-- lualine_y = { getLGTMs }
|
||||||
|
},
|
||||||
|
})
|
||||||
|
@ -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>')
|
|
||||||
|
@ -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
|
||||||
|
@ -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>")
|
||||||
|
@ -1,25 +1,23 @@
|
|||||||
local null_ls = require("null-ls")
|
local null_ls = require("null-ls")
|
||||||
|
|
||||||
local sources = {
|
local sources = {
|
||||||
-- Catch insensitive, inconsiderate writing.
|
-- Catch insensitive, inconsiderate writing.
|
||||||
null_ls.builtins.diagnostics.alex,
|
null_ls.builtins.diagnostics.alex,
|
||||||
|
|
||||||
-- buildifier is a tool for formatting and linting bazel BUILD, WORKSPACE, and .bzl files.
|
-- buildifier is a tool for formatting and linting bazel BUILD, WORKSPACE, and .bzl files.
|
||||||
null_ls.builtins.diagnostics.buildifier,
|
null_ls.builtins.diagnostics.buildifier,
|
||||||
|
|
||||||
-- Codespell finds common misspellings in text files.
|
-- Codespell finds common misspellings in text files.
|
||||||
-- null_ls.builtins.diagnostics.codespell,
|
-- null_ls.builtins.diagnostics.codespell,
|
||||||
-- null_ls.builtins.diagnostics.cspell, null_ls.builtins.code_actions.cspell,
|
-- null_ls.builtins.diagnostics.cspell, null_ls.builtins.code_actions.cspell,
|
||||||
|
|
||||||
-- An English prose linter. Can fix some issues via code actions.
|
-- An English prose linter. Can fix some issues via code actions.
|
||||||
null_ls.builtins.code_actions.proselint,
|
null_ls.builtins.code_actions.proselint,
|
||||||
|
|
||||||
-- Reformats Java source code according to Google Java Style.
|
|
||||||
null_ls.builtins.formatting.google_java_format
|
|
||||||
|
|
||||||
|
-- Reformats Java source code according to Google Java Style.
|
||||||
|
null_ls.builtins.formatting.google_java_format,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
null_ls.setup({
|
null_ls.setup({
|
||||||
sources = sources,
|
sources = sources,
|
||||||
})
|
})
|
||||||
|
@ -3,72 +3,72 @@ 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({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
update_focused_file = {
|
update_focused_file = {
|
||||||
enable = true,
|
enable = true,
|
||||||
update_root = false,
|
update_root = false,
|
||||||
ignore_list = {},
|
ignore_list = {},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
map("n", "<C-T>", ":NvimTreeToggle<CR>")
|
map("n", "<C-T>", ":NvimTreeToggle<CR>")
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
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",
|
||||||
|
|
||||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
|
|
||||||
highlight = {
|
highlight = {
|
||||||
-- `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"},
|
||||||
--
|
--
|
||||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||||
-- Instead of true it can also be a list of languages
|
-- Instead of true it can also be a list of languages
|
||||||
-- additional_vim_regex_highlighting = true,
|
-- additional_vim_regex_highlighting = true,
|
||||||
additional_vim_regex_highlighting = {"java"},
|
additional_vim_regex_highlighting = { "java" },
|
||||||
},
|
},
|
||||||
-- rainbow = {
|
-- rainbow = {
|
||||||
-- enable = true,
|
-- enable = true,
|
||||||
-- extended_mode = true,
|
-- extended_mode = true,
|
||||||
-- }
|
-- }
|
||||||
}
|
})
|
||||||
|
@ -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)
|
||||||
|
@ -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 }
|
||||||
|
)
|
||||||
|
@ -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)')
|
|
@ -1,23 +1,21 @@
|
|||||||
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"},
|
goto_location = "<Cr>",
|
||||||
goto_location = "<Cr>",
|
-- focus_location = "o",
|
||||||
-- focus_location = "o",
|
hover_symbol = "<C-space>",
|
||||||
hover_symbol = "<C-space>",
|
toggle_preview = "L",
|
||||||
toggle_preview = "L",
|
-- rename_symbol = "r",
|
||||||
-- rename_symbol = "r",
|
-- code_actions = "a",
|
||||||
-- code_actions = "a",
|
-- fold = "h",
|
||||||
-- fold = "h",
|
-- unfold = "l",
|
||||||
-- unfold = "l",
|
fold_all = "H",
|
||||||
fold_all = "H",
|
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>")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
local home = vim.fn.expand("~/zettelkasten")
|
local home = vim.fn.expand("~/zettelkasten")
|
||||||
|
|
||||||
require('telekasten').setup({
|
require("telekasten").setup({
|
||||||
home = home,
|
home = home,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_lines = true,
|
virtual_lines = true,
|
||||||
virtual_text = false,
|
virtual_text = false,
|
||||||
severity_sort = true,
|
severity_sort = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Diagnostics
|
-- Diagnostics
|
||||||
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
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Mappings
|
-- Mappings
|
||||||
|
@ -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
|
||||||
}
|
})
|
||||||
|
@ -3,18 +3,17 @@ local use_google = require("utils").use_google
|
|||||||
|
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
vim.fn.system({
|
vim.fn.system({
|
||||||
"git",
|
"git",
|
||||||
"clone",
|
"clone",
|
||||||
"--filter=blob:none",
|
"--filter=blob:none",
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
"--branch=stable", -- latest stable release
|
"--branch=stable", -- latest stable release
|
||||||
lazypath,
|
lazypath,
|
||||||
})
|
})
|
||||||
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")
|
||||||
|
|
||||||
|
@ -1,314 +1,327 @@
|
|||||||
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,
|
||||||
lazy = false,
|
lazy = false,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
branch = "v2.x",
|
branch = "v2.x",
|
||||||
config = function()
|
config = function()
|
||||||
require("config.neotree")
|
require("config.neotree")
|
||||||
end,
|
end,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"MunifTanjim/nui.nvim",
|
"MunifTanjim/nui.nvim",
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ "<C-n>", ":Neotree filesystem reveal toggle reveal_force_cwd<cr>", desc = "Open NeoTree" },
|
{ "<C-n>", ":Neotree filesystem reveal toggle reveal_force_cwd<cr>", desc = "Open NeoTree" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- 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,
|
||||||
keys = {
|
keys = {
|
||||||
{ "<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",
|
||||||
cond = not use_google(),
|
event = "InsertEnter",
|
||||||
},
|
cond = not use_google(),
|
||||||
{
|
},
|
||||||
'ErichDonGubler/lsp_lines.nvim',
|
{
|
||||||
event = "VimEnter",
|
"ErichDonGubler/lsp_lines.nvim",
|
||||||
keys = {
|
event = "VimEnter",
|
||||||
{ "<leader>l", function() require("lsp_lines").toggle() end, desc = "Toggle LSP Lines" },
|
keys = {
|
||||||
},
|
{
|
||||||
},
|
"<leader>l",
|
||||||
{
|
function()
|
||||||
'jose-elias-alvarez/null-ls.nvim',
|
require("lsp_lines").toggle()
|
||||||
event = "VimEnter",
|
end,
|
||||||
config = function()
|
desc = "Toggle LSP Lines",
|
||||||
require("config.null-ls")
|
},
|
||||||
end
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
event = "VimEnter",
|
||||||
|
config = function()
|
||||||
|
require("config.null-ls")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
-- Rust
|
||||||
'nvim-telescope/telescope.nvim',
|
{
|
||||||
branch = '0.1.x',
|
"saecki/crates.nvim",
|
||||||
config = function()
|
ft = "rust",
|
||||||
require("config.telescope")
|
version = "v0.3.0",
|
||||||
end,
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
dependencies = {
|
config = function()
|
||||||
"telescope_codesearch",
|
require("crates").setup()
|
||||||
"telescope_citc",
|
end,
|
||||||
"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
|
{ "simrat39/rust-tools.nvim", ft = "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'},
|
{
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
event = "VimEnter",
|
||||||
|
config = function()
|
||||||
|
require("config.trouble")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
'folke/trouble.nvim',
|
"ThePrimeagen/refactoring.nvim",
|
||||||
event = "VimEnter",
|
dependencies = {
|
||||||
config = function()
|
{ "nvim-lua/plenary.nvim" },
|
||||||
require("config.trouble")
|
{ "nvim-treesitter/nvim-treesitter" },
|
||||||
end,
|
},
|
||||||
},
|
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
|
||||||
'ThePrimeagen/refactoring.nvim',
|
{
|
||||||
dependencies = {
|
"<leader>rx",
|
||||||
{"nvim-lua/plenary.nvim"},
|
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]],
|
||||||
{"nvim-treesitter/nvim-treesitter"}
|
mode = "v",
|
||||||
},
|
{ noremap = true, silent = true, expr = false },
|
||||||
config = function()
|
},
|
||||||
require("config.refactoring")
|
{
|
||||||
end,
|
"<leader>rxf",
|
||||||
keys = {
|
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]],
|
||||||
-- remap to open the Telescope refactoring menu in visual mode
|
mode = "v",
|
||||||
{"<leader>rr", "<Esc><cmd>lua require('telescope').extensions.refactoring.refactors()<CR>", { noremap = true }},
|
{ 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
|
-- Extract block doesn't need visual mode
|
||||||
{ "<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>rxb",
|
||||||
{ "<leader>rxv", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]], mode ="v" , {noremap = true, silent = true, expr = false}},
|
[[ <Cmd>lua require('refactoring').refactor('Extract Block')<CR>]],
|
||||||
{ "<leader>ri", [[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], mode ="v", {noremap = true, silent = true, expr = false}},
|
{ 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
|
-- Inline variable can also pick up the identifier currently under the cursor without 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}},
|
"<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}},
|
"simrat39/symbols-outline.nvim",
|
||||||
{ "<leader>rx", [[ <Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]], {noremap = true, silent = true, expr = false}},
|
config = function()
|
||||||
}
|
require("config.symbols-outline")
|
||||||
},
|
end,
|
||||||
{'andymass/vim-matchup', event = 'VimEnter'},
|
},
|
||||||
|
{
|
||||||
|
"petertriho/nvim-scrollbar",
|
||||||
|
config = function()
|
||||||
|
require("scrollbar").setup()
|
||||||
|
end,
|
||||||
|
lazy = false,
|
||||||
|
},
|
||||||
|
|
||||||
{ 'simrat39/symbols-outline.nvim',
|
{
|
||||||
config = function()
|
"rmagatti/auto-session",
|
||||||
require("config.symbols-outline")
|
config = function()
|
||||||
end
|
require("auto-session").setup({
|
||||||
},
|
log_level = "error",
|
||||||
{
|
-- auto_session_suppress_dirs = { "~/", "~/Downloads", "/", os.getenv("HOME")},
|
||||||
'petertriho/nvim-scrollbar',
|
})
|
||||||
config = function()
|
end,
|
||||||
require("scrollbar").setup()
|
},
|
||||||
end,
|
|
||||||
lazy = false,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
'rmagatti/auto-session',
|
"ipod825/libp.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require("auto-session").setup {
|
require("libp").setup()
|
||||||
log_level = "error",
|
end,
|
||||||
auto_session_suppress_dirs = { "~/", "~/Downloads", "/", os.getenv("HOME")},
|
},
|
||||||
}
|
|
||||||
end
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"ipod825/libp.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
config = function()
|
lazy = false,
|
||||||
require("libp").setup()
|
config = function()
|
||||||
end,
|
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,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
-- mine
|
||||||
'nvim-lualine/lualine.nvim',
|
{
|
||||||
lazy = false,
|
"squk/java-syntax.vim",
|
||||||
config = function()
|
lazy = false,
|
||||||
require("config.lualine")
|
},
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'rcarriga/nvim-notify',
|
|
||||||
config = function()
|
|
||||||
require("config.notify")
|
|
||||||
end
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"catppuccin/nvim",
|
"folke/which-key.nvim",
|
||||||
name = "catppuccin",
|
config = function()
|
||||||
lazy = false, -- make sure we load this during startup if it is your main colorscheme
|
require("config.whichkey")
|
||||||
priority = 1000, -- make sure to load this before all the other start plugins
|
end,
|
||||||
config = function()
|
},
|
||||||
require("config.catppuccin")
|
{ "junegunn/fzf", build = ":call fzf#install()" },
|
||||||
end
|
{ "udalov/kotlin-vim", ft = "kotin" },
|
||||||
},
|
{
|
||||||
{
|
"wesQ3/vim-windowswap",
|
||||||
'ojroques/nvim-osc52',
|
init = function()
|
||||||
config = function()
|
vim.g.windowswap_map_keys = 0
|
||||||
require("config.oscyank")
|
end,
|
||||||
end
|
},
|
||||||
},
|
{ "vim-scripts/vcscommand.vim" },
|
||||||
|
{
|
||||||
-- mine
|
"mhinz/vim-signify",
|
||||||
{
|
event = "VimEnter",
|
||||||
'squk/java-syntax.vim',
|
keys = {
|
||||||
lazy = false,
|
{ "]d", "<plug>(signify-next-hunk)" },
|
||||||
},
|
{ "[d", "<plug>(signify-prev-hunk)" },
|
||||||
|
},
|
||||||
{
|
},
|
||||||
"folke/which-key.nvim",
|
{
|
||||||
config = function()
|
"iamcco/markdown-preview.nvim",
|
||||||
require("config.whichkey")
|
build = "cd app && npm install",
|
||||||
end
|
init = function()
|
||||||
},
|
vim.g.mkdp_filetypes = { "markdown" }
|
||||||
{ 'junegunn/fzf', build = ":call fzf#install()" },
|
end,
|
||||||
|
ft = { "markdown" },
|
||||||
{ '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" }
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
39
vim/.vim/lua/plugins/formatter.lua
Normal file
39
vim/.vim/lua/plugins/formatter.lua
Normal 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,
|
||||||
|
}
|
@ -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" },
|
||||||
}
|
}
|
||||||
|
@ -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",
|
||||||
|
103
vim/.vim/lua/plugins/telescope.lua
Normal file
103
vim/.vim/lua/plugins/telescope.lua
Normal 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 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
@ -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()
|
||||||
|
@ -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
|
||||||
|
@ -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() {
|
||||||
|
Reference in New Issue
Block a user