more updates
This commit is contained in:
parent
913df8f0e9
commit
cf081920eb
@ -1,58 +0,0 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" },
|
||||
"aerial.nvim": { "branch": "master", "commit": "1160fb7a15a34b03b7381d95d45560712b5f19d0" },
|
||||
"base16-vim": { "branch": "master", "commit": "3be3cd82cd31acfcab9a41bad853d9c68d30478d" },
|
||||
"blink.cmp": { "branch": "main", "commit": "5f442681df24fe705d1ee7ce5b4d435aa4b4dee4" },
|
||||
"conform.nvim": { "branch": "master", "commit": "9180320205d250429f0f80e073326c674e2a7149" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" },
|
||||
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||
"git-blame.nvim": { "branch": "master", "commit": "2883a7460f611c2705b23f12d58d398d5ce6ec00" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
|
||||
"go.nvim": { "branch": "master", "commit": "c6d5ca26377d01c4de1f7bff1cd62c8b43baa6bc" },
|
||||
"gruvbox-material": { "branch": "master", "commit": "055aefde5fd49018f3a858bca7b529bc2e08c02b" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "68c3460a5d1d1a362318960035c9f3466d5011f5" },
|
||||
"harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"mini.base16": { "branch": "main", "commit": "23453dacc1606e5d42238d82f0b42a2985386b62" },
|
||||
"mini.bufremove": { "branch": "main", "commit": "285bdac9596ee7375db50c0f76ed04336dcd2685" },
|
||||
"mini.comment": { "branch": "main", "commit": "a56581c40c19fa26f2b39da72504398de3173c5a" },
|
||||
"mini.icons": { "branch": "main", "commit": "6787321f70d674a481776b7cc2c781fb7002c644" },
|
||||
"mini.surround": { "branch": "main", "commit": "aa5e245829dd12d8ff0c96ef11da28681d6049aa" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
|
||||
"neogen": { "branch": "main", "commit": "dd0301bfba1f83a3bc009b5430fce7aa3cee6941" },
|
||||
"neorg": { "branch": "main", "commit": "6b945909d84b5aeadc875f9b3f529ec44b9bc60f" },
|
||||
"noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" },
|
||||
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
|
||||
"numb.nvim": { "branch": "master", "commit": "3f7d4a74bd456e747a1278ea1672b26116e0824d" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "8a65c448122fc8fac9c67b2e857b6e830a4afd0b" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" },
|
||||
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "e947d35bbf919ea88a24c21cb8afa4621e3cf547" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "4adeeaa7a32d46cf3b5833341358c797304f950a" },
|
||||
"oil.nvim": { "branch": "master", "commit": "ba858b662599eab8ef1cba9ab745afded99cb180" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
|
||||
"rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" },
|
||||
"sonokai": { "branch": "master", "commit": "1d7ca954792dfddd9e73c53563d85adaeb8c8437" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" },
|
||||
"treesitter-context": { "branch": "master", "commit": "2bcf700b59bc92850ca83a1c02e86ba832e0fae0" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" },
|
||||
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
|
||||
"vim": { "branch": "master", "commit": "65f4225e0526516a67d56c8ac09925a209138e53" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
|
||||
"vim-markdown": { "branch": "master", "commit": "8f6cb3a6ca4e3b6bcda0730145a0b700f3481b51" },
|
||||
"vim-slash": { "branch": "master", "commit": "31aee09b7ea8893a18fa34f65e63e364fc998444" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" },
|
||||
"zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" },
|
||||
"zk-nvim": { "branch": "main", "commit": "6beea6fafe2c781cb10e80878e68d5e32937692a" }
|
||||
}
|
||||
@ -58,6 +58,10 @@ vim.keymap.set("n", "<leader>-", "<cmd>Oil<CR>")
|
||||
vim.keymap.set("t", "<esc><esc>", "<c-\\><c-n>")
|
||||
vim.keymap.set("n", "<leader>xt", "<cmd>PlenaryBustedFile %<cr>")
|
||||
|
||||
local angular_utils = require("lazyvim.utils.angular")
|
||||
-- angular related
|
||||
vim.keymap.set("n", "<leader>gs", function() angular_utils.toggle_between_spec_and_file() end)
|
||||
|
||||
local job_id = 0
|
||||
vim.keymap.set("n", "<leader>Ts", function()
|
||||
vim.cmd.vnew()
|
||||
|
||||
@ -83,7 +83,15 @@ return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
name = "treesitter-context",
|
||||
enabled = true,
|
||||
lazy = true,
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
enabled = true,
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter"
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
45
.config/nvim/lua/lazyvim/utils/angular.lua
Normal file
45
.config/nvim/lua/lazyvim/utils/angular.lua
Normal file
@ -0,0 +1,45 @@
|
||||
local path = require("plenary.path")
|
||||
local scan = require("plenary.scandir")
|
||||
|
||||
local M = {}
|
||||
local max_depth = 5
|
||||
|
||||
local function load_file_into_buffer(file)
|
||||
local uri = vim.uri_from_fname(file)
|
||||
local new_buff = vim.uri_to_bufnr(uri)
|
||||
vim.api.nvim_win_set_buf(0, new_buff)
|
||||
vim.fn.execute("edit")
|
||||
end
|
||||
|
||||
function M.jump_to_angular_component_part(part)
|
||||
-- todo: implement inline jumping
|
||||
end
|
||||
|
||||
function M.toggle_between_spec_and_file()
|
||||
local current_buffer = vim.api.nvim_buf_get_name(0)
|
||||
local buf_path = path:new(current_buffer)
|
||||
local relative_path = buf_path:make_relative()
|
||||
local filename = string.match(relative_path, "([^/]+)$")
|
||||
|
||||
local full_destination = nil
|
||||
if string.match(filename, ".spec.ts") then
|
||||
-- if the current file is a spec file, then jump to the file it is testing
|
||||
local file_name = string.match(filename, "(.-)%.spec")
|
||||
full_destination = buf_path:parent() .. "/" .. file_name .. ".ts"
|
||||
else
|
||||
-- if the current file is not a spec file, then jump to the spec file
|
||||
local filename_without_ext = string.match(filename, "(.-)%.ts")
|
||||
full_destination = buf_path:parent() .. "/" .. filename_without_ext .. ".spec.ts"
|
||||
end
|
||||
|
||||
local exists = vim.fn.filereadable(full_destination)
|
||||
-- don't open a buffer if the file doesn't exist since you may end up creating a file without knowing it
|
||||
if exists == 0 then
|
||||
vim.notify("File doesn't exist: " .. full_destination, vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
load_file_into_buffer(full_destination)
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Reference in New Issue
Block a user