kitchen sink cause I'm too lazy to sort through this junk

This commit is contained in:
2023-08-11 20:43:58 -04:00
parent b8d70ed288
commit 590f030999
23 changed files with 463 additions and 206 deletions

View File

@ -0,0 +1,6 @@
local status_ok, fold = pcall(require, "cleanfold")
if not status_ok then
return
end
fold.setup {}

13
after/plugin/foldsign.lua Normal file
View File

@ -0,0 +1,13 @@
local status_ok, foldsign = pcall(require, "nvim-foldsign")
if not status_ok then
return
end
foldsign.setup {
offset = -2,
foldsigns = {
open = 'V',
close = '>',
seps = { '', '' },
}
}

View File

@ -1,4 +1,9 @@
require("killersheep").setup { local status_ok, killersheep = pcall(require, "killersheep")
if not status_ok then
return
end
killersheep.setup {
gore = true, gore = true,
border = 'shadow', border = 'shadow',
keymaps = { keymaps = {

View File

@ -1,23 +0,0 @@
local status_ok, lightbulb = pcall(require, "nvim-lightbulb")
if not status_ok then
return
end
lightbulb.setup {
sign = {
enabled = true,
priority = 10000, -- make this really high so it always shows
},
autocmd = {
enabled = true,
pattern = {"*"},
events = {"CursorHold", "CursorHoldI"}
}
}
vim.fn.sign_define('LightBulbSign', {
text = "f",
texthl = "LightBulbSignTxthl",
linehl="",
numhl="",
})

View File

@ -35,7 +35,6 @@ set_lsp_sign("DiagnosticSignInfo" , "i")
set_lsp_sign("DiagnosticSignHint" , "h") set_lsp_sign("DiagnosticSignHint" , "h")
local function lsp_settings() local function lsp_settings()
vim.diagnostic.config({ vim.diagnostic.config({
virtual_text = false, virtual_text = false,
signs = true, signs = true,

View File

@ -5,5 +5,5 @@ end
marks.setup { marks.setup {
default_mappings = true, default_mappings = true,
builtin_marks = nil, builtin_marks = false,
} }

6
after/plugin/neodev.lua Normal file
View File

@ -0,0 +1,6 @@
local status_ok, neodev = pcall(require, "neodev")
if not status_ok then
return
end
neodev.setup {}

View File

@ -45,6 +45,7 @@ neorg.setup {
zen_mode = "truezen", zen_mode = "truezen",
} }
}, },
["core.integrations.telescope"] = {},
} }
} }

View File

@ -23,3 +23,11 @@ scrollbar.setup({
handle = true, handle = true,
}, },
}) })
--[[ scrollbar.setup {
current_only = true,
winblend = 50,
zindex = 40,
excluded_filetypes = {},
width = 2,
} ]]

View File

@ -3,18 +3,18 @@ if not status_ok then
return return
end end
local redraw = alpha.redraw math.randomseed(os.time())
local win = vim.api.nvim_get_current_win()
local buf = vim.api.nvim_get_current_buf() local C = {}
local augroup = vim.api.nvim_create_augroup('alpha_recalc', { clear = true }) local R = {}
-- buttons -- buttons
local function button(sc, txt, keybind) local function button(sc, txt, keybind)
local opts = { local opts = {
position = "center", position = "center",
shortcut = sc, shortcut = sc,
cursor = 5, cursor = -1,
width = 80, width = string.len(C.header[1]),
align_shortcut = "right", align_shortcut = "right",
hl_shortcut = "Keyword", hl_shortcut = "Keyword",
redraw_on_resize = false, redraw_on_resize = false,
@ -33,55 +33,304 @@ local function button(sc, txt, keybind)
end end
-- actual config -- actual config
local R = {} C.bigheader = {
{
[[ |\ ]],
[[ ||. ]],
[[ ||;` ]],
[[ ,'|; : ]],
[[ ,': |; ` ]],
[[ ,' | ; `-` ]],
[[ ,' | ; : ]],
[[ ,' `-|; ` ]],
[[ ; ; ` ]],
[[ ,' `--\`-. `--: ]],
[[ ,-._,'`. |\||`-. ` ]],
[[ `;-.`-._`. | |\ \ `-. ` ]],
[[ :`--`-.`-\ `--.| /`\;\ `-: ]],
[[ ; ``-`. |/ ; \ `. ]],
[[ ; `.`-/ ; \ ` ]],
[[ ; : `/ ; \ ` ]],
[[ ,-._ | / ; -`\ : ]],
[[ `;-.`-._| : / | \ ` ]],
[[ ; `-.| : / | \ ` ]],
[[ ; | : : / | \ : ]],
[[ ; | : / ; | \ ` ]],
[[ ; | / ; | --`\ ` ]],
[[ | | : / ; | \ : ]],
[[ | : | : / ; \ ` ]],
[[ | : ; ;:'-.._ -`\ ` ]],
[[ | : ;___ ;'---....___;__:__| `-._ \ : ]],
[[ | : `;``-------'';|| : \ `-._ \` ]],
[[ -=======:===;===========;=|| : \ `-.\: ]],
[[ ___ ; _;_|| ; ||___,:-.\___,....__\_ ]],
[[ |`--:.|;_o||-______;,..-----""""" __|__...-'' ]],
[[----....|___ """" jrei__||-------........________]],
[[ """"----....____ __..--'' || ~~~~~ ]],
[[ ~~~ ~~~ """"----....____|/ ~~~~~~~ ~~~~~~~]],
[[~~~ ~~~~ ~~~~~~ ~ ~~~ ~~~~ ]],
[[ ~~~~~ ~~~ ~ ~~~~~~~~~ ~~~ ~~~~~~~~~~ ]],
},
{
[[ J\ ]],
[[ | \ ]],
[[ | `. ]],
[[ F `. ]],
[[ F \ ]],
[[ F \ ]],
[[ J `. ]],
[[ J `. _ ]],
[[ J \ |\ ]],
[[ |. `.J|\ ]],
[[ | `. `.L \ ]],
[[ | `. \L `. ]],
[[ J ` F `. ]],
[[ J F \ ]],
[[ J J \ ]],
[[ F | \ ]],
[[ F | `. ]],
[[ F F `. ]],
[[ | F \ ]],
[[ | J \ ]],
[[ | | \ ]],
[[ | | \ ]],
[[ J F \ ]],
[[----------J J \-------------]],
[[ L | \ ]],
[[~ O ======F \ ~ ]],
[[ ~ (\`-. / J \-. ~ ]],
[[ \_\/ )"L_ _\_) ]],
[[ >|`-.||[_][""""---------.'_.-\\ ~ ]],
[[~~ ~~~ \`-. J_ Veronica"""""\/"_.--'\\ ]],
[[ ~ `. "--._ _..--""" |\` ]],
[[ ~~ ~~ ~""-. """"""""""" | ]],
[[ ~~ ~ ~~ ~"----._--.-._--""""\|'\| ]],
[[ ~ ~~~ ~~ ~~~ ~~~~ `- `--.` ` ]],
[[~~~ ~~ ~~ ~~~~ ~~ ~ ]],
},
{
[[ . . ]],
[[ _..-''"""\ _.--'"""\ ]],
[[ | L | \ ]],
[[ _ / _.-.---.\. / .-.----.\ ]],
[[ _/-|--- _/<"---'"""""\\`. /-'--''"""""\ ]],
[[ | \ | L`.`-. | L ]],
[[ /_.-.---.L | \ \ `| J`. ]],
[[ _/--'"""" \ F \L \ | L ]],
[[ L `. L J _.---.-"""-.\`. L_/ _.--|"""""--.\ `. ]],
[[ | \+. /-"__.--'"""" \ `./'"---'"""""" \`. `. ]],
[[ F _____ \ `F" `. \ \ L `. ]],
[[ /.-'"_|---'"\ | ` JL | L `.`. ]],
[[ <-'"" \| _.-.------._ A J _.-.-----`.--| ``.`. ]],
[[ L `. |/.-'"_.-`---'""\."| /-'"---'""""" \`.\. \ `.`. ]],
[[ | _.------\.<'""" L\ L\ `.`\`. \ `. ]],
[[ _.-'//'"--'""" L\| ________\ `.F ___.-------._L \ `-\ \`. ]],
[[ /___| F F _.--'"_|-------L /_.-'"_.-|-'"""""""\ L L `.`. ]],
[[ | F _.-'|"""""/'"-'""" J <'""" L J | `.`. ]],
[[ |/-'-''/|""\ )-|\ F \ | L .'"""`\""-\\_ ]],
[[ F`-'-'-(`-') | \ F \ |___`"""`.""`.-'" ]],
[[------------/ `-'---| F L L __ |"""""`-'"__________]],
[[ .'_ | |__L __ J__ | _.--'"""" `".----'".' ]],
[[ '""""""""""""|--._+--F _.-'""||" """___/.-'" ||-'"/""""" \_. .' ]],
[[ J------------(___\__/'_____.--------'-------'"""""""" / ]],
[[ `-. _.__.__.__.____ J_.-._ ]],
[[ .'`-._ (-`--`---.'--._`---._.-'`-._.-'_.-'``-._' `-''-' ]],
},
{
[[ _____|\ ]],
[[ _.--| SSt |: ]],
[[ <____|.----|| ]],
[[ .---''---, ]],
[[ ;..__..' _... ]],
[[ ,'/ ;|/..--'' \ ]],
[[ ,'_/.-/': : ]],
[[ _..-'''/ / | \ \ _|/| ]],
[[ \ /-./_ \; \ \,;' \ ]],
[[ ,\ / \: `:\ \ // `:`. ]],
[[ ,' \ /-._; | : : :: ,. . ]],
[[ ,' :: /`-._| | | || ' : `.`.)]],
[[ _,' |;._:: | | | | `| : `' ]],
[[ ,' `. / |`-:_ ; | | | : \ ]],
[[ `--. ) /|-._: : | \ \ ]],
[[ / / :_| ;`-._; __..--'; : : ]],
[[ / ( ;|;-./_ _/.-:'o | / ' | ]],
[[ / , \._/_/_./--''/_|:|___|_,' | ]],
[[ : / `'-'--'----'---------' | ]],
[[ | : O ._O O_. O ._O O_. ; ; ]],
[[ : `. // // // // ,' / ]],
[[ ~~~`.______//____//____//____//_______,'~ ]],
[[ // //~ // // ]],
[[ ~~ _// _// _// ~ _// ~ ]],
[[ ~ / / / / / / / / ~ ~~ ]],
[[ ~~~ ~~~ ~~~ ~~~ ]],
},
{
[[ P___----.... ]],
[[ ! __ ]],
[[ ' ~~ ---.#..__ ` ~ ~ - - . .: ]],
[[ ` ~~--. .F~~___-__. ]],
[[ ; , .- . _! ]],
[[ , ' ; ~ . ]],
[[ , ____ ; ' _ ._ ; ]],
[[ ,_ . - '___#, ~~~ ---. _, . ' .#' ~ .; ]],
[[ =---==~~~ ~~~==--__ ; '~ -. ,#_ .' ]],
[[ ' `~=.; ` / ]],
[[ ' ' '. ]],
[[ ' ' ]],
[[ \ ' ' ' ]],
[[ `.`\ ' . ; , ]],
[[ \ ` ' ' ; ]],
[[ ; ' ' ' ]],
[[ /_ ., / __...---./ ' ]],
[[ ',_, __.--- ~~;#~ --..__ _'.-~;# // `.' ]],
[[ / / ~~ .' . #; ~~ /// #; // / ]],
[[ / ' . __ . ' ;#;_ . ////.;#;./ ; / ]],
[[ \ . / ,##' / _ /. '(/ ~||~\' ]],
[[ \ ` - . /_ . -==- ~ ' / (/ ' . ;;. ', ]],
[[ /' . ' -^^^...--- ``(/' _ ' '' `,; ]],
[[##,. .#...( ' .c c .c c c. '.. ;; ../ ]],
[[%%#%;,..##.\_ ,;###;,. ;;.:##;,. raf ]],
[[%%%%########%%%%;,.....,;%%%%%%;,.....,;%%%%%%%%%%%%%%%%%%%%............]],
},
{
[[ .. ]],
[[ .( )`-._ ]],
[[ .' || `._ ]],
[[ .' || `. ]],
[[ .' || `._ ]],
[[ .' _||_ `-. ]],
[[ .' |====| `.. ]],
[[ .' \__/ ( ) ]],
[[ ( ) || _ || ]],
[[ /|\ || .-` \ || ]],
[[ .' | ' || _.-' | || ]],
[[ / |\ \ || .' `.__.' || _.-.. ]],
[[ .' /| `. _.-' _.-' _.-.`-'`._`.` ]],
[[ \ .' | | .-.` `./ _.-`. `._.-' ]],
[[ |. | `. _.-' `. .' .' `._.`---` ]],
[[ .' | | : `._..-'.' `._..' || ]],
[[ / | \ `-._.' || || ]],
[[ | .'|`. | ||_.--.-._ || ]],
[[ ' / | \ \ __.--'\ `. : || ]],
[[ \ .' | \| ..-' \ `._-._.' || ]],
[[`.._ |/ | `. \ \ `._.- || ]],
[[ `-.._ / | \ `-.'_.--' || ]],
[[ `-.._.' | | | | _ _ _ _'_ _ _ _ _ ]],
[[ `-.._ | \ | | |_|_|_'|_|_|_|_|_|_| ]],
[[ [`--^-..._.' | | /....../| __ __ | ]],
[[ \`---.._|`--.._ | | /....../ | |__| |__| | ]],
[[ \__ _ `-.._| `-._|_|_ _ _/_ _ _ / | |__| |__| | ]],
[[ \ _o_ _`-._|_|_|_|_|_|_|_|_/ '-----------/ ]],
[[ \_`.|.' _ - .--.--.--.--.--.`--------------' ]],
[[ .```-._ ``-.._ \__ _ _ '--'--'--'--'--' - _ - _ __/ ]],
[[ .`-.```-._ ``-..__``.- `. _ - _ _ _ - _- _ __/(.``-._]],
[[ _.-` ``--.. .. _.-` ``--.. .. .._ _. __ __ _ __ ..--.._ / .( _..``]],
[[`.-._ `._ `- `-._ .`-.```-._ ``-..__``.- -._--.__---._--..-._`...```]],
[[ _.-` ``--.. .. `.-._ `._ `- `-._ .-_. ._.- -._ --.._`` _.-`LGB`-.]],
},
}
C.mediumheader = {
{
[[ |._ ]],
[[ |._( ]],
[[ <|.__..-'|. ]],
[[ ,| .|)\ ]],
[[ /| .|) \ ]],
[[ /.|) .|) \ ]],
[[ / .|) .|) \ ]],
[[ / .|) .|) \ ]],
[[ / .|) .|) \ ]],
[[ / ,--+---_ | \ , ]],
[[ '\==-,,;,,;,,;,,,,,,,-==;7 ]],
[[ _ \__...____...__ __/ _ seal _]],
[[ ~ ~~~~ ~~ ]],
},
{
[[ , ]],
[[ |"-,_ ]],
[[ I--(_ ]],
[[ ,I?8, ]],
[[ d|`888. ]],
[[ d8| 8888b ]],
[[ ,88| ?8888b ]],
[[ ,888| `88888b ]],
[[ ,8888| 8888g8b ]],
[[ ,88888| 888PX?8b ]],
[[ ,888888| 8888bd88, ]],
[[ o8888888| ,888888888 ]],
[[ d8888888P| d888888888b ]],
[[ _.d888gggg8'| 8gg88888888, ]],
[[ '\==-,,,,,,,,|/;,,,,,-==;7 ]],
[[ _ \__...____...__ __/ _ seal _]],
[[ ~ ~~~~ ~~ ]],
},
}
C.smallheader = {
{
[[ _~ ]],
[[ _~ )_)_~ ]],
[[ )_))_))_) ]],
[[ _!__!__!_ ]],
[[ \______t/ ]],
[[~~~~~~~~~~~~~]],
},
{
[[ __4___ ]],
[[ _ \ \ \ \ ]],
[[<'\ /_/_/_/ ]],
[[ ((____!___/)]],
[[ \0\0\0\0\/ ]],
},
{
[[ I\ ]],
[[ I \ ]],
[[ I \ ]],
[[ I*--\ ]],
[[ I \ ]],
[[ I \ ]],
[[ I______\ ]],
[[ _____I__O______ ]],
[[ \ ( ) b ^ ^]],
[[^^^^^^^^^^^^^^^^^ ^ ]],
},
{
[[ ^ +~+~~ ]],
[[ ^ )`.). ]],
[[ )``)``) .~~ ]],
[[ ).-'.-')|) ]],
[[ |-).-).-'_'-/ ]],
[[~~~\ `o-o-o' /~~~~~~~~~~~~~~~~~]],
[[ ~~~'---.____/~~Eric C. Liebl~~~]],
},
{
[[ ,_ ]],
[[ I~ ]],
[[ |\ ]],
[[ /|.\ ]],
[[ / || \ ]],
[[ ,' |' \ ]],
[[.-'.-==|/_--' ]],
[[`--'-------' _ seal _]],
}
}
R.width = vim.api.nvim_win_get_width(0) R.width = vim.api.nvim_win_get_width(0)
R.height = vim.api.nvim_win_get_height(0) R.height = vim.api.nvim_win_get_height(0)
if R.width >= 120 then C.header = C.bigheader[math.random(#C.bigheader)]
alpha.setup { if #C.header >= R.height then
layout = { C.header = C.mediumheader[math.random(#C.mediumheader)]
{ type = "padding", val = math.floor(R.height / 2.5) }, if #C.header >= R.height then
button([[ `'::. `'::::. ]], "Recent Files", "<cmd>Telescope oldfiles<CR>"), C.header = C.smallheader[math.random(#C.smallheader)]
button([[ _________H ,%%&%, _____A_ ]], "New File", "<cmd>ene<CR>"), if #C.header >= R.height then
button([[ /\ _ \%&&%%&% / /\ ]], "Update Plugins", "<cmd>DepSync<CR>"), C.header = ""
button([[ / \___/^\___\%&%%&& __/__/\__/ \___ ]], "", ""),
button([[ | | [] [] |%\Y&%' /__|" '' "| /___/\ ]], "", ""),
button([[ | | .-. | || |''|"'||'"| |' '|| ]], "", ""),
button([[~~@._|@@_|||_@@|~||~~~ ~`""`""))""`"`""""`~~]], "", ""),
button([[ `""") )"""` // ]], "", ""),
}
}
end
if R.width <= 119 then
local header = {
[[ `'::. `'::::. ]],
[[ _________H ,%%&%, _____A_ ]],
[[ /\ _ \%&&%%&% / /\ ]],
[[ / \___/^\___\%&%%&& __/__/\__/ \___ ]],
[[ | | [] [] |%\Y&%' /__|" '' "| /___/\ ]],
[[ | | .-. | || |''|"'||'"| |' '|| ]],
[[~~@._|@@_|||_@@|~||~~~ ~`""`""))""`"`""""`~~]],
[[ `""") )"""` // ]],
}
alpha.setup {
layout = {
{ type = "padding", val = math.floor(R.height / 2.5) },
{ type = "text", val = header, opts = { position = "center", hl = "AlphaHeader" } },
{ type = "padding", val = 1 },
button([[]], "Recent Files", "<cmd>Telescope oldfiles<CR>"),
button([[]], "New File", "<cmd>ene<CR>"),
button([[]], "Update Plugins", "<cmd>DepSync<CR>"),
}
}
end
vim.api.nvim_create_autocmd('VimResized', {
group = augroup,
buffer = buf,
callback = function()
if vim.api.nvim_get_current_win() == win then
redraw()
end end
end end
}) end
alpha.setup {
layout = {
{ type = "padding", val = math.floor((R.height - #C.header) / 2) },
{ type = "text", val = C.header, opts = { position = 'center', hl = "AlphaHeader" } },
},
}

View File

@ -92,7 +92,6 @@ local modes = {
el.setup { el.setup {
generator = function() generator = function()
local items = { local items = {
{ c.mode { modes = modes, fmt = " %s %s ", icon = "", hl_icon_only = false } }, { c.mode { modes = modes, fmt = " %s %s ", icon = "", hl_icon_only = false } },
{ sections.split, required = true }, { sections.split, required = true },

View File

@ -1,9 +0,0 @@
local status_ok, luatab = pcall(require, "luatab")
if not status_ok then
return
end
luatab.setup {
windowCount = function() return '' end,
devicon = function() return '' end,
}

View File

@ -5,10 +5,8 @@ end
todocomments.setup { todocomments.setup {
keywords = { keywords = {
FIX = { FIX = { icon = "", alt = { "FIXME", "BUG" } },
icon = " ", -- icon used for the sign, and in search results TODO = { icon = "i ", color = "info" },
},
TODO = { icon = "", color = "info" },
HACK = { icon = "* ", color = "warning" }, HACK = { icon = "* ", color = "warning" },
WARN = { icon = "! ", color = "warning", alt = { "WARNING", "XXX" } }, WARN = { icon = "! ", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },

View File

@ -4,15 +4,20 @@ a = vim.api
g = vim.g g = vim.g
c = vim.cmd c = vim.cmd
-- performance ----------------------------------------------------------------
vim.loader.enable()
-- main lua files ------------------------------------------------------------- -- main lua files -------------------------------------------------------------
require('bootstrap') require('bootstrap')
require('core.handler') require('core.handler')
-- call all snippets in the lua/snippets directory ---------------------------- -- call all snippets in the lua/snippets directory ----------------------------
require('snippet.shorthands') if pcall(require, "luasnip") then
for _, file in ipairs(vim.fn.readdir(vim.fn.stdpath('config')..'/lua/snippet', require('snippet.shorthands')
[[v:val =~ '\.lua$']])) do for _, file in ipairs(vim.fn.readdir(vim.fn.stdpath('config')..'/lua/snippet',
require('snippet.'..file:gsub('%.lua$', '')) [[v:val =~ '\.lua$']])) do
require('snippet.'..file:gsub('%.lua$', ''))
end
end end
-- call the config manager ---------------------------------------------------- -- call the config manager ----------------------------------------------------

View File

@ -7,6 +7,7 @@ a.nvim_create_augroup('bufcheck', {clear = true})
auto('TextYankPost', { -- highlight yanks auto('TextYankPost', { -- highlight yanks
group = 'bufcheck', group = 'bufcheck',
pattern = '*', pattern = '*',
desc = 'Highlight on yank.',
callback = function() callback = function()
vim.highlight.on_yank{ timeout = 250 } vim.highlight.on_yank{ timeout = 250 }
end end
@ -15,68 +16,20 @@ auto('TextYankPost', { -- highlight yanks
auto('FileType', { -- start git messages in insert mode auto('FileType', { -- start git messages in insert mode
group = 'bufcheck', group = 'bufcheck',
pattern = { 'gitcommit', 'gitrebase', }, pattern = { 'gitcommit', 'gitrebase', },
desc = 'Start git messages in insert mode.',
command = 'startinsert | 1' command = 'startinsert | 1'
}) })
auto('FileType', { -- show git cached diff
group = 'bufcheck',
pattern = { 'gitcommit', 'gitrebase', },
callback = function()
local function lower(a, b)
if a > b then
return b
else
return a
end
end
local function tablelength(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end
local diff = io.popen('git diff --cached', "r")
local diffl = {}
for i in diff:lines() do
table.insert(diffl, i)
end
diff:close()
if next(diffl) == nil then
vim.notify('No diff to show :(', vim.log.levels.INFO, {
title = 'Neovim Config' })
return
end
local buf = a.nvim_create_buf(true, false)
a.nvim_buf_set_lines(buf, 0, -1, false, diffl)
a.nvim_buf_set_name(buf, 'Git Commit Diff')
a.nvim_buf_set_option(buf, 'ft', 'diff')
a.nvim_buf_set_option(buf, 'readonly', true)
a.nvim_buf_set_option(buf, 'modifiable', false)
a.nvim_buf_set_option(buf, 'modified', false)
local win = a.nvim_open_win(buf, false, {
row = 1,
col = 80,
relative = 'win',
width = 80,
height = lower(vim.o.lines - vim.o.cmdheight - 4, tablelength(diffl)),
border = 'shadow',
style = 'minimal',
})
end,
})
auto('BufRead', { -- return to last place auto('BufRead', { -- return to last place
pattern = '*', pattern = '*',
command = [[call setpos(".", getpos("'\""))]] command = [[call setpos(".", getpos("'\""))]],
desc = 'Return to the last place the buffer was closed in.',
}) })
auto('TermOpen', { -- start terminal in insert mode auto('TermOpen', { -- start terminal in insert mode
group = 'bufcheck', group = 'bufcheck',
pattern = '*', pattern = '*',
desc = 'Start terminal in insert mode.',
callback = function() callback = function()
vim.cmd('startinsert | set winfixheight') vim.cmd('startinsert | set winfixheight')
o.winfixheight = true o.winfixheight = true
@ -87,6 +40,7 @@ auto('TermOpen', { -- start terminal in insert mode
auto('TermClose', { -- close terminal buffers after shell dies auto('TermClose', { -- close terminal buffers after shell dies
group = 'bufcheck', group = 'bufcheck',
pattern = 'term://*', pattern = 'term://*',
desc = 'Close terminal after shell dies.',
callback = function() callback = function()
vim.cmd('call nvim_input("<CR>")') vim.cmd('call nvim_input("<CR>")')
o.cmdheight = 1 o.cmdheight = 1
@ -95,6 +49,7 @@ auto('TermClose', { -- close terminal buffers after shell dies
auto('InsertEnter', { -- toggle things when entering insert mode auto('InsertEnter', { -- toggle things when entering insert mode
group = 'bufcheck', group = 'bufcheck',
desc = 'Turn things on insert mode.',
callback = function() callback = function()
o.colorcolumn = { 80 } o.colorcolumn = { 80 }
end end
@ -102,6 +57,7 @@ auto('InsertEnter', { -- toggle things when entering insert mode
auto('InsertLeave', { -- toggle things when exiting insert mode auto('InsertLeave', { -- toggle things when exiting insert mode
group = 'bufcheck', group = 'bufcheck',
desc = 'Turn things off insert mode.',
callback = function() callback = function()
o.colorcolumn = { 0 } o.colorcolumn = { 0 }
end end
@ -110,6 +66,7 @@ auto('InsertLeave', { -- toggle things when exiting insert mode
auto('BufWritePre', { -- make dirs when they don't exist auto('BufWritePre', { -- make dirs when they don't exist
pattern = '*', pattern = '*',
group = vim.api.nvim_create_augroup('auto_create_dir', { clear = true }), group = vim.api.nvim_create_augroup('auto_create_dir', { clear = true }),
desc = 'Basically mkdir -p.',
callback = function(ctx) callback = function(ctx)
local dir = vim.fn.fnamemodify(ctx.file, ':p:h') local dir = vim.fn.fnamemodify(ctx.file, ':p:h')
vim.fn.mkdir(dir, 'p') vim.fn.mkdir(dir, 'p')

View File

@ -1,5 +1,8 @@
local function map(mode, bind, cmd, opts) local function map(mode, bind, cmd, opts)
opts = opts or {noremap = true, silent = true} opts = opts or {}
opts['noremap'] = true
opts['silent'] = true
if type(bind) == 'table' then if type(bind) == 'table' then
for i in pairs(bind) do for i in pairs(bind) do
vim.keymap.set(mode, bind[i], cmd, opts) vim.keymap.set(mode, bind[i], cmd, opts)
@ -23,12 +26,12 @@ end
-- vim binds ------------------------------------------------------------------ -- vim binds ------------------------------------------------------------------
g.mapleader = ' ' -- set leader key g.mapleader = ' ' -- set leader key
map('x', '<leader>p', [["_dP]]) -- greatest remap ever map('x', '<leader>p', [["_dP]], { desc = 'Greatest remap of all time.' })
map('n', '<ESC>', ':nohlsearch<Bar>:echo<CR>') -- clear search map('n', '<esc>', ':nohlsearch<Bar>:echo<CR>', { desc = 'Clear search.' })
map('t', '<ESC>', '<C-\\><C-n>') -- make <ESC> work in terminals map('t', '<esc>', '<C-\\><C-n>', { desc = 'make <esc> work in terminals.' })
-- move selected text up/down -- move selected text up/down
map('v', '<S-k>', ":m '<-2<CR>gv=gv") map('v', '<S-k>', ":m '<-2<CR>gv=gv", { desc = 'Move selected text up.' })
map('v', '<S-j>', ":m '>+1<CR>gv=gv") map('v', '<S-j>', ":m '>+1<CR>gv=gv", { desc = 'Move selected text down.' })
-- the cursor STAYS IN THE MIDDLE -- the cursor STAYS IN THE MIDDLE
map('n', '<S-j>', 'mzJ`z<cmd>delm z<CR>') -- when combining lines map('n', '<S-j>', 'mzJ`z<cmd>delm z<CR>') -- when combining lines
@ -50,10 +53,16 @@ a.nvim_create_autocmd('FileType', {
bind('l', '<CR>') -- Go down a directory / open a file bind('l', '<CR>') -- Go down a directory / open a file
bind('.', 'gh') -- Toggle dotfiles bind('.', 'gh') -- Toggle dotfiles
bind('P', '<C-w>z') -- Close preview window bind('P', '<C-w>z') -- Close preview window
bind('<ESC>', '<cmd>q<CR>') -- Close netrw bind('<esc>', '<cmd>q<CR>') -- Close netrw
end end
}) })
-- tabs
map('n', '<C-q>n', '<cmd>tabnew<CR>')
map('n', '<C-q>w', '<cmd>tabclose<CR>')
map('n', '<C-q>h', '<cmd>tabprev<CR>')
map('n', '<C-q>l', '<cmd>tabnext<CR>')
-- plugin binds --------------------------------------------------------------- -- plugin binds ---------------------------------------------------------------
-- pretty lsp view -- pretty lsp view
@ -62,41 +71,56 @@ map('n', 'gr', '<CMD>Glance references<CR>')
map('n', 'gy', '<CMD>Glance type_definitions<CR>') map('n', 'gy', '<CMD>Glance type_definitions<CR>')
map('n', 'gi', '<CMD>Glance implementations<CR>') map('n', 'gi', '<CMD>Glance implementations<CR>')
local treesj = require('treesj') -- treesj if pcall(require, "treesj") then
map('n', '<leader>j', treesj.toggle) local treesj = require('treesj') -- treesj
map('n', '<leader>j', treesj.toggle)
end
local telebuilt = require('telescope.builtin') -- telescope if pcall(require, "telescope") then
map('n', '<leader>sf', telebuilt.find_files) local telebuilt = require('telescope.builtin') -- telescope
map('n', '<leader>sg', telebuilt.git_files) map('n', '<leader>sf', telebuilt.find_files, { desc = 'Find files.' })
map('n', '<leader>sp', function() map('n', '<leader>sg', telebuilt.git_files, { desc = 'Find git files.' })
telebuilt.grep_string({ search = vim.fn.input('Find string in project > ') }) map('n', '<leader>sp', function()
end) telebuilt.grep_string({ search = vim.fn.input(
map('n', '<leader>so', telebuilt.oldfiles) 'Find string in project > '
) })
end, { desc = 'Find string in project.' })
map('n', '<leader>so', telebuilt.oldfiles, { desc = 'Find old files.' })
end
local intellitab = require('intellitab') -- intellitab map('n', '<leader>u', '<cmd>UndotreeToggle<CR>', { desc = 'Open undo tree.' })
map('n', '<Tab>', intellitab.indent) map('n', '<leader>f', '<cmd>SFMToggle<CR>', { desc = 'Open file tree view.' })
map('n', '<leader>b', '<cmd>JABSOpen<CR>', { desc = 'Switch between buffers.' })
map('n', '<leader>tt', '<cmd>TroubleToggle<CR>', { desc = 'Diagnostic list.' })
map('n', '<leader>tc', '<cmd>TodoTrouble<CR>', { desc = 'Comment list.' })
map('n', '<C-e>', '<cmd>IconPickerYank<CR>', { desc = 'Icon picker list.' })
map('n', '<leader>u', '<cmd>UndotreeToggle<CR>') -- undo tree if pcall(require, "dapui") then
map('n', '<leader>f', '<cmd>SFMToggle<CR>') -- sfm local dapui = require('dapui') -- dap ui
map('n', '<leader>b', '<cmd>JABSOpen<CR>') -- switch between previous buffers map('n', '<leader>d', dapui.toggle, { desc = 'Debuging ui.' })
map('n', '<leader>tt', '<cmd>TroubleToggle<CR>') -- trouble (lsp error view) end
map('n', '<leader>tc', '<cmd>TodoTrouble<CR>') -- todo trouble
map('n', '<C-e>', '<cmd>IconPickerYank<CR>') -- icon picker
local dapui = require('dapui') -- dap ui if pcall(require, "smart-splits") then
map('n', '<leader>d', dapui.toggle) local smartsplits = require('smart-splits') -- resizing buffers (toggleable)
map('n', '<leader>r', smartsplits.start_resize_mode)
local smartsplits = require('smart-splits') -- resizing buffers (toggleable) end
map('n', '<leader>r', smartsplits.start_resize_mode)
-- toggle term (don't use leader key in these binds) -- toggle term (don't use leader key in these binds)
map({'n', 't'}, '<C-\\>', '<cmd>ToggleTerm direction=float<CR>') map({'n', 't'}, '<C-\\>', '<cmd>ToggleTerm direction=float<CR>')
map({'n', 't'}, '<C-g>', '<cmd>lua _glow()<CR>') map({'n', 't'}, '<C-g>', '<cmd>lua _glow()<CR>')
-- true zen -- true zen
map('n', '<leader>zf', '<cmd>lua require("true-zen.focus").toggle()<CR>') if pcall(require, "true-zen") then
map('n', '<leader>zm', '<cmd>lua require("true-zen.minimalist").toggle()<CR>') map('n', '<leader>zf', require("true-zen.focus").toggle, {
map('n', '<leader>za', '<cmd>lua require("true-zen.ataraxis").toggle()<CR>') desc = 'fullscreen',
})
map('n', '<leader>zm', require("true-zen.minimalist").toggle, {
desc = 'minimal',
})
map('n', '<leader>za', require("true-zen.ataraxis").toggle, {
desc = 'zen',
})
end
-- Git -- Git
map('n', '<leader>gph', '<cmd>Gitsigns preview_hunk_inline<CR>') map('n', '<leader>gph', '<cmd>Gitsigns preview_hunk_inline<CR>')
@ -104,4 +128,8 @@ map('n', '<leader>gsh', '<cmd>Gitsigns stage_hunk<CR>')
map('n', '<leader>gb', '<cmd>Gitsigns blame_line<CR>') map('n', '<leader>gb', '<cmd>Gitsigns blame_line<CR>')
-- neogen -- neogen
map('n', '<leader>df', '<cmd>lua require("neogen").generate()<CR>') if pcall(require, "neogen") then
map('n', '<leader>df', require("neogen").generate, {
desc = 'Generate anootations',
})
end

View File

@ -1,5 +1,4 @@
require('core.plugins') -- load plugins first to allow colorscheme to be set in opts require('core.plugins') -- load plugins first to allow colorscheme to be set in opts
require'impatient'.enable_profile()
require('core.opts') require('core.opts')
require('core.highlight') require('core.highlight')
require('core.binds') require('core.binds')

View File

@ -1,4 +1,5 @@
local highlight = function(group, opts, space) local highlight = function(group, opts, space)
if not pcall(require, "mellow") then return end
space = space or 0 space = space or 0
if type(group) == 'table' then if type(group) == 'table' then
@ -10,7 +11,7 @@ local highlight = function(group, opts, space)
end end
end end
local c = require('mellow.colors').dark if pcall(require, "mellow") then c = require('mellow.colors').dark end
-- vim highlights ------------------------------------------------------------- -- vim highlights -------------------------------------------------------------
highlight('CursorLineNr', { bg = c.bg_dark, fg = c.fg, bold = true }) highlight('CursorLineNr', { bg = c.bg_dark, fg = c.fg, bold = true })

View File

@ -1,5 +1,5 @@
-- better ui ------------------------------------------------------------------ -- better ui ------------------------------------------------------------------
vim.notify = require("notify") if pcall(require, "notify") then vim.notify = require("notify") end
-- o.colorcolumn = { 80 } -- o.colorcolumn = { 80 }
-- buffer -- buffer
@ -34,7 +34,7 @@ o.softtabstop = tabwidth
-- colorscheme -- colorscheme
o.termguicolors = true o.termguicolors = true
vim.cmd('colorscheme mellow') if pcall(require, "mellow") then vim.cmd('colorscheme mellow') end
-- better editing ------------------------------------------------------------- -- better editing -------------------------------------------------------------
o.clipboard = 'unnamedplus' -- system clipboard (on unix like) o.clipboard = 'unnamedplus' -- system clipboard (on unix like)

View File

@ -15,15 +15,17 @@ require 'dep' {
-- flexing on all the discord users ----------------------------------------- -- flexing on all the discord users -----------------------------------------
-- { 'andweeb/presence.nvim' }, -- { 'andweeb/presence.nvim' },
-- colorschemes -------------------------------------------------------------
{ 'kvrohit/mellow.nvim' },
{ 'rockerBOO/boo-colorscheme-nvim' },
-- ui ----------------------------------------------------------------------- -- ui -----------------------------------------------------------------------
{ 'kvrohit/mellow.nvim' }, -- colorscheme
{ 'lukas-reineke/indent-blankline.nvim' }, -- indentation indicators { 'lukas-reineke/indent-blankline.nvim' }, -- indentation indicators
{ 'folke/which-key.nvim' }, -- key map help { 'folke/which-key.nvim' }, -- key map help
{ 'rcarriga/nvim-notify' }, -- notifications { 'rcarriga/nvim-notify' }, -- notifications
{ 'tjdevries/express_line.nvim', -- status bar { 'tjdevries/express_line.nvim', -- status bar
requires = 'nvim-lua/plenary.nvim', requires = 'nvim-lua/plenary.nvim',
}, },
{ 'alvarosevilla95/luatab.nvim' }, -- tabline
{ 'goolord/alpha-nvim' }, -- start page { 'goolord/alpha-nvim' }, -- start page
{ 'dinhhuy258/sfm.nvim', -- tree view { 'dinhhuy258/sfm.nvim', -- tree view
requires = 'dinhhuy258/sfm-git.nvim', requires = 'dinhhuy258/sfm-git.nvim',
@ -32,10 +34,14 @@ require 'dep' {
{ 'axieax/urlview.nvim' }, -- view urls in current buffer { 'axieax/urlview.nvim' }, -- view urls in current buffer
{ 'matbme/JABS.nvim' }, -- buffer switcher { 'matbme/JABS.nvim' }, -- buffer switcher
{ 'ziontee113/icon-picker.nvim' }, -- icons { 'ziontee113/icon-picker.nvim' }, -- icons
{ 'petertriho/nvim-scrollbar' }, { 'petertriho/nvim-scrollbar' }, -- scrollbar
{ 'pocco81/true-zen.nvim' }, -- { 'lewis6991/satellite.nvim' }, -- new scrollbar for nvim 0.10
{ 'pocco81/true-zen.nvim' }, -- focus on the current thing
{ 'tomiis4/Hypersonic.nvim' }, -- regex helper/displayer { 'tomiis4/Hypersonic.nvim' }, -- regex helper/displayer
{ 'lewis6991/cleanfold.nvim' }, -- nice fold line
{ 'yaocccc/nvim-foldsign' }, -- fold sign in gutter
-- functional plugins ------------------------------------------------------- -- functional plugins -------------------------------------------------------
{ 'lewis6991/gitsigns.nvim' }, { 'lewis6991/gitsigns.nvim' },
{ 'chentoast/marks.nvim' }, { 'chentoast/marks.nvim' },
@ -50,6 +56,7 @@ require 'dep' {
-- note taking -------------------------------------------------------------- -- note taking --------------------------------------------------------------
{ 'nvim-neorg/neorg' }, { 'nvim-neorg/neorg' },
{ 'nvim-neorg/neorg-telescope' },
-- fzf ---------------------------------------------------------------------- -- fzf ----------------------------------------------------------------------
{ 'nvim-telescope/telescope.nvim', { 'nvim-telescope/telescope.nvim',
@ -96,10 +103,10 @@ require 'dep' {
{ 'j-hui/fidget.nvim', -- shows lsp progress { 'j-hui/fidget.nvim', -- shows lsp progress
branch = 'legacy', branch = 'legacy',
}, },
{ 'folke/neodev.nvim' }, -- configure lua lsp for neovim
{ 'ray-x/lsp_signature.nvim' }, -- see information about the current function { 'ray-x/lsp_signature.nvim' }, -- see information about the current function
{ 'dnlhc/glance.nvim' }, -- diagnostic info at a glance { 'dnlhc/glance.nvim' }, -- diagnostic info at a glance
{ 'kosayoda/nvim-lightbulb' }, -- "light bulb" - Gru
{ 'weilbith/nvim-code-action-menu' }, -- code actions
{ 'folke/trouble.nvim' }, { 'folke/trouble.nvim' },
{ 'folke/todo-comments.nvim' }, { 'folke/todo-comments.nvim' },

View File

@ -1,2 +1 @@
require('mngr.menu') require('mngr.menu')
require('mngr.updates')

View File

@ -1,3 +1,11 @@
-- helper functions that can come in handy
local function run(cmd)
local x = io.popen(cmd)
local y = x:read("*a")
x:close()
return y
end
-- custom menu for simpler neovim managment ----------------------------------- -- custom menu for simpler neovim managment -----------------------------------
local function genmenu() local function genmenu()
local list = {} local list = {}
@ -15,6 +23,8 @@ local function genmenu()
add('update plugins', 'dep') add('update plugins', 'dep')
add('update config', nil) add('update config', nil)
add('show keybinds', 'telescope') add('show keybinds', 'telescope')
add('change colorscheme', 'telescope')
add('new plugins', 'telescope')
return list return list
end end
@ -42,6 +52,19 @@ local function configmenu()
if choice == 'show keybinds' then if choice == 'show keybinds' then
require('telescope.builtin').keymaps() require('telescope.builtin').keymaps()
end end
if choice == 'change colorscheme' then
require('telescope.builtin').colorscheme()
end
-- search though plugins (powered by nvim.sh)
if choice == 'new plugins' then
local result = run("curl -s https://nvim.sh/s")
local array = {}
for s in string.gmatch(result, "[^\r\n]+") do
table.insert(array, s)
end
local header = table.remove(array, 1)
vim.ui.select(array, { vpt = header}, function() end)
end
end) end)
end end

View File

@ -1,14 +0,0 @@
-- janky popen madness to use curl without luarocks
-- local remoteCommit = io.popen([[curl -s https://git.squi.bid/nvim/commit/ | grep -o "<a href='/nvim/commit/?id=.*>" | cut -d "'" -f 2 | cut -d "=" -f 2 | head -1]])
-- local remoteResult = remoteCommit:read("*a")
-- remoteCommit:close()
--
-- local localCommit = io.popen([[cd $XDG_CONFIG_HOME/nvim; git log | head -1 | cut -d " " -f 2]])
-- local localResult = localCommit:read("*a")
-- localCommit:close()
--
-- if remoteResult ~= localResult then
-- vim.notify("Out of date with remote repo :(", vim.log.levels.WARN, {title = "Nvim Config"})
-- else
-- vim.notify("Up to date with remote repo :)", vim.log.levels.INFO, {title = "Nvim Config"})
-- end