less of a rewrite, more of a restructure
This commit is contained in:
27
flake.lock
generated
27
flake.lock
generated
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1775036866,
|
||||
"narHash": "sha256-ZojAnPuCdy657PbTq5V0Y+AHKhZAIwSIT2cb8UgAz/U=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6201e203d09599479a3b3450ed24fa81537ebc4e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
117
init.lua
117
init.lua
@@ -1,10 +1,8 @@
|
||||
-- Set mapleader
|
||||
vim.g.mapleader = "<Space>"
|
||||
vim.g.maplocalleader = ","
|
||||
|
||||
-- Lazy
|
||||
require("config.lazy")
|
||||
|
||||
-- Colorcheme
|
||||
vim.cmd.colorscheme("catppuccin-mocha")
|
||||
|
||||
-- Line numbers
|
||||
vim.opt.cursorline = true
|
||||
vim.wo.relativenumber = true
|
||||
@@ -12,22 +10,6 @@ vim.wo.number = true
|
||||
vim.api.nvim_set_hl(0, "LineNr", { fg = "#6c7086" }) -- overlay0
|
||||
vim.api.nvim_set_hl(0, "CursorLineNr", { fg = "#cba6f7", bold = true }) -- mauve
|
||||
|
||||
local cursorline_group = vim.api.nvim_create_augroup("CursorLineControl", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "WinEnter", "BufEnter" }, {
|
||||
group = cursorline_group,
|
||||
callback = function()
|
||||
vim.opt_local.cursorline = true
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "WinLeave" }, {
|
||||
group = cursorline_group,
|
||||
callback = function()
|
||||
vim.opt_local.cursorline = false
|
||||
end,
|
||||
})
|
||||
|
||||
-- Windows
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.splitright = true
|
||||
@@ -52,99 +34,12 @@ vim.opt.incsearch = true
|
||||
-- Nowrap
|
||||
vim.opt.wrap = false
|
||||
|
||||
-- Colorcheme
|
||||
vim.cmd.colorscheme("catppuccin-mocha")
|
||||
|
||||
-- Scrolloff
|
||||
vim.opt.scrolloff = math.floor(vim.o.lines / 2) - 3
|
||||
|
||||
-- Indent
|
||||
vim.o.autoindent = true
|
||||
|
||||
-- Keymap function
|
||||
function Keymap(mode, key, binding)
|
||||
vim.keymap.set(mode, key, binding, { noremap = true, silent = true })
|
||||
end
|
||||
|
||||
-- Better keymaps
|
||||
Keymap("i", "jj", "<Esc>")
|
||||
Keymap("n", "q:", ":")
|
||||
Keymap("n", "<leader>bd", function() -- delete buffer
|
||||
vim.cmd("bd")
|
||||
vim.cmd("echo 'Buffer deleted'")
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "i", function()
|
||||
if vim.fn.getline("."):match("^%s*$") then
|
||||
return [["_cc]]
|
||||
else
|
||||
return "i"
|
||||
end
|
||||
end, { expr = true, desc = "Inent properly on empty lines" })
|
||||
|
||||
vim.keymap.set("n", "a", function()
|
||||
if vim.fn.getline("."):match("^%s*$") then
|
||||
return [["_cc]]
|
||||
else
|
||||
return "a"
|
||||
end
|
||||
end, { expr = true, desc = "Indent properly on empty lines" })
|
||||
|
||||
vim.keymap.set("n", "A", function()
|
||||
if vim.fn.getline("."):match("^%s*$") then
|
||||
return [["_cc]]
|
||||
else
|
||||
return "A"
|
||||
end
|
||||
end, { expr = true, desc = "Indent properly on empty lines" })
|
||||
|
||||
-- C-BS for deleting whole word in insert mode
|
||||
vim.keymap.set("i", "<C-BS>", "<C-W>", { noremap = true })
|
||||
|
||||
-- Keybinds for MiniSessions
|
||||
vim.keymap.set("n", "<leader>qj", function() -- quit and save session local
|
||||
MiniSessions.write(".session")
|
||||
vim.cmd("wqa")
|
||||
end, { noremap = true })
|
||||
|
||||
vim.keymap.set("n", "<leader>qd", function() -- quit and delete session
|
||||
pcall(MiniSessions.delete(".session"))
|
||||
vim.cmd("wqa")
|
||||
end, { noremap = true })
|
||||
|
||||
-- lg keybind
|
||||
Keymap("n", "<leader>l", function()
|
||||
Snacks.lazygit.open()
|
||||
end)
|
||||
|
||||
-- Autocommand to check git status
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
callback = function()
|
||||
-- Verify if the current directory is a git repo
|
||||
local is_git = os.execute("git rev-parse --is-inside-work-tree > /dev/null 2>&1")
|
||||
if is_git ~= 0 then
|
||||
return
|
||||
end
|
||||
|
||||
-- Perform an async fetch to avoid startup lag
|
||||
vim.fn.jobstart("git fetch", {
|
||||
on_exit = function()
|
||||
-- Get the number of commits the remote is ahead of local HEAD
|
||||
local count = vim.fn.system("git rev-list --count HEAD..@{u} 2>/dev/null"):gsub("%s+", "")
|
||||
|
||||
if count ~= "" and tonumber(count) > 0 then
|
||||
vim.schedule(function()
|
||||
vim.notify(
|
||||
" " .. count .. " new commit(s) available on remote.",
|
||||
vim.log.levels.INFO,
|
||||
{ title = "Git Status", icon = "" }
|
||||
)
|
||||
end)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- Keybind to check diags from linter
|
||||
vim.api.nvim_set_keymap("n", "<leader>d", "<cmd>lua vim.diagnostic.open_float()<CR>", { noremap = true, silent = true })
|
||||
-- Undotree
|
||||
vim.cmd("packadd nvim.undotree")
|
||||
vim.keymap.set("n", "<leader>u", require("undotree").open)
|
||||
|
||||
44
lua/config/autocmd.lua
Normal file
44
lua/config/autocmd.lua
Normal file
@@ -0,0 +1,44 @@
|
||||
-- Autocommand to check git status
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
callback = function()
|
||||
-- Verify if the current directory is a git repo
|
||||
local is_git = os.execute("git rev-parse --is-inside-work-tree > /dev/null 2>&1")
|
||||
if is_git ~= 0 then
|
||||
return
|
||||
end
|
||||
|
||||
-- Perform an async fetch to avoid startup lag
|
||||
vim.fn.jobstart("git fetch", {
|
||||
on_exit = function()
|
||||
-- Get the number of commits the remote is ahead of local HEAD
|
||||
local count = vim.fn.system("git rev-list --count HEAD..@{u} 2>/dev/null"):gsub("%s+", "")
|
||||
|
||||
if count ~= "" and tonumber(count) > 0 then
|
||||
vim.schedule(function()
|
||||
vim.notify(
|
||||
" " .. count .. " new commit(s) available on remote.",
|
||||
vim.log.levels.INFO,
|
||||
{ title = "Git Status", icon = "" }
|
||||
)
|
||||
end)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
local cursorline_group = vim.api.nvim_create_augroup("CursorLineControl", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "WinEnter", "BufEnter" }, {
|
||||
group = cursorline_group,
|
||||
callback = function()
|
||||
vim.opt_local.cursorline = true
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "WinLeave" }, {
|
||||
group = cursorline_group,
|
||||
callback = function()
|
||||
vim.opt_local.cursorline = false
|
||||
end,
|
||||
})
|
||||
29
lua/config/binds.lua
Normal file
29
lua/config/binds.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
-- Keymap function
|
||||
function Keymap(mode, key, binding)
|
||||
vim.keymap.set(mode, key, binding, { noremap = true, silent = true })
|
||||
end
|
||||
|
||||
Keymap("n", "q:", ":") -- remove nonsense command
|
||||
Keymap("n", "<leader>bd", function() -- delete buffer
|
||||
vim.cmd("bd")
|
||||
vim.cmd("echo 'Buffer deleted'")
|
||||
end)
|
||||
|
||||
for bind = "i", "a", "A" do -- proper indenting function
|
||||
Keymap("n", bind, function()
|
||||
if vim.fn.getline("."):match("^%s*$") then
|
||||
return [["_cc]]
|
||||
else
|
||||
return bind
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
Keymap("i", "<C-BS>", "<C-W>") -- C-Backscpace for whole words
|
||||
|
||||
-- Open Lazygit
|
||||
Keymap("n", "<leader>l", function()
|
||||
Snacks.lazygit.open()
|
||||
end)
|
||||
|
||||
Keymap("n", "<leader>d", "<cmd>lua vim.diagnostic.open_float()<CR>") -- Diagnostics for Linter
|
||||
@@ -19,16 +19,17 @@ vim.opt.rtp:prepend(lazypath)
|
||||
-- loading lazy.nvim so that mappings are correct.
|
||||
-- This is also a good place to setup other settings (vim.opt)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = ","
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins.utils" },
|
||||
{ import = "plugins" },
|
||||
{ import = "plugins.completion" },
|
||||
{ import = "plugins.ui" },
|
||||
{ import = "plugins.functional" },
|
||||
{ import = "plugins.functional.neorg" },
|
||||
{ import = "plugins.editing" },
|
||||
{ import = "plugins.completion" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
|
||||
@@ -15,7 +15,6 @@ return {
|
||||
"json",
|
||||
"lua",
|
||||
"norg",
|
||||
"norg_meta",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"query",
|
||||
|
||||
106
lua/plugins/editing/neorg.lua
Normal file
106
lua/plugins/editing/neorg.lua
Normal file
@@ -0,0 +1,106 @@
|
||||
return {
|
||||
{
|
||||
"nvim-neorg/neorg",
|
||||
lazy = true,
|
||||
ft = "norg",
|
||||
version = "*",
|
||||
dependencies = {
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
{ "nvim-neorg/neorg-telescope" },
|
||||
{ "benlubas/neorg-interim-ls" },
|
||||
},
|
||||
config = function()
|
||||
require("neorg").setup({
|
||||
load = {
|
||||
["core.defaults"] = {},
|
||||
["core.concealer"] = {},
|
||||
["core.qol.toc"] = {
|
||||
config = {
|
||||
close_after_use = true,
|
||||
},
|
||||
},
|
||||
["core.integrations.treesitter"] = {},
|
||||
["core.looking-glass"] = {},
|
||||
["core.itero"] = {
|
||||
config = {
|
||||
iterables = {
|
||||
"unordered_list%d",
|
||||
"ordered_list%d",
|
||||
"quote%d",
|
||||
},
|
||||
},
|
||||
},
|
||||
["core.completion"] = {
|
||||
config = { engine = { module_name = "external.lsp-completion" } },
|
||||
},
|
||||
["core.dirman"] = {
|
||||
config = {
|
||||
workspaces = {
|
||||
notes = "~/Notes",
|
||||
site = "~/Documents/voidarc/content/",
|
||||
},
|
||||
default_workspace = "notes",
|
||||
},
|
||||
},
|
||||
["core.integrations.telescope"] = {
|
||||
config = {
|
||||
insert_file_link = {
|
||||
-- Whether to show the title preview in telescope. Affects performance with a large
|
||||
-- number of files.
|
||||
show_title_preview = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
["external.interim-ls"] = {
|
||||
config = {
|
||||
-- default config shown
|
||||
completion_provider = {
|
||||
-- Enable or disable the completion provider
|
||||
enable = true,
|
||||
|
||||
-- Show file contents as documentation when you complete a file name
|
||||
documentation = true,
|
||||
|
||||
-- Try to complete categories provided by Neorg Query. Requires `benlubas/neorg-query`
|
||||
categories = false,
|
||||
|
||||
-- suggest heading completions from the given file for `{@x|}` where `|` is your cursor
|
||||
-- and `x` is an alphanumeric character. `{@name}` expands to `[name]{:$/people:# name}`
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.wo.foldlevel = 99
|
||||
vim.wo.conceallevel = 2
|
||||
|
||||
vim.api.nvim_create_autocmd("Filetype", {
|
||||
pattern = "norg",
|
||||
callback = function()
|
||||
vim.keymap.set("n", "<CR>", "<Plug>(neorg.esupports.hop.hop-link.vsplit)", { buffer = true })
|
||||
vim.keymap.set("i", "<CR>", "<Plug>(neorg.itero.next-iteration)", { buffer = true })
|
||||
vim.keymap.set("n", "<localleader>m", "<cmd>Neorg inject-metadata<CR>", { buffer = true })
|
||||
vim.keymap.set("n", "<localleader>f", "<cmd>Telescope neorg insert_link<CR>", { buffer = true })
|
||||
vim.opt.colorcolumn = "140"
|
||||
vim.api.nvim_set_hl(0, "@neorg.tags.ranged_verbatim.code_block", { bg = "NONE" })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
config = function()
|
||||
require("snacks").setup({
|
||||
bigfile = {},
|
||||
lazygit = {},
|
||||
image = {
|
||||
enabled = true,
|
||||
math = {
|
||||
enabled = true,
|
||||
latex = {},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -3,3 +3,4 @@ return {
|
||||
event = { "CursorMoved", "WinScrolled" },
|
||||
opts = {},
|
||||
}
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
return {
|
||||
"okuuva/auto-save.nvim",
|
||||
version = "^1.0.0", -- see https://devhints.io/semver, alternatively use '*' to use the latest tagged release
|
||||
cmd = "ASToggle", -- optional for lazy loading on command
|
||||
event = { "InsertLeave", "TextChanged" },
|
||||
opts = {},
|
||||
config = function(opts)
|
||||
require("auto-save").setup({
|
||||
enabled = true,
|
||||
trigger_events = { -- See :h events
|
||||
immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" }, -- vim events that trigger an immediate save
|
||||
defer_save = { "InsertLeave" }, -- vim events that trigger a deferred save (saves after `debounce_delay`)
|
||||
cancel_deferred_save = { "InsertEnter" }, -- vim events that cancel a pending deferred save
|
||||
},
|
||||
debounce_delay = 1000,
|
||||
noautocmd = true,
|
||||
})
|
||||
local group = vim.api.nvim_create_augroup("autosave", {})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "AutoSaveWritePre",
|
||||
group = group,
|
||||
callback = function(opts)
|
||||
if opts.data.saved_buffer ~= nil then
|
||||
local filename = vim.fn.expand("%:t")
|
||||
print("Saved '" .. filename .. "' at " .. vim.fn.strftime("%H:%M:%S"))
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "AutoSaveEnable",
|
||||
group = group,
|
||||
callback = function(opts)
|
||||
print("AutoSave enabled")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "AutoSaveDisable",
|
||||
group = group,
|
||||
callback = function(opts)
|
||||
print("AutoSave disabled")
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
return {
|
||||
"echasnovski/mini.nvim",
|
||||
version = "",
|
||||
|
||||
config = function()
|
||||
require("mini.pairs").setup() -- Bracket pairs and stuff
|
||||
|
||||
require("mini.ai").setup() -- Around and In extension for visual mode
|
||||
|
||||
require("mini.cursorword").setup() -- Underline current word below cursor (makes it easier to c and d)
|
||||
|
||||
require("mini.indentscope").setup({ -- shows indents
|
||||
symbol = "│",
|
||||
draw = {
|
||||
delay = 10,
|
||||
animation = require("mini.indentscope").gen_animation.linear({
|
||||
duration = 15,
|
||||
unit = "step",
|
||||
easing = "out",
|
||||
}),
|
||||
},
|
||||
})
|
||||
|
||||
require("mini.trailspace").setup() -- Shows useless spaces
|
||||
|
||||
require("mini.sessions").setup({ -- dir based session management
|
||||
autoread = true,
|
||||
autowrite = true,
|
||||
file = ".session",
|
||||
force = { read = false, write = true, delete = true },
|
||||
})
|
||||
|
||||
require("mini.surround").setup() -- Suround selections with characters
|
||||
|
||||
require("mini.move").setup({ -- move selection in visual mode
|
||||
mappings = {
|
||||
down = "J",
|
||||
up = "K",
|
||||
},
|
||||
})
|
||||
|
||||
require("mini.icons").setup() -- Icon provider
|
||||
|
||||
local animate = require("mini.animate") -- animations ovs
|
||||
require("mini.animate").setup({
|
||||
cursor = {
|
||||
enable = false,
|
||||
},
|
||||
scroll = {
|
||||
-- Animate for 200 milliseconds with linear easing
|
||||
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||
-- Animate equally but with at most 120 steps instead of default 60
|
||||
subscroll = animate.gen_subscroll.equal({ max_output_steps = 60 }),
|
||||
},
|
||||
open = {
|
||||
-- Animate for 400 milliseconds with linear easing
|
||||
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||
-- Animate with wiping from nearest edge instead of default static one
|
||||
winconfig = animate.gen_winconfig.wipe({ direction = "from_edge" }),
|
||||
-- Make bigger windows more transparent
|
||||
winblend = animate.gen_winblend.linear({ from = 0, to = 0 }),
|
||||
},
|
||||
close = {
|
||||
-- Animate for 400 milliseconds with linear easing
|
||||
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||
-- Animate with wiping to nearest edge instead of default static one
|
||||
winconfig = animate.gen_winconfig.wipe({ direction = "to_edge" }),
|
||||
-- Make bigger windows more transparent
|
||||
winblend = animate.gen_winblend.linear({ from = 0, to = 0 }),
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
return {
|
||||
"nvim-neorg/neorg",
|
||||
lazy = false,
|
||||
version = "*",
|
||||
dependencies = { { "nvim-lua/plenary.nvim" }, { "nvim-neorg/neorg-telescope" }, { "benlubas/neorg-interim-ls" } },
|
||||
config = function()
|
||||
require("neorg").setup({
|
||||
load = {
|
||||
["core.defaults"] = {},
|
||||
["core.concealer"] = {},
|
||||
["core.qol.toc"] = {
|
||||
config = {
|
||||
close_after_use = true,
|
||||
},
|
||||
},
|
||||
["core.integrations.treesitter"] = {},
|
||||
["core.looking-glass"] = {},
|
||||
["core.itero"] = {
|
||||
config = {
|
||||
iterables = {
|
||||
"unordered_list%d",
|
||||
"ordered_list%d",
|
||||
"quote%d",
|
||||
},
|
||||
},
|
||||
},
|
||||
["core.completion"] = {
|
||||
config = { engine = { module_name = "external.lsp-completion" } },
|
||||
},
|
||||
["core.dirman"] = {
|
||||
config = {
|
||||
workspaces = {
|
||||
notes = "~/Notes",
|
||||
site = "~/Documents/voidarc/content/",
|
||||
},
|
||||
default_workspace = "notes",
|
||||
},
|
||||
},
|
||||
["core.integrations.telescope"] = {
|
||||
config = {
|
||||
insert_file_link = {
|
||||
-- Whether to show the title preview in telescope. Affects performance with a large
|
||||
-- number of files.
|
||||
show_title_preview = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
["external.interim-ls"] = {
|
||||
config = {
|
||||
-- default config shown
|
||||
completion_provider = {
|
||||
-- Enable or disable the completion provider
|
||||
enable = true,
|
||||
|
||||
-- Show file contents as documentation when you complete a file name
|
||||
documentation = true,
|
||||
|
||||
-- Try to complete categories provided by Neorg Query. Requires `benlubas/neorg-query`
|
||||
categories = false,
|
||||
|
||||
-- suggest heading completions from the given file for `{@x|}` where `|` is your cursor
|
||||
-- and `x` is an alphanumeric character. `{@name}` expands to `[name]{:$/people:# name}`
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.wo.foldlevel = 99
|
||||
vim.wo.conceallevel = 2
|
||||
|
||||
vim.api.nvim_create_autocmd("Filetype", {
|
||||
pattern = "norg",
|
||||
callback = function()
|
||||
vim.keymap.set("n", "<CR>", "<Plug>(neorg.esupports.hop.hop-link.vsplit)", { buffer = true })
|
||||
vim.keymap.set("i", "<CR>", "<Plug>(neorg.itero.next-iteration)", { buffer = true })
|
||||
vim.keymap.set("n", "<localleader>m", "<cmd>Neorg inject-metadata<CR>", { buffer = true })
|
||||
vim.keymap.set("n", "<localleader>f", "<cmd>Telescope neorg insert_link<CR>", { buffer = true })
|
||||
vim.opt.colorcolumn = "140"
|
||||
vim.api.nvim_set_hl(0, "@neorg.tags.ranged_verbatim.code_block", { bg = "NONE" })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
return {
|
||||
'2kabhishek/nerdy.nvim',
|
||||
cmd = 'Nerdy',
|
||||
opts = {
|
||||
max_recents = 30, -- Configure recent icons limit
|
||||
copy_to_clipboard = false, -- Copy glyph to clipboard instead of inserting
|
||||
copy_register = '+', -- Register to use for copying (if `copy_to_clipboard` is true)
|
||||
},
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
return {
|
||||
"vladdoster/remember.nvim",
|
||||
config = function()
|
||||
require("remember").setup({})
|
||||
end,
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
return {
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.8",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope-symbols.nvim",
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
},
|
||||
config = function()
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
file_ignore_patterns = { ".git", ".venv", ".node_modules" },
|
||||
},
|
||||
pickers = {
|
||||
live_grep = {
|
||||
additional_args = function(opts)
|
||||
return { "--hidden" }
|
||||
end,
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
file_browser = {
|
||||
theme = "ivy",
|
||||
hijack_netrw = true,
|
||||
},
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown({
|
||||
-- even more opts
|
||||
}),
|
||||
},
|
||||
},
|
||||
})
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
vim.keymap.set("n", "<leader>ff", function()
|
||||
builtin.find_files({ hidden = true })
|
||||
end, { desc = "Telescope find files (current file dir)" })
|
||||
|
||||
vim.keymap.set("n", "<space>fn", function()
|
||||
local full_path = vim.api.nvim_buf_get_name(0)
|
||||
local dir = vim.fn.fnamemodify(full_path, ":h")
|
||||
require("telescope").extensions.file_browser.file_browser({
|
||||
path = dir,
|
||||
})
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<space>fs", function() -- select sessions
|
||||
MiniSessions.select()
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<space>fd", function() -- select sessions
|
||||
MiniSessions.select("delete")
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>fg", function()
|
||||
builtin.live_grep({ hidden = true })
|
||||
end, { desc = "Telescope live grep (current file dir)" })
|
||||
|
||||
vim.keymap.set("n", "<leader>fb", function()
|
||||
builtin.buffers({ cwd = vim.fn.expand("%:p:h") }) -- buffers don’t need cwd, but harmless
|
||||
end, { desc = "Telescope buffers" })
|
||||
|
||||
require("telescope").load_extension("file_browser")
|
||||
require("telescope").load_extension("ui-select")
|
||||
require("telescope").load_extension("nerdy")
|
||||
end,
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
return {
|
||||
"mbbill/undotree",
|
||||
lazy = false,
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>u", "<cmd>UndotreeToggle<cr><cmd>UndotreeFocus<cr>")
|
||||
end,
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
return { undefined }
|
||||
return {}
|
||||
|
||||
@@ -10,3 +10,4 @@ return {
|
||||
show_end_of_buffer = true, -- shows the '~' characters after the end of buffers
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,3 +69,4 @@ return {
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
|
||||
@@ -44,3 +44,4 @@ return {
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
config = function()
|
||||
require("snacks").setup({
|
||||
bigfile = {},
|
||||
lazygit = {},
|
||||
image = {
|
||||
enabled = true,
|
||||
math = {
|
||||
enabled = true,
|
||||
latex = {},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -5,3 +5,4 @@ return {
|
||||
fadelevel = 0.6,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
55
lua/plugins/utils/files.lua
Normal file
55
lua/plugins/utils/files.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
return {
|
||||
{
|
||||
"okuuva/auto-save.nvim",
|
||||
version = "^1.0.0", -- see https://devhints.io/semver, alternatively use '*' to use the latest tagged release
|
||||
cmd = "ASToggle", -- optional for lazy loading on command
|
||||
event = { "InsertLeave", "TextChanged" },
|
||||
opts = {},
|
||||
config = function(opts)
|
||||
require("auto-save").setup({
|
||||
enabled = true,
|
||||
trigger_events = { -- See :h events
|
||||
immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" }, -- vim events that trigger an immediate save
|
||||
defer_save = { "InsertLeave" }, -- vim events that trigger a deferred save (saves after `debounce_delay`)
|
||||
cancel_deferred_save = { "InsertEnter" }, -- vim events that cancel a pending deferred save
|
||||
},
|
||||
debounce_delay = 1000,
|
||||
noautocmd = true,
|
||||
})
|
||||
local group = vim.api.nvim_create_augroup("autosave", {})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "AutoSaveWritePre",
|
||||
group = group,
|
||||
callback = function(opts)
|
||||
if opts.data.saved_buffer ~= nil then
|
||||
local filename = vim.fn.expand("%:t")
|
||||
print("Saved '" .. filename .. "' at " .. vim.fn.strftime("%H:%M:%S"))
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "AutoSaveEnable",
|
||||
group = group,
|
||||
callback = function(opts)
|
||||
print("AutoSave enabled")
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "AutoSaveDisable",
|
||||
group = group,
|
||||
callback = function(opts)
|
||||
print("AutoSave disabled")
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"vladdoster/remember.nvim",
|
||||
config = function()
|
||||
require("remember").setup({})
|
||||
end,
|
||||
},
|
||||
}
|
||||
73
lua/plugins/utils/mini.lua
Normal file
73
lua/plugins/utils/mini.lua
Normal file
@@ -0,0 +1,73 @@
|
||||
return {
|
||||
"echasnovski/mini.nvim",
|
||||
version = "",
|
||||
|
||||
config = function()
|
||||
require("mini.pairs").setup() -- Bracket pairs and stuff
|
||||
|
||||
require("mini.ai").setup() -- Around and In extension for visual mode
|
||||
|
||||
require("mini.cursorword").setup() -- Underline current word below cursor (makes it easier to c and d)
|
||||
|
||||
require("mini.indentscope").setup({ -- shows indents
|
||||
symbol = "│",
|
||||
draw = {
|
||||
delay = 10,
|
||||
animation = require("mini.indentscope").gen_animation.linear({
|
||||
duration = 15,
|
||||
unit = "step",
|
||||
easing = "out",
|
||||
}),
|
||||
},
|
||||
})
|
||||
|
||||
require("mini.trailspace").setup() -- Shows useless spaces
|
||||
|
||||
require("mini.sessions").setup({ -- dir based session management
|
||||
autoread = true,
|
||||
autowrite = true,
|
||||
file = ".session",
|
||||
force = { read = false, write = true, delete = true },
|
||||
})
|
||||
|
||||
require("mini.surround").setup() -- Suround selections with characters
|
||||
|
||||
require("mini.move").setup({ -- move selection in visual mode
|
||||
mappings = {
|
||||
down = "J",
|
||||
up = "K",
|
||||
},
|
||||
})
|
||||
|
||||
require("mini.icons").setup() -- Icon provider
|
||||
|
||||
-- local animate = require("mini.animate") -- animations ovs
|
||||
-- require("mini.animate").setup({
|
||||
-- cursor = {
|
||||
-- enable = false,
|
||||
-- },
|
||||
-- scroll = {
|
||||
-- -- Animate for 200 milliseconds with linear easing
|
||||
-- timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||
-- -- Animate equally but with at most 120 steps instead of default 60
|
||||
-- subscroll = animate.gen_subscroll.equal({ max_output_steps = 60 }),
|
||||
-- },
|
||||
-- open = {
|
||||
-- -- Animate for 400 milliseconds with linear easing
|
||||
-- timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||
-- -- Animate with wiping from nearest edge instead of default static one
|
||||
-- winconfig = animate.gen_winconfig.wipe({ direction = "from_edge" }),
|
||||
-- -- Make bigger windows more transparent
|
||||
-- winblend = animate.gen_winblend.linear({ from = 0, to = 0 }),
|
||||
-- },
|
||||
-- close = {
|
||||
-- -- Animate for 400 milliseconds with linear easing
|
||||
-- timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||
-- -- Animate with wiping to nearest edge instead of default static one
|
||||
-- winconfig = animate.gen_winconfig.wipe({ direction = "to_edge" }),
|
||||
-- -- Make bigger windows more transparent
|
||||
-- winblend = animate.gen_winblend.linear({ from = 0, to = 0 }),
|
||||
-- },
|
||||
-- })
|
||||
end,
|
||||
}
|
||||
83
lua/plugins/utils/telescope.lua
Normal file
83
lua/plugins/utils/telescope.lua
Normal file
@@ -0,0 +1,83 @@
|
||||
return {
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope-symbols.nvim",
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
},
|
||||
config = function()
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
file_ignore_patterns = { ".git", ".venv", ".node_modules" },
|
||||
},
|
||||
pickers = {
|
||||
live_grep = {
|
||||
additional_args = function(opts)
|
||||
return { "--hidden" }
|
||||
end,
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
file_browser = {
|
||||
theme = "ivy",
|
||||
hijack_netrw = true,
|
||||
},
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown({
|
||||
-- even more opts
|
||||
}),
|
||||
},
|
||||
},
|
||||
})
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
vim.keymap.set("n", "<leader>ff", function()
|
||||
builtin.find_files({ hidden = true })
|
||||
end, { desc = "Telescope find files (current file dir)" })
|
||||
|
||||
vim.keymap.set("n", "<space>fn", function()
|
||||
local full_path = vim.api.nvim_buf_get_name(0)
|
||||
local dir = vim.fn.fnamemodify(full_path, ":h")
|
||||
require("telescope").extensions.file_browser.file_browser({
|
||||
path = dir,
|
||||
})
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<space>fs", function() -- select sessions
|
||||
MiniSessions.select()
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<space>fd", function() -- select sessions
|
||||
MiniSessions.select("delete")
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>fg", function()
|
||||
builtin.live_grep({ hidden = true })
|
||||
end, { desc = "Telescope live grep (current file dir)" })
|
||||
|
||||
vim.keymap.set("n", "<leader>fb", function()
|
||||
builtin.buffers({ cwd = vim.fn.expand("%:p:h") }) -- buffers don’t need cwd, but harmless
|
||||
end, { desc = "Telescope buffers" })
|
||||
|
||||
require("telescope").load_extension("file_browser")
|
||||
require("telescope").load_extension("ui-select")
|
||||
require("telescope").load_extension("nerdy")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
{
|
||||
"2kabhishek/nerdy.nvim",
|
||||
cmd = "Nerdy",
|
||||
opts = {
|
||||
max_recents = 30, -- Configure recent icons limit
|
||||
copy_to_clipboard = false, -- Copy glyph to clipboard instead of inserting
|
||||
copy_register = "+", -- Register to use for copying (if `copy_to_clipboard` is true)
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user