04.06.2025
This commit is contained in:
parent
d4c839302b
commit
27416cef99
15 changed files with 190 additions and 205 deletions
|
@ -56,17 +56,9 @@ return {
|
|||
return false
|
||||
end
|
||||
|
||||
-- Skip autosave if you're in an active snippet
|
||||
if require("luasnip").in_snippet() then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
write_all_buffers = false, -- write all buffers when the current one meets `condition`
|
||||
-- Do not execute autocmds when saving
|
||||
-- If you set noautocmd = true, autosave won't trigger an auto format
|
||||
-- https://github.com/okuuva/auto-save.nvim/issues/55
|
||||
write_all_buffers = true, -- write all buffers when the current one meets `condition`
|
||||
noautocmd = false,
|
||||
lockmarks = false, -- lock marks when saving, see `:h lockmarks` for more details
|
||||
-- delay after which a pending save is executed (default 1000)
|
||||
|
|
|
@ -6,91 +6,44 @@ local source_mapping = {
|
|||
path = "[Path]",
|
||||
}
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
"saghen/blink.cmp",
|
||||
lazy = false,
|
||||
version = "1.*",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
lazy = true,
|
||||
version = "v2.*",
|
||||
build = "make install_jsregexp",
|
||||
opts = {
|
||||
history = true,
|
||||
delete_check_events = "TextChanged",
|
||||
},
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
config = function()
|
||||
require("plugins.snippets")
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
require("luasnip.loaders.from_vscode").lazy_load("./snippets")
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<C-K>",
|
||||
function()
|
||||
require("luasnip").expand()
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<C-L>",
|
||||
function()
|
||||
require("luasnip").jump(1)
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
{
|
||||
"<C-J>",
|
||||
function()
|
||||
require("luasnip").jump(-1)
|
||||
end,
|
||||
silent = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("cmp").setup({
|
||||
preselect = require("cmp").PreselectMode.None,
|
||||
experimental = {
|
||||
ghost_text = false,
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = "enter",
|
||||
},
|
||||
completion = {
|
||||
list = {
|
||||
selection = {
|
||||
preselect = false,
|
||||
auto_insert = false,
|
||||
},
|
||||
},
|
||||
|
||||
confirmation = {
|
||||
default_behavior = require("cmp").ConfirmBehavior.Replace,
|
||||
ghost_text = {
|
||||
enabled = true,
|
||||
},
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert,noselect",
|
||||
keyword_length = 2,
|
||||
},
|
||||
mapping = require("cmp").mapping.preset.insert({
|
||||
["<C-b>"] = require("cmp").mapping.scroll_docs(-4),
|
||||
["<C-f>"] = require("cmp").mapping.scroll_docs(4),
|
||||
["<C-Space>"] = require("cmp").mapping.complete(),
|
||||
["<C-e>"] = require("cmp").mapping.abort(),
|
||||
["<CR>"] = require("cmp").mapping.confirm({ select = false }),
|
||||
["<C-y>"] = require("cmp").mapping.confirm({ select = true }),
|
||||
}),
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
vim_item.menu = source_mapping[entry.source.name] or "[Unknown]"
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
sources = require("cmp").config.sources({
|
||||
{ name = "nvim_lsp", priority = 1000 },
|
||||
{ name = "codecompanion", priority = 800 },
|
||||
{ name = "luasnip", priority = 750 },
|
||||
{ name = "path", priority = 500 },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
})
|
||||
end,
|
||||
},
|
||||
cmdline = {
|
||||
keymap = { preset = "inherit" },
|
||||
completion = { menu = { auto_show = true } },
|
||||
sources = { "cmdline" },
|
||||
},
|
||||
snippets = { preset = "luasnip" },
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer", "codecompanion" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local d = ls.dynamic_node
|
||||
local r = ls.restore_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
local rep = require("luasnip.extras").rep
|
||||
|
||||
ls.config.setup({
|
||||
history = true,
|
||||
update_events = "TextChanged,TextChangedI",
|
||||
})
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
require("luasnip.loaders.from_vscode").lazy_load({
|
||||
paths = { vim.fn.stdpath("config") .. "/snippets" },
|
||||
})
|
||||
ls.add_snippets("json", require("snippets.json"))
|
69
nvim/lua/plugins/todo.lua
Normal file
69
nvim/lua/plugins/todo.lua
Normal file
|
@ -0,0 +1,69 @@
|
|||
return {
|
||||
"phrmendes/todotxt.nvim",
|
||||
cmd = { "TodoTxt", "DoneTxt" },
|
||||
opts = {
|
||||
todotxt = "/home/neonxp/Документы/todo.txt",
|
||||
donetxt = "/home/neonxp/Документы/done.txt",
|
||||
},
|
||||
-- suggested keybindings
|
||||
keys = {
|
||||
{
|
||||
"<leader>tp",
|
||||
function() require("todotxt").cycle_priority() end,
|
||||
desc = "todo.txt: cycle priority",
|
||||
ft = "todotxt",
|
||||
},
|
||||
{
|
||||
"<cr>",
|
||||
function() require("todotxt").toggle_todo_state() end,
|
||||
desc = "todo.txt: toggle task state",
|
||||
ft = "todotxt",
|
||||
},
|
||||
{
|
||||
"<leader>tn",
|
||||
function() require("todotxt").capture_todo() end,
|
||||
desc = "New entry",
|
||||
},
|
||||
{
|
||||
"<leader>tt",
|
||||
function() require("todotxt").toggle_todotxt() end,
|
||||
desc = "Open",
|
||||
},
|
||||
{
|
||||
"<leader>tr",
|
||||
function() require("todotxt").move_done_tasks() end,
|
||||
desc = "Move to done.txt",
|
||||
ft = "todotxt",
|
||||
},
|
||||
{
|
||||
"<leader>tss",
|
||||
function() require("todotxt").sort_tasks() end,
|
||||
desc = "Sort",
|
||||
ft = "todotxt",
|
||||
},
|
||||
{
|
||||
"<leader>tsd",
|
||||
function() require("todotxt").sort_tasks_by_due_date() end,
|
||||
desc = "Sort by due:date",
|
||||
ft = "todotxt",
|
||||
},
|
||||
{
|
||||
"<leader>tsP",
|
||||
function() require("todotxt").sort_tasks_by_priority() end,
|
||||
desc = "Sort by (priority)",
|
||||
ft = "todotxt",
|
||||
},
|
||||
{
|
||||
"<leader>tsc",
|
||||
function() require("todotxt").sort_tasks_by_context() end,
|
||||
desc = "Sort by @context",
|
||||
ft = "todotxt",
|
||||
},
|
||||
{
|
||||
"<leader>tsp",
|
||||
function() require("todotxt").sort_tasks_by_project() end,
|
||||
desc = "Sort by +project",
|
||||
ft = "todotxt",
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue