new config old version is now on v1 branch

This commit is contained in:
2023-04-30 18:41:13 -04:00
parent 7c5d3eff78
commit 01a09f243c
77 changed files with 1611 additions and 1267 deletions

View File

@ -1,73 +1,48 @@
local function auto(event, opts)
a.nvim_create_autocmd(event, opts)
end
a.nvim_create_augroup('bufcheck', {clear = true})
-- highlight yanks
a.nvim_create_autocmd('TextYankPost', {
group = 'bufcheck',
pattern = '*',
callback = function() vim.highlight.on_yank{timeout = 250} end
})
-- start terminal in insert mode
a.nvim_create_autocmd('TermOpen', {
group = 'bufcheck',
pattern = '*',
command = 'startinsert | set winfixheight'
})
-- close terminal buffers after shell dies
a.nvim_create_autocmd('TermClose', {
auto('TextYankPost', {
group = 'bufcheck',
pattern = 'term://*',
command = 'call nvim_input("<CR>")'
pattern = '*',
callback = function()
vim.highlight.on_yank{ timeout = 250 }
end
})
-- start git messages in insert mode
a.nvim_create_autocmd('FileType', {
group = 'bufcheck',
pattern = { 'gitcommit', 'gitrebase', },
command = 'startinsert | 1'
auto('FileType', {
group = 'bufcheck',
pattern = { 'gitcommit', 'gitrebase', },
command = 'startinsert | 1'
})
-- return to last place
a.nvim_create_autocmd('BufRead', {
auto('BufRead', {
pattern = '*',
command = [[call setpos(".", getpos("'\""))]]
})
-- disable color column in certain files
a.nvim_create_autocmd('FileType', {
pattern = {
'netrw',
"help",
"term",
"gitcommit",
"packer",
"vim",
"Trouble",
"norg",
"alpha"
},
command = 'set colorcolumn=0'
-- start terminal in insert mode
auto('TermOpen', {
group = 'bufcheck',
pattern = '*',
callback = function()
vim.cmd('startinsert | set winfixheight')
o.winfixheight = true
o.cmdheight = 0
end
})
-- disable intent markers in certain files
a.nvim_create_autocmd('FileType', {
pattern = {
'netrw',
"help",
"term",
"gitcommit",
"packer",
"vim",
"Trouble",
"norg",
"alpha"
},
command = 'IndentBlanklineDisable'
})
-- disable extra tildas in certain files
a.nvim_create_autocmd('FileType', {
pattern = '*',
command = 'hi NonText guifg=bg'
-- close terminal buffers after shell dies
auto('TermClose', {
group = 'bufcheck',
pattern = 'term://*',
callback = function()
vim.cmd('call nvim_input("<CR>")')
o.cmdheight = 1
end
})

148
lua/core/binds.lua Normal file
View File

@ -0,0 +1,148 @@
local function map(mode, bind, cmd, opts)
opts = opts or {noremap = true, silent = true}
if type(bind) == 'table' then
for i in pairs(bind) do
vim.keymap.set(mode, bind[i], cmd, opts)
end
elseif type(bind) == 'string' then
vim.keymap.set(mode, bind, cmd, opts)
else
vim.notify('-- Invalid bind for keymap:\nvim.keymap.set(\''
.. mode .. '\', ' .. bind .. ', \'' .. cmd .. '\')',
vim.log.levels.WARN, {
title = 'Neovim Config',
on_open = function(win)
local buf = vim.api.nvim_win_get_buf(win)
vim.api.nvim_buf_set_option(buf, "filetype", "lua")
end
}
)
end
end
-- vim binds ------------------------------------------------------------------
g.mapleader = ' ' -- set leader key
-- greatest remap ever
map('x', '<leader>p', [["_dP]])
-- clear search
map('n', '<ESC>', ':nohlsearch<Bar>:echo<CR>')
-- move selected text up/down
map('v', '<S-k>', ":m '<-2<CR>gv=gv")
map('v', '<S-j>', ":m '>+1<CR>gv=gv")
-- the cursor STAYS IN THE MIDDLE
map('n', '<S-j>', 'mzJ`z<cmd>delm z<CR>') -- when combining lines
map('n', 'n', 'nzzzv') -- searching
map('n', 'N', 'Nzzzv')
map('n', '<C-d>', '<C-d>zz') -- half page jumping
map('n', '<C-u>', '<C-u>zz')
-- execute order 111
map('n', '<leader>x', '<cmd>!chmod +x %<CR>')
-- tabs
--[[ map('n', '<C-i>', '<cmd>tabnew<CR>')
map('n', '<C-o>', '<cmd>tabclose<CR>')
map('n', '<C-u>', '<cmd>tabprevious<CR>')
map('n', '<C-p>', '<cmd>tabnext<CR>')
map('n', '<leader>tL', '<cmd>tabmove +1<CR>')
map('n', '<leader>tH', '<cmd>tabmove -1<CR>') ]]
-- 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
})
-- custom menu for simpler neovim managment -----------------------------------
local function configmenu()
local list = {}
local function add(name, plug)
if not plug then
table.insert(list, name)
return
end
if package.loaded[plug] then
table.insert(list, name)
end
end
add('edit config')
add('update plugins', 'dep')
vim.ui.select(list, { prompt = 'Config Menu' },
function(choice)
if choice == 'edit config' then
vim.cmd'e $XDG_CONFIG_HOME/nvim/init.lua'
end
if choice == 'update plugins' then
require('dep').sync()
if package.loaded['nvim-treesitter'] then
vim.cmd'TSUpdate'
end
if package.loaded['mason'] then
require('mason.api.command').MasonUpdate()
end
end
end)
end
map('n', '<C-m>', configmenu)
-- plugin binds ---------------------------------------------------------------
-- treesj
local treesj = require('treesj')
map('n', '<leader>j', treesj.toggle)
-- telescope
local telebuilt = require('telescope.builtin')
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)
-- intellitab
local intellitab = require('intellitab')
map('n', '<Tab>', intellitab.indent)
-- undo tree
map('n', '<leader>u', '<cmd>UndotreeToggle<CR>')
-- sfm
map('n', '<leader>f', '<cmd>SFMToggle<CR>')
-- dap ui
local dapui = require('dapui')
map('n', '<leader>d', dapui.toggle)
-- switch between previous buffers
map('n', '<leader>b', '<cmd>JABSOpen<CR>')
-- resizing buffers (toggleable)
local smartsplits = require('smart-splits')
map('n', '<leader>r', smartsplits.start_resize_mode)
-- trouble (lsp error view)
map('n', '<leader>t', '<cmd>TroubleToggle<CR>')
-- icon picker
map('n', '<C-e>', '<cmd>IconPickerYank<CR>')
-- toggle term
map('t', '<ESC>', '<C-\\><C-n>') -- make <ESC> work in terminals
map({'n', 't'}, '<C-\\>', '<cmd>ToggleTerm size=20<CR>')
map({'n', 't'}, '<leader>gl', '<cmd>lua _glow()<CR>')

6
lua/core/cmds.lua Normal file
View File

@ -0,0 +1,6 @@
local function cmd(name, exec, opts)
opts = opts or {}
vim.api.nvim_create_user_command(name, exec, opts)
end
cmd('Colorscheme', 'Telescope colorscheme')

7
lua/core/handler.lua Normal file
View File

@ -0,0 +1,7 @@
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')
require('core.auto')
require('core.cmds')

50
lua/core/highlight.lua Normal file
View File

@ -0,0 +1,50 @@
local highlight = function(group, opts, space)
space = space or 0
a.nvim_set_hl(space, group, opts)
end
local c = require('mellow.colors')
-- vim highlights -------------------------------------------------------------
highlight("CursorLineNr", { fg = '#FFFFFF', bold = true })
-- diagnostics
-- highlight('DiagnosticError', { fg = c.cyan })
-- highlight('DiagnosticWarn', { fg = c.red })
-- highlight('DiagnosticInfo', { fg = c.yellow })
-- highlight('DiagnosticHint', { fg = c.blue })
-- highlight('DiagnosticUnderlineError', { fg = c.cyan })
-- highlight('DiagnosticUnderlineWarn', { fg = c.red })
-- highlight('DiagnosticUnderlineInfo', { fg = c.yellow })
-- highlight('DiagnosticUnderlineHint', { fg = c.blue })
-- plugin highlights ----------------------------------------------------------
-- telescope
highlight('TelescopeMatching', { bg = '#1B1B1D' })
highlight('TelescopeNormal', { bg = '#131314' })
highlight('TelescopePreviewBorder', { bg = '#161617' })
highlight('TelescopePreviewNormal', { bg = '#161617' })
highlight('TelescopePreviewTitle', { bg = '#161617', fg = '#161617' })
highlight('TelescopePromptBorder', { bg = '#1B1B1D' })
highlight('TelescopePromptNormal', { bg = '#1B1B1D' })
highlight('TelescopePromptPrefix', { bg = '#1B1B1D' })
highlight('TelescopePromptTitle', { bg = '#1B1B1D'})
highlight('TelescopeResultsBorder', { bg = '#131314' })
highlight('TelescopeResultsNormal', { bg = '#131314' })
highlight('TelescopeResultsTitle', { bg = '#131314', fg = '#131314' })
highlight('TelescopeSelection', { bg = '#161617' })
highlight('TelescopeSelectionCaret', { bg = '#161617', fg = '#F5A191'})
-- indent blankline
highlight('IndentBlanklineIndent1', { bg = '#161617' })
highlight('IndentBlanklineIndent2', { bg = '#121212' })
-- alpha
highlight('AlphaHeader', { fg = '#AAA0CE' })
-- fidget
highlight('FidgetTask', { fg = '#ffffff' })

View File

@ -1,6 +0,0 @@
require('core.plugins')
require('core.opts')
require('core.maps')
require('core.auto')
require("core.snippets.init")
require('core.overrides.init')

View File

@ -1,165 +0,0 @@
local opts = { noremap = true, silent = true }
-- greatest remap ever
a.nvim_set_keymap("n", "<leader>p", "\"_dP", opts)
-- toggle terminal buffer
a.nvim_set_keymap("n", "<C-\\>", "<cmd>ToggleTerm size=20<CR>", opts)
a.nvim_set_keymap("t", "<C-\\>", "<cmd>ToggleTerm<CR>", opts)
-- esc to go to normal mode in term bufers
a.nvim_set_keymap("t", "<ESC>", "<C-\\><C-n>", opts)
-- 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)
-- move selected text
a.nvim_set_keymap("v", "<S-j>", ":m '>+1<CR>gv=gv", opts)
a.nvim_set_keymap("v", "<S-k>", ":m '<-2<CR>gv=gv", opts)
-- keep cursor middle
a.nvim_set_keymap("n", "<S-j>", "mzJ`z", opts) -- when combining lines
a.nvim_set_keymap("n", "n", "nzzzv", opts) -- searching
a.nvim_set_keymap("n", "N", "Nzzzv", opts)
a.nvim_set_keymap("n", "<C-d>", "<C-d>zz", opts) -- half page jumping
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)
a.nvim_set_keymap("n", '<C-k>', "<cmd>SmartResizeUp<CR>", opts)
a.nvim_set_keymap("n", '<C-l>', "<cmd>SmartResizeRight<CR>", opts)
-- don't blame me pls
a.nvim_set_keymap("n", "<C-g>", [[<cmd>Gitsigns toggle_current_line_blame<CR>]], opts)
-- telescope
a.nvim_set_keymap('n', '<leader>sf', '<cmd>Telescope find_files<CR>', opts)
a.nvim_set_keymap('n', '<leader>sg', '<cmd>Telescope git_commits<CR>', opts)
a.nvim_set_keymap('n', '<leader>sb', '<cmd>Telescope current_buffer_fuzzy_find<CR>', opts)
a.nvim_set_keymap('n', '<leader>so', '<cmd>Telescope oldfiles<CR>', opts)
a.nvim_set_keymap('n', '<leader>sc', '<cmd>Telescope neoclip unnamed<CR>', opts)
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)
-- 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)
-- 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)
-- true zen
local truezen = require('true-zen')
local keymap = vim.keymap
keymap.set('n', '<leader>zn', function()
local first = 0
local last = vim.api.nvim_buf_line_count(0)
truezen.narrow(first, last)
end, { noremap = true })
keymap.set('v', '<leader>zn', function()
local first = vim.fn.line('v')
local last = vim.fn.line('.')
truezen.narrow(first, last)
end, { noremap = true })
a.nvim_set_keymap('n', '<leader>zf', '<cmd>lua require("true-zen.focus").toggle()<CR>', opts)
a.nvim_set_keymap('n', '<leader>zm', '<cmd>lua require("true-zen.minimalist").toggle()<CR>', opts)
a.nvim_set_keymap('n', '<leader>za', '<cmd>lua require("true-zen.ataraxis").toggle()<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)
-- code actions + renaming
a.nvim_set_keymap('n', '<leader>gn', '<cmd>lua require("cosmic-ui").rename()<CR>', opts)
a.nvim_set_keymap('v', '<leader>ga', '<cmd>lua require("cosmic-ui").range_code_actions()<CR>', opts)
a.nvim_set_keymap('n', '<leader>ga', '<cmd>lua require("cosmic-ui").code_actions()<CR>', opts)
-- glow
a.nvim_set_keymap('n', '<leader>gl', '<cmd>lua _glow()<CR>', opts)
-- open file tree
a.nvim_set_keymap('n', '<leader>to', '<cmd>SFMToggle<CR>', opts)
-- vbox note taking
function _G.Toggle_venn()
local venn_enabled = vim.inspect(vim.b.venn_enabled)
vim.notify = require('notify')
if venn_enabled == "nil" then
vim.b.venn_enabled = true
cmd[[setlocal ve=all]]
-- draw a line on HJKL keystokes
a.nvim_buf_set_keymap(0, "n", "J", "<C-v>j:VBox<CR>", {noremap = true})
a.nvim_buf_set_keymap(0, "n", "K", "<C-v>k:VBox<CR>", {noremap = true})
a.nvim_buf_set_keymap(0, "n", "L", "<C-v>l:VBox<CR>", {noremap = true})
a.nvim_buf_set_keymap(0, "n", "H", "<C-v>h:VBox<CR>", {noremap = true})
-- draw a box by pressing "f" with visual selection
a.nvim_buf_set_keymap(0, "v", "f", ":VBox<CR>", {noremap = true})
-- make easier to navigate
o.cursorcolumn = true
o.colorcolumn = { 0 }
-- notify
vim.notify("venn toggled on", "info", { title = "Neovim config" })
else
cmd[[setlocal ve=]]
cmd[[mapclear <buffer>]]
vim.b.venn_enabled = nil
o.cursorcolumn = false
o.colorcolumn = { 80 }
-- notify
vim.notify("venn toggled off", "info", { title = "Neovim config" })
end
end
-- toggle keymappings for venn using <leader>v
a.nvim_set_keymap('n', '<leader>v', ":lua Toggle_venn()<CR>", { noremap = true})

View File

@ -1,116 +1,57 @@
---------------
-- better ui --
---------------
o.number = true
o.relativenumber = true
o.numberwidth = 2 -- width o numberline
o.signcolumn = 'yes:1' -- show gutter
o.cursorline = true -- highlights the current line
o.scrolloff = 5 -- # lines below/above cursor
o.showmode = false -- stop vim from showing mode
o.cmdheight = 2 -- vim command height
o.mouse = "" -- no mouse
o.laststatus = 3 -- global statusline
-- better ui ------------------------------------------------------------------
vim.notify = require("notify")
o.colorcolumn = { 80 }
o.wrap = true -- wrap lines
-- buffer
o.scrolloff = 5
o.wrap = true -- wraping lines
o.linebreak = true -- fix where line is wraped
o.emoji = false -- something to do with the spacing of emojis
o.clipboard = 'unnamedplus' -- use system clipboard
o.cursorline = true
-- intenting & tabing
-- statusbar
o.laststatus = 3
o.cmdheight = 1
if o.cmdheight == 0 then
o.showcmdloc = 'statusline'
end
o.showmode = false -- stop vim from showing mode (we have a statusbar)
-- status column
o.signcolumn = 'yes:1' -- show gutter
o.relativenumber = true
o.number = true
o.numberwidth = 2
-- indents + tabs
local tabwidth = 2
o.expandtab = true
o.smarttab = true
o.cindent = true
o.autoindent = true
o.tabstop = 2
o.shiftwidth = 2
o.softtabstop = -1 -- If negative, shiftwidth value is used
o.tabstop = tabwidth
o.shiftwidth = tabwidth
o.softtabstop = tabwidth
-- spelling
o.spelllang = { 'en_us' }
-- colors
-- colorscheme
o.termguicolors = true
cmd('colorscheme jellybeans-nvim')
vim.cmd('colorscheme mellow')
-- diagnostics w/o virtual text
vim.diagnostic.config({
underline = true,
virtual_text = false
})
-- better editing -------------------------------------------------------------
o.clipboard = 'unnamedplus' -- system clipboard (on unix like)
colors = {
black = '#000000',
black2 = '#161616',
black3 = '#0E0E0E',
black4 = '#101010',
grey = '#1E1E1E',
grey2 = '#404040',
white = '#ffffff',
red = '#E06C75',
orange = '#EA936C',
yellow = '#E5C07B',
green = '#98C379',
blue = '#61AFEF',
purple = '#C678DD',
pink = '#704A5A',
}
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 }
-- custom opts
copts = {
tablines = 'colored', -- false, 'colored', and 'wrap'
minimapcolor = colors.grey2,
}
------------
-- saving --
------------
-- file saving ----------------------------------------------------------------
o.swapfile = false
o.undofile = true
o.confirm = true
------------
-- search --
------------
-- searching ------------------------------------------------------------------
o.ignorecase = true
o.smartcase = true
o.wrapscan = true
o.showmatch = true
o.incsearch = true
----------------
-- wild menus --
----------------
-- wild menus -----------------------------------------------------------------
o.wildoptions = 'pum'
o.pumblend = 3
o.pumheight = 20
@ -118,101 +59,9 @@ o.pumheight = 20
o.wildignorecase = true
o.wildignore = '*.o'
-----------
-- netrw --
-----------
g.netrw_banner = 0
-- netrw ----------------------------------------------------------------------
g.netrw_banner = 1
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 })
a.nvim_set_hl(0, "CursorLineNr", { fg = colors.white, bold = true })
-- indent line colors
a.nvim_set_hl(0, "IndentBlanklineIndent1", { fg = colors.red } )
a.nvim_set_hl(0, "IndentBlanklineIndent2", { fg = colors.orange } )
a.nvim_set_hl(0, "IndentBlanklineIndent3", { fg = colors.yellow } )
a.nvim_set_hl(0, "IndentBlanklineIndent4", { fg = colors.green } )
a.nvim_set_hl(0, "IndentBlanklineIndent5", { fg = colors.blue } )
a.nvim_set_hl(0, "IndentBlanklineIndent6", { fg = colors.purple } )
-- code window
a.nvim_set_hl(0, 'CodewindowBorder', {fg = copts.minimapcolor})
-- diagnostics
a.nvim_set_hl(0, "DiagnosticVirtualTextHint", { fg = "#ffffff", bg = "#1E1E1E" })
a.nvim_set_hl(0, "DiagnosticVirtualTextInfo", { fg = "#006fd8", bg = "#152f47" })
a.nvim_set_hl(0, "DiagnosticVirtualTextWarn", { fg = "#E9AD5A", bg = "#533221" })
a.nvim_set_hl(0, "DiagnosticVirtualTextError",
{ fg = "#ED3B44", bg = "#4b1313" })
-- alpha start page 4chan edition
a.nvim_set_hl(0, "AlphaHeader", {fg = "#789922" })
a.nvim_set_hl(0, "AlphaEmphasis", {fg = "#DD0000" })
-- murmur (word highlights)
a.nvim_set_hl(0, "murmur_cursor_rgb", { bg = colors.grey2 })
-- cmp/treesitter stuff
a.nvim_set_hl(0, "CmpItemMenu", { fg = colors.purple, italic = true })
a.nvim_set_hl(0, "CmpItemKindSnippet", { bg = "#A377BF", bold = true })
a.nvim_set_hl(0, "CmpItemKindText", { bg = "#63bc47", bold = true })
a.nvim_set_hl(0, "CmpItemKindField", { bg = "#db7093", bold = true })
a.nvim_set_hl(0, "CmpItemKindVariable", { bg = "#ff8c00", bold = true })
a.nvim_set_hl(0, "CmpItemKindEnum", { bg = "#FF5733", bold = true })
a.nvim_set_hl(0, "CmpItemKindFunction", { bg = "#483d8b", bold = true })
a.nvim_set_hl(0, "CmpItemKindKeyword", { bg = "#FF339C", bold = true })
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, "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 })
a.nvim_set_hl(0, "TelescopeNormal", { bg = colors.black3 })
a.nvim_set_hl(0, "TelescopePreviewBorder", { bg = colors.black3 })
a.nvim_set_hl(0, "TelescopePreviewNormal", { bg = colors.black3 })
a.nvim_set_hl(0, "TelescopePreviewTitle", { bg = colors.black3,
fg = colors.black3 })
a.nvim_set_hl(0, "TelescopePromptBorder", { bg = colors.black2 })
a.nvim_set_hl(0, "TelescopePromptNormal", { bg = colors.black2 })
a.nvim_set_hl(0, "TelescopePromptPrefix", { bg = colors.black2 })
a.nvim_set_hl(0, "TelescopePromptTitle", { bg = colors.black2,
fg = colors.black2 })
a.nvim_set_hl(0, "TelescopeResultsBorder", { bg = colors.black4 })
a.nvim_set_hl(0, "TelescopeResultsNormal", { bg = colors.black4 })
a.nvim_set_hl(0, "TelescopeResultsTitle", { bg = colors.black4,
fg = colors.black4 })
a.nvim_set_hl(0, "TelescopeSelection", { bg = colors.black2 })
a.nvim_set_hl(0, "TelescopeSelectionCaret", { bg = colors.black2,
fg = colors.orange, bold = true })
-- sfm (tree view stuff)
a.nvim_set_hl(0, "SFMGitStaged", { fg = colors.green })
a.nvim_set_hl(0, "SFMGitUnstaged", { fg = colors.green })
a.nvim_set_hl(0, "SFMGitRenamed", { fg = colors.purple })
a.nvim_set_hl(0, "SFMGitNew", { fg = colors.orange })
a.nvim_set_hl(0, "SFMGitDeleted", { fg = colors.red })
a.nvim_set_hl(0, "SFMGitIgnored", { fg = colors.grey })
g.netrw_preview = 1

View File

@ -1,260 +0,0 @@
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 CANT 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)

View File

@ -1,97 +0,0 @@
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(a.nvim_win_get_cursor(0))
return col ~= 0 and a.nvim_buf_get_lines(0, line - 1, line, true)
[1]:sub(col, col):match("%s") == nil
end
local cmp = require('cmp')
local luasnip = require('luasnip')
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup {
completion = { autocomplete = false, },
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
sources = cmp.config.sources({
{ name = 'nvim_lsp', keyword_length = 3 },
{ name = 'luasnip', keyword_length = 3 },
{ name = 'path' },
{ name = 'buffer', keyword_length = 3, max_item_count = 7 },
{ name = 'calc' },
{ name = 'neorg' },
}),
window = {
completion = {
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
col_offset = -3,
side_padding = 0,
}
},
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
local kind_icons = lspicons
local menu_items = {
buffer = "buffer",
nvim_lsp = "LSP",
luasnip = "luasnip",
nvim_lua = "lua",
calc = "calc",
}
vim_item.kind = string.format(' %s ', kind_icons[vim_item.kind])
vim_item.menu = string.format(' (%s)', menu_items[entry.source.name])
return vim_item
end
},
mapping = cmp.mapping.preset.insert({
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
['<CR>'] = cmp.mapping.confirm({ select = true }),
['<ESC>'] = cmp.mapping.close(),
}),
sorting = {
comparators = {
cmp.config.compare.offset,
cmp.config.compare.exact,
cmp.config.compare.score,
require "cmp-under-comparator".under,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
},
},
enabled = function()
local context = require 'cmp.config.context'
if a.nvim_get_mode().mode == 'c' then
return true
else
return not context.in_treesitter_capture("comment")
and not context.in_syntax_group("Comment")
end
end
}

View File

@ -1,3 +0,0 @@
require('cmp_luasnip_choice').setup {
auto_open = true,
}

View File

@ -1,8 +0,0 @@
require('colorizer').setup {
filetypes = { '*' },
user_default_options = {
names = false,
RRGGBBAA = true,
AARRGGBB = true,
},
}

View File

@ -1,18 +0,0 @@
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
}

View File

@ -1,22 +0,0 @@
if copts.tablines == 'colored' then
require("indent_blankline").setup {
space_char_blankline = ' ',
char_highlight_list = {
'IndentBlanklineIndent1',
'IndentBlanklineIndent2',
'IndentBlanklineIndent3',
'IndentBlanklineIndent4',
'IndentBlanklineIndent5',
'IndentBlanklineIndent6',
},
}
elseif copts.tablines == 'wrap' then
o.list = true
require('indent_blankline').setup {
space_char_blankline = ' ',
show_current_context = true,
show_current_context_start = true,
}
else
g.indent_blankline_char = ' '
end

View File

@ -1,24 +0,0 @@
require('core.overrides.indentblankline')
require('core.overrides.lualine')
require('core.overrides.telescope')
require('core.overrides.modicator')
require('core.overrides.neorg')
require('core.overrides.whichkey')
require('core.overrides.neoclip')
require('core.overrides.smartsplits')
require('core.overrides.treesitter')
require('core.overrides.treesj')
require('core.overrides.colorizer')
require('core.overrides.trouble')
require('core.overrides.lspzero')
require('core.overrides.cmp')
require('core.overrides.snip')
require('core.overrides.lspkind')
require('core.overrides.cmpluasnipchoice')
require('core.overrides.truezen')
require('core.overrides.alpha')
require('core.overrides.notify')
require('core.overrides.hover')
require('core.overrides.scrollbar')
require('core.overrides.toggleterm')
require('core.overrides.sfm')

View File

@ -1 +0,0 @@
require('lspkind').init()

View File

@ -1,17 +0,0 @@
local lsp = require('lsp-zero')
lsp.set_preferences {
suggest_lsp_servers = true,
setup_servers_on_start = true,
set_lsp_keymaps = true,
configure_diagnostics = true,
cmp_capabilities = true,
manage_nvim_cmp = false,
call_servers = 'local',
sign_icons = {
error = 'x',
warn = '!',
hint = '?',
info = 'i'
}
}
lsp.setup()

View File

@ -1,145 +0,0 @@
local custom = require'lualine.themes.auto'
custom.normal = {
a = { fg = colors.black, bg = colors.blue, gui = 'bold' },
b = { fg = colors.black, bg = colors.grey, gui = 'bold' },
c = { fg = colors.white, bg = colors.grey },
x = {},
y = { fg = colors.blue, bg = colors.black2 },
z = { fg = colors.black2, bg = colors.blue, gui = 'bold' },
}
custom.insert = {
a = { fg = colors.black, bg = colors.green, gui = 'bold' },
b = { fg = colors.black, bg = colors.grey, gui = 'bold' },
c = { fg = colors.white, bg = colors.grey },
x = {},
y = { fg = colors.green, bg = colors.black2 },
z = { fg = colors.black2, bg = colors.green, gui = 'bold' },
}
custom.replace = {
a = { fg = colors.black, bg = colors.orange, gui = 'bold' },
b = { fg = colors.black, bg = colors.grey, gui = 'bold' },
c = { fg = colors.white, bg = colors.grey },
x = {},
y = { fg = colors.orange, bg = colors.black2 },
z = { fg = colors.black2, bg = colors.orange, gui = 'bold' },
}
custom.visual = {
a = { fg = colors.black, bg = colors.purple, gui = 'bold' },
b = { fg = colors.black, bg = colors.grey, gui = 'bold' },
c = { fg = colors.white, bg = colors.grey },
x = {},
y = { fg = colors.purple, bg = colors.black2 },
z = { fg = colors.black2, bg = colors.purple, gui = 'bold' },
}
custom.command = {
a = { fg = colors.black, bg = colors.red, gui = 'bold' },
b = { fg = colors.black, bg = colors.grey, gui = 'bold' },
c = { fg = colors.white, bg = colors.grey },
x = {},
y = { fg = colors.red, bg = colors.black2 },
z = { fg = colors.black2, bg = colors.red, gui = 'bold' },
}
custom.terminal = {
a = { fg = colors.black, bg = colors.yellow, gui = 'bold' },
b = { fg = colors.black, bg = colors.grey, gui = 'bold' },
c = { fg = colors.white, bg = colors.grey },
x = {},
y = { fg = colors.yellow, bg = colors.black2 },
z = { fg = colors.black2, bg = colors.yellow, gui = 'bold' },
}
custom.inactive = {
a = { bg = colors.black2 },
b = { bg = colors.black2 },
c = { bg = colors.black2 },
x = { bg = colors.black2 },
y = { bg = colors.black2 },
z = { bg = colors.black2 },
}
local function diff_source()
local gitsigns = vim.b.gitsigns_status_dict
if gitsigns then
return {
added = gitsigns.added,
modified = gitsigns.changed,
removed = gitsigns.removed
}
end
end
local function maximize_status()
return require("true-zen.focus").running and '[M]' or '[]='
end
require('lualine').setup {
options = {
icons_enabled = false,
component_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
disabled_filetypes = {
statusline = {
'no-neck-pain',
'alpha',
'TelescopePrompt',
},
winbar = {},
},
theme = custom,
always_divide_middle = false,
globalstatus = true,
refresh = {
statusline = 500,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = {
{ 'mode' },
{ 'filetype',
color = { fg = colors.white, bg = colors.grey },
},
{ 'filename',
filestatus = true,
path = 0,
symbols = {
modified = '[+]',
readonly = '[=]',
unnamed = 'No Name',
newfile = '[New]',
}
}
},
lualine_b = {
{ 'diff',
source = diff_source,
},
{ 'diagnostics',
sources = {'nvim_diagnostic', 'nvim_lsp'},
sections = {'error', 'warn', 'info', 'hint'},
diagnostics_color = {
error = 'DiagnosticError',
warn = 'DiagnosticWarn',
info = 'DiagnosticInfo',
hint = 'DiagnosticHint',
},
symbols = {error = '[x]', warn = '[!]', info = '[i]', hint = '[?]'},
}
},
lualine_c = {},
lualine_x = {
{ 'fileformat',
color = { gui = 'bold' }
}
},
lualine_y = {
{ maximize_status },
},
lualine_z = { 'progress' }
},
inactive_sections = {
lualine_x = {'location'},
},
}

View File

@ -1,18 +0,0 @@
require('modicator').setup({
show_warnings = true,
highlights = {
defaults = {
bold = true,
},
modes = {
['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, },
},
},
})

View File

@ -1,9 +0,0 @@
require('neoclip').setup {
keys = {
telescope = {
i = {
paste_behind = ' '
},
},
},
}

View File

@ -1,18 +0,0 @@
require('neorg').setup {
load = {
['core.defaults'] = {},
['core.norg.concealer'] = {
config = {
dim_code_blocks = {
width = 'content',
padding = { right = 2, },
},
folds = false,
}
},
['core.norg.completion'] = {
config = { engine = 'nvim-cmp', }
},
['core.integrations.nvim-cmp'] = {},
}
}

View File

@ -1,14 +0,0 @@
require('notify').setup(
{
icons = {
DEBUG = "B",
ERROR = "x",
INFO = "i",
TRACE = "t",
WARN = "!"
},
minimum_width = 35,
max_width = 80,
render = "compact",
}
)

View File

@ -1,29 +0,0 @@
require("scrollbar").setup({
show = true,
show_in_active_only = true,
handle = {
color = colors.bg_highlight,
},
marks = {
Search = { color = colors.pink },
Error = { color = colors.red },
Warn = { color = colors.orange },
Info = { color = colors.blue },
Hint = { color = colors.grey2 },
Misc = { color = colors.purple },
},
excluded_buftypes = {
"terminal",
},
excluded_filetypes = {
"prompt",
"TelescopePrompt",
"noice",
"alpha",
"sfm",
},
handlers = {
diagnostic = true,
gitsigns = true,
}
})

View File

@ -1,40 +0,0 @@
local sfm = require('sfm')
sfm.setup {
view = {
side = "left", -- side of the tree, can be `left`, `right`
width = 30
},
mappings = {
custom_only = false,
},
renderer = {
icons = {
file = {
default = "#",
symlink = "#",
},
folder = {
default = "[|",
open = "[/",
symlink = "[|",
symlink_open = "[/",
},
indicator = {
folder_closed = "",
folder_open = "",
file = "",
},
}
},
}:load_extension('sfm-git', {
icons = {
staged = "^",
unstaged = "+",
unmerged = "",
renamed = ">",
untracked = "?",
deleted = "x",
ignored = "#"
}
})

View File

@ -1,7 +0,0 @@
require('smart-splits').setup {
resize_mode = {
hooks = {
on_leave = require('bufresize').register
},
},
}

View File

@ -1,9 +0,0 @@
local ls = require('luasnip')
ls.config.set_config {
-- return back into snippet
history = true,
-- update on text insert
updateevents = "TextChanged,TextChangedI"
}

View File

@ -1,42 +0,0 @@
local telescope = require('telescope')
local actions = require('telescope.actions')
telescope.setup {
defaults = {
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
sorting_strategy = 'ascending',
layout_config = {
height = 0.9,
prompt_position = 'top',
},
mappings = {
i = {
['<C-h>'] = 'which_key',
['<C-j>'] = actions.move_selection_next,
['<C-k>'] = actions.move_selection_previous,
['<C-l>'] = actions.select_default,
['<C-u>'] = actions.preview_scrolling_up,
['<C-d>'] = actions.preview_scrolling_down,
},
n = {
["gg"] = actions.move_to_top,
["G"] = actions.move_to_bottom,
},
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown {
-- even more opts
}
}
},
}
}
telescope.load_extension('undo')
telescope.load_extension('file_browser')
telescope.load_extension('ui-select')
a.nvim_create_autocmd('User', {
pattern = 'TelescopePreviewerLoaded',
command = 'setlocal number',
})

View File

@ -1,19 +0,0 @@
require('toggleterm').setup {
shade_terminals = true,
}
local Terminal = require('toggleterm.terminal').Terminal
local glow = Terminal:new({
cmd = "glow",
hidden = true,
direction = "float",
float_opts = {
border = "shadow",
width = 120,
height = 50,
}
})
function _glow()
glow:toggle()
end

View File

@ -1,15 +0,0 @@
require('nvim-treesitter.configs').setup {
ensure_installed = {
'help',
'c',
'lua',
'norg',
'bash',
'html',
'make',
},
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}

View File

@ -1,3 +0,0 @@
require('treesj').setup({
use_default_keymaps = false,
})

View File

@ -1,11 +0,0 @@
require("trouble").setup {
icons = false,
fold_open = "v",
fold_closed = ">",
signs = {
error = "[x]",
warning = "[!]",
hint = "[?]",
information = "[i]"
},
}

View File

@ -1,13 +0,0 @@
require('true-zen').setup {
modes = {
ataraxis = { -- normal zen
minimum_writing_area = { -- minimum size of main window
width = 120,
height = 44,
},
},
narrow = {
folds_style = "invisible",
},
},
}

View File

@ -1,8 +0,0 @@
require("which-key").setup {
icons = {
breadcrumb = '>>',
separator = '->',
},
window = { winblend = 3, },
layout = { align = 'center', },
}

View File

@ -1,111 +1,70 @@
-- make sure lazy is installed
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git", lazypath })
vim.fn.system({ "git", "-C", lazypath, "checkout", "tags/stable" })
end
end
vim.opt.rtp:prepend(lazypath)
require 'dep' {
-- dep manages dep ----------------------------------------------------------
{ 'squibid/dep',
url = 'https://git.squi.bid/dep',
branch = 'dev'
},
require('lazy').setup{
{ 'tamton-aquib/essentials.nvim' },
-- preformance --------------------------------------------------------------
{ 'lewis6991/impatient.nvim' },
-- only the most useless plugins (some of these are also ui related)
{ 'goolord/alpha-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',
},
{ 'mrjones2014/smart-splits.nvim'}, -- buffer resizing
{ 'axieax/urlview.nvim' }, -- view urls in current buffer
{ 'matbme/JABS.nvim' }, -- buffer switcher
{ 'ziontee113/icon-picker.nvim' }, -- icons
{ 'petertriho/nvim-scrollbar' },
{ 'alec-gibson/nvim-tetris' },
{ 'kwakzalver/duckytype.nvim', config = true }, -- like monkey type
{ 'melkster/modicator.nvim' },
{ 'nyngwang/murmur.lua', config = true },
{ 'potamides/pantran.nvim' },
--
-- colorscheme / ui
{ 'metalelf0/jellybeans-nvim',
dependencies = 'rktjmp/lush.nvim',
lazy = false,
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, },
{ 'folke/which-key.nvim' },
{ 'mrjones2014/smart-splits.nvim',
dependencies = { 'kwkarlwang/bufresize.nvim', config = true, },
},
{ 'rcarriga/nvim-notify' },
{ 'CosmicNvim/cosmic-ui',
dependencies = { 'MunifTanjim/nui.nvim' },
config = true,
},
{ 'dinhhuy258/sfm.nvim',
dependencies = { 'dinhhuy258/sfm-git.nvim' }
},
--
-- functional plugins -------------------------------------------------------
{ 'lewis6991/gitsigns.nvim' },
{ 'chentoast/marks.nvim' },
{ 'pta2002/intellitab.nvim' },
{ 'mbbill/undotree' }, -- careful this one is written in vimscript
{ 'windwp/nvim-autopairs' },
{ 'numToStr/Comment.nvim' },
{ 'jghauser/mkdir.nvim' }, -- mkdir's when they dont exist
{ 'numtostr/BufOnly.nvim' }, -- kill the other buffers with :BufOnly
{ 'ahmedkhalf/project.nvim' }, -- cd into root of project
{ 'akinsho/toggleterm.nvim' },
-- careful the following plugins might be considered useful proceed with caution
-- muh fzf
-- note taking --------------------------------------------------------------
{ 'nvim-neorg/neorg' },
-- fzf ----------------------------------------------------------------------
{ 'nvim-telescope/telescope.nvim',
version = '0.1.*',
dependencies = {
requires = 'nvim-lua/plenary.nvim',
deps = {
'nvim-telescope/telescope-file-browser.nvim',
'nvim-telescope/telescope-ui-select.nvim',
'nvim-lua/plenary.nvim',
'debugloop/telescope-undo.nvim',
'AckslD/nvim-neoclip.lua',
}
},
--
-- movement
{ 'pta2002/intellitab.nvim' },
--
-- debugging
{ 'numToStr/Comment.nvim', config = true, },
{ 'folke/trouble.nvim' },
{ 'folke/todo-comments.nvim', config = true, },
{ 'akinsho/toggleterm.nvim', version = '*' },
--
-- project stuff
{ 'sindrets/diffview.nvim', config = true, },
{ 'notjedi/nvim-rooter.lua', config = true, },
--
-- notes
{ 'jbyuki/venn.nvim' },
{ 'nvim-neorg/neorg',
version = '*',
ft = 'norg',
build = ':Neorg sync-parsers',
},
{ 'loqusion/true-zen.nvim' },
{ 'Pocco81/high-str.nvim' },
--
-- cmp, lsp and syntax
-- treesitter + colorizing --------------------------------------------------
{ 'nvim-treesitter/nvim-treesitter',
dependencies = {
{ 'm-demare/hlargs.nvim', config = true },
'Wansmer/treesj',
deps = {
{ 'm-demare/hlargs.nvim' },
{ 'Wansmer/treesj' },
{ 'nvim-treesitter/nvim-treesitter-context' },
}
},
{ 'lewis6991/hover.nvim' },
{ 'nvchad/nvim-colorizer.lua' },
{ 'VonHeikemen/lsp-zero.nvim' },
{ 'NvChad/nvim-colorizer.lua' },
-- cmp ----------------------------------------------------------------------
{ 'hrsh7th/nvim-cmp',
dependencies = {
deps = {
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-calc',
@ -116,14 +75,35 @@ require('lazy').setup{
'onsails/lspkind.nvim',
},
},
{ 'ray-x/lsp_signature.nvim' },
-- snippets -----------------------------------------------------------------
{ 'L3MON4D3/LuaSnip',
version = 'v1.*',
dependencies = 'rafamadriz/friendly-snippets',
deps = 'rafamadriz/friendly-snippets',
},
{ 'doxnit/cmp-luasnip-choice' },
-- lsp ----------------------------------------------------------------------
{ 'neovim/nvim-lspconfig' },
{ 'williamboman/mason.nvim' },
{ 'williamboman/mason-lspconfig.nvim' },
{ 'windwp/nvim-autopairs', config = true, },
--
{ 'j-hui/fidget.nvim' }, -- shows lsp progress
{ 'folke/trouble.nvim' },
-- optional language specific lsp's
-- { 'mfussenegger/nvim-jdtls' },
-- dap ----------------------------------------------------------------------
{ 'mfussenegger/nvim-dap',
deps = {
'rcarriga/nvim-dap-ui',
}
},
-- dap + lsp + linter + formatter installer ---------------------------------
{ 'williamboman/mason.nvim',
deps = {
{ 'WhoIsSethDaniel/mason-tool-installer.nvim' },
{ 'williamboman/mason-lspconfig.nvim' },
{ 'jay-babu/mason-nvim-dap.nvim' },
},
},
}

View File

@ -1,29 +0,0 @@
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);',
'}',
})
})
})

View File

@ -1,35 +0,0 @@
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')

View File

@ -1,14 +0,0 @@
ls.add_snippets('lua', {
s({
name = "local require",
trig = "req",
dscr = "simple lua require"
},
fmt("local {} = require('{}')",
{
i(1, "default"),
ri(1),
}
)
)
})

View File

@ -1,41 +0,0 @@
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),
}
)
),
})