Compare commits
1 commit
af7eb4bf7e
...
cd5582af85
Author | SHA1 | Date | |
---|---|---|---|
cd5582af85 |
5 changed files with 137 additions and 150 deletions
|
@ -23,7 +23,9 @@ in {
|
|||
];
|
||||
|
||||
autoCmd = [
|
||||
(autocmds.mk' ["FocusGained" "TermClose" "TermLeave"] "checktime" (mkRaw ''
|
||||
(autocmds.mk' ["FocusGained" "TermClose" "TermLeave"] "checktime" (mkRaw
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
if vim.o.buftype ~= "nofile" then
|
||||
vim.cmd("checktime")
|
||||
|
@ -31,13 +33,17 @@ in {
|
|||
end
|
||||
'') "Check if file needs to be reloaded when changed")
|
||||
|
||||
(autocmds.mk' ["TextYankPost"] "highlight_yank" (mkRaw ''
|
||||
(autocmds.mk' ["TextYankPost"] "highlight_yank" (mkRaw
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
(vim.hl or vim.highlight).on_yank()
|
||||
end
|
||||
'') "Highlight on yank")
|
||||
|
||||
(autocmds.mk' ["VimResized"] "resize_splits" (mkRaw ''
|
||||
(autocmds.mk' ["VimResized"] "resize_splits" (mkRaw
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
local current_tab = vim.fn.tabpagenr()
|
||||
vim.cmd("tabdo wincmd =")
|
||||
|
@ -45,7 +51,9 @@ in {
|
|||
end
|
||||
'') "Resize splits on window resize")
|
||||
|
||||
(autocmds.mk' ["BufReadPost"] "last_loc" (mkRaw ''
|
||||
(autocmds.mk' ["BufReadPost"] "last_loc" (mkRaw
|
||||
# lua
|
||||
''
|
||||
function(event)
|
||||
local exclude = { "gitcommit" }
|
||||
local buf = event.buf
|
||||
|
@ -78,7 +86,9 @@ in {
|
|||
"spectre_panel"
|
||||
"startuptime"
|
||||
"tsplayground"
|
||||
] (mkRaw ''
|
||||
] (mkRaw
|
||||
# lua
|
||||
''
|
||||
function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
vim.schedule(function()
|
||||
|
@ -94,7 +104,9 @@ in {
|
|||
end
|
||||
'') "Close some filetypes with <q>")
|
||||
|
||||
(autocmds.mk ["FileType"] "man_unlisted" ["man"] (mkRaw ''
|
||||
(autocmds.mk ["FileType"] "man_unlisted" ["man"] (mkRaw
|
||||
# lua
|
||||
''
|
||||
function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
end
|
||||
|
@ -106,20 +118,26 @@ in {
|
|||
"typst"
|
||||
"gitcommit"
|
||||
"markdown"
|
||||
] (mkRaw ''
|
||||
] (mkRaw
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.spell = true
|
||||
end
|
||||
'') "Wrap & check spelling in text files")
|
||||
|
||||
(autocmds.mk ["FileType"] "json_conceal" ["json" "jsonc" "json5"] (mkRaw ''
|
||||
(autocmds.mk ["FileType"] "json_conceal" ["json" "jsonc" "json5"] (mkRaw
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
vim.opt_local.conceallevel = 0
|
||||
end
|
||||
'') "Fix conceallevel for json files")
|
||||
|
||||
(autocmds.mk' ["BufWritePre"] "auto_create_dir" (mkRaw ''
|
||||
(autocmds.mk' ["BufWritePre"] "auto_create_dir" (mkRaw
|
||||
# lua
|
||||
''
|
||||
function(event)
|
||||
if event.match:match("^%w%w+:[\\/][\\/]") then
|
||||
return
|
||||
|
|
|
@ -165,9 +165,9 @@ in {
|
|||
# Diagnostics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
++ [
|
||||
(keys.mk ["n"] "<LEADER>cd" (
|
||||
mkRaw ''
|
||||
function() vim.diagnostic.open_float() end
|
||||
''
|
||||
mkRaw
|
||||
# lua
|
||||
"function() vim.diagnostic.open_float() end"
|
||||
) "Line Diagnostics")
|
||||
]
|
||||
++ (
|
||||
|
@ -200,11 +200,13 @@ in {
|
|||
cmd = toLower dir;
|
||||
sev = sevs."${key}".key;
|
||||
in
|
||||
keys.mk ["n"] kmap (
|
||||
mkRaw ''
|
||||
function() vim.diagnostic.goto_${cmd}({ severity = ${sev} }) end
|
||||
''
|
||||
) "${dir} ${sevs."${key}".desc}"
|
||||
keys.mk ["n"] kmap
|
||||
(
|
||||
mkRaw
|
||||
# lua
|
||||
"function() vim.diagnostic.goto_${cmd}({ severity = ${sev} }) end"
|
||||
)
|
||||
"${dir} ${sevs."${key}".desc}"
|
||||
)
|
||||
{
|
||||
dir = ["Next" "Prev"];
|
||||
|
|
|
@ -3,20 +3,27 @@
|
|||
helpers,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) flatten mapAttrsToList map;
|
||||
inherit (lib.marleyvim) icons keys autocmds;
|
||||
inherit (helpers) mkRaw;
|
||||
inherit (lib) flatten mapAttrsToList map;
|
||||
inherit (lib.marleyvim) icons keys;
|
||||
in {
|
||||
plugins.bufferline = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
options = {
|
||||
close_command.__raw = "function(n) Snacks.bufdelete(n) end";
|
||||
right_mouse_command.__raw = "function(n) Snacks.bufdelete(n) end";
|
||||
close_command =
|
||||
mkRaw
|
||||
# lua
|
||||
"function(n) Snacks.bufdelete(n) end";
|
||||
right_mouse_command =
|
||||
mkRaw
|
||||
# lua
|
||||
"function(n) Snacks.bufdelete(n) end";
|
||||
|
||||
diagnostics = "nvim_lsp";
|
||||
diagnostics_indicator.__raw =
|
||||
diagnostics_indicator =
|
||||
mkRaw
|
||||
# lua
|
||||
''
|
||||
function(_, _, diag)
|
||||
|
@ -25,42 +32,10 @@ in {
|
|||
return vim.trim(ret)
|
||||
end
|
||||
'';
|
||||
|
||||
always_show_bufferline = true;
|
||||
|
||||
offsets = [
|
||||
{
|
||||
filetype = "neo-tree";
|
||||
text = "Explorer";
|
||||
highlight = "Directory";
|
||||
text_align = "left";
|
||||
}
|
||||
];
|
||||
|
||||
get_element_icon.__raw = ''
|
||||
function(elem)
|
||||
local icon, hl, _ =
|
||||
require('mini.icons').get('filetype', elem.filetype)
|
||||
return icon, hl
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
autoGroups.marleyos_bufferline.clear = true;
|
||||
autoCmd = [
|
||||
(autocmds.mk' ["BufAdd" "BufDelete"] "bufferline" (
|
||||
mkRaw ''
|
||||
function()
|
||||
vim.schedule(function()
|
||||
pcall(nvim_bufferline)
|
||||
end)
|
||||
end
|
||||
''
|
||||
) "Fix bufferline when restoring a session")
|
||||
];
|
||||
|
||||
keymaps =
|
||||
[
|
||||
(keys.mk ["n"] "<LEADER>bp" "<CMD>BufferLineTogglePin<CR>" "Toggle Pin")
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
_: {
|
||||
plugins.mini = {
|
||||
enable = true;
|
||||
|
||||
mockDevIcons = true;
|
||||
modules.icons = {};
|
||||
};
|
||||
}
|
|
@ -23,62 +23,62 @@ in {
|
|||
|
||||
keymaps = [
|
||||
(keys.mk ["n"] "<LEADER>un" (
|
||||
mkRaw ''
|
||||
function() Snacks.notifier.hide() end
|
||||
''
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.notifier.hide() end"
|
||||
) "Dismiss All Notifications")
|
||||
|
||||
(keys.mk ["n"] "<LEADER>bd" (
|
||||
mkRaw ''
|
||||
function() Snacks.bufdelete() end
|
||||
''
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.bufdelete() end"
|
||||
) "Delete Buffer")
|
||||
|
||||
(keys.mk ["n"] "<LEADER>bo" (
|
||||
mkRaw ''
|
||||
function() Snacks.bufdelete.other() end
|
||||
''
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.bufdelete.other() end"
|
||||
) "Delete Other Buffers")
|
||||
|
||||
# LazyGit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
(keys.mk ["n"] "<LEADER>gg" (
|
||||
mkRaw ''
|
||||
function() Snacks.lazygit() end
|
||||
''
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.lazygit() end"
|
||||
) "Lazygit")
|
||||
|
||||
(keys.mk ["n"] "<LEADER>gf" (
|
||||
mkRaw ''
|
||||
function() Snacks.lazygit.log_file() end
|
||||
''
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.lazygit.log_file() end"
|
||||
) "Lazygit Current File History")
|
||||
|
||||
(keys.mk ["n"] "<LEADER>gl" (
|
||||
mkRaw ''
|
||||
function() Snacks.lazygit.log() end
|
||||
''
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.lazygit.log() end"
|
||||
) "Lazygit Log")
|
||||
|
||||
# Git - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
(keys.mk ["n"] "<LEADER>gb" (
|
||||
mkRaw ''
|
||||
function() Snacks.git.blame_line() end
|
||||
''
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.git.blame_line() end"
|
||||
) "Git Blame Line")
|
||||
|
||||
(keys.mk ["n" "x"] "<LEADER>gB" (
|
||||
mkRaw ''
|
||||
function() Snacks.gitbrowse() end
|
||||
''
|
||||
mkRaw
|
||||
# lua
|
||||
"function() Snacks.gitbrowse() end"
|
||||
) "Git Browse (open)")
|
||||
|
||||
(keys.mk ["n" "x"] "<LEADER>gY" (
|
||||
mkRaw ''
|
||||
(keys.mk ["n" "x"] "<LEADER>gY" (mkRaw
|
||||
# lua
|
||||
''
|
||||
function()
|
||||
Snacks.gitbrowse({ open = function(url) vim.fn.setreg("+", url) end })
|
||||
end
|
||||
''
|
||||
) "Git Browse (copy)")
|
||||
'') "Git Browse (copy)")
|
||||
];
|
||||
|
||||
# Toggles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
Loading…
Reference in a new issue