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,
border = 'shadow',
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")
local function lsp_settings()
vim.diagnostic.config({
virtual_text = false,
signs = true,

View File

@ -5,5 +5,5 @@ end
marks.setup {
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",
}
},
["core.integrations.telescope"] = {},
}
}

View File

@ -23,3 +23,11 @@ scrollbar.setup({
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
end
local redraw = alpha.redraw
local win = vim.api.nvim_get_current_win()
local buf = vim.api.nvim_get_current_buf()
local augroup = vim.api.nvim_create_augroup('alpha_recalc', { clear = true })
math.randomseed(os.time())
local C = {}
local R = {}
-- buttons
local function button(sc, txt, keybind)
local opts = {
position = "center",
shortcut = sc,
cursor = 5,
width = 80,
cursor = -1,
width = string.len(C.header[1]),
align_shortcut = "right",
hl_shortcut = "Keyword",
redraw_on_resize = false,
@ -33,55 +33,304 @@ local function button(sc, txt, keybind)
end
-- 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.height = vim.api.nvim_win_get_height(0)
if R.width >= 120 then
alpha.setup {
layout = {
{ type = "padding", val = math.floor(R.height / 2.5) },
button([[ `'::. `'::::. ]], "Recent Files", "<cmd>Telescope oldfiles<CR>"),
button([[ _________H ,%%&%, _____A_ ]], "New File", "<cmd>ene<CR>"),
button([[ /\ _ \%&&%%&% / /\ ]], "Update Plugins", "<cmd>DepSync<CR>"),
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()
C.header = C.bigheader[math.random(#C.bigheader)]
if #C.header >= R.height then
C.header = C.mediumheader[math.random(#C.mediumheader)]
if #C.header >= R.height then
C.header = C.smallheader[math.random(#C.smallheader)]
if #C.header >= R.height then
C.header = ""
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 {
generator = function()
local items = {
{ c.mode { modes = modes, fmt = " %s %s ", icon = "", hl_icon_only = false } },
{ 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 {
keywords = {
FIX = {
icon = " ", -- icon used for the sign, and in search results
},
TODO = { icon = "", color = "info" },
FIX = { icon = "", alt = { "FIXME", "BUG" } },
TODO = { icon = "i ", color = "info" },
HACK = { icon = "* ", color = "warning" },
WARN = { icon = "! ", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },

View File

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

View File

@ -7,6 +7,7 @@ a.nvim_create_augroup('bufcheck', {clear = true})
auto('TextYankPost', { -- highlight yanks
group = 'bufcheck',
pattern = '*',
desc = 'Highlight on yank.',
callback = function()
vim.highlight.on_yank{ timeout = 250 }
end
@ -15,68 +16,20 @@ auto('TextYankPost', { -- highlight yanks
auto('FileType', { -- start git messages in insert mode
group = 'bufcheck',
pattern = { 'gitcommit', 'gitrebase', },
desc = 'Start git messages in insert mode.',
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
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
group = 'bufcheck',
pattern = '*',
desc = 'Start terminal in insert mode.',
callback = function()
vim.cmd('startinsert | set winfixheight')
o.winfixheight = true
@ -87,6 +40,7 @@ auto('TermOpen', { -- start terminal in insert mode
auto('TermClose', { -- close terminal buffers after shell dies
group = 'bufcheck',
pattern = 'term://*',
desc = 'Close terminal after shell dies.',
callback = function()
vim.cmd('call nvim_input("<CR>")')
o.cmdheight = 1
@ -95,6 +49,7 @@ auto('TermClose', { -- close terminal buffers after shell dies
auto('InsertEnter', { -- toggle things when entering insert mode
group = 'bufcheck',
desc = 'Turn things on insert mode.',
callback = function()
o.colorcolumn = { 80 }
end
@ -102,6 +57,7 @@ auto('InsertEnter', { -- toggle things when entering insert mode
auto('InsertLeave', { -- toggle things when exiting insert mode
group = 'bufcheck',
desc = 'Turn things off insert mode.',
callback = function()
o.colorcolumn = { 0 }
end
@ -110,6 +66,7 @@ auto('InsertLeave', { -- toggle things when exiting insert mode
auto('BufWritePre', { -- make dirs when they don't exist
pattern = '*',
group = vim.api.nvim_create_augroup('auto_create_dir', { clear = true }),
desc = 'Basically mkdir -p.',
callback = function(ctx)
local dir = vim.fn.fnamemodify(ctx.file, ':p:h')
vim.fn.mkdir(dir, 'p')

View File

@ -1,5 +1,8 @@
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
for i in pairs(bind) do
vim.keymap.set(mode, bind[i], cmd, opts)
@ -23,12 +26,12 @@ end
-- vim binds ------------------------------------------------------------------
g.mapleader = ' ' -- set leader key
map('x', '<leader>p', [["_dP]]) -- greatest remap ever
map('n', '<ESC>', ':nohlsearch<Bar>:echo<CR>') -- clear search
map('t', '<ESC>', '<C-\\><C-n>') -- make <ESC> work in terminals
map('x', '<leader>p', [["_dP]], { desc = 'Greatest remap of all time.' })
map('n', '<esc>', ':nohlsearch<Bar>:echo<CR>', { desc = 'Clear search.' })
map('t', '<esc>', '<C-\\><C-n>', { desc = 'make <esc> work in terminals.' })
-- move selected text up/down
map('v', '<S-k>', ":m '<-2<CR>gv=gv")
map('v', '<S-j>', ":m '>+1<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", { desc = 'Move selected text down.' })
-- the cursor STAYS IN THE MIDDLE
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('.', 'gh') -- Toggle dotfiles
bind('P', '<C-w>z') -- Close preview window
bind('<ESC>', '<cmd>q<CR>') -- Close netrw
bind('<esc>', '<cmd>q<CR>') -- Close netrw
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 ---------------------------------------------------------------
-- pretty lsp view
@ -62,41 +71,56 @@ map('n', 'gr', '<CMD>Glance references<CR>')
map('n', 'gy', '<CMD>Glance type_definitions<CR>')
map('n', 'gi', '<CMD>Glance implementations<CR>')
local treesj = require('treesj') -- treesj
map('n', '<leader>j', treesj.toggle)
if pcall(require, "treesj") then
local treesj = require('treesj') -- treesj
map('n', '<leader>j', treesj.toggle)
end
local telebuilt = require('telescope.builtin') -- telescope
map('n', '<leader>sf', telebuilt.find_files)
map('n', '<leader>sg', telebuilt.git_files)
map('n', '<leader>sp', function()
telebuilt.grep_string({ search = vim.fn.input('Find string in project > ') })
end)
map('n', '<leader>so', telebuilt.oldfiles)
if pcall(require, "telescope") then
local telebuilt = require('telescope.builtin') -- telescope
map('n', '<leader>sf', telebuilt.find_files, { desc = 'Find files.' })
map('n', '<leader>sg', telebuilt.git_files, { desc = 'Find git files.' })
map('n', '<leader>sp', function()
telebuilt.grep_string({ search = vim.fn.input(
'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', '<Tab>', intellitab.indent)
map('n', '<leader>u', '<cmd>UndotreeToggle<CR>', { desc = 'Open undo tree.' })
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
map('n', '<leader>f', '<cmd>SFMToggle<CR>') -- sfm
map('n', '<leader>b', '<cmd>JABSOpen<CR>') -- switch between previous buffers
map('n', '<leader>tt', '<cmd>TroubleToggle<CR>') -- trouble (lsp error view)
map('n', '<leader>tc', '<cmd>TodoTrouble<CR>') -- todo trouble
map('n', '<C-e>', '<cmd>IconPickerYank<CR>') -- icon picker
if pcall(require, "dapui") then
local dapui = require('dapui') -- dap ui
map('n', '<leader>d', dapui.toggle, { desc = 'Debuging ui.' })
end
local dapui = require('dapui') -- dap ui
map('n', '<leader>d', dapui.toggle)
local smartsplits = require('smart-splits') -- resizing buffers (toggleable)
map('n', '<leader>r', smartsplits.start_resize_mode)
if pcall(require, "smart-splits") then
local smartsplits = require('smart-splits') -- resizing buffers (toggleable)
map('n', '<leader>r', smartsplits.start_resize_mode)
end
-- toggle term (don't use leader key in these binds)
map({'n', 't'}, '<C-\\>', '<cmd>ToggleTerm direction=float<CR>')
map({'n', 't'}, '<C-g>', '<cmd>lua _glow()<CR>')
-- true zen
map('n', '<leader>zf', '<cmd>lua require("true-zen.focus").toggle()<CR>')
map('n', '<leader>zm', '<cmd>lua require("true-zen.minimalist").toggle()<CR>')
map('n', '<leader>za', '<cmd>lua require("true-zen.ataraxis").toggle()<CR>')
if pcall(require, "true-zen") then
map('n', '<leader>zf', require("true-zen.focus").toggle, {
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
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>')
-- 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'impatient'.enable_profile()
require('core.opts')
require('core.highlight')
require('core.binds')

View File

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

View File

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

View File

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

View File

@ -1,2 +1 @@
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 -----------------------------------
local function genmenu()
local list = {}
@ -15,6 +23,8 @@ local function genmenu()
add('update plugins', 'dep')
add('update config', nil)
add('show keybinds', 'telescope')
add('change colorscheme', 'telescope')
add('new plugins', 'telescope')
return list
end
@ -42,6 +52,19 @@ local function configmenu()
if choice == 'show keybinds' then
require('telescope.builtin').keymaps()
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

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