Skip to content

Commit

Permalink
win: merge w/ nvim branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Manca committed Nov 17, 2024
1 parent 48e84b2 commit 983698f
Show file tree
Hide file tree
Showing 14 changed files with 155 additions and 156 deletions.
26 changes: 13 additions & 13 deletions lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SchemaStore.nvim": { "branch": "main", "commit": "5f0639d68cbea3ab8a9a24a51a5f984d86ea8438" },
"alpha-nvim": { "branch": "main", "commit": "bf3c8bb8c02ed3d9644cc5bbc48e2bdc39349cd7" },
"SchemaStore.nvim": { "branch": "main", "commit": "8ae7ed5b8a58ad36136d9b440205cef552bd0e41" },
"alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-calc": { "branch": "main", "commit": "5947b412da67306c5b68698a02a846760059be2e" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
Expand All @@ -10,40 +10,40 @@
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp-vimtex": { "branch": "master", "commit": "5283bf9108ef33d41e704027b9ef22437ce7a15b" },
"color-picker.nvim": { "branch": "master", "commit": "06cb5f853535dea529a523e9a0e8884cdf9eba4d" },
"conform.nvim": { "branch": "master", "commit": "e3263eabbfc1bdbc5b6a60ba8431b64e8dca0a79" },
"conform.nvim": { "branch": "master", "commit": "023f795dbcf32d4351b6a9ed2e613d471b5bb812" },
"data-viewer.nvim": { "branch": "main", "commit": "40ddf37bb7ab6c04ff9e820812d1539afe691668" },
"gitsigns.nvim": { "branch": "main", "commit": "4daf7022f1481edf1e8fb9947df13bb07c18e89a" },
"gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" },
"jupytext.nvim": { "branch": "main", "commit": "c8baf3ad344c59b3abd461ecc17fc16ec44d0f7b" },
"kurayami.nvim": { "branch": "main", "commit": "943069e44009dd4667a398812abebeb200b9b327" },
"lazy.nvim": { "branch": "main", "commit": "60cf258a9ae7fffe04bb31141141a91845158dcc" },
"lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" },
"lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" },
"markdown.nvim": { "branch": "main", "commit": "d80acb3f4ccc88052f65fa0a26e46c106b328bbe" },
"markdown.nvim": { "branch": "main", "commit": "82184c4a3c3580a7a859b2cb7e58f16c10fd29ef" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.ai": { "branch": "main", "commit": "31c149067d38b97720d2a179619f7745a0006ecc" },
"mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" },
"mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" },
"mini.surround": { "branch": "main", "commit": "48a9795c9d352c771e1ab5dedab6063c0a2df037" },
"molten-nvim": { "branch": "main", "commit": "66ee5c0a0fbe3e014b867d04db44592f2d3eb30f" },
"noice.nvim": { "branch": "main", "commit": "2087bbf8cd64482b47fb5f33b5e0eabf329ab14b" },
"noice.nvim": { "branch": "main", "commit": "4824592317e7f5faf51adb8dfba6567aa8456d61" },
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
"nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-dap": { "branch": "master", "commit": "8517126e9323e346f6a99b3b594c5a940b914dcd" },
"nvim-dap": { "branch": "master", "commit": "6bf4de67dbe90271608e1c81797e5edc79ec6335" },
"nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" },
"nvim-dbee": { "branch": "master", "commit": "21d2cc0844a16262bb6ea93ab3d0a0f20bd87853" },
"nvim-jdtls": { "branch": "master", "commit": "c4279b8ffce9b64eb302056d78dfebc2968a49bc" },
"nvim-lint": { "branch": "master", "commit": "36da8dd0ddc4f88e0beae234c20e75397326f143" },
"nvim-lspconfig": { "branch": "master", "commit": "4cb925e96288a71409a86c84fd97f4434a95453e" },
"nvim-lspconfig": { "branch": "master", "commit": "87c7c83ce62971e0bdb29bb32b8ad2b19c8f95d0" },
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" },
"nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" },
"nvim-treesitter": { "branch": "master", "commit": "8e40904e49bbad5812798eb54be8c00d77cdd301" },
"nvim-treesitter": { "branch": "master", "commit": "06611c75fec573420838369fe76ac5f8bd740240" },
"nvim-treesitter-context": { "branch": "master", "commit": "158377d700596367a91ea41818f76abdbf75a232" },
"nvim-treesitter-refactor": { "branch": "master", "commit": "d8b74fa87afc6a1e97b18da23e762efb032dc270" },
"nvim-ufo": { "branch": "main", "commit": "522d719d421fc42b95577d9624048d8348d326ea" },
"nvim-ufo": { "branch": "main", "commit": "c070ee849bfedb2ed778f60419a1eae8c8544be8" },
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
"oil.nvim": { "branch": "master", "commit": "621f8ba4fa821724e9b646732a26fb2e795fe008" },
"oil.nvim": { "branch": "master", "commit": "8ea40b5506115b6d355e304dd9ee5089f7d78601" },
"otter.nvim": { "branch": "main", "commit": "ca9ce67d0399380b659923381b58d174344c9ee7" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
Expand All @@ -52,6 +52,6 @@
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" },
"toggleterm.nvim": { "branch": "main", "commit": "87b2d6a3cab8e2bd9a0255427074285f0365398d" },
"vimtex": { "branch": "master", "commit": "251615c0624b820e2245c4ad20a70f0002e596a0" },
"vimtex": { "branch": "master", "commit": "6ee92c7ed2cdc876f499bd5561a65d04dee10d1f" },
"which-key.nvim": { "branch": "main", "commit": "68e37e12913a66b60073906f5d3f14dee0de19f2" }
}
3 changes: 1 addition & 2 deletions lua/lib/automation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function automation.auto_timestamp()
if vim.opt_local.modified:get() == true then
local cursor_pos = vim.api.nvim_win_get_cursor(0)

vim.api.nvim_command [[0,10s/\(.*Modified?*:\)\s\+\(.\+\)/\=submatch(1) . ' ' . strftime('%d %h %Y, %H:%M')/g]]
vim.api.nvim_command [[0,10s/\(.*Modified*:\)\s\+\(.\+\)/\=submatch(1) . ' ' . strftime('%d %h %Y, %H:%M')/g]]
vim.fn.histdel("search", -1)
vim.api.nvim_win_set_cursor(0, cursor_pos)
end
Expand All @@ -38,4 +38,3 @@ function automation.auto_remove_trailing_spaces()
})
end

return automation
37 changes: 17 additions & 20 deletions lua/lib/session.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@
-- File : session.lua
-- Description : module to manage vim builtin sessions
-- Author : Kevin
-- Last Modified: 24 Mar 2024, 13:25
-- Last Modified: 08 Sep 2024, 11:06
-------------------------------------

local session = {}
local session = {
dir = string.format("%s/session", vim.fn.stdpath "state"),
}

---Get available sessions
---@private
---@return table
local function get_sessions()
local sessions = {}

local sessions_data_stdpath = vim.fn.stdpath "data" .. "/sessions"
local sessions_files = vim.split(
vim.fn.globpath(sessions_data_stdpath, "*.vim"),
"\n",
{ trimempty = true }
)
local sessions_files = vim.split(vim.fn.globpath(session.dir, "*.vim"), "\n", { trimempty = true })

for _, f in pairs(sessions_files) do
table.insert(sessions, f)
Expand All @@ -41,10 +38,7 @@ local function delete_session()
detach = true,
on_exit = function()
local choice_name = vim.fn.fnamemodify(choice, ":t")
vim.notify(
string.format("Session < %s > deleted!", choice_name),
vim.log.levels.WARN
)
vim.notify(string.format("Session < %s > deleted!", choice_name), vim.log.levels.WARN)
end,
})
end
Expand All @@ -62,6 +56,9 @@ local function restore_session()
require "telescope"
vim.ui.select(sessions, {
prompt = " > Select session to restore",
format_item = function(item)
return string.format("(%s) %s", item, vim.fn.fnamemodify(item, ":p:t:r"))
end,
default = nil,
}, function(choice)
local s_name = vim.fn.fnamemodify(choice, ":p:t:r")
Expand All @@ -76,7 +73,6 @@ local function restore_session()
end
end


---Save current vim session with name.
--- The session is saved into 'data' stdpath of nvim
--@see mksession |:mksession|
Expand All @@ -87,16 +83,20 @@ local function save_session()
default = nil,
}, function(input)
if input then
local mks_path = vim.fn.stdpath "data" .. "/sessions/" .. input .. ".vim"
vim.cmd("mksession! " .. mks_path)
if vim.fn.isdirectory(session.dir) ~= 1 then
vim.fn.mkdir(session.dir, "pR")
end
local new_session_path = string.format("%s/%s.vim", session.dir, input)
vim.cmd.mksession { new_session_path, bang = true }
-- vim.cmd("mksession! " .. mks_path)
vim.notify(string.format("Session < %s > created!", input), vim.log.levels.INFO)
end
end)
end

---Helper function to usercmd completion
function session.usercmd_session_completion()
local args = { 'restore', 'save', 'delete' }
local args = { "restore", "save", "delete" }
return table.concat(args, "\n")
end

Expand All @@ -108,10 +108,7 @@ function session.select(arg)
elseif arg == "delete" then
delete_session()
else
vim.notify("Invalid argument.\nUsage -> :Session [save|restore|delete]",
vim.log.levels.WARN,
{ title = "Session" }
)
vim.notify("Invalid argument.\nUsage -> :Session [save|restore|delete]", vim.log.levels.WARN, { title = "Session" })
end
end

Expand Down
3 changes: 1 addition & 2 deletions lua/plugins/editor/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ return {
{
"garymjr/nvim-snippets",
event = "InsertEnter",
dependencies = { "kevinm6/snippets", dev = true },
opts = {
-- TODO on nvim-0.11 => set when activating built-in completion (w/o nvim-cmp)
-- o.create_cmp_source = false
Expand All @@ -314,4 +313,4 @@ return {
search_paths = { vim.fn.expand(vim.env.HOME .. "/dev/snippets") },
},
},
}
}
7 changes: 2 additions & 5 deletions lua/plugins/editor/oil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- File : oil.lua
-- Description : oil plugin config
-- Author : Kevin
-- Last Modified: 09 May 2024, 17:51
-- Last Modified: 17 Nov 2024, 10:49
-------------------------------------

---- Get defaults columns view
Expand Down Expand Up @@ -74,15 +74,12 @@ return {
["gh"] = {
desc = "Open UserDir",
callback = function()
require("oil").close()
local home_dir = tostring(vim.env.HOME)
require("oil").open_float(home_dir)
vim.cmd.edit(vim.env.HOME)
end,
},
["q"] = "actions.close",
["<Esc><Esc>"] = "actions.close",
["<C-h>"] = "actions.parent",
["<C-.>"] = "actions.toggle_hidden",
["g."] = "actions.toggle_hidden",
["-"] = "actions.parent",
["gw"] = "actions.open_cwd",
Expand Down
6 changes: 3 additions & 3 deletions lua/plugins/editor/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ return {

o.defaults = {
preview = { hide_on_startup = true },
-- file_previewer = require("lib.telescope").image_preview().file_previewer,
-- buffer_previewer_maker = require("lib.telescope").image_preview().buffer_previewer_maker,
file_previewer = require("lib.telescope").image_preview().file_previewer,
buffer_previewer_maker = require("lib.telescope").image_preview().buffer_previewer_maker,
initial_mode = "insert",
prompt_prefix = icons.get("filetype", "telescope") .. " ",
selection_caret = "",
Expand Down Expand Up @@ -566,4 +566,4 @@ return {

---UI-select
"nvim-telescope/telescope-ui-select.nvim",
}
}
9 changes: 2 additions & 7 deletions lua/plugins/editor/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- File : treesitter.lua
-- Description : TreeSitter config
-- Author : Kevin
-- Last Modified: 01 May 2024, 13:23
-- Last Modified: 17 Nov 2024, 10:49
-------------------------------------

local function parsers_to_be_installed()
Expand Down Expand Up @@ -59,10 +59,6 @@ return {
lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline
main = "nvim-treesitter.configs",
build = ":TSUpdate",
-- dependencies = {
-- "nvim-treesitter/nvim-treesitter-refactor",
-- "nvim-treesitter/nvim-treesitter-context",
-- },
opts = function(_, o)
o.ensure_installed = parsers_to_be_installed()
o.sync_install = false -- install languages synchronously (only applied to `ensure_installed`)
Expand Down Expand Up @@ -159,7 +155,6 @@ return {
},

"nvim-treesitter/nvim-treesitter-refactor",
"nvim-treesitter/nvim-treesitter-context",
{
"HiPhish/rainbow-delimiters.nvim",
cond = false,
Expand Down Expand Up @@ -187,4 +182,4 @@ return {
}
end,
},
}
}
13 changes: 4 additions & 9 deletions lua/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- File : init.lua
-- Description : plugin init scheme
-- Author : Kevin
-- Last Modified: 14 Jul 2024, 12:10
-- Last Modified: 17 Nov 2024, 10:50
-------------------------------------

local M = {
Expand Down Expand Up @@ -50,15 +50,13 @@ local M = {

---Image in NeoVim
{
"kevinm6/image.nvim",
"3rd/image.nvim",
-- pin = true, -- DON'T update for now -> https://github.com/3rd/image.nvim/issues/191
dev = true,
cond = function()
return vim.fn.has("win32") ~= 1
end,
-- dev = true,
ft = { "markdown", "vimwiki", "png", "jpeg", "jpg", "image_nvim" },
opts = function(_, o)
o.backend = "kitty"
o.processor = "magick_cli"
o.window_overlap_clear_enabled = true -- toggles images when windows are overlapped
-- o.editor_only_render_when_focused = true -- auto show/hide images when the editor gains/looses focus
o.window_overlap_clear_ft_ignore = {}
Expand Down Expand Up @@ -263,7 +261,6 @@ local M = {
ft = { "qmd", "jupyter_notebook", "quarto" },
version = "^1.0.0",
build = ":UpdateRemotePlugins",
-- dependencies = { "image.nvim" },
init = function()
vim.g.molten_image_provider = "image.nvim"
vim.g.molten_output_win_max_height = 20
Expand Down Expand Up @@ -356,7 +353,6 @@ local M = {
{
"quarto-dev/quarto-nvim",
ft = { "quarto" },
-- dependencies = { "otter.nvim" },
opts = function(_, o)
o.codeRunner = {
enabled = false,
Expand Down Expand Up @@ -413,4 +409,3 @@ local M = {
},
}

return M
Loading

0 comments on commit 983698f

Please sign in to comment.