changed telesnip and formatted some stuff

This commit is contained in:
pika 2024-08-21 23:32:00 +02:00
parent b36925682a
commit d9122c06de
4 changed files with 73 additions and 44 deletions

View file

@ -21,6 +21,8 @@ return {
graphql = { "prettier" }, graphql = { "prettier" },
liquid = { "prettier" }, liquid = { "prettier" },
sh = { "shfmt" }, sh = { "shfmt" },
zsh = { "shfmt" },
batch = { "shfmt", "prettier" },
lua = { "stylua" }, lua = { "stylua" },
}, },
format_on_save = { format_on_save = {

View file

@ -1,16 +1,21 @@
-- Example assuming you're configuring your plugin in lazy.nvim
return { return {
"https://git.k4li.de/pika/telesnip.nvim", "https://git.k4li.de/pika/telesnip.nvim",
config = function() config = function()
-- Load your plugin -- Load your plugin
local telesnip = require("telesnip") local telesnip = require("telesnip")
telesnip.setup({
-- snippet_path = "/path/to/your/snippets",
})
-- Define the :Snippets command -- Define the :TelesnipSnippets command
vim.api.nvim_create_user_command("Snippets", function() vim.api.nvim_create_user_command("TelesnipSnippets", function()
telesnip.snippet_picker() telesnip.telesnip_show()()
end, {}) end, {})
-- Optional: Set up a keybinding if desired -- Optional: Set up a keybinding if desired
vim.keymap.set("n", "<leader>S", ":Snippets<CR>", { desc = "Open Snippet Picker" }) vim.keymap.set("n", "<leader>S", ":TelesnipSnippets<CR>", { desc = "Open Snippet Picker" })
vim.keymap.set("v", "<leader>cs", function()
require("telesnip").save_custom_snippet()
end, { noremap = true })
end, end,
} }

View file

@ -1,37 +1,59 @@
return { return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
build = ":TSUpdate", build = ":TSUpdate",
dependencies = { dependencies = {
"windwp/nvim-ts-autotag", "windwp/nvim-ts-autotag",
}, },
config = function() config = function()
require("nvim-treesitter.configs").setup({ require("nvim-treesitter.configs").setup({
highlight = { highlight = {
enable = true, enable = true,
additional_vim_regex_highlighting = false, additional_vim_regex_highlighting = false,
}, },
indent = { enable = true }, indent = { enable = true },
autotag = { enable = true }, autotag = { enable = true },
ensure_installed = { ensure_installed = {
"bash", "fish", "http", "html", "php", "css", "scss", "bash",
"gitignore", "git_config", "markdown", "markdown_inline", "fish",
"dockerfile", "yaml", "json", "javascript", "typescript", "http",
"graphql", "lua", "query", "c", "prisma", "hyprlang", "html",
"ini", "passwd", "vim", "vimdoc", "php",
}, "css",
incremental_selection = { "scss",
enable = true, "gitignore",
keymaps = { "git_config",
init_selection = "<C-space>", "markdown",
node_incremental = "<C-space>", "markdown_inline",
scope_incremental = false, "dockerfile",
node_decremental = "<bs>", "yaml",
}, "json",
}, "javascript",
-- Add these fields to address the error "typescript",
sync_install = true, "graphql",
auto_install = true, "lua",
}) "query",
end, "c",
"prisma",
"hyprlang",
"ini",
"passwd",
"vim",
"vimdoc",
-- "sh",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
-- Add these fields to address the error
sync_install = true,
auto_install = true,
})
end,
} }

View file

@ -1,6 +1,6 @@
return { return {
'szw/vim-maximizer', "szw/vim-maximizer",
keys = { keys = {
{ '<C-f>', '<cmd>MaximizerToggle<CR>', desc = 'Maximize/minimize a split' }, { "<C-f>", "<cmd>MaximizerToggle<CR>", desc = "Maximize/minimize a split" },
}, },
} }