many updates

This commit is contained in:
Solomon Laing 2025-01-07 12:56:43 +10:30
parent 802517b65b
commit 913df8f0e9
34 changed files with 771 additions and 297 deletions

View File

@ -0,0 +1,123 @@
args = ["--login"]
program = "/usr/bin/zsh"
[[keyboard.bindings]]
action = "Paste"
key = "V"
mods = "Control|Shift"
[[keyboard.bindings]]
action = "Copy"
key = "C"
mods = "Control|Shift"
[[keyboard.bindings]]
action = "PasteSelection"
key = "Insert"
mods = "Shift"
[[keyboard.bindings]]
action = "ResetFontSize"
key = "Numpad0"
mods = "Control"
[[keyboard.bindings]]
action = "IncreaseFontSize"
key = "NumpadEquals"
mods = "Control"
[[keyboard.bindings]]
action = "DecreaseFontSize"
key = "NumpadSubtract"
mods = "Control"
[[keyboard.bindings]]
action = "Paste"
key = "Paste"
[[keyboard.bindings]]
action = "Copy"
key = "Copy"
[[keyboard.bindings]]
action = "ClearLogNotice"
key = "L"
mods = "Control"
[[keyboard.bindings]]
chars = "\f"
key = "L"
mods = "Control"
[[keyboard.bindings]]
action = "ScrollPageUp"
key = "PageUp"
mode = "~Alt"
mods = "Shift"
[[keyboard.bindings]]
action = "ScrollPageDown"
key = "PageDown"
mode = "~Alt"
mods = "Shift"
[[keyboard.bindings]]
action = "ScrollToTop"
key = "Home"
mode = "~Alt"
mods = "Shift"
[[keyboard.bindings]]
action = "ScrollToBottom"
key = "End"
mode = "~Alt"
mods = "Shift"
[general]
import = ["/path/to/dracula.yml"]
[env]
TERM = "xterm-256color"
[font]
size = 10.0
[font.bold]
family = "FiraCode Nerd Font"
style = "Bold"
[font.bold_italic]
family = "FiraCode Nerd Font"
style = "Bold Italic"
[font.italic]
family = "FiraCode Nerd Font"
style = "Italic"
[font.normal]
family = "FiraCode Nerd Font"
style = "Regular"
[font.offset]
x = 0
y = 0
[scrolling]
history = 5000
[window]
opacity = 0.7
title = "Alacritty"
[window.class]
general = "Alacritty"
instance = "Alacritty"
[window.padding]
x = 6
y = 6
[colors]
draw_bold_text_with_bright_colors = true
[keyboard]

View File

@ -0,0 +1,58 @@
{
"LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" },
"aerial.nvim": { "branch": "master", "commit": "1160fb7a15a34b03b7381d95d45560712b5f19d0" },
"base16-vim": { "branch": "master", "commit": "3be3cd82cd31acfcab9a41bad853d9c68d30478d" },
"blink.cmp": { "branch": "main", "commit": "5f442681df24fe705d1ee7ce5b4d435aa4b4dee4" },
"conform.nvim": { "branch": "master", "commit": "9180320205d250429f0f80e073326c674e2a7149" },
"dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" },
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"git-blame.nvim": { "branch": "master", "commit": "2883a7460f611c2705b23f12d58d398d5ce6ec00" },
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
"go.nvim": { "branch": "master", "commit": "c6d5ca26377d01c4de1f7bff1cd62c8b43baa6bc" },
"gruvbox-material": { "branch": "master", "commit": "055aefde5fd49018f3a858bca7b529bc2e08c02b" },
"gruvbox.nvim": { "branch": "main", "commit": "68c3460a5d1d1a362318960035c9f3466d5011f5" },
"harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" },
"indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" },
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
"lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.base16": { "branch": "main", "commit": "23453dacc1606e5d42238d82f0b42a2985386b62" },
"mini.bufremove": { "branch": "main", "commit": "285bdac9596ee7375db50c0f76ed04336dcd2685" },
"mini.comment": { "branch": "main", "commit": "a56581c40c19fa26f2b39da72504398de3173c5a" },
"mini.icons": { "branch": "main", "commit": "6787321f70d674a481776b7cc2c781fb7002c644" },
"mini.surround": { "branch": "main", "commit": "aa5e245829dd12d8ff0c96ef11da28681d6049aa" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
"neogen": { "branch": "main", "commit": "dd0301bfba1f83a3bc009b5430fce7aa3cee6941" },
"neorg": { "branch": "main", "commit": "6b945909d84b5aeadc875f9b3f529ec44b9bc60f" },
"noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" },
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
"numb.nvim": { "branch": "master", "commit": "3f7d4a74bd456e747a1278ea1672b26116e0824d" },
"nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" },
"nvim-colorizer.lua": { "branch": "master", "commit": "8a65c448122fc8fac9c67b2e857b6e830a4afd0b" },
"nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-treesitter": { "branch": "master", "commit": "e947d35bbf919ea88a24c21cb8afa4621e3cf547" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
"nvim-web-devicons": { "branch": "master", "commit": "4adeeaa7a32d46cf3b5833341358c797304f950a" },
"oil.nvim": { "branch": "master", "commit": "ba858b662599eab8ef1cba9ab745afded99cb180" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
"rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" },
"sonokai": { "branch": "master", "commit": "1d7ca954792dfddd9e73c53563d85adaeb8c8437" },
"telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" },
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
"tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" },
"treesitter-context": { "branch": "master", "commit": "2bcf700b59bc92850ca83a1c02e86ba832e0fae0" },
"trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" },
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
"vim": { "branch": "master", "commit": "65f4225e0526516a67d56c8ac09925a209138e53" },
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
"vim-markdown": { "branch": "master", "commit": "8f6cb3a6ca4e3b6bcda0730145a0b700f3481b51" },
"vim-slash": { "branch": "master", "commit": "31aee09b7ea8893a18fa34f65e63e364fc998444" },
"which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" },
"zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" },
"zk-nvim": { "branch": "main", "commit": "6beea6fafe2c781cb10e80878e68d5e32937692a" }
}

View File

@ -0,0 +1,81 @@
-- highlight on yank
vim.api.nvim_create_autocmd('TextYankPost', {
group = vim.api.nvim_create_augroup('highlight_yank', {}),
desc = 'Hightlight selection on yank',
pattern = '*',
callback = function()
vim.highlight.on_yank { higroup = 'IncSearch', timeout = 500 }
end,
})
vim.api.nvim_create_autocmd({ "VimEnter" }, {
callback = function()
vim.cmd("hi link illuminatedWord LspReferenceText")
end,
})
-- go to last loc when opening a buffer
vim.api.nvim_create_autocmd("BufReadPost", {
callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"')
local lcount = vim.api.nvim_buf_line_count(0)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end,
})
-- close some filetypes with <q>
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"qf",
"help",
"man",
"notify",
"lspinfo",
"spectre_panel",
"startuptime",
"tsplayground",
"PlenaryTestPopup",
},
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
end,
})
-- add spellcheck and wrapping to some file types
vim.api.nvim_create_autocmd("FileType", {
pattern = { "gitcommit", "markdown" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
})
-- Prevent auto comment on next line
vim.cmd('autocmd BufEnter * set formatoptions-=cro')
vim.cmd('autocmd BufEnter * setlocal formatoptions-=cro')
-- Set filetype to tex for .tex files?
vim.cmd([[autocmd BufRead,BufNewFile *.tex set filetype=tex]])
-- Trim whitespace from files on save
vim.cmd([[
autocmd BufWritePre * let currPos = getpos(".")
autocmd BufWritePre * %s/\s\+$//e
autocmd BufWritePre * %s/\n\+\%$//e
autocmd BufWritePre *.[ch] %s/\%$/\r/e
autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
]])
-- Run custom textclear command when exiting a .tex file (cleanup files)
vim.cmd([[autocmd VimLeave *.tex !texclear %]])
vim.api.nvim_create_autocmd("TermOpen", {
group = vim.api.nvim_create_augroup("custom-term-open", { clear = true }),
callback = function()
vim.opt.number = false
vim.opt.relativenumber = false
end
})

View File

@ -56,6 +56,7 @@ vim.keymap.set("n", "<leader>x", ":.lua<CR>", { desc = "Source Line" })
vim.keymap.set("v", "<leader>x", ":lua<CR>", { desc = "Source Selection" })
vim.keymap.set("n", "<leader>-", "<cmd>Oil<CR>")
vim.keymap.set("t", "<esc><esc>", "<c-\\><c-n>")
vim.keymap.set("n", "<leader>xt", "<cmd>PlenaryBustedFile %<cr>")
local job_id = 0
vim.keymap.set("n", "<leader>Ts", function()

View File

@ -1,48 +1,48 @@
local options = {
backup = false, -- creates a backup file
clipboard = "unnamedplus", -- gives nvim access to clipboard
cmdheight = 1, -- more space in nvim cmd line
completeopt = { "menuone", "noselect" }, -- cmp related
conceallevel = 3, -- don't hide `` in md
fileencoding = "utf-8",
hlsearch = false,
ignorecase = true,
mouse = "a", -- allow use of mouse (bad I know but sometimes useful)
pumheight = 10, -- popup menu height
showmode = true,
smartcase = true,
smartindent = true,
splitbelow = true,
splitright = true,
swapfile = false,
termguicolors = true,
timeoutlen = 500,
ttimeoutlen = 10,
undofile = true,
updatetime = 100,
writebackup = false,
expandtab = true, -- use spaces instead of tab
shiftwidth = 4, -- insert 4 spaces for indentation
tabstop = 4, -- insert 4 spaces for tab
cursorline = false,
number = true,
laststatus = 3,
showcmd = false,
ruler = false,
relativenumber = true,
numberwidth = 2,
signcolumn = "yes",
wrap = false,
scrolloff = 8,
sidescrolloff = 8,
guifont = "monospace:h17",
title = true,
spelllang = "en_gb",
autowrite = true,
confirm = true,
formatoptions = "jcroqlnt", -- tcqj
grepformat = "%f:%l:%c:%m",
grepprg = "rg --vimgrep",
backup = false, -- creates a backup file
clipboard = "unnamedplus", -- gives nvim access to clipboard
cmdheight = 1, -- more space in nvim cmd line
completeopt = { "menuone", "noselect" }, -- cmp related
conceallevel = 0, -- don't hide ``` in markdown
fileencoding = "utf-8",
hlsearch = false,
ignorecase = true,
mouse = "a", -- allow use of mouse (bad I know but sometimes useful)
pumheight = 10, -- popup menu height
showmode = true,
smartcase = true,
smartindent = true,
splitbelow = true,
splitright = true,
swapfile = false,
termguicolors = true,
timeoutlen = 500,
ttimeoutlen = 10,
undofile = true,
updatetime = 100,
writebackup = false,
expandtab = true, -- use spaces instead of tab
shiftwidth = 4, -- insert 4 spaces for indentation
tabstop = 4, -- insert 4 spaces for tab
cursorline = false,
number = true,
laststatus = 3,
showcmd = false,
ruler = false,
relativenumber = true,
numberwidth = 2,
signcolumn = "yes:1",
wrap = false,
scrolloff = 8,
sidescrolloff = 8,
guifont = "monospace:h17",
title = true,
spelllang = "en_gb",
autowrite = true,
confirm = true,
formatoptions = "jcroqlnt", -- tcqj
grepformat = "%f:%l:%c:%m",
grepprg = "rg --vimgrep",
}
vim.opt.fillchars = vim.opt.fillchars + "eob: "
@ -50,7 +50,7 @@ vim.opt.fillchars = vim.opt.fillchars + "eob: "
vim.opt.shortmess:append("c")
for k, v in pairs(options) do
vim.opt[k] = v
vim.opt[k] = v
end
vim.cmd("set whichwrap+=<,>,[,],h,l")

View File

@ -1,10 +1,11 @@
return {
{
"stevearc/aerial.nvim",
opts = {},
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
},
{
"stevearc/aerial.nvim",
enabled = false,
opts = {},
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons",
},
},
}

View File

@ -1,6 +1,7 @@
return {
{
'saghen/blink.cmp',
enabled = true,
-- optional: provides snippets for the snippet source
dependencies = 'rafamadriz/friendly-snippets',
@ -14,6 +15,11 @@ return {
---@module 'blink.cmp'
---@type blink.cmp.Config
opts = {
enabled = function()
-- you list filetypes where you dob't want blink blink to work here
local disabled_filetypes = { "oil_preview", "oil", "TelescopePrompt" } -- you can add extra fileypes you do not want blink enabled.
return not vim.tbl_contains(disabled_filetypes, vim.bo.filetype)
end,
-- 'default' for mappings similar to built-in completion
-- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate)
-- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
@ -34,6 +40,7 @@ return {
-- elsewhere in your config, without redefining it, due to `opts_extend`
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer' },
cmdline = {}
},
},
opts_extend = { "sources.default" }

View File

@ -1,41 +1,49 @@
return {
{
"sainnhe/gruvbox-material",
enabled = true,
lazy = true,
priority = 1000,
},
{
"ellisonleao/gruvbox.nvim",
enabled = true,
lazy = true,
priority = 1000,
},
{
"sainnhe/sonokai",
enabled = true,
lazy = true,
priority = 1000,
},
{
"dracula/vim",
enabled = true,
lazy = true,
priority = 1000,
},
{
"folke/tokyonight.nvim",
enabled = true,
lazy = true,
priority = 1000,
},
{
"echasnovski/mini.base16",
enabled = true,
lazy = false,
priority = 1000,
},
{
"chriskempson/base16-vim",
enabled = true,
lazy = false,
priority = 1000,
},
{
"NvChad/nvim-colorizer.lua",
enabled = true,
opts = function()
require("colorizer").setup({})
end,

View File

@ -1,6 +1,7 @@
return {
{
"folke/todo-comments.nvim",
enabled = true,
cmd = { "TodoTrouble", "TodoTelescope" },
event = "BufReadPost",
config = true,
@ -13,9 +14,10 @@ return {
{ "<leader>tf", "<cmd>TodoTelescope<cr>", desc = "Todo Telescope" },
},
},
{ "JoosepAlviste/nvim-ts-context-commentstring" },
{ "JoosepAlviste/nvim-ts-context-commentstring", enabled = true },
{
"echasnovski/mini.comment",
enabled = true,
event = "VeryLazy",
opts = {
hooks = {

View File

@ -1,5 +1,5 @@
return {
{
"folke/lazy.nvim",
},
{
"folke/lazy.nvim",
},
}

View File

@ -0,0 +1,7 @@
return {
{
dir = "~/repos/neovim-plugins/present.nvim",
enabled = true,
lazy = false,
}
}

View File

@ -1,17 +1,18 @@
return {
{
"stevearc/dressing.nvim",
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.input = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.input(...)
end
end,
},
{
"stevearc/dressing.nvim",
enabled = false,
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.input = function(...)
require("lazy").load({ plugins = { "dressing.nvim" } })
return vim.ui.input(...)
end
end,
},
}

View File

@ -1,6 +1,7 @@
return {
{
"folke/flash.nvim",
enabled = false,
event = "VeryLazy",
opts = {},
-- stylua: ignore

View File

@ -1,6 +1,7 @@
return {
{
"lewis6991/gitsigns.nvim",
enabled = true,
event = "BufReadPre",
opts = {
signs = {
@ -36,6 +37,7 @@ return {
},
{
"f-person/git-blame.nvim",
enabled = true,
event = "BufEnter",
},
}

View File

@ -1,6 +1,7 @@
return {
{
"ray-x/go.nvim",
enabled = true,
requires = {
"ray-x/guihua.lua",
"neovim/nvim-lspconfig",

View File

@ -1,16 +1,17 @@
return {
{
"ThePrimeagen/harpoon",
keys = {
{ "]m", '<cmd>lua require("harpoon.ui").nav_next()<cr>', desc = "Harpoon Next" },
{ "[m", '<cmd>lua require("harpoon.ui").nav_prev()<cr>', desc = "Harpoon Prev" },
{ "mm", '<cmd>lua require("harpoon.mark").add_file()<cr>', desc = "Harpoon" },
{ "ms", "<cmd>Telescope harpoon marks<cr>", desc = "Search Files" },
{ "mu", '<cmd>lua require("harpoon.ui").toggle_quick_menu()<cr>', desc = "Harpoon UI" },
{ "m1", '<cmd> lua require("harpoon.ui").nav_file(1)<cr>', desc = "Goto 1" },
{ "m2", '<cmd> lua require("harpoon.ui").nav_file(2)<cr>', desc = "Goto 2" },
{ "m3", '<cmd> lua require("harpoon.ui").nav_file(3)<cr>', desc = "Goto 3" },
{ "m4", '<cmd> lua require("harpoon.ui").nav_file(4)<cr>', desc = "Goto 4" },
},
},
{
"ThePrimeagen/harpoon",
enabled = true,
keys = {
{ "]m", '<cmd>lua require("harpoon.ui").nav_next()<cr>', desc = "Harpoon Next" },
{ "[m", '<cmd>lua require("harpoon.ui").nav_prev()<cr>', desc = "Harpoon Prev" },
{ "mm", '<cmd>lua require("harpoon.mark").add_file()<cr>', desc = "Harpoon" },
{ "ms", "<cmd>Telescope harpoon marks<cr>", desc = "Search Files" },
{ "mu", '<cmd>lua require("harpoon.ui").toggle_quick_menu()<cr>', desc = "Harpoon UI" },
{ "m1", '<cmd> lua require("harpoon.ui").nav_file(1)<cr>', desc = "Goto 1" },
{ "m2", '<cmd> lua require("harpoon.ui").nav_file(2)<cr>', desc = "Goto 2" },
{ "m3", '<cmd> lua require("harpoon.ui").nav_file(3)<cr>', desc = "Goto 3" },
{ "m4", '<cmd> lua require("harpoon.ui").nav_file(4)<cr>', desc = "Goto 4" },
},
},
}

View File

@ -2,6 +2,7 @@ return {
-- lspconfig
{
"neovim/nvim-lspconfig",
enabled = true,
event = "BufReadPre",
dependencies = {
{
@ -192,6 +193,7 @@ return {
-- cmdline tools and lsp servers
{
"williamboman/mason.nvim",
enabled = true,
cmd = "Mason",
keys = { { "<leader>lM", "<cmd>Mason<cr>", desc = "Mason" } },
opts = {
@ -217,6 +219,7 @@ return {
-- language specific tooling
{
"simrat39/rust-tools.nvim",
enabled = true,
opts = {
server = {
on_attach = function(_, bufnr)

View File

@ -7,7 +7,7 @@ function M.disable_deno_formatting(client)
end
function M.resolve_tsserver_deno(client)
local active_clients = vim.lsp.get_active_clients()
local active_clients = vim.lsp.get_clients()
if client.name == "denols" then
for _, client_ in pairs(active_clients) do
-- stop tsserver if denols is already active
@ -26,7 +26,7 @@ function M.resolve_tsserver_deno(client)
end
function M.disable_others_when_zk(client)
local active_clients = vim.lsp.get_active_clients()
local active_clients = vim.lsp.get_clients()
if client.name == "zk" then
for _, client_ in pairs(active_clients) do
-- stop ltex if zk is already active

View File

@ -1,115 +1,116 @@
return {
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function()
local colors = {
red = "#ca1243",
grey = "#a0a1a7",
black = "#383a42",
white = "#f3f3f3",
light_green = "#83a598",
orange = "#fe8019",
green = "#8ec07c",
}
"nvim-lualine/lualine.nvim",
enabled = true,
event = "VeryLazy",
opts = function()
local colors = {
red = "#ca1243",
grey = "#a0a1a7",
black = "#383a42",
white = "#f3f3f3",
light_green = "#83a598",
orange = "#fe8019",
green = "#8ec07c",
}
-- Put proper separators and gaps between components in sections
local function process_sections(sections)
for name, section in pairs(sections) do
local left = name:sub(9, 10) < "x"
for pos = 1, name ~= "lualine_z" and #section or #section - 1 do
table.insert(section, pos * 2, { color = { fg = colors.white, bg = colors.white } })
end
for id, comp in ipairs(section) do
if type(comp) ~= "table" then
comp = { comp }
section[id] = comp
end
comp.separator = left and { right = "" } or { left = "" }
end
end
return sections
end
-- Put proper separators and gaps between components in sections
local function process_sections(sections)
for name, section in pairs(sections) do
local left = name:sub(9, 10) < "x"
for pos = 1, name ~= "lualine_z" and #section or #section - 1 do
table.insert(section, pos * 2, { color = { fg = colors.white, bg = colors.white } })
end
for id, comp in ipairs(section) do
if type(comp) ~= "table" then
comp = { comp }
section[id] = comp
end
comp.separator = left and { right = "" } or { left = "" }
end
end
return sections
end
local function search_result()
if vim.v.hlsearch == 0 then
return ""
end
local last_search = vim.fn.getreg("/")
if not last_search or last_search == "" then
return ""
end
local searchcount = vim.fn.searchcount({ maxcount = 9999 })
return last_search .. "(" .. searchcount.current .. "/" .. searchcount.total .. ")"
end
local function search_result()
if vim.v.hlsearch == 0 then
return ""
end
local last_search = vim.fn.getreg("/")
if not last_search or last_search == "" then
return ""
end
local searchcount = vim.fn.searchcount({ maxcount = 9999 })
return last_search .. "(" .. searchcount.current .. "/" .. searchcount.total .. ")"
end
local function modified()
if vim.bo.modified then
return "+"
elseif vim.bo.modifiable == false or vim.bo.readonly == true then
return "-"
end
return ""
end
local function modified()
if vim.bo.modified then
return "+"
elseif vim.bo.modifiable == false or vim.bo.readonly == true then
return "-"
end
return ""
end
return {
options = {
theme = "auto",
globalstatus = true,
disabled_filetypes = { statusline = { "dashboard", "lazy", "alpha" } },
},
sections = process_sections({
lualine_a = { "mode" },
lualine_b = {
"branch",
"diff",
{
"diagnostics",
source = { "nvim" },
sections = { "error" },
-- diagnostics_color = { error = { bg = colors.red, fg = colors.white } },
},
{
"diagnostics",
source = { "nvim" },
sections = { "warn" },
-- diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } },
},
{ "filename", file_status = false, path = 1 },
{ modified, color = { bg = colors.red } },
{
"%w",
cond = function()
return vim.wo.previewwindow
end,
},
{
"%r",
cond = function()
return vim.bo.readonly
end,
},
{
"%q",
cond = function()
return vim.bo.buftype == "quickfix"
end,
},
},
lualine_c = {
{
function()
return require("nvim-navic").get_location()
end,
cond = function()
return package.loaded["nvim-navic"] and require("nvim-navic").is_available()
end,
},
},
lualine_x = {},
lualine_y = { search_result, "filetype" },
-- lualine_y = { "filetype " },
lualine_z = { "%l:%c", "%p%%/%L" },
}),
}
end,
return {
options = {
theme = "auto",
globalstatus = true,
disabled_filetypes = { statusline = { "dashboard", "lazy", "alpha" } },
},
sections = process_sections({
lualine_a = { "mode" },
lualine_b = {
"branch",
"diff",
{
"diagnostics",
source = { "nvim" },
sections = { "error" },
-- diagnostics_color = { error = { bg = colors.red, fg = colors.white } },
},
{
"diagnostics",
source = { "nvim" },
sections = { "warn" },
-- diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } },
},
{ "filename", file_status = false, path = 1 },
{ modified, color = { bg = colors.red } },
{
"%w",
cond = function()
return vim.wo.previewwindow
end,
},
{
"%r",
cond = function()
return vim.bo.readonly
end,
},
{
"%q",
cond = function()
return vim.bo.buftype == "quickfix"
end,
},
},
lualine_c = {
{
function()
return require("nvim-navic").get_location()
end,
cond = function()
return package.loaded["nvim-navic"] and require("nvim-navic").is_available()
end,
},
},
lualine_x = {},
lualine_y = { search_result, "filetype" },
-- lualine_y = { "filetype " },
lualine_z = { "%l:%c", "%p%%/%L" },
}),
}
end,
}

View File

@ -1,37 +1,38 @@
return {
"nvim-neorg/neorg",
ft = "norg",
cmd = "Neorg",
build = ":Neorg sync-parsers",
dependencies = {
{ "nvim-lua/plenary.nvim" },
},
opts = {
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.dirman"] = {
config = {
workspaces = {
default = "~/notes/neorg",
work = "~/notes/neorg/work",
personal = "~/notes/neorg/personal",
journal = "~/notes/neorg/journal",
},
default_workspace = "default",
},
},
["core.completion"] = {
config = {
engine = "nvim-cmp",
},
},
["core.presenter"] = {
config = {
zen_mode = "zen-mode",
},
},
["core.ui"] = {},
},
},
"nvim-neorg/neorg",
enabled = false,
ft = "norg",
cmd = "Neorg",
build = ":Neorg sync-parsers",
dependencies = {
{ "nvim-lua/plenary.nvim" },
},
opts = {
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.dirman"] = {
config = {
workspaces = {
default = "~/notes/neorg",
work = "~/notes/neorg/work",
personal = "~/notes/neorg/personal",
journal = "~/notes/neorg/journal",
},
default_workspace = "default",
},
},
["core.completion"] = {
config = {
engine = "nvim-cmp",
},
},
["core.presenter"] = {
config = {
zen_mode = "zen-mode",
},
},
["core.ui"] = {},
},
},
}

View File

@ -1,6 +1,7 @@
return {
{
"folke/noice.nvim",
enabled = false,
event = "VeryLazy",
opts = {
lsp = {

View File

@ -0,0 +1,9 @@
return {
'stevearc/oil.nvim',
enabled = true,
lazy = false,
opts = {
default_file_explorer = true,
},
dependencies = { { "echasnovski/mini.icons", opts = {} } },
}

View File

@ -1,6 +1,7 @@
return {
{
"L3MON4D3/LuaSnip",
enabled = true,
dependencies = {
"rafamadriz/friendly-snippets",
config = function()

View File

@ -3,30 +3,31 @@ local util = require("lazyvim.utils")
return {
{
"nvim-telescope/telescope.nvim",
enabled = true,
event = "VeryLazy",
keys = {
{ "<leader>/", util.telescope("live_grep"), desc = "Telescope Find in Files (Grep)" },
{ "<leader><space>", util.telescope("find_files"), desc = "Telescope Find Files (root dir)" },
{ "<leader>ff", util.telescope("find_files"), desc = "Telescope Find Files (root dir)" },
{ "<leader>fF", util.telescope("find_files", { cwd = false }), desc = "Telescope Find Files (cwd)" },
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Telescope Recent" },
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "Telescope commits" },
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "Telescope status" },
{ "<leader>gb", "<cmd>Telescope git_branches<CR>", desc = "Telescope branches" },
{ "<leader>ha", "<cmd>Telescope autocommands<cr>", desc = "Telescope Auto Commands" },
{ "<leader>hc", "<cmd>Telescope commands<cr>", desc = "Telescope Commands" },
{ "<leader>hf", "<cmd>Telescope filetypes<cr>", desc = "Telescope File Types" },
{ "<leader>hh", "<cmd>Telescope help_tags<cr>", desc = "Telescope Help Pages" },
{ "<leader>hk", "<cmd>Telescope keymaps<cr>", desc = "Telescope Key Maps" },
{ "<leader>hm", "<cmd>Telescope man_pages<cr>", desc = "Telescope Man Pages" },
{ "<leader>ho", "<cmd>Telescope vim_options<cr>", desc = "Telescope Options" },
{ "<leader>hs", "<cmd>Telescope highlights<cr>", desc = "Telescope Search Highlight Groups" },
{ "<leader>ht", "<cmd>Telescope builtin<cr>", desc = "Telescope" },
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Telescope Buffer" },
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Telescope Command History" },
{ "<leader>sg", util.telescope("live_grep", { cwd = false }), desc = "Telescope Grep (cwd)" },
{ "<leader>sm", "<cmd>Telescope marks<cr>", desc = "Telescope Jump to Mark" },
{ "<leader>so", "<cmd>Telescope resume<cr>", desc = "Telescope Resume last search" },
{ "<leader>/", util.telescope("live_grep"), desc = "Telescope Find in Files (Grep)" },
{ "<leader><space>", util.telescope("find_files"), desc = "Telescope Find Files (root dir)" },
{ "<leader>fn", util.telescope("find_files", { dir = "~/.config/nvim/" }), desc = "Telescope Find Files (config)" },
{ "<leader>ff", util.telescope("find_files", { cwd = false }), desc = "Telescope Find Files (cwd)" },
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Telescope Recent" },
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "Telescope commits" },
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "Telescope status" },
{ "<leader>gb", "<cmd>Telescope git_branches<CR>", desc = "Telescope branches" },
{ "<leader>ha", "<cmd>Telescope autocommands<cr>", desc = "Telescope Auto Commands" },
{ "<leader>hc", "<cmd>Telescope commands<cr>", desc = "Telescope Commands" },
{ "<leader>hf", "<cmd>Telescope filetypes<cr>", desc = "Telescope File Types" },
{ "<leader>hh", "<cmd>Telescope help_tags<cr>", desc = "Telescope Help Pages" },
{ "<leader>hk", "<cmd>Telescope keymaps<cr>", desc = "Telescope Key Maps" },
{ "<leader>hm", "<cmd>Telescope man_pages<cr>", desc = "Telescope Man Pages" },
{ "<leader>ho", "<cmd>Telescope vim_options<cr>", desc = "Telescope Options" },
{ "<leader>hs", "<cmd>Telescope highlights<cr>", desc = "Telescope Search Highlight Groups" },
{ "<leader>ht", "<cmd>Telescope builtin<cr>", desc = "Telescope" },
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Telescope in Buffer" },
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Telescope Command History" },
{ "<leader>sg", util.telescope("live_grep", { cwd = false }), desc = "Telescope Grep (cwd)" },
{ "<leader>sm", "<cmd>Telescope marks<cr>", desc = "Telescope Jump to Mark" },
{ "<leader>so", "<cmd>Telescope resume<cr>", desc = "Telescope Resume last search" },
{
"<leader>ss",
util.telescope("lsp_document_symbols", {
@ -45,8 +46,8 @@ return {
}),
desc = "Goto Symbol",
},
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
{ "<leader>fb", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
},
opts = {
defaults = {

View File

@ -1,8 +1,8 @@
return {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
enable = true,
build = ":TSUpdate",
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))

View File

@ -1,6 +1,7 @@
return {
{
"folke/trouble.nvim",
enabled = true,
cmd = { "Trouble" },
opts = { use_diagnostic_signs = true },
keys = {

View File

@ -3,9 +3,11 @@ local icons = require("lazyvim.config.icons")
return {
{
"nvim-lua/plenary.nvim",
enabled = true,
},
{
"RRethy/vim-illuminate",
enabled = true,
event = "BufReadPost",
config = function()
require("illuminate").configure({ delay = 200 })
@ -18,6 +20,7 @@ return {
},
{
"nvim-lua/popup.nvim",
enabled = true,
},
{
"rcarriga/nvim-notify",
@ -51,6 +54,7 @@ return {
},
{
"echasnovski/mini.bufremove",
enabled = true,
event = "VeryLazy",
-- stylua: ignore
keys = {
@ -93,16 +97,20 @@ return {
},
{
"mbbill/undotree",
enabled = true,
cmd = { "UndotreeToggle" },
},
{
"MunifTanjim/nui.nvim",
enabled = true,
},
{
"kyazdani42/nvim-web-devicons",
enabled = true,
},
{
"lukas-reineke/indent-blankline.nvim",
enabled = true,
opts = {},
},
{
@ -119,9 +127,11 @@ return {
},
{
"preservim/vim-markdown",
enabled = true,
},
{
"nacro90/numb.nvim",
enabled = true,
event = "BufEnter",
config = function()
require("numb").setup({
@ -132,44 +142,11 @@ return {
},
{
"junegunn/vim-slash",
},
{
"folke/zen-mode.nvim",
cmd = { "ZenMode" },
config = function()
require("zen-mode").setup({
window = {
backdrop = 1,
height = 0.9,
width = 80,
options = {
signcolumn = "no",
number = false,
relativenumber = false,
cursorline = true,
cursorcolumn = false, -- disable cursor column
},
},
plugins = {
gitsigns = { enabled = false },
tmux = { enabled = false },
twilight = { enabled = false },
},
on_open = function()
vim.g.cmp_active = false
vim.cmd([[LspStop]])
vim.opt.sidescrolloff = 0
end,
on_close = function()
vim.g.cmp_active = true
vim.cmd([[LspStart]])
vim.opt.sidescrolloff = 8
end,
})
end,
enabled = true,
},
{
"echasnovski/mini.surround",
enabled = true,
keys = { "gz" },
opts = {
mappings = {
@ -189,6 +166,7 @@ return {
},
{
"danymat/neogen",
enabled = true,
event = "BufEnter",
config = function()
require("neogen").setup({
@ -199,6 +177,7 @@ return {
},
{
"SmiteshP/nvim-navic",
enabled = true,
init = function()
vim.g.navic_silence = true
require("lazyvim.utils").on_attach(function(client, buffer)

View File

@ -1,5 +1,6 @@
return {
"folke/which-key.nvim",
enabled = true,
dependencies = { "echasnovski/mini.icons" },
event = "VeryLazy",
opts = {
@ -267,8 +268,7 @@ return {
{
"<leader>oc",
function()
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
utils.toggle("conceallevel", false, { 0, conceallevel })
utils.toggle("conceallevel", false, { 0, 3 })
end,
desc = "Toggle conceal"
},

View File

@ -0,0 +1,38 @@
return {
{
"folke/zen-mode.nvim",
enabled = false,
cmd = { "ZenMode" },
config = function()
require("zen-mode").setup({
window = {
backdrop = 1,
height = 0.9,
width = 80,
options = {
signcolumn = "no",
number = false,
relativenumber = false,
cursorline = true,
cursorcolumn = false, -- disable cursor column
},
},
plugins = {
gitsigns = { enabled = false },
tmux = { enabled = false },
twilight = { enabled = false },
},
on_open = function()
vim.g.cmp_active = false
vim.cmd([[LspStop]])
vim.opt.sidescrolloff = 0
end,
on_close = function()
vim.g.cmp_active = true
vim.cmd([[LspStart]])
vim.opt.sidescrolloff = 8
end,
})
end,
},
}

View File

@ -1,6 +1,7 @@
return {
{
"mickael-menu/zk-nvim",
enabled = true,
event = "VeryLazy",
opts = {
picker = "telescope",

View File

@ -30,7 +30,7 @@ function M.get_root()
---@type string[]
local roots = {}
if path then
for _, client in pairs(vim.lsp.get_active_clients({ bufnr = 0 })) do
for _, client in pairs(vim.lsp.get_clients({ bufnr = 0 })) do
local workspace = client.config.workspace_folders
local paths = workspace
and vim.tbl_map(function(ws)
@ -128,8 +128,10 @@ function M.get_buf_option(opt)
end
function M.telescope(builtin, opts)
opts = opts or {}
opts.dir = opts.dir or M.get_root()
return function()
require("telescope.builtin")[builtin](vim.tbl_deep_extend("force", { cwd = M.get_root() }, opts or {}))
require("telescope.builtin")[builtin](vim.tbl_deep_extend("force", { cwd = opts.dir }, opts))
end
end
@ -141,7 +143,7 @@ function M.setColorscheme(scheme)
if not okay then
vim.notify("Colorscheme " .. colorscheme .. " not found!")
vim.cmd("colorsheme habamax")
vim.cmd("colorscheme habamax")
end
end

View File

@ -0,0 +1,37 @@
vim.cmd [[
aunmenu PopUp
anoremenu PopUp.Inspect <cmd>Inspect<CR>
amenu PopUp.-1- <NOP>
anoremenu PopUp.Definition <cmd>lua vim.lsp.buf.definition()<CR>
anoremenu PopUp.References <cmd>Telescope lsp_references<CR>
nnoremenu PopUp.Back <C-t>
amenu PopUp.-2- <NOP>
amenu PopUp.URL gx
]]
local group = vim.api.nvim_create_augroup("nvim_popupmenu", { clear = true })
vim.api.nvim_create_autocmd("MenuPopup", {
pattern = "*",
group = group,
desc = "Custom PopUp Setup",
callback = function()
vim.cmd [[
amenu disable PopUp.Definition
amenu disable PopUp.References
amenu disable PopUp.URL
]]
if vim.lsp.get_clients({ bufnr = 0 })[1] then
vim.cmd [[
amenu enable PopUp.Definition
amenu enable PopUp.References
]]
end
local urls = require("vim.ui")._get_urls()
if vim.startswith(urls[1], "http") then
vim.cmd [[amenu enable PopUp.URL]]
end
end,
})
-- TODO: Add autocoommand

View File

@ -0,0 +1,52 @@
local pickers = require "telescope.pickers"
local finders = require "telescope.finders"
local make_entry = require "telescope.make_entry"
local conf = require "telescope.config".values
local M = {}
local live_multigrep = function(opts)
opts = opts or {}
opts.cwd = opts.cwd or vim.uv.cwd()
local finder = finders.new_async_job({
command_generator = function(prompt)
if not prompt or prompt == "" then
return nil
end
local pieces = vim.split(prompt, " ")
local args = { "rg" }
if pieces[1] then
table.insert(args, "-e")
table.insert(args, pieces[1])
end
if pieces[2] then
table.insert(args, "-g")
table.insert(args, pieces[2])
end
---@diagnostic disable-next-line: deprecated
return vim.tbl_flatten({ args,
{ "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" }
})
end,
entry_maker = make_entry.gen_from_vimgrep(opts),
cwd = opts.cwd,
})
pickers.new(opts, {
debounce = 100,
prompt_title = "Multi Grep",
finder = finder,
previewer = conf.grep_previewer(opts),
sorter = require("telescope.sorters").empty()
}):find()
end
M.setup = function()
vim.keymap.set("n", "<leader>sG", live_multigrep, { desc = "Live Multigrep" })
end
return M

View File

@ -0,0 +1,53 @@
local state = {
floating = {
buf = -1,
win = -1
}
}
function create_floating_window(opts)
-- Set default options if not provided
opts = opts or {}
opts.width = opts.width or math.floor(vim.o.columns * 0.8) -- Default 80% of screen width
opts.height = opts.height or math.floor(vim.o.lines * 0.8) -- Default 80% of screen height
-- Create buffer
local buf = nil
if vim.api.nvim_buf_is_valid(opts.buf) then
buf = opts.buf
else
buf = vim.api.nvim_create_buf(false, true) -- no file, scratch buffer
end
-- Calculate center position
local row = math.floor((vim.o.lines - opts.height) / 2)
local col = math.floor((vim.o.columns - opts.width) / 2)
-- Floating window options
local win_opts = {
relative = "editor",
width = opts.width,
height = opts.height,
col = col,
row = row,
style = "minimal",
border = "rounded", -- You can use "none", "single", "double", or "rounded"
}
-- Create the floating window
local win = vim.api.nvim_open_win(buf, true, win_opts)
return { buf = buf, win = win }
end
-- Emable usage:
vim.api.nvim_create_user_command("FloatTerminal", function()
if not vim.api.nvim_win_is_valid(state.floating.win) then
state.floating = create_floating_window({ buf = state.floating.buf })
if vim.bo[state.floating.buf].buftype ~= "terminal" then
vim.cmd.term()
end
else
vim.api.nvim_win_hide(state.floating.win)
end
end, {})