summaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/core/auto.lua4
-rw-r--r--lua/core/maps.lua73
-rw-r--r--lua/core/opts.lua64
-rw-r--r--lua/core/overrides/alpha.lua260
-rw-r--r--lua/core/overrides/cmp.lua28
-rw-r--r--lua/core/overrides/codewindow.lua1
-rw-r--r--lua/core/overrides/hover.lua18
-rw-r--r--lua/core/overrides/init.lua6
-rw-r--r--lua/core/overrides/lualine.lua29
-rw-r--r--lua/core/overrides/modicator.lua27
-rw-r--r--lua/core/overrides/noneckpain.lua6
-rw-r--r--lua/core/overrides/notify.lua14
-rw-r--r--lua/core/overrides/snip.lua9
-rw-r--r--lua/core/overrides/telescope.lua4
-rw-r--r--lua/core/overrides/treesitter.lua3
-rw-r--r--lua/core/overrides/treesittercontext.lua9
-rw-r--r--lua/core/overrides/treesj.lua3
-rw-r--r--lua/core/plugins.lua36
-rw-r--r--lua/core/snippets/c.lua29
-rw-r--r--lua/core/snippets/init.lua35
-rw-r--r--lua/core/snippets/lua.lua14
-rw-r--r--lua/core/snippets/makefile.lua41
22 files changed, 595 insertions, 118 deletions
diff --git a/lua/core/auto.lua b/lua/core/auto.lua
index e68032e..81270bf 100644
--- a/lua/core/auto.lua
+++ b/lua/core/auto.lua
@@ -68,9 +68,7 @@ a.nvim_create_autocmd('FileType', {
-- disable extra tildas in certain files
a.nvim_create_autocmd('FileType', {
- pattern = {
- 'alpha'
- },
+ pattern = '*',
command = 'hi NonText guifg=bg'
})
diff --git a/lua/core/maps.lua b/lua/core/maps.lua
index bd4367e..d616e8f 100644
--- a/lua/core/maps.lua
+++ b/lua/core/maps.lua
@@ -9,17 +9,11 @@ a.nvim_set_keymap("n", "<leader>to", "<C-w>v<C-w>w:term<CR>", opts)
-- esc to go to normal mode in term bufers
a.nvim_set_keymap("t", "<ESC>", "<C-\\><C-n>", opts)
--- open Trouble buffer
-a.nvim_set_keymap("n", "<leader>tt",
- "<cmd>TroubleToggle document_diagnostics<CR>", opts)
-a.nvim_set_keymap("n", "<leader>td", "<cmd>TodoTrouble<CR>", opts)
-
--- dismiss notifications
-a.nvim_set_keymap("n", "<leader>nd", "", { callback = require('notify').dismiss })
-
-- open file viewer
a.nvim_set_keymap("n", "<leader>fo", ":Ex<CR>", opts)
a.nvim_set_keymap("n", "<leader>fs", ":Sex<CR>", opts)
+a.nvim_set_keymap("n", "<leader>fh", ":Hex<CR>", opts)
+a.nvim_set_keymap("n", "<leader>fv", ":Vex<CR>", opts)
-- clear search
a.nvim_set_keymap("n", "<ESC>", ":nohlsearch<Bar>:echo<CR>", opts)
@@ -38,6 +32,33 @@ a.nvim_set_keymap("n", "<C-u>", "<C-u>zz", opts)
-- execute order 111
a.nvim_set_keymap("n", "<leader>x", "<cmd>!chmod +x %<CR>", opts)
+-- add some keybinds to the file view
+a.nvim_create_autocmd('FileType', {
+ pattern = 'netrw',
+ callback = function()
+ local bind = function(lhs, rhs)
+ vim.keymap.set('n', lhs, rhs, { remap = true, buffer = true })
+ end
+ bind('h', '-^') -- Go up a directory
+ 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
+ end
+})
+
+-- plugin related binds
+-- better indenting
+a.nvim_set_keymap('i', '<tab>', '<cmd>lua require("intellitab").indent()<CR>', opts)
+
+-- open Trouble buffer
+a.nvim_set_keymap("n", "<leader>tt",
+"<cmd>TroubleToggle document_diagnostics<CR>", opts)
+a.nvim_set_keymap("n", "<leader>td", "<cmd>TodoTrouble<CR>", opts)
+
+-- dismiss notifications
+a.nvim_set_keymap("n", "<leader>nd", "", { callback = require('notify').dismiss })
+
-- resizing splits
a.nvim_set_keymap("n", '<C-h>', "<cmd>SmartResizeLeft<CR>", opts)
a.nvim_set_keymap("n", '<C-j>', "<cmd>SmartResizeDown<CR>", opts)
@@ -58,24 +79,28 @@ a.nvim_set_keymap('n', '<leader>su', '<cmd>Telescope undo<CR>', opts)
a.nvim_set_keymap('n', '<leader>sd', '<cmd>Telescope diagnostics<CR>', opts)
a.nvim_set_keymap('n', '<leader>sn', '<cmd>Telescope notify<CR>', opts)
--- resource snippets
+-- treesitter
+a.nvim_set_keymap('n', '<leader>j', '<cmd>TSJToggle<CR>', opts)
+
+-- re-source snippets
a.nvim_set_keymap('n', '<leader><leader>s', '<cmd>source ~/.config/nvim/lua/core/snippets/init.lua<CR>', opts)
--- auto comand keybinds
--- add some keybinds to the file view
-a.nvim_create_autocmd('FileType', {
- pattern = 'netrw',
- callback = function()
- local bind = function(lhs, rhs)
- vim.keymap.set('n', lhs, rhs, {remap = true, buffer = true})
- end
- bind('h', '-^') -- Go up a directory
- 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
- end
-})
+-- hover
+vim.keymap.set('n', '<S-tab>', require("hover").hover_select, opts)
+
+-- lsp diagnostics float
+a.nvim_set_keymap('n', '<tab>', '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
+
+-- essentials
+a.nvim_set_keymap('n', '<leader>eu', '<cmd>lua require("essentials").go_to_url()<CR>', opts)
+a.nvim_set_keymap('n', '<leader>ec', '<cmd>lua require("essentials").cheat_sh()<CR>', opts)
+
+-- return to home screen
+a.nvim_set_keymap('n', '<leader>gh', '<cmd>Alpha<CR>', opts)
+
+-- highlighting
+a.nvim_set_keymap("v", "<leader>ha", ":<c-u>HSHighlight 1<CR>", opts)
+a.nvim_set_keymap("v", "<leader>hc", ":<c-u>HSRmHighlight<CR>", opts)
-- vbox note taking
function _G.Toggle_venn()
diff --git a/lua/core/opts.lua b/lua/core/opts.lua
index d08bc0c..38ba762 100644
--- a/lua/core/opts.lua
+++ b/lua/core/opts.lua
@@ -1,10 +1,3 @@
-o = vim.opt
-g = vim.g
-a = vim.api
-cmd = vim.cmd
-
-g.mapleader = " "
-
---------------
-- better ui --
---------------
@@ -33,18 +26,18 @@ o.tabstop = 2
o.shiftwidth = 2
o.softtabstop = -1 -- If negative, shiftwidth value is used
+-- spelling
+o.spelllang = { 'en_us' }
+
-- colors
o.termguicolors = true
cmd('colorscheme jellybeans-nvim')
--- diagnostics
-vim.lsp.handlers["textDocument/publishDiagnostics"] =
- vim.lsp.with(
- vim.lsp.diagnostic.on_publish_diagnostics,
- {
- virtual_text = { prefix = '*' },
- }
-)
+-- diagnostics w/o virtual text
+vim.diagnostic.config({
+ underline = true,
+ virtual_text = false
+})
colors = {
black = '#000000',
@@ -62,6 +55,34 @@ colors = {
purple = '#C678DD',
}
+lspicons = {
+ Text = 'Tx',
+ Snippet = '<>',
+ Method = ' ',
+ Function = '{}',
+ Constructor = ' ',
+ Field = '""',
+ Variable = 'x=',
+ Class = '~{',
+ Interface = '.h',
+ Module = ' ',
+ Property = '@p',
+ Unit = ' ',
+ Value = ' ',
+ Enum = 'E#',
+ Keyword = '$1',
+ Color = ' ',
+ File = '#`',
+ Reference = ' ',
+ Folder = '[/',
+ EnumMember = ' ',
+ Constant = ' ',
+ Struct = ' ',
+ Event = ' ',
+ Operator = '%*',
+ TypeParameter = ' ',
+}
+
-- width line
o.colorcolumn = { 80 }
@@ -104,9 +125,18 @@ g.netrw_localcopydircmd = 'cp -r'
g.netrw_winsize = 30
g.netrw_liststyle = 1
+-----------------------
+-- language settings --
+-----------------------
+g.c_syntax_for_h = true -- treat c header files as c files instead of c++ files
+
----------------
-- highlights --
----------------
+-- transparent background
+-- a.nvim_set_hl(0, "Normal", { bg = "" })
+
+--
a.nvim_set_hl(0, "ColorColumn", { bg = colors.grey }) -- color column
a.nvim_set_hl(0, "Pmenu", { bg = colors.black2 })
a.nvim_set_hl(0, "PmenuSel", { bg = colors.grey2 })
@@ -151,8 +181,8 @@ a.nvim_set_hl(0, "CmpItemKindProperty", { bg = "#4FBF63", bold = true })
a.nvim_set_hl(0, "CmpItemKindInterface", { bg = "#1e90ff", bold = true })
a.nvim_set_hl(0, "CmpItemKindClass", { bg = "#4D4C5C", bold = true })
a.nvim_set_hl(0, "CmpItemKindFile", { bg = "#E8D01C", bold = true })
-
-a.nvim_set_hl(0, "TreesitterContext", { bg = colors.grey })
+a.nvim_set_hl(0, "CmpItemKindFolder", { bg = "#E8D01C", bold = true })
+a.nvim_set_hl(0, "CmpItemKindOperator", { bg = "#E06C75", bold = true })
-- telescope
a.nvim_set_hl(0, "TelescopeMatching", { bg = colors.black3 })
diff --git a/lua/core/overrides/alpha.lua b/lua/core/overrides/alpha.lua
new file mode 100644
index 0000000..373eeff
--- /dev/null
+++ b/lua/core/overrides/alpha.lua
@@ -0,0 +1,260 @@
+local present, alpha = pcall(require, "alpha")
+if not present then
+ return
+end
+
+local pepe = {
+ {
+ [[⠄⠄⠄⠄⠄⠄⠄⢀⣠⣶⣾⣿⣶⣦⣤⣀⠄⢀⣀⣤⣤⣤⣤⣄⠄⠄⠄⠄⠄⠄]],
+ [[⠄⠄⠄⠄⠄⢀⣴⣿⣿⣿⡿⠿⠿⠿⠿⢿⣷⡹⣿⣿⣿⣿⣿⣿⣷⠄⠄⠄⠄⠄]],
+ [[⠄⠄⠄⠄⠄⣾⣿⣿⣿⣯⣵⣾⣿⣿⡶⠦⠭⢁⠩⢭⣭⣵⣶⣶⡬⣄⣀⡀⠄⠄]],
+ [[⠄⠄⠄⡀⠘⠻⣿⣿⣿⣿⡿⠟⠩⠶⠚⠻⠟⠳⢶⣮⢫⣥⠶⠒⠒⠒⠒⠆⠐⠒]],
+ [[⠄⢠⣾⢇⣿⣿⣶⣦⢠⠰⡕⢤⠆⠄⠰⢠⢠⠄⠰⢠⠠⠄⡀⠄⢊⢯⠄⡅⠂⠄]],
+ [[⢠⣿⣿⣿⣿⣿⣿⣿⣏⠘⢼⠬⠆⠄⢘⠨⢐⠄⢘⠈⣼⡄⠄⠄⡢⡲⠄⠂⠠⠄]],
+ [[⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣥⣀⡁⠄⠘⠘⠘⢀⣠⣾⣿⢿⣦⣁⠙⠃⠄⠃⠐⣀]],
+ [[⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣋⣵⣾⣿⣿⣿⣿⣦⣀⣶⣾⣿⣿⡉⠉⠉]],
+ [[⣿⣿⣿⣿⣿⣿⣿⠟⣫⣥⣬⣭⣛⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡆⠄]],
+ [[⣿⣿⣿⣿⣿⣿⣿⠸⣿⣏⣙⠿⣿⣿⣶⣦⣍⣙⠿⠿⠿⠿⠿⠿⠿⠿⣛⣩⣶⠄]],
+ [[⣛⣛⣛⠿⠿⣿⣿⣿⣮⣙⠿⢿⣶⣶⣭⣭⣛⣛⣛⣛⠛⠛⠻⣛⣛⣛⣛⣋⠁⢀]],
+ [[⣿⣿⣿⣿⣿⣶⣬⢙⡻⠿⠿⣷⣤⣝⣛⣛⣛⣛⣛⣛⣛⣛⠛⠛⣛⣛⠛⣡⣴⣿]],
+ [[⣛⣛⠛⠛⠛⣛⡑⡿⢻⢻⠲⢆⢹⣿⣿⣿⣿⣿⣿⠿⠿⠟⡴⢻⢋⠻⣟⠈⠿⠿]],
+ [[⣿⡿⡿⣿⢷⢤⠄⡔⡘⣃⢃⢰⡦⡤⡤⢤⢤⢤⠒⠞⠳⢸⠃⡆⢸⠄⠟⠸⠛⢿]],
+ [[⡟⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢸]],
+ },
+ {
+ [[⠄⠄⠄⠄⠄⠄⠄⠄⠄⣾⣿⣿⣿⣿⡄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄]],
+ [[⠄⠄⠄⠄⠄⠄⠄⠄⣼⣿⣿⣿⣿⣿⣿⣧⠄⠄⠄⠄⠄⣀⣀⠄⠄⠄⠄⠄⠄⠄]],
+ [[⠄⠄⠄⠄⠄⠄⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣧⠄⠄⠄⣾⠛⠛⣷⢀⣾⠟⠻⣦⠄]],
+ [[⠄⠄⠄⠄⠄⠄⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀⠄⠄⢰⡿⠋⠄⠄⣠⡾⠋⠄]],
+ [[⠄⠄⠄⠄⠄⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄⠄⣬⡄⠄⠄⠄⣭⡅⠄⠄]],
+ [[⠄⠄⠄⠄⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡆⠄⠄⠄⠄⠄⠄⠄⠄⠄]],
+ [[⠄⠄⠄⠄⢛⣛⣛⣛⣛⣛⣛⣛⣛⡛⢋⣉⣭⣭⣥⣬⣤⣤⣀⠄⠄⠄⠄⠄⠄⠄]],
+ [[⠄⠄⣴⣵⣿⣟⡉⣥⣶⣶⠶⠶⠬⣉⡂⠹⣟⡫⠽⠟⢒⣒⠒⠆⠄⠄⠄⠄⠄⠄]],
+ [[⠄⣼⣿⣿⣿⣿⣿⣶⣭⣃⡈⠄⠄⠘⠃⡰⢶⣶⣿⠏⠄⠄⠙⡛⠄⠄⠄⠄⠄⠄]],
+ [[⢰⣿⣿⣿⣿⣿⣿⣿⣯⣉⣉⣩⣭⣶⣿⡿⠶⠶⠶⠶⠶⠾⣋⠄⠄⠄⠄⠄⠄⠄]],
+ [[⢾⣿⣿⣿⣿⣿⣿⣿⢩⣶⣒⠒⠶⢖⣒⣚⡛⠭⠭⠭⠍⠉⠁⠄⠄⠄⣀⣀⡀⠄]],
+ [[⠘⢿⣿⣿⣿⣿⣿⣿⣧⣬⣭⣭⣭⣤⡤⠤⠶⠟⣋⣀⣀⡀⢀⣤⣾⠟⠋⠈⢳⠄]],
+ [[⣴⣦⡒⠬⠭⣭⣭⣭⣙⣛⠋⠭⡍⠁⠈⠙⠛⠛⠛⠛⢻⠛⠉⢻⠁⠄⠄⠄⢸⡀]],
+ [[⣿⣿⣿⣿⣷⣦⣤⠤⢬⢍⣼⣦⡾⠛⠄⠄⠄⠄⠄⠄⠈⡇⠄⢸⠄⠄⠄⢦⣄⣇]],
+ [[⣿⣿⡿⣋⣭⣭⣶⣿⣶⣿⣿⣿⠟⠛⠃⠄⠄⠄⠄⠄⢠⠃⠄⡜⠄⠄⠄⠔⣿⣿]],
+ },
+ {
+ [[⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠔⠊⠉⠉⠉⠉⠉⠐⢦⡄⠄⠄⠄⠄⠄⠄⠄⠄]],
+ [[⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡐⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠘⣆⠄⠄⠄⠄⠄⠄⠄]],
+ [[⠄⠄⠄⠄⠄⠄⠄⠄⢀⠖⠁⢀⣾⣆⡰⠶⡷⠶⣀⣾⣄⠄⠈⣆⠄⠄⠄⠄⠄⠄]],
+ [[⠄⠄⡄⠄⠠⢤⣤⠔⠃⠄⠄⠄⠄⠘⢧⣤⢣⣤⠋⠄⠄⠄⠄⠈⠣⢤⡠⠄⠄⠄]],
+ [[⠄⠄⠘⠦⡀⠄⠄⠄⠄⠄⠄⠄⢻⡟⠻⣿⣿⡿⠻⡟⠃⠄⠄⠄⠄⠄⠄⠄⡀⠞]],
+ [[⠄⠄⠄⠄⠉⢢⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⡠⠊⠄⠄]],
+ [[⠄⠄⠄⠄⠄⠄⠈⠢⣤⣤⣴⣶⡶⢶⣶⣶⣶⣆⢒⣤⣤⠄⢠⠤⠤⠚⠄⠄⠄⠄]],
+ [[⠄⠄⠄⠄⠄⢀⣠⣾⣿⣿⣿⣿⣎⢻⣿⠁⡀⣿⡎⣿⣿⣀⣃⠧⡀⠄⠄⠄⠄⠄]],
+ [[⠄⠄⣠⣶⣾⣿⣿⣿⣿⣿⣿⣿⡹⡼⢿⣠⠵⠿⣑⢿⣟⣛⠤⣩⡁⠄⠄⠄⠄⠄]],
+ [[⢠⣿⣿⣿⢏⡜⡻⣷⡽⣿⣷⣭⣿⣮⣽⣯⣽⣿⣿⣷⣤⣾⡿⠟⠃⠄⠄⠄⠄⠄]],
+ [[⠻⣿⣿⣿⣌⢷⣙⠾⠯⣒⡿⠭⣝⣛⣛⣛⣛⠛⠭⠭⠟⢣⠌⠄⠄⠄⠄⠄⠄⠄]],
+ [[⠄⠻⣿⣿⣿⣮⣟⠷⣦⣤⣝⣛⠲⠶⠶⠒⢂⣀⠠⠄⠐⠁⠄⠄⠄⠄⠄⠄⠄⠄]],
+ [[⠄⠄⠄⠙⠿⠿⢿⣿⡷⠶⠭⠭⠭⠵⠶⠒⠋⠉⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄]],
+ },
+ {
+ [[⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]],
+ [[⣿⣿⣿⣿⣿⣿⣿⠛⢩⣴⣶⣶⣶⣌⠙⠫⠛⢋⣭⣤⣤⣤⣤⡙⣿⣿⣿⣿⣿⣿]],
+ [[⣿⣿⣿⣿⣿⡟⢡⣾⣿⠿⣛⣛⣛⣛⣛⡳⠆⢻⣿⣿⣿⠿⠿⠷⡌⠻⣿⣿⣿⣿]],
+ [[⣿⣿⣿⣿⠏⣰⣿⣿⣴⣿⣿⣿⡿⠟⠛⠛⠒⠄⢶⣶⣶⣾⡿⠶⠒⠲⠌⢻⣿⣿]],
+ [[⣿⣿⠏⣡⢨⣝⡻⠿⣿⢛⣩⡵⠞⡫⠭⠭⣭⠭⠤⠈⠭⠒⣒⠩⠭⠭⣍⠒⠈⠛]],
+ [[⡿⢁⣾⣿⣸⣿⣿⣷⣬⡉⠁⠄⠁⠄⠄⠄⠄⠄⠄⠄⣶⠄⠄⠄⠄⠄⠄⠄⠄⢀]],
+ [[⢡⣾⣿⣿⣿⣿⣿⣿⣿⣧⡀⠄⠄⠄⠄⠄⠄⠄⢀⣠⣿⣦⣤⣀⣀⣀⣀⠄⣤⣾]],
+ [[⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣶⡶⢇⣰⣿⣿⣟⠿⠿⠿⠿⠟⠁⣾⣿⣿]],
+ [[⣿⣿⣿⣿⣿⣿⣿⡟⢛⡛⠿⠿⣿⣧⣶⣶⣿⣿⣿⣿⣿⣷⣼⣿⣿⣿⣧⠸⣿⣿]],
+ [[⠘⢿⣿⣿⣿⣿⣿⡇⢿⡿⠿⠦⣤⣈⣙⡛⠿⠿⠿⣿⣿⣿⣿⠿⠿⠟⠛⡀⢻⣿]],
+ [[⠄⠄⠉⠻⢿⣿⣿⣷⣬⣙⠳⠶⢶⣤⣍⣙⡛⠓⠒⠶⠶⠶⠶⠖⢒⣛⣛⠁⣾⣿]],
+ [[⠄⠄⠄⠄⠄⠈⠛⠛⠿⠿⣿⣷⣤⣤⣈⣉⣛⣛⣛⡛⠛⠛⠿⠿⠿⠟⢋⣼⣿⣿]],
+ [[⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠈⠉⠉⣻⣿⣿⣿⣿⡿⠿⠛⠃⠄⠙⠛⠿⢿⣿]],
+ [[⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢬⣭⣭⡶⠖⣢⣦⣀⠄⠄⠄⠄⢀⣤⣾⣿]],
+ [[⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢰⣶⣶⣶⣾⣿⣿⣿⣿⣷⡄⠄⢠⣾⣿⣿⣿]],
+ },
+}
+
+-- dynamic header padding
+local fn = vim.fn
+local marginTopPercent = 0.2
+local Padding = fn.max { 2, fn.floor(fn.winheight(0) * marginTopPercent) }
+
+local header = {
+ type = "text",
+ val = pepe[math.random(#pepe)],
+ opts = {
+ position = "center",
+ hl = "AlphaAscii",
+ },
+}
+
+local plugins = require('lazy').stats().count
+local date = os.date("%d/%m/%y(%a)%X")
+
+math.randomseed(os.time())
+local id = math.random(10000000, 99999999)
+local id1 = math.random(10000000, 99999999)
+local id2 = math.random(10000000, 99999999)
+
+local chan = {
+ [[based!!!]],
+ [[in other words, 4chan is better because
+ everyone gets to be an idiot.]],
+ [[NOOOOOOO YOU CAN’T PUBLISH BENCHMARKS FOR
+ OUR ANCIENT OS]],
+ [[This is the beginning of the end. AI has
+ finally won. Tech is no longer a viable job.]],
+ [[And Wikipedia is bloat because of html,
+ mathml, rich text, etc. Using modern codecs
+ and a simpler form of wiki we could store
+ the entire "human knowledge-base" and plain
+ text references (books, papers, articles,
+ websites) inside a single μSD card]],
+ [[My arch install broke again]],
+ [[Why are stdout, stderr and stdin already
+ opened when I start my program? Who opened
+ them and what is he doing in my computer?]],
+ [[YES BOYCOTT!
+ SPREAD THIS MESSAGE
+ EVERYONE QUIT USING THE SITE, THEY CANNOT
+ IGNORE US ANYMORE. FROM THIS DAY ONWARDS
+ THEIR PRODUCT WILL NOT BE ABLE TO HOLD UP
+ WITHOUT US]],
+ [[COMPANY A BETTER THAN COMPANY B]],
+ [[Nah, ignore this anon. If you want to
+ REALLY learn programming, you need to
+ learn with punch cards. Once you've
+ got that under your belt, move on
+ up to assembly.]],
+}
+local phrase = chan[math.random(#chan)]
+
+local heading = {
+ type = "text",
+ val = "  Anonymous " .. date .. " No." .. id .. " ",
+ opts = {
+ position = "center",
+ hl = "AlphaButtons",
+ },
+}
+
+local post_buttons = {
+ type = "text",
+ val = "They don't get it. For me, it's nvim. ",
+ opts = {
+ position = "center",
+ hl = "AlphaFooter",
+ },
+}
+
+local pre_foot = {
+ type = "text",
+ val = ">>" .. id2 .. "(OP) ",
+ opts = {
+ position = "center",
+ hl = "AlphaEmphasis",
+ },
+}
+
+local footer = {
+ type = "text",
+ val = " I've " .. plugins .. " plugins, it launches instantly kek.",
+ opts = {
+ position = "center",
+ hl = "AlphaFooter",
+ },
+}
+
+local pre_foot_2 = {
+ type = "text",
+ val = ">>" .. id1 .. " ",
+ opts = {
+ position = "center",
+ hl = "AlphaEmphasis",
+ },
+}
+
+local footer_2 = {
+ type = "text",
+ val = " " .. phrase,
+ opts = {
+ position = "left",
+ hl = "AlphaFooter",
+ },
+}
+
+local function button(sc, txt, keybind)
+ local sc_ = sc:gsub("%s", ""):gsub("SPC", "<leader>")
+
+ local opts = {
+ position = "center",
+ text = txt,
+ shortcut = sc,
+ cursor = 0,
+ width = 44,
+ align_shortcut = "right",
+ hl_shortcut = "AlphaShortcuts",
+ hl = "AlphaHeader",
+ }
+ if keybind then
+ opts.keymap = { "n", sc_, keybind, { noremap = true, silent = true } }
+ end
+
+ return {
+ type = "button",
+ val = txt,
+ on_press = function()
+ local key = vim.api.nvim_replace_termcodes(sc_, true, false, true)
+ vim.api.nvim_feedkeys(key, "normal", false)
+ end,
+ opts = opts,
+ }
+end
+
+local buttons = {
+ type = "group",
+ val = {
+ button("LDR e", " >open new file", ":ene<CR>"),
+ button("LDR h", " >open oldfiles", ":Telescope oldfiles<CR>"),
+ button("LDR f", " >fuzzy search", ":Telescope find_files<CR>"),
+ button("LDR y", " >browse folders" , ":Telescope file_browser path=%:p:h<CR>"),
+ button("LDR /", " >regex search", ":Telescope live_grep<CR>"),
+ button("LDR u", " >update plugins", ":lua require('lazy').update()<CR>"),
+ },
+ opts = {
+ spacing = 0,
+ },
+}
+
+local section = {
+ header = header,
+ buttons = buttons,
+ heading = heading,
+ post_buttons = post_buttons,
+ pre_foot = pre_foot,
+ footer = footer,
+ pre_foot_2 = pre_foot_2,
+ footer_2 = footer_2,
+}
+
+local opts = {
+ layout = {
+ { type = "padding", val = Padding},
+ { type = "padding", val = 1 },
+ section.header,
+ { type = "padding", val = 1 },
+ section.heading,
+ { type = "padding", val = 1 },
+ section.buttons,
+ section.post_buttons,
+ { type = "padding", val = 1 },
+ section.pre_foot,
+ section.footer,
+ { type = "padding", val = 1 },
+ section.pre_foot_2,
+ section.footer_2,
+ { type = "padding", val = Padding },
+ },
+ opts = {
+ margin = 50,
+ },
+}
+alpha.setup(opts)
diff --git a/lua/core/overrides/cmp.lua b/lua/core/overrides/cmp.lua
index c904d1e..5fbb2a5 100644
--- a/lua/core/overrides/cmp.lua
+++ b/lua/core/overrides/cmp.lua
@@ -34,33 +34,7 @@ cmp.setup {
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
- local kind_icons = {
- Text = 'Tx',
- Snippet = '<>',
- Method = ' ',
- Function = '{}',
- Constructor = ' ',
- Field = '""',
- Variable = 'x=',
- Class = '~{',
- Interface = '.h',
- Module = ' ',
- Property = '@p',
- Unit = ' ',
- Value = ' ',
- Enum = 'E#',
- Keyword = '$1',
- Color = ' ',
- File = '#`',
- Reference = ' ',
- Folder = ' ',
- EnumMember = ' ',
- Constant = ' ',
- Struct = ' ',
- Event = ' ',
- Operator = ' ',
- TypeParameter = ' ',
- }
+ local kind_icons = lspicons
local menu_items = {
buffer = "buffer",
nvim_lsp = "LSP",
diff --git a/lua/core/overrides/codewindow.lua b/lua/core/overrides/codewindow.lua
index c5f7195..9703143 100644
--- a/lua/core/overrides/codewindow.lua
+++ b/lua/core/overrides/codewindow.lua
@@ -12,6 +12,7 @@ codewindow.setup({
"vim",
"Trouble",
"alpha",
+ "NvimTree",
},
})
codewindow.apply_default_keybinds()
diff --git a/lua/core/overrides/hover.lua b/lua/core/overrides/hover.lua
new file mode 100644
index 0000000..9e8a684
--- /dev/null
+++ b/lua/core/overrides/hover.lua
@@ -0,0 +1,18 @@
+require("hover").setup {
+ init = function()
+ -- Require providers
+ require("hover.providers.lsp")
+ -- require('hover.providers.gh')
+ -- require('hover.providers.gh_user')
+ -- require('hover.providers.jira')
+ require('hover.providers.man')
+ require('hover.providers.dictionary')
+ end,
+ preview_opts = {
+ border = 'single'
+ },
+ -- Whether the contents of a currently open hover window should be moved
+ -- to a :h preview-window when pressing the hover keymap.
+ preview_window = true,
+ title = true
+}
diff --git a/lua/core/overrides/init.lua b/lua/core/overrides/init.lua
index 4492f93..23e02cf 100644
--- a/lua/core/overrides/init.lua
+++ b/lua/core/overrides/init.lua
@@ -8,15 +8,15 @@ require('core.overrides.whichkey')
require('core.overrides.neoclip')
require('core.overrides.smartsplits')
require('core.overrides.treesitter')
-require('core.overrides.treesittercontext')
+require('core.overrides.treesj')
require('core.overrides.colorizer')
require('core.overrides.trouble')
require('core.overrides.lspzero')
require('core.overrides.cmp')
-require('core.overrides.luasnip')
+require('core.overrides.snip')
require('core.overrides.lspkind')
require('core.overrides.cmpluasnipchoice')
require('core.overrides.noneckpain')
require('core.overrides.alpha')
require('core.overrides.notify')
-require('core.overrides.nvim-lsp-notify')
+require('core.overrides.hover')
diff --git a/lua/core/overrides/lualine.lua b/lua/core/overrides/lualine.lua
index 597c3fe..19162eb 100644
--- a/lua/core/overrides/lualine.lua
+++ b/lua/core/overrides/lualine.lua
@@ -68,6 +68,10 @@ local function diff_source()
end
end
+local function maximize_status()
+ return vim.t.maximized and '[M]' or '[]='
+end
+
require('lualine').setup {
options = {
icons_enabled = false,
@@ -85,20 +89,20 @@ require('lualine').setup {
always_divide_middle = false,
globalstatus = true,
refresh = {
- statusline = 100,
+ statusline = 500,
tabline = 1000,
winbar = 1000,
}
},
sections = {
- lualine_a = {'mode'},
- lualine_b = {
+ lualine_a = {
+ { 'mode' },
{ 'filetype',
color = { fg = colors.white, bg = colors.grey },
},
{ 'filename',
filestatus = true,
- path = 1,
+ path = 0,
symbols = {
modified = '[+]',
@@ -108,18 +112,21 @@ require('lualine').setup {
}
}
},
- lualine_c = { { 'diff', source = diff_source } },
+ lualine_b = {},
+ lualine_c = {
+ { 'diff',
+ source = diff_source,
+ },
+ },
lualine_x = {
{ 'fileformat',
color = { gui = 'bold' }
}
},
- lualine_y = {'progress'},
- lualine_z = {
- { 'location',
- padding = 1,
- }
- }
+ lualine_y = {
+ { maximize_status },
+ },
+ lualine_z = { 'progress' }
},
inactive_sections = {
lualine_x = {'location'},
diff --git a/lua/core/overrides/modicator.lua b/lua/core/overrides/modicator.lua
index 5cc6925..dc978de 100644
--- a/lua/core/overrides/modicator.lua
+++ b/lua/core/overrides/modicator.lua
@@ -1,15 +1,18 @@
-require('modicator').setup {
+require('modicator').setup({
show_warnings = true,
highlights = {
+ defaults = {
+ bold = true,
+ },
modes = {
- ['i'] = colors.green,
- ['v'] = colors.purple,
- ['V'] = colors.purple,
- ['�'] = colors.purple,
- ['s'] = colors.yellow,
- ['S'] = colors.yellow,
- ['R'] = colors.orange,
- ['c'] = colors.red,
- }
- }
-}
+ ['i'] = { foreground = colors.green, },
+ ['v'] = { foreground = colors.purple, },
+ ['V'] = { foreground = colors.purple, },
+ [''] = { foreground = colors.purple, },
+ ['s'] = { foreground = colors.purple, },
+ ['S'] = { foreground = colors.yellow, },
+ ['R'] = { foreground = colors.orange, },
+ ['c'] = { foreground = colors.red, },
+ },
+ },
+})
diff --git a/lua/core/overrides/noneckpain.lua b/lua/core/overrides/noneckpain.lua
new file mode 100644
index 0000000..2944208
--- /dev/null
+++ b/lua/core/overrides/noneckpain.lua
@@ -0,0 +1,6 @@
+require('no-neck-pain').setup({
+ width = 120,
+ buffers = {
+ blend = -1,
+ },
+})
diff --git a/lua/core/overrides/notify.lua b/lua/core/overrides/notify.lua
new file mode 100644
index 0000000..f816d86
--- /dev/null
+++ b/lua/core/overrides/notify.lua
@@ -0,0 +1,14 @@
+require('notify').setup(
+ {
+ icons = {
+ DEBUG = "B",
+ ERROR = "x",
+ INFO = "i",
+ TRACE = "t",
+ WARN = "!"
+ },
+ minimum_width = 35,
+ max_width = 80,
+ render = "compact",
+ }
+)
diff --git a/lua/core/overrides/snip.lua b/lua/core/overrides/snip.lua
new file mode 100644
index 0000000..c11236e
--- /dev/null
+++ b/lua/core/overrides/snip.lua
@@ -0,0 +1,9 @@
+local ls = require('luasnip')
+
+ls.config.set_config {
+ -- return back into snippet
+ history = true,
+
+ -- update on text insert
+ updateevents = "TextChanged,TextChangedI"
+}
diff --git a/lua/core/overrides/telescope.lua b/lua/core/overrides/telescope.lua
index f1745f6..54a105f 100644
--- a/lua/core/overrides/telescope.lua
+++ b/lua/core/overrides/telescope.lua
@@ -1,8 +1,6 @@
local telescope = require('telescope')
local actions = require('telescope.actions')
-telescope.load_extension('undo')
-telescope.load_extension('file_browser')
telescope.setup {
defaults = {
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
@@ -27,6 +25,8 @@ telescope.setup {
},
}
}
+telescope.load_extension('undo')
+telescope.load_extension('file_browser')
a.nvim_create_autocmd('User', {
pattern = 'TelescopePreviewerLoaded',
diff --git a/lua/core/overrides/treesitter.lua b/lua/core/overrides/treesitter.lua
index a4d2dfe..e74af0d 100644
--- a/lua/core/overrides/treesitter.lua
+++ b/lua/core/overrides/treesitter.lua
@@ -1,5 +1,6 @@
require('nvim-treesitter.configs').setup {
- ensure_installed = { 'help',
+ ensure_installed = {
+ 'help',
'c',
'lua',
'norg',
diff --git a/lua/core/overrides/treesittercontext.lua b/lua/core/overrides/treesittercontext.lua
deleted file mode 100644
index 8a60704..0000000
--- a/lua/core/overrides/treesittercontext.lua
+++ /dev/null
@@ -1,9 +0,0 @@
-require('treesitter-context').setup {
- enable = true,
- max_lines = 1,
- patterns = {
- default = {
- 'function',
- },
- },
-}
diff --git a/lua/core/overrides/treesj.lua b/lua/core/overrides/treesj.lua
new file mode 100644
index 0000000..dc618de
--- /dev/null
+++ b/lua/core/overrides/treesj.lua
@@ -0,0 +1,3 @@
+require('treesj').setup({
+ use_default_keymaps = false,
+})
diff --git a/lua/core/plugins.lua b/lua/core/plugins.lua
index bcdab7d..b1c4b4c 100644
--- a/lua/core/plugins.lua
+++ b/lua/core/plugins.lua
@@ -9,8 +9,9 @@ if not vim.loop.fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)
-require('lazy').setup({
- { 'rcarriga/nvim-notify' },
+require('lazy').setup{
+ { 'notjedi/nvim-rooter.lua', config = true },
+ { 'tamton-aquib/essentials.nvim' },
-- only the most useless plugins (some of these are also ui related)
{ 'goolord/alpha-nvim' },
@@ -19,6 +20,7 @@ require('lazy').setup({
{ 'kwakzalver/duckytype.nvim', config = true }, -- like monkey type
{ 'melkster/modicator.nvim' },
{ 'nyngwang/murmur.lua', config = true },
+ { 'potamides/pantran.nvim' },
--
-- colorscheme / ui
@@ -28,6 +30,13 @@ require('lazy').setup({
priority = 1000,
},
{ 'nvim-lualine/lualine.nvim' },
+ { 'utilyre/barbecue.nvim',
+ version = '*',
+ dependencies = {
+ 'SmiteshP/nvim-navic',
+ },
+ config = true,
+ },
{ 'lukas-reineke/indent-blankline.nvim' },
{ 'lewis6991/gitsigns.nvim', config = true, },
{ 'chentoast/marks.nvim', config = true, },
@@ -35,9 +44,11 @@ require('lazy').setup({
{ 'mrjones2014/smart-splits.nvim',
dependencies = { 'kwkarlwang/bufresize.nvim', config = true, },
},
+ { 'rcarriga/nvim-notify' },
+ { 'declancm/maximize.nvim', config = true, },
--
- -- careful the following plugins might be considered useful procede with caution
+ -- careful the following plugins might be considered useful proceed with caution
-- muh fzf
{ 'nvim-telescope/telescope.nvim',
version = '0.1.*',
@@ -45,16 +56,19 @@ require('lazy').setup({
'nvim-telescope/telescope-file-browser.nvim',
'nvim-lua/plenary.nvim',
'debugloop/telescope-undo.nvim',
- 'AckslD/nvim-neoclip.lua'
+ 'AckslD/nvim-neoclip.lua',
}
},
--
+ -- movement
+ { 'pta2002/intellitab.nvim' },
+ --
+
-- debugging
{ 'numToStr/Comment.nvim', config = true, },
{ 'folke/trouble.nvim' },
{ 'folke/todo-comments.nvim', config = true, },
- { 'andrewferrier/debugprint.nvim', config = true },
--
-- notes
@@ -63,17 +77,22 @@ require('lazy').setup({
version = '*',
ft = 'norg',
build = ':Neorg sync-parsers',
- dependencies = 'nvim-lua/plenary.nvim',
},
{ 'shortcuts/no-neck-pain.nvim',
version = '*',
},
+ { 'ellisonleao/glow.nvim' },
+ { 'Pocco81/high-str.nvim' },
--
-- cmp, lsp and syntax
{ 'nvim-treesitter/nvim-treesitter',
- dependencies = 'nvim-treesitter/nvim-treesitter-context'
+ dependencies = {
+ { 'm-demare/hlargs.nvim', config = true },
+ 'Wansmer/treesj',
+ }
},
+ { 'lewis6991/hover.nvim' },
{ 'nvchad/nvim-colorizer.lua' },
{ 'VonHeikemen/lsp-zero.nvim' },
{ 'hrsh7th/nvim-cmp',
@@ -86,7 +105,6 @@ require('lazy').setup({
'hrsh7th/cmp-nvim-lsp',
'lukas-reineke/cmp-under-comparator',
'onsails/lspkind.nvim',
- 'mrded/nvim-lsp-notify',
},
},
{ 'L3MON4D3/LuaSnip',
@@ -99,4 +117,4 @@ require('lazy').setup({
{ 'williamboman/mason-lspconfig.nvim' },
{ 'windwp/nvim-autopairs', config = true, },
--
-})
+}
diff --git a/lua/core/snippets/c.lua b/lua/core/snippets/c.lua
new file mode 100644
index 0000000..c45f556
--- /dev/null
+++ b/lua/core/snippets/c.lua
@@ -0,0 +1,29 @@
+ls.add_snippets('c', {
+ s('trip', {
+ -- cond ? then : else statment
+ i(1, 'cond'), t(' ? '), i(2, 'then'), t(' : '), i(3, 'else')
+ }),
+ s('stdlibs', {
+ -- cond ? then : else statment
+ t('#include <stdio.h>'),
+ t({'', '#include <stdlib.h>'})
+ }),
+ s('die', {
+ t({
+ 'void die(const char *fmt, ...) {', '',
+ 'va_list ap;',
+ '',
+ 'va_start(ap, fmt);',
+ 'vfprintf(stderr, fmt, ap);',
+ 'va_end(ap);',
+ '',
+ [[if (fmt[0] && fmt[strlen(fmt)-1] == ':') {]],
+ [[ fputc(' ', stderr);]],
+ ' perror(NULL);',
+ '} else',
+ [[ fputc('\n', stderr);]],
+ ' exit(1);',
+ '}',
+ })
+ })
+})
diff --git a/lua/core/snippets/init.lua b/lua/core/snippets/init.lua
new file mode 100644
index 0000000..a7824e2
--- /dev/null
+++ b/lua/core/snippets/init.lua
@@ -0,0 +1,35 @@
+ls = require("luasnip")
+s = ls.snippet
+sn = ls.snippet_node
+isn = ls.indent_snippet_node
+t = ls.text_node
+i = ls.insert_node
+f = ls.function_node
+c = ls.choice_node
+d = ls.dynamic_node
+r = ls.restore_node
+events = require("luasnip.util.events")
+ai = require("luasnip.nodes.absolute_indexer")
+extras = require("luasnip.extras")
+l = extras.lambda
+rep = extras.rep
+p = extras.partial
+m = extras.match
+n = extras.nonempty
+dl = extras.dynamic_lambda
+fmt = require("luasnip.extras.fmt").fmt
+fmta = require("luasnip.extras.fmt").fmta
+conds = require("luasnip.extras.expand_conditions")
+postfix = require("luasnip.extras.postfix").postfix
+types = require("luasnip.util.types")
+parse = require("luasnip.util.parser").parse_snippet
+
+-- Repeat Insernode text
+-- @param insert_node_id The id of the insert node to repeat (the first line from)
+ri = function (insert_node_id)
+ return f(function (args) return args[1][1] end, insert_node_id)
+end
+
+require('core.snippets.c')
+require('core.snippets.makefile')
+require('core.snippets.lua')
diff --git a/lua/core/snippets/lua.lua b/lua/core/snippets/lua.lua
new file mode 100644
index 0000000..c5466ff
--- /dev/null
+++ b/lua/core/snippets/lua.lua
@@ -0,0 +1,14 @@
+ls.add_snippets('lua', {
+ s({
+ name = "local require",
+ trig = "req",
+ dscr = "simple lua require"
+ },
+ fmt("local {} = require('{}')",
+ {
+ i(1, "default"),
+ ri(1),
+ }
+ )
+ )
+})
diff --git a/lua/core/snippets/makefile.lua b/lua/core/snippets/makefile.lua
new file mode 100644
index 0000000..d15ef8d
--- /dev/null
+++ b/lua/core/snippets/makefile.lua
@@ -0,0 +1,41 @@
+ls.add_snippets('make', {
+ s({
+ name = "Start Makefile",
+ trig = "make",
+ dscr = "simple starter make file"
+ },
+ fmta(
+ [[
+ # flags and incs
+ CFLAGS = <FLAGS>
+ INCS = <MAIN>.c
+
+ PREFIX = <PREFIX>
+
+ # compiler and linker
+ CC = cc
+
+ all: <MAINA>
+ <MAINA>: <MAINA>.o
+ $(CC) <MAINA>.o $(CFLAGS) -o $@
+ <MAINA>.o: $(INCS)
+
+ clean:
+ rm -f <MAINA> *.o
+
+ install: <MAINA>
+ mkdir -p $(PREFIX)/bin
+ cp -f <MAINA> $(PREFIX)/bin
+ chmod 755 $(PREFIX)/bin/<MAINA>
+ uninstall: <MAINA>
+ rm -f $(PREFIX)/bin/<MAINA>
+ ]],
+ {
+ FLAGS = i(1, "-Wall"),
+ MAIN = i(2, "main"),
+ PREFIX = i(3, "/usr/local"),
+ MAINA = ri(2),
+ }
+ )
+ ),
+})