new config old version is now on v1 branch
This commit is contained in:
78
README.md
78
README.md
@ -1,78 +0,0 @@
|
|||||||
# muh neovim config
|
|
||||||
|
|
||||||
#### some goals for my config:
|
|
||||||
- reduce the use of nerdfonts
|
|
||||||
- keep as simple as possible without losing functionality
|
|
||||||
|
|
||||||
## screenshots
|
|
||||||
<img src="pics/alpha.png" style="width:90vw;">
|
|
||||||
<img src="pics/editing-c.png" style="width:90vw;">
|
|
||||||
|
|
||||||
## plugins
|
|
||||||
<details><summary>click me to view the plugins that are currently in muh config</summary>
|
|
||||||
|
|
||||||
- [essentials](https://github.com/tamton-aquib/essentials.nvim)
|
|
||||||
- [alpha-nvim](https://github.com/goolord/alpha-nvim)
|
|
||||||
- [nvim-scrollbar](https://github.com/petertriho/nvim-scrollbar)
|
|
||||||
- [nvim-tetris](https://github.com/alec-gibson/nvim-tetris)
|
|
||||||
- [duckytype](https://github.com/kwakzalver/duckytype.nvim)
|
|
||||||
- [modicator](https://github.com/melkster/modicator.nvim)
|
|
||||||
- [murmur](https://github.com/nyngwang/murmur.lua)
|
|
||||||
- [pantran](https://github.com/potamides/pantran.nvim)
|
|
||||||
- [jellybeans-nvim](https://github.com/metalelf0/jellybeans-nvim)
|
|
||||||
- [lush.nvim](https://github.com/rktjmp/lush.nvim)
|
|
||||||
- [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim)
|
|
||||||
- [barbacue.nvim](https://github.com/utilyre/barbecue.nvim)
|
|
||||||
- [nvim-navic](https://github.com/SmiteshP/nvim-navic)
|
|
||||||
- [indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim)
|
|
||||||
- [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim)
|
|
||||||
- [marks.nvim](https://github.com/chentoast/marks.nvim)
|
|
||||||
- [which-key.nvim](https://github.com/folke/which-key.nvim)
|
|
||||||
- [smart-splits](https://github.com/mrjones2014/smart-splits.nvim)
|
|
||||||
- [bufresize](https://github.com/kwkarlwang/bufresize.nvim)
|
|
||||||
- [nvim-notify](https://github.com/rcarriga/nvim-notify)
|
|
||||||
- [cosmic-ui](https://github.com/CosmicNvim/cosmic-ui)
|
|
||||||
- [nui.nvim](https://github.com/MunifTanjim/nui.nvim)
|
|
||||||
- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim)
|
|
||||||
- [telescope-file-browser.nvim](https://github.com/nvim-telescope/telescope-file-browser.nvim)
|
|
||||||
- [telescope-ui-select.nvim](https://github.com/nvim-telescope/telescope-ui-select.nvim)
|
|
||||||
- [plenary.nvim](https://github.com/nvim-lua/plenary.nvim)
|
|
||||||
- [telescope-undo.nvim](https://github.com/debugloop/telescope-undo.nvim)
|
|
||||||
- [nvim-neoclip.lua](https://github.com/AckslD/nvim-neoclip.lua)
|
|
||||||
- [intellitab.nvim](https://github.com/pta2002/intellitab.nvim)
|
|
||||||
- [comment.nvim](https://github.com/numToStr/Comment.nvim)
|
|
||||||
- [trouble.nvim](https://github.com/folke/trouble.nvim)
|
|
||||||
- [todo-comments.nvim](https://github.com/folke/todo-comments.nvim)
|
|
||||||
- [toggleterm.nvim](https://github.com/akinsho/toggleterm.nvim)
|
|
||||||
- [diffview.nvim](https://github.com/sindrets/diffview.nvim)
|
|
||||||
- [nvim-rooter.lua](https://github.com/notjedi/nvim-rooter.lua)
|
|
||||||
- [venn.nvim](https://github.com/jbyuki/venn.nvim)
|
|
||||||
- [neorg](https://github.com/nvim-neorg/neorg)
|
|
||||||
- [true-zen.nvim](https://github.com/loqusion/true-zen.nvim)
|
|
||||||
- [high-str.nvim](https://github.com/Pocco81/high-str.nvim)
|
|
||||||
- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
|
|
||||||
- [hlargs](https://github.com/m-demare/hlargs.nvim)
|
|
||||||
- [treesj](https://github.com/Wansmer/treesj)
|
|
||||||
- [hover.nvim](https://github.com/lewis6991/hover.nvim)
|
|
||||||
- [nvim-colorizer.lua](https://github.com/nvchad/nvim-colorizer.lua)
|
|
||||||
- [lsp-zero.nvim](https://github.com/VonHeikemen/lsp-zero.nvim)
|
|
||||||
- [nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
|
|
||||||
- [cmp-buffer](https://github.com/hrsh7th/cmp-buffer)
|
|
||||||
- [cmp-path](https://github.com/hrsh7th/cmp-path)
|
|
||||||
- [cmp-calc](https://github.com/hrsh7th/cmp-calc)
|
|
||||||
- [cmp_luasnip](https://github.com/saadparwaiz1/cmp_luasnip)
|
|
||||||
- [cmp-nvim-lua](https://github.com/hrsh7th/cmp-nvim-lua)
|
|
||||||
- [cmp-nvim-lsp](https://github.com/hrsh7th/cmp-nvim-lsp)
|
|
||||||
- [cmp-under-comparator](https://github.com/lukas-reineke/cmp-under-comparator)
|
|
||||||
- [lspkind.nvim](https://github.com/onsails/lspkind.nvim)
|
|
||||||
- [LuaSnip](https://github.com/L3MON4D3/LuaSnip)
|
|
||||||
- [friendly-snippets](https://github.com/rafamadriz/friendly-snippets)
|
|
||||||
- [cmp-luasnip-choice](https://github.com/doxnit/cmp-luasnip-choice)
|
|
||||||
- [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
|
|
||||||
- [mason.nvim](https://github.com/williamboman/mason.nvim)
|
|
||||||
- [mason-lspconfig.nvim](https://github.com/williamboman/mason-lspconfig.nvim)
|
|
||||||
- [nvim-autopairs](https://github.com/windwp/nvim-autopairs)
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<sub>PS: sry about the kitchen sink commits, I just learned about `git add --patch`</sub>
|
|
1
after/ftplugin/help.lua
Normal file
1
after/ftplugin/help.lua
Normal file
@ -0,0 +1 @@
|
|||||||
|
vim.treesitter.start()
|
11
after/ftplugin/java.lua
Normal file
11
after/ftplugin/java.lua
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
local status_ok, jdtls = pcall(require, "jdtls")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
jdtls.start_or_attach {
|
||||||
|
cmd = {'/home/squibid/Downloads/jdt-lang-serv/bin/jdtls'},
|
||||||
|
root_dir = vim.fs.dirname(
|
||||||
|
vim.fs.find({ 'gradlew', '.git', 'mvnw' }, { upward = true })[1]
|
||||||
|
),
|
||||||
|
}
|
6
after/plugin/autopairs.lua
Normal file
6
after/plugin/autopairs.lua
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
local status_ok, autopairs = pcall(require, "nvim-autopairs")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
autopairs.setup{}
|
@ -1,3 +1,36 @@
|
|||||||
|
local status_ok, cmp = pcall(require, "cmp")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local 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 = 'c=',
|
||||||
|
Struct = ' ',
|
||||||
|
Event = ' ',
|
||||||
|
Operator = '%*',
|
||||||
|
TypeParameter = ' ',
|
||||||
|
}
|
||||||
|
|
||||||
local has_words_before = function()
|
local has_words_before = function()
|
||||||
unpack = unpack or table.unpack
|
unpack = unpack or table.unpack
|
||||||
local line, col = unpack(a.nvim_win_get_cursor(0))
|
local line, col = unpack(a.nvim_win_get_cursor(0))
|
||||||
@ -5,7 +38,6 @@ local has_words_before = function()
|
|||||||
[1]:sub(col, col):match("%s") == nil
|
[1]:sub(col, col):match("%s") == nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local cmp = require('cmp')
|
|
||||||
local luasnip = require('luasnip')
|
local luasnip = require('luasnip')
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
@ -27,7 +59,7 @@ cmp.setup {
|
|||||||
window = {
|
window = {
|
||||||
completion = {
|
completion = {
|
||||||
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
||||||
col_offset = -3,
|
col_offset = 0,
|
||||||
side_padding = 0,
|
side_padding = 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -58,7 +90,7 @@ cmp.setup {
|
|||||||
elseif has_words_before() then
|
elseif has_words_before() then
|
||||||
cmp.complete()
|
cmp.complete()
|
||||||
else
|
else
|
||||||
fallback()
|
require("intellitab").indent()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
@ -1,4 +1,9 @@
|
|||||||
require('colorizer').setup {
|
local status_ok, colorizer = pcall(require, "colorizer")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
colorizer.setup {
|
||||||
filetypes = { '*' },
|
filetypes = { '*' },
|
||||||
user_default_options = {
|
user_default_options = {
|
||||||
names = false,
|
names = false,
|
26
after/plugin/comment.lua
Normal file
26
after/plugin/comment.lua
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
local status_ok, comment = pcall(require, "Comment")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
comment.setup {
|
||||||
|
toggler = {
|
||||||
|
line = 'gcc',
|
||||||
|
block = 'gbc',
|
||||||
|
},
|
||||||
|
opleader = {
|
||||||
|
line = 'gc',
|
||||||
|
block = 'gb',
|
||||||
|
},
|
||||||
|
extra = {
|
||||||
|
above = 'gcO',
|
||||||
|
below = 'gco',
|
||||||
|
eol = 'gcA',
|
||||||
|
},
|
||||||
|
mappings = {
|
||||||
|
basic = true,
|
||||||
|
extra = true,
|
||||||
|
},
|
||||||
|
pre_hook = nil,
|
||||||
|
post_hook = nil,
|
||||||
|
}
|
6
after/plugin/dapui.lua
Normal file
6
after/plugin/dapui.lua
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
local status_ok, dapui = pcall(require, "dapui")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
dapui.setup {}
|
14
after/plugin/fidget.lua
Normal file
14
after/plugin/fidget.lua
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
local status_ok, fidget = pcall(require, "fidget")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
fidget.setup {
|
||||||
|
text = {
|
||||||
|
spinner = "line",
|
||||||
|
done = ":)",
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
zindex = 1,
|
||||||
|
}
|
||||||
|
}
|
28
after/plugin/gitsigns.lua
Normal file
28
after/plugin/gitsigns.lua
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
local status_ok, gitsigns = pcall(require, "gitsigns")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
gitsigns.setup {
|
||||||
|
signs = {
|
||||||
|
add = { text = '│' },
|
||||||
|
change = { text = '│' },
|
||||||
|
delete = { text = '-' },
|
||||||
|
topdelete = { text = '‾' },
|
||||||
|
changedelete = { text = '~' },
|
||||||
|
untracked = { text = '┆' },
|
||||||
|
},
|
||||||
|
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||||
|
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||||
|
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||||
|
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||||
|
watch_gitdir = {
|
||||||
|
interval = 1000,
|
||||||
|
follow_files = true
|
||||||
|
},
|
||||||
|
attach_to_untracked = true,
|
||||||
|
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
|
||||||
|
preview_config = {
|
||||||
|
border = 'shadow',
|
||||||
|
},
|
||||||
|
}
|
6
after/plugin/hlargs.lua
Normal file
6
after/plugin/hlargs.lua
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
local status_ok, hlargs = pcall(require, "hlargs")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
hlargs.setup {}
|
6
after/plugin/iconpicker.lua
Normal file
6
after/plugin/iconpicker.lua
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
local status_ok, iconpicker = pcall(require, "icon-picker")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
iconpicker.setup {}
|
17
after/plugin/indent-blankline.lua
Normal file
17
after/plugin/indent-blankline.lua
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
local status_ok, indent_blankline = pcall(require, "indent_blankline")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
indent_blankline.setup {
|
||||||
|
char = "",
|
||||||
|
char_highlight_list = {
|
||||||
|
"IndentBlanklineIndent1",
|
||||||
|
"IndentBlanklineIndent2",
|
||||||
|
},
|
||||||
|
space_char_highlight_list = {
|
||||||
|
"IndentBlanklineIndent1",
|
||||||
|
"IndentBlanklineIndent2",
|
||||||
|
},
|
||||||
|
show_trailing_blankline_indent = false,
|
||||||
|
}
|
23
after/plugin/jabs.lua
Normal file
23
after/plugin/jabs.lua
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
local status_ok, jabs = pcall(require, "jabs")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
jabs.setup {
|
||||||
|
offset = { bottom = 2, right = 2 },
|
||||||
|
|
||||||
|
symbols = {
|
||||||
|
current = "@",
|
||||||
|
split = "|",
|
||||||
|
alternate = "*",
|
||||||
|
hidden = "\\",
|
||||||
|
locked = "=",
|
||||||
|
ro = "=",
|
||||||
|
edited = "+",
|
||||||
|
terminal = ">_",
|
||||||
|
default_file = "~",
|
||||||
|
terminal_symbol = ">_",
|
||||||
|
},
|
||||||
|
|
||||||
|
use_devicons = false,
|
||||||
|
}
|
105
after/plugin/lsp.lua
Normal file
105
after/plugin/lsp.lua
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
local status_ok, lspconfig = pcall(require, "lspconfig")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local function lsp_keymaps(bufnr)
|
||||||
|
local map = function(m, lhs, rhs)
|
||||||
|
local opts = {remap = false, silent = true, buffer = bufnr}
|
||||||
|
vim.keymap.set(m, lhs, rhs, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- LSP actions
|
||||||
|
map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
|
||||||
|
map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
|
||||||
|
map('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
|
||||||
|
map('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
|
||||||
|
map('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
|
||||||
|
map('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
|
||||||
|
map('n', '<S-Tab>', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
|
||||||
|
map('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
|
||||||
|
map('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
|
||||||
|
|
||||||
|
-- Diagnostics
|
||||||
|
map('n', '<Tab>', '<cmd>lua vim.diagnostic.open_float()<cr>')
|
||||||
|
map('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
|
||||||
|
map('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
|
||||||
|
end
|
||||||
|
|
||||||
|
local function lsp_settings()
|
||||||
|
local sign = function(opts)
|
||||||
|
vim.fn.sign_define(opts.name, {
|
||||||
|
texthl = opts.name,
|
||||||
|
text = opts.text,
|
||||||
|
numhl = ''
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
sign({name = 'DiagnosticSignError', text = 'x'})
|
||||||
|
sign({name = 'DiagnosticSignWarn', text = '!'})
|
||||||
|
sign({name = 'DiagnosticSignHint', text = 'h'})
|
||||||
|
sign({name = 'DiagnosticSignInfo', text = 'i'})
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = false,
|
||||||
|
signs = true,
|
||||||
|
update_in_insert = false,
|
||||||
|
underline = true,
|
||||||
|
severity_sort = true,
|
||||||
|
float = {
|
||||||
|
focusable = false,
|
||||||
|
show_header = true,
|
||||||
|
style = 'minimal',
|
||||||
|
border = 'shadow',
|
||||||
|
source = 'always',
|
||||||
|
header = '',
|
||||||
|
prefix = '* ',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with( vim.lsp.handlers.hover,
|
||||||
|
{ border = 'shadow', }
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
|
||||||
|
vim.lsp.handlers.signature_help,
|
||||||
|
{border = 'shadow'}
|
||||||
|
)
|
||||||
|
|
||||||
|
local command = vim.api.nvim_create_user_command
|
||||||
|
|
||||||
|
command('LspWorkspaceAdd', function()
|
||||||
|
vim.lsp.buf.add_workspace_folder()
|
||||||
|
end, {desc = 'Add folder to workspace'})
|
||||||
|
|
||||||
|
command('LspWorkspaceList', function()
|
||||||
|
vim.notify(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
|
end, {desc = 'List workspace folders'})
|
||||||
|
|
||||||
|
command('LspWorkspaceRemove', function()
|
||||||
|
vim.lsp.buf.remove_workspace_folder()
|
||||||
|
end, {desc = 'Remove folder from workspace'})
|
||||||
|
end
|
||||||
|
|
||||||
|
local function lsp_attach(client, bufnr)
|
||||||
|
local buf_command = vim.api.nvim_buf_create_user_command
|
||||||
|
|
||||||
|
lsp_keymaps(bufnr)
|
||||||
|
|
||||||
|
buf_command(bufnr, 'LspFormat', function()
|
||||||
|
vim.lsp.buf.format()
|
||||||
|
end, {desc = 'Format buffer with language server'})
|
||||||
|
end
|
||||||
|
|
||||||
|
lsp_settings()
|
||||||
|
|
||||||
|
require('mason').setup({})
|
||||||
|
require('mason-lspconfig').setup({})
|
||||||
|
|
||||||
|
local get_servers = require('mason-lspconfig').get_installed_servers
|
||||||
|
for _, server_name in ipairs(get_servers()) do
|
||||||
|
lspconfig[server_name].setup({
|
||||||
|
on_attach = lsp_attach,
|
||||||
|
capabilities = require('cmp_nvim_lsp').default_capabilities(),
|
||||||
|
})
|
||||||
|
end
|
12
after/plugin/lspsignature.lua
Normal file
12
after/plugin/lspsignature.lua
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
local status_ok, lspsignature = pcall(require, "lsp_signature")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
lspsignature.setup {
|
||||||
|
hint_enable = false,
|
||||||
|
floating_window = true,
|
||||||
|
handler_opts = {
|
||||||
|
border = "shadow"
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,9 @@
|
|||||||
local ls = require('luasnip')
|
local status_ok, luasnip = pcall(require, "luasnip")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
ls.config.set_config {
|
luasnip.config.set_config {
|
||||||
-- return back into snippet
|
-- return back into snippet
|
||||||
history = true,
|
history = true,
|
||||||
|
|
9
after/plugin/marks.lua
Normal file
9
after/plugin/marks.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
local status_ok, marks = pcall(require, "marks")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
marks.setup {
|
||||||
|
default_mappings = true,
|
||||||
|
builtin_marks = nil,
|
||||||
|
}
|
8
after/plugin/mason-dap.lua
Normal file
8
after/plugin/mason-dap.lua
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
local status_ok, masondap = pcall(require, "mason-nvim-dap")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
masondap.setup {
|
||||||
|
automatic_setup = true,
|
||||||
|
}
|
29
after/plugin/mason.lua
Normal file
29
after/plugin/mason.lua
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
local status_ok, mason = pcall(require, "mason")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
mason.setup({
|
||||||
|
ui = {
|
||||||
|
border = "shadow",
|
||||||
|
width = 0.6,
|
||||||
|
height = 0.9,
|
||||||
|
|
||||||
|
icons = {
|
||||||
|
package_installed = "+",
|
||||||
|
package_pending = "?",
|
||||||
|
package_uninstalled = "x"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
keymaps = {
|
||||||
|
toggle_package_expand = "<CR>",
|
||||||
|
install_package = "i", -- Keymap to install the package under the current cursor position
|
||||||
|
update_package = "u", -- Keymap to reinstall/update the package under the current cursor position
|
||||||
|
check_package_version = "c", -- Keymap to check for new version for the package under the current cursor position
|
||||||
|
update_all_packages = "U", -- Keymap to update all installed packages
|
||||||
|
check_outdated_packages = "C", -- Keymap to check which installed packages are outdated
|
||||||
|
uninstall_package = "r", -- Keymap to uninstall a package
|
||||||
|
cancel_installation = "<C-c>", -- Keymap to cancel a package installation
|
||||||
|
apply_language_filter = "<C-f>", -- Keymap to apply language filter
|
||||||
|
},
|
||||||
|
})
|
18
after/plugin/masontool.lua
Normal file
18
after/plugin/masontool.lua
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
local status_ok, masontool = pcall(require, "mason-tool-installer")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
masontool.setup {
|
||||||
|
-- a list of all tools you want to ensure are installed upon
|
||||||
|
-- start; they should be the names Mason uses for each tool
|
||||||
|
ensure_installed = {
|
||||||
|
'lua-language-server',
|
||||||
|
'stylua',
|
||||||
|
'shellcheck',
|
||||||
|
'editorconfig-checker',
|
||||||
|
'shfmt',
|
||||||
|
'clangd',
|
||||||
|
'clang-format',
|
||||||
|
},
|
||||||
|
}
|
34
after/plugin/neorg.lua
Normal file
34
after/plugin/neorg.lua
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
local status_ok, neorg = pcall(require, "neorg")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
neorg.setup {
|
||||||
|
load = {
|
||||||
|
["core.defaults"] = {},
|
||||||
|
["core.dirman"] = {
|
||||||
|
config = {
|
||||||
|
workspaces = {
|
||||||
|
home = "~/Documents/notes/home",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["core.concealer"] = {
|
||||||
|
config = {
|
||||||
|
dim_code_blocks = {
|
||||||
|
padding = { right = 2, },
|
||||||
|
content_only = false,
|
||||||
|
width = "content",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
["core.export"] = {},
|
||||||
|
["core.completion"] = {
|
||||||
|
config = {
|
||||||
|
engine = "nvim-cmp",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- vim.cmd('Neorg sync-parsers')
|
16
after/plugin/notify.lua
Normal file
16
after/plugin/notify.lua
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
local status_ok, notify = pcall(require, "notify")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
notify.setup {
|
||||||
|
icons = {
|
||||||
|
DEBUG = "B",
|
||||||
|
ERROR = "x",
|
||||||
|
INFO = "i",
|
||||||
|
TRACE = "t",
|
||||||
|
WARN = "!"
|
||||||
|
},
|
||||||
|
minimum_width = 35,
|
||||||
|
max_width = 80,
|
||||||
|
}
|
10
after/plugin/project.lua
Normal file
10
after/plugin/project.lua
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
local status_ok, project = pcall(require, "project_nvim")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
project.setup {
|
||||||
|
detection_methods = { "pattern" },
|
||||||
|
patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" },
|
||||||
|
show_hidden = false,
|
||||||
|
}
|
22
after/plugin/scrollbar.lua
Normal file
22
after/plugin/scrollbar.lua
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
local status_ok, scrollbar = pcall(require, "scrollbar")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
scrollbar.setup({
|
||||||
|
hide_if_all_visible = true,
|
||||||
|
handle = {
|
||||||
|
hide_if_all_visible = true,
|
||||||
|
},
|
||||||
|
marks = {
|
||||||
|
Cursor = {
|
||||||
|
text = "*",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handlers = {
|
||||||
|
cursor = true,
|
||||||
|
diagnostic = true,
|
||||||
|
gitsigns = true, -- Requires gitsigns
|
||||||
|
handle = true,
|
||||||
|
},
|
||||||
|
})
|
@ -1,12 +1,18 @@
|
|||||||
local sfm = require('sfm')
|
local status_ok, sfm = pcall(require, "sfm")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
sfm.setup {
|
sfm.setup {
|
||||||
view = {
|
view = {
|
||||||
side = "left", -- side of the tree, can be `left`, `right`
|
side = 'right',
|
||||||
width = 30
|
width = 35,
|
||||||
},
|
},
|
||||||
mappings = {
|
mappings = {
|
||||||
custom_only = false,
|
custom_only = false,
|
||||||
|
list = {
|
||||||
|
-- user mappings go here
|
||||||
|
}
|
||||||
},
|
},
|
||||||
renderer = {
|
renderer = {
|
||||||
icons = {
|
icons = {
|
||||||
@ -24,17 +30,17 @@ sfm.setup {
|
|||||||
folder_closed = "",
|
folder_closed = "",
|
||||||
folder_open = "",
|
folder_open = "",
|
||||||
file = "",
|
file = "",
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
}:load_extension('sfm-git', {
|
}:load_extension('sfm-git', {
|
||||||
icons = {
|
icons = {
|
||||||
staged = "^",
|
|
||||||
unstaged = "+",
|
unstaged = "+",
|
||||||
unmerged = "",
|
staged = "S",
|
||||||
renamed = ">",
|
unmerged = "U",
|
||||||
|
renamed = "r",
|
||||||
untracked = "?",
|
untracked = "?",
|
||||||
deleted = "x",
|
deleted = "-",
|
||||||
ignored = "#"
|
ignored = "?",
|
||||||
}
|
}
|
||||||
})
|
})
|
28
after/plugin/smartsplits.lua
Normal file
28
after/plugin/smartsplits.lua
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
local status_ok, smartsplits = pcall(require, "smart-splits")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
smartsplits.setup {
|
||||||
|
default_amount = 3,
|
||||||
|
resize_mode = {
|
||||||
|
quit_key = '<leader>r',
|
||||||
|
resize_keys = {
|
||||||
|
'<C-h>',
|
||||||
|
'<C-j>',
|
||||||
|
'<C-k>',
|
||||||
|
'<C-l>',
|
||||||
|
},
|
||||||
|
silent = true,
|
||||||
|
hooks = {
|
||||||
|
on_enter = function()
|
||||||
|
vim.notify("Resize mode on", vim.log.levels.INFO, { title = "Smart Splits" })
|
||||||
|
vim.cmd('unmap <leader>r')
|
||||||
|
end,
|
||||||
|
on_leave = function()
|
||||||
|
vim.notify("Resize Mode off", vim.log.levels.INFO, { title = "Smart Splits" })
|
||||||
|
vim.keymap.set('n', '<leader>r', smartsplits.start_resize_mode, {})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
71
after/plugin/startpage.lua
Normal file
71
after/plugin/startpage.lua
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
local status_ok, alpha = pcall(require, "alpha")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- buttons
|
||||||
|
local function button(sc, txt, keybind)
|
||||||
|
local opts = {
|
||||||
|
position = "center",
|
||||||
|
shortcut = sc,
|
||||||
|
cursor = 5,
|
||||||
|
width = 80,
|
||||||
|
align_shortcut = "right",
|
||||||
|
hl_shortcut = "Keyword",
|
||||||
|
}
|
||||||
|
local function on_press()
|
||||||
|
local key = vim.api.nvim_replace_termcodes(keybind .. "<Ignore>", true, false, true)
|
||||||
|
vim.api.nvim_feedkeys(key, "t", false)
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
type = "button",
|
||||||
|
val = txt,
|
||||||
|
on_press = on_press,
|
||||||
|
opts = opts,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- actual config
|
||||||
|
local R = {}
|
||||||
|
|
||||||
|
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
|
136
after/plugin/statusline.lua
Normal file
136
after/plugin/statusline.lua
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
local status_ok, el = pcall(require, "el")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
el.reset_windows()
|
||||||
|
|
||||||
|
local builtin = require "el.builtin"
|
||||||
|
local sections = require "el.sections"
|
||||||
|
local c = require "components"
|
||||||
|
|
||||||
|
-- color setup
|
||||||
|
local hl_statusline = "StatusLine"
|
||||||
|
--diagnostic colors
|
||||||
|
local hl_hint = "DiagnosticHint"
|
||||||
|
local hl_info = "DiagnosticInfo"
|
||||||
|
local hl_warn = "DiagnosticWarn"
|
||||||
|
local hl_err = "DiagnosticError"
|
||||||
|
-- git colors
|
||||||
|
local hl_red = "ErrorMsg"
|
||||||
|
local hl_green = "diffAdded"
|
||||||
|
local hl_yellow = "WarningMsg"
|
||||||
|
local highlights = {
|
||||||
|
-- diagnostic colors
|
||||||
|
diag_err = c.extract_hl({
|
||||||
|
bg = { [hl_statusline] = "bg" },
|
||||||
|
fg = { [hl_err] = "fg" },
|
||||||
|
bold = true,
|
||||||
|
}),
|
||||||
|
diag_warn = c.extract_hl({
|
||||||
|
bg = { [hl_statusline] = "bg" },
|
||||||
|
fg = { [hl_warn] = "fg" },
|
||||||
|
bold = true,
|
||||||
|
}),
|
||||||
|
diag_info = c.extract_hl({
|
||||||
|
bg = { [hl_statusline] = "bg" },
|
||||||
|
fg = { [hl_info] = "fg" },
|
||||||
|
bold = true,
|
||||||
|
}),
|
||||||
|
diag_hint = c.extract_hl({
|
||||||
|
bg = { [hl_statusline] = "bg" },
|
||||||
|
fg = { [hl_hint] = "fg" },
|
||||||
|
bold = true,
|
||||||
|
}),
|
||||||
|
|
||||||
|
-- git colors
|
||||||
|
red_fg = c.extract_hl({
|
||||||
|
bg = { [hl_statusline] = "bg" },
|
||||||
|
fg = { [hl_red] = "fg" },
|
||||||
|
bold = true,
|
||||||
|
}),
|
||||||
|
green_fg = c.extract_hl({
|
||||||
|
bg = { [hl_statusline] = "bg" },
|
||||||
|
fg = { [hl_green] = "fg" },
|
||||||
|
bold = true,
|
||||||
|
}),
|
||||||
|
yellow_fg = c.extract_hl({
|
||||||
|
bg = { [hl_statusline] = "bg" },
|
||||||
|
fg = { [hl_yellow] = "fg" },
|
||||||
|
bold = true,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
|
||||||
|
-- modes
|
||||||
|
local modes = {
|
||||||
|
-- display name, mode, highlight group
|
||||||
|
n = { "Normal", "N" },
|
||||||
|
niI = { "Normal", "N" },
|
||||||
|
niR = { "Normal", "N" },
|
||||||
|
niV = { "Normal", "N" },
|
||||||
|
no = { "N·OpPd", "?" },
|
||||||
|
v = { "Visual", "V" },
|
||||||
|
V = { "V·Line", "Vl" },
|
||||||
|
[""] = { "V·Block", "Vb" },
|
||||||
|
s = { "Select", "S" },
|
||||||
|
S = { "S·Line", "Sl" },
|
||||||
|
[""] = { "S·Block", "Sb" },
|
||||||
|
i = { "Insert", "I" },
|
||||||
|
ic = { "ICompl", "Ic" },
|
||||||
|
R = { "Replace", "R" },
|
||||||
|
Rv = { "VReplace", "Rv" },
|
||||||
|
c = { "Command", "C" },
|
||||||
|
cv = { "Vim Ex", "E" },
|
||||||
|
ce = { "Ex (r)", "E" },
|
||||||
|
r = { "Prompt", "P" },
|
||||||
|
rm = { "More ", "M" },
|
||||||
|
["r?"] = { "Confirm", "Cn" },
|
||||||
|
["!"] = { "Shell ", "S" },
|
||||||
|
nt = { "Term ", "T" },
|
||||||
|
t = { "Term ", "T" },
|
||||||
|
}
|
||||||
|
|
||||||
|
el.setup {
|
||||||
|
generator = function()
|
||||||
|
|
||||||
|
local items = {
|
||||||
|
{ c.mode { modes = modes, fmt = " %s %s ", icon = "", hl_icon_only = false } },
|
||||||
|
{ sections.split, required = true },
|
||||||
|
{ sections.collapse_builtin { { builtin.filetype }, { " " } } },
|
||||||
|
{ sections.maximum_width(builtin.tail_file, 0.50), required = true },
|
||||||
|
{ sections.collapse_builtin { { " " }, { builtin.modified_flag } } },
|
||||||
|
{ sections.split, required = true },
|
||||||
|
{ c.diagnostics {
|
||||||
|
fmt = "[%s]", lsp = true,
|
||||||
|
hl_err = highlights.diag_err,
|
||||||
|
hl_warn = highlights.diag_warn,
|
||||||
|
hl_info = highlights.diag_info,
|
||||||
|
hl_hint = highlights.diag_hint,
|
||||||
|
icon_err = 'x', icon_warn = '!', icon_info = 'i', icon_hint = 'h'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ c.git_branch { fmt = "%s *%s", icon = "" } },
|
||||||
|
{ c.git_changes_buf {
|
||||||
|
fmt = "[%s]",
|
||||||
|
icon_insert = "+",
|
||||||
|
icon_change = "~",
|
||||||
|
icon_delete = "-",
|
||||||
|
hl_insert = highlights.green_fg,
|
||||||
|
hl_change = highlights.yellow_fg,
|
||||||
|
hl_delete = highlights.red_fg,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local add_item = function(result, item)
|
||||||
|
table.insert(result, item)
|
||||||
|
end
|
||||||
|
|
||||||
|
local result = {}
|
||||||
|
for _, item in ipairs(items) do
|
||||||
|
add_item(result, item)
|
||||||
|
end
|
||||||
|
|
||||||
|
return result
|
||||||
|
end,
|
||||||
|
}
|
9
after/plugin/tabline.lua
Normal file
9
after/plugin/tabline.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
local status_ok, luatab = pcall(require, "luatab")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
luatab.setup {
|
||||||
|
windowCount = function() return '' end,
|
||||||
|
devicon = function() return '' end,
|
||||||
|
}
|
@ -1,13 +1,20 @@
|
|||||||
local telescope = require('telescope')
|
local status_ok, telescope = pcall(require, "telescope")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
local actions = require('telescope.actions')
|
local actions = require('telescope.actions')
|
||||||
|
|
||||||
telescope.setup {
|
telescope.setup {
|
||||||
defaults = {
|
defaults = {
|
||||||
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
|
borderchars = {
|
||||||
|
prompt = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' };
|
||||||
|
results = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' };
|
||||||
|
preview = {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' };
|
||||||
|
},
|
||||||
sorting_strategy = 'ascending',
|
sorting_strategy = 'ascending',
|
||||||
|
layout_strategy = 'bottom_pane',
|
||||||
layout_config = {
|
layout_config = {
|
||||||
height = 0.9,
|
height = 0.3,
|
||||||
prompt_position = 'top',
|
|
||||||
},
|
},
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
@ -25,16 +32,16 @@ telescope.setup {
|
|||||||
},
|
},
|
||||||
extensions = {
|
extensions = {
|
||||||
["ui-select"] = {
|
["ui-select"] = {
|
||||||
require("telescope.themes").get_dropdown {
|
require("telescope.themes").get_ivy {
|
||||||
-- even more opts
|
-- even more opts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
telescope.load_extension('undo')
|
|
||||||
telescope.load_extension('file_browser')
|
telescope.load_extension('file_browser')
|
||||||
telescope.load_extension('ui-select')
|
telescope.load_extension('ui-select')
|
||||||
|
telescope.load_extension('projects')
|
||||||
|
|
||||||
a.nvim_create_autocmd('User', {
|
a.nvim_create_autocmd('User', {
|
||||||
pattern = 'TelescopePreviewerLoaded',
|
pattern = 'TelescopePreviewerLoaded',
|
33
after/plugin/toggleterm.lua
Normal file
33
after/plugin/toggleterm.lua
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
local status_ok, toggleterm = pcall(require, "toggleterm")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
toggleterm.setup {
|
||||||
|
shade_terminals = true,
|
||||||
|
float_opts = {
|
||||||
|
border = 'shadow',
|
||||||
|
},
|
||||||
|
on_open = function()
|
||||||
|
vim.opt.cmdheight = 0
|
||||||
|
end,
|
||||||
|
on_close = function()
|
||||||
|
vim.opt.cmdheight = 1
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
local term = require('toggleterm.terminal').Terminal
|
||||||
|
local glow = term:new({
|
||||||
|
cmd = "glow",
|
||||||
|
hidden = true,
|
||||||
|
direction = "float",
|
||||||
|
float_opts = {
|
||||||
|
border = "shadow",
|
||||||
|
width = 120,
|
||||||
|
height = 50,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function _glow()
|
||||||
|
glow:toggle()
|
||||||
|
end
|
@ -1,4 +1,9 @@
|
|||||||
require("trouble").setup {
|
local status_ok, trouble = pcall(require, "trouble")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
trouble.setup {
|
||||||
icons = false,
|
icons = false,
|
||||||
fold_open = "v",
|
fold_open = "v",
|
||||||
fold_closed = ">",
|
fold_closed = ">",
|
27
after/plugin/ts.lua
Normal file
27
after/plugin/ts.lua
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
local status_ok, treesitter = pcall(require, "nvim-treesitter.configs")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
treesitter.setup {
|
||||||
|
ensure_installed = {
|
||||||
|
"c",
|
||||||
|
"lua",
|
||||||
|
"bash",
|
||||||
|
"vim",
|
||||||
|
"vimdoc",
|
||||||
|
"query",
|
||||||
|
"git_rebase",
|
||||||
|
"gitattributes",
|
||||||
|
"gitcommit",
|
||||||
|
"gitignore",
|
||||||
|
"git_config",
|
||||||
|
},
|
||||||
|
|
||||||
|
auto_install = true,
|
||||||
|
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
}
|
10
after/plugin/tsc.lua
Normal file
10
after/plugin/tsc.lua
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
local status_ok, tc = pcall(require, "treesitter-context")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
tc.setup{
|
||||||
|
enable = true,
|
||||||
|
line_numbers = true,
|
||||||
|
separator = '-',
|
||||||
|
}
|
9
after/plugin/tsj.lua
Normal file
9
after/plugin/tsj.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
local status_ok, treesj = pcall(require, "treesj")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
treesj.setup {
|
||||||
|
use_default_keymaps = false,
|
||||||
|
max_join_length = 120,
|
||||||
|
}
|
8
after/plugin/urlview.lua
Normal file
8
after/plugin/urlview.lua
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
local status_ok, urlview = pcall(require, "urlview")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
urlview.setup {
|
||||||
|
default_picker = 'telescope',
|
||||||
|
}
|
20
after/plugin/whichkey.lua
Normal file
20
after/plugin/whichkey.lua
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
local status_ok, whichkey = pcall(require, "which-key")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
whichkey.setup {
|
||||||
|
icons = {
|
||||||
|
breadcrumb = '>>',
|
||||||
|
separator = '->',
|
||||||
|
},
|
||||||
|
winblend = 0,
|
||||||
|
window = {
|
||||||
|
border = 'shadow',
|
||||||
|
margin = { 1, 5, 2, 5 },
|
||||||
|
},
|
||||||
|
layout = {
|
||||||
|
width = { min = 20, max = 50 },
|
||||||
|
align = 'left',
|
||||||
|
}
|
||||||
|
}
|
18
init.lua
18
init.lua
@ -1,9 +1,15 @@
|
|||||||
-- global shorthands
|
-- shorhands ------------------------------------------------------------------
|
||||||
o = vim.opt
|
o = vim.opt
|
||||||
g = vim.g
|
|
||||||
a = vim.api
|
a = vim.api
|
||||||
cmd = vim.cmd
|
g = vim.g
|
||||||
g.mapleader = " "
|
c = vim.cmd
|
||||||
|
|
||||||
-- load config
|
-- main lua files -------------------------------------------------------------
|
||||||
require('core.init')
|
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$', ''))
|
||||||
|
end
|
||||||
|
56
lua/.luarc.json
Normal file
56
lua/.luarc.json
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
"diagnostics.globals": [
|
||||||
|
"vim",
|
||||||
|
"a",
|
||||||
|
"o",
|
||||||
|
"g"
|
||||||
|
],
|
||||||
|
"workspace.library": [
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/neodev.nvim/types/stable",
|
||||||
|
"/usr/share/nvim/runtime/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/Comment.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/LuaSnip/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/cmp-buffer/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/cmp-calc/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/cmp-luasnip-choice/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/cmp-nvim-lsp/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/cmp-nvim-lua/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/cmp-path/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/cmp-under-comparator/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/cmp_luasnip/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/dep/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/express_line.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/gitsigns.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/hlargs.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/impatient.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/indent-blankline.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/intellitab.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/lsp_signature.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/lspkind.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/marks.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/mason-lspconfig.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/mason-tool-installer.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/mason.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/mellow.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/modicator.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/neodev.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-autopairs/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-cmp/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-colorizer.lua/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-lsp-notify/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-lspconfig/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-neoclip.lua/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-notify/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-scrollbar/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-treesitter/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/plenary.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/telescope-file-browser.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/telescope-ui-select.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/telescope.nvim/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/treesj/lua",
|
||||||
|
"/home/squibid/.local/share/nvim/site/pack/deps/opt/which-key.nvim/lua",
|
||||||
|
"/home/squibid/.config/nvim/lua",
|
||||||
|
"${3rd}/luv/library"
|
||||||
|
],
|
||||||
|
"workspace.checkThirdParty": false
|
||||||
|
}
|
7
lua/bootstrap.lua
Normal file
7
lua/bootstrap.lua
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
local path = vim.fn.stdpath("data") .. "/site/pack/deps/opt/dep"
|
||||||
|
|
||||||
|
if vim.fn.empty(vim.fn.glob(path)) > 0 then
|
||||||
|
vim.fn.system({ "git", "clone", "--depth=1", "https://git.squi.bid/dep", path })
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.cmd("packadd dep")
|
340
lua/components.lua
Normal file
340
lua/components.lua
Normal file
@ -0,0 +1,340 @@
|
|||||||
|
if not pcall(require, "el") then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local Job = require "plenary.job"
|
||||||
|
local el_sub = require "el.subscribe"
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
function M.extract_hl(spec)
|
||||||
|
if not spec or vim.tbl_isempty(spec) then return end
|
||||||
|
local hl_name, hl_opts = { "El" }, {}
|
||||||
|
for attr, val in pairs(spec) do
|
||||||
|
if type(val) == "table" then
|
||||||
|
table.insert(hl_name, attr)
|
||||||
|
assert(vim.tbl_count(val) == 1)
|
||||||
|
local hl, what = next(val)
|
||||||
|
local hlID = vim.fn.hlID(hl)
|
||||||
|
if hlID > 0 then
|
||||||
|
table.insert(hl_name, hl)
|
||||||
|
local col = vim.fn.synIDattr(hlID, what)
|
||||||
|
if col and #col > 0 then
|
||||||
|
table.insert(hl_name, what)
|
||||||
|
hl_opts[attr] = col
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- bold, underline, etc
|
||||||
|
hl_opts[attr] = val
|
||||||
|
end
|
||||||
|
end
|
||||||
|
hl_name = table.concat(hl_name, "_")
|
||||||
|
-- if highlight exists, verify it has
|
||||||
|
-- the correct colorscheme highlights
|
||||||
|
local newID = vim.fn.hlID(hl_name)
|
||||||
|
if newID > 0 then
|
||||||
|
for what, expected in pairs(hl_opts) do
|
||||||
|
local res = vim.fn.synIDattr(newID, what)
|
||||||
|
if type(expected) == "boolean" then
|
||||||
|
-- synIDattr returns '1' for boolean
|
||||||
|
res = res and res == "1" and true
|
||||||
|
end
|
||||||
|
if res ~= expected then
|
||||||
|
-- need to regen the highlight
|
||||||
|
-- print("color mismatch", hl_name, what, "e:", expected, "c:", res)
|
||||||
|
newID = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if newID == 0 then
|
||||||
|
vim.api.nvim_set_hl(0, hl_name, hl_opts)
|
||||||
|
end
|
||||||
|
return hl_name
|
||||||
|
end
|
||||||
|
|
||||||
|
local function set_hl(hls, s)
|
||||||
|
if not hls or not s then return s end
|
||||||
|
hls = type(hls) == "string" and { hls } or hls
|
||||||
|
for _, hl in ipairs(hls) do
|
||||||
|
if vim.fn.hlID(hl) > 0 then
|
||||||
|
return ("%%#%s#%s%%0*"):format(hl, s)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return s
|
||||||
|
end
|
||||||
|
|
||||||
|
local function wrap_fnc(opts, fn)
|
||||||
|
return function(window, buffer)
|
||||||
|
-- buf_autocmd doesn't send win
|
||||||
|
if not window and buffer then
|
||||||
|
window = { win_id = vim.fn.bufwinid(buffer.bufnr) }
|
||||||
|
end
|
||||||
|
if opts.hide_inactive and window and
|
||||||
|
window.win_id ~= vim.api.nvim_get_current_win() then
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
return fn(window, buffer)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
M.mode = function(opts)
|
||||||
|
opts = opts or {}
|
||||||
|
return wrap_fnc(opts, function(_, _)
|
||||||
|
local fmt = opts.fmt or "%s%s"
|
||||||
|
local mode = vim.api.nvim_get_mode().mode
|
||||||
|
local mode_data = opts.modes and opts.modes[mode]
|
||||||
|
local hls = mode_data and mode_data[3]
|
||||||
|
local icon = opts.hl_icon_only and set_hl(hls, opts.icon) or opts.icon
|
||||||
|
mode = mode_data and mode_data[1]:upper() or mode
|
||||||
|
mode = (fmt):format(icon or "", mode)
|
||||||
|
return not opts.hl_icon_only and set_hl(hls, mode) or mode
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
M.try_devicons = function()
|
||||||
|
if not M._has_devicons then
|
||||||
|
M._has_devicons, M._devicons = pcall(require, "nvim-web-devicons")
|
||||||
|
end
|
||||||
|
return M._devicons
|
||||||
|
end
|
||||||
|
|
||||||
|
M.file_icon = function(opts)
|
||||||
|
opts = opts or {}
|
||||||
|
return el_sub.buf_autocmd("el_file_icon", "BufRead",
|
||||||
|
wrap_fnc(opts, function(_, buffer)
|
||||||
|
if not M.try_devicons() then return "" end
|
||||||
|
local fmt = opts.fmt or "%s"
|
||||||
|
local ext = vim.fn.fnamemodify(buffer.name, ":p:e")
|
||||||
|
local icon, hl = M._devicons.get_icon(buffer.name, ext:lower(), { default = true })
|
||||||
|
-- local icon = extensions.file_icon(_, bufnr)
|
||||||
|
if icon then
|
||||||
|
if opts.hl_icon then
|
||||||
|
local hlgroup = M.extract_hl({
|
||||||
|
bg = { StatusLine = "bg" },
|
||||||
|
fg = { [hl] = "fg" },
|
||||||
|
})
|
||||||
|
icon = set_hl(hlgroup, icon)
|
||||||
|
end
|
||||||
|
return (fmt):format(icon)
|
||||||
|
end
|
||||||
|
return ""
|
||||||
|
end))
|
||||||
|
end
|
||||||
|
|
||||||
|
M.git_branch = function(opts)
|
||||||
|
opts = opts or {}
|
||||||
|
return el_sub.buf_autocmd("el_git_branch", "BufEnter",
|
||||||
|
wrap_fnc(opts, function(_, buffer)
|
||||||
|
-- Try fugitive first as it's most reliable
|
||||||
|
local branch = vim.g.loaded_fugitive == 1 and
|
||||||
|
vim.fn.FugitiveHead() or nil
|
||||||
|
-- buffer can be null and code will crash with:
|
||||||
|
-- E5108: Error executing lua ... 'attempt to index a nil value'
|
||||||
|
if not buffer or not (buffer.bufnr > 0) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- fugitive is empty or not loaded, try gitsigns
|
||||||
|
if not branch or #branch == 0 then
|
||||||
|
local ok, res = pcall(vim.api.nvim_buf_get_var,
|
||||||
|
buffer.bufnr, "gitsigns_head")
|
||||||
|
if ok then branch = res end
|
||||||
|
end
|
||||||
|
-- last resort run git command
|
||||||
|
if not branch then
|
||||||
|
local j = Job:new {
|
||||||
|
command = "git",
|
||||||
|
args = { "branch", "--show-current" },
|
||||||
|
cwd = vim.fn.fnamemodify(buffer.name, ":h"),
|
||||||
|
}
|
||||||
|
|
||||||
|
local ok, result = pcall(function()
|
||||||
|
return vim.trim(j:sync()[1])
|
||||||
|
end)
|
||||||
|
if ok then
|
||||||
|
branch = result
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if branch and #branch > 0 then
|
||||||
|
local fmt = opts.fmt or "%s %s"
|
||||||
|
local icon = opts.icon or ""
|
||||||
|
return set_hl(opts.hl, (fmt):format(icon, branch))
|
||||||
|
end
|
||||||
|
end))
|
||||||
|
end
|
||||||
|
|
||||||
|
local git_changes_formatter = function(opts)
|
||||||
|
local specs = {
|
||||||
|
insert = {
|
||||||
|
regex = "(%d+) insertions?",
|
||||||
|
icon = opts.icon_insert or "+",
|
||||||
|
hl = opts.hl_insert,
|
||||||
|
},
|
||||||
|
change = {
|
||||||
|
regex = "(%d+) files? changed",
|
||||||
|
icon = opts.icon_change or "~",
|
||||||
|
hl = opts.hl_change,
|
||||||
|
},
|
||||||
|
delete = {
|
||||||
|
regex = "(%d+) deletions?",
|
||||||
|
icon = opts.icon_delete or "-",
|
||||||
|
hl = opts.hl_delete,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return function(_, _, s)
|
||||||
|
local result = {}
|
||||||
|
for k, v in pairs(specs) do
|
||||||
|
local count = nil
|
||||||
|
if type(s) == "string" then
|
||||||
|
-- 'git diff --shortstat' output
|
||||||
|
-- from 'git_changes_all'
|
||||||
|
count = tonumber(string.match(s, v.regex))
|
||||||
|
else
|
||||||
|
-- map from 'git_changes_buf'
|
||||||
|
count = s[k]
|
||||||
|
end
|
||||||
|
if count and count > 0 then
|
||||||
|
table.insert(result, set_hl(v.hl, ("%s%d"):format(v.icon, count)))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return table.concat(result, ", ")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- requires gitsigns
|
||||||
|
M.git_changes_buf = function(opts)
|
||||||
|
opts = opts or {}
|
||||||
|
local formatter = opts.formatter or git_changes_formatter(opts)
|
||||||
|
return wrap_fnc(opts, function(window, buffer)
|
||||||
|
local stats = {}
|
||||||
|
if buffer and buffer.bufnr > 0 then
|
||||||
|
local ok, res = pcall(vim.api.nvim_buf_get_var,
|
||||||
|
buffer.bufnr, "vgit_status")
|
||||||
|
if ok then stats = res end
|
||||||
|
end
|
||||||
|
if buffer and buffer.bufnr > 0 then
|
||||||
|
local ok, res = pcall(vim.api.nvim_buf_get_var,
|
||||||
|
buffer.bufnr, "gitsigns_status_dict")
|
||||||
|
if ok then stats = res end
|
||||||
|
end
|
||||||
|
local counts = {
|
||||||
|
insert = stats.added > 0 and stats.added or nil,
|
||||||
|
change = stats.changed > 0 and stats.changed or nil,
|
||||||
|
delete = stats.removed > 0 and stats.removed or nil,
|
||||||
|
}
|
||||||
|
if not vim.tbl_isempty(counts) then
|
||||||
|
local fmt = opts.fmt or "%s"
|
||||||
|
local out = formatter(window, buffer, counts)
|
||||||
|
return out and fmt:format(out) or nil
|
||||||
|
else
|
||||||
|
-- el functions that return a
|
||||||
|
-- string must not return nil
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
M.git_changes_all = function(opts)
|
||||||
|
opts = opts or {}
|
||||||
|
local formatter = opts.formatter or git_changes_formatter(opts)
|
||||||
|
return el_sub.buf_autocmd("el_git_changes", "BufWritePost",
|
||||||
|
wrap_fnc(opts, function(window, buffer)
|
||||||
|
if not buffer or
|
||||||
|
not (buffer.bufnr > 0) or
|
||||||
|
vim.bo[buffer.bufnr].bufhidden ~= "" or
|
||||||
|
vim.bo[buffer.bufnr].buftype == "nofile" or
|
||||||
|
vim.fn.filereadable(buffer.name) ~= 1 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local j = Job:new {
|
||||||
|
command = "git",
|
||||||
|
args = { "diff", "--shortstat" },
|
||||||
|
-- makes no sense to run for one file as
|
||||||
|
-- 'file(s) changed' will always be 1
|
||||||
|
-- args = { "diff", "--shortstat", buffer.name },
|
||||||
|
cwd = vim.fn.fnamemodify(buffer.name, ":h"),
|
||||||
|
}
|
||||||
|
|
||||||
|
local ok, git_changes = pcall(function()
|
||||||
|
return formatter(window, buffer, vim.trim(j:sync()[1]))
|
||||||
|
end)
|
||||||
|
|
||||||
|
if ok then
|
||||||
|
local fmt = opts.fmt or "%s"
|
||||||
|
return git_changes and fmt:format(git_changes) or nil
|
||||||
|
end
|
||||||
|
end))
|
||||||
|
end
|
||||||
|
|
||||||
|
local function lsp_srvname(bufnr)
|
||||||
|
local buf_clients = vim.lsp.buf_get_clients(bufnr)
|
||||||
|
if not buf_clients or #buf_clients == 0 then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
local names = ""
|
||||||
|
for i, c in ipairs(buf_clients) do
|
||||||
|
if i > 1 then names = names .. ", " end
|
||||||
|
names = names .. c.name
|
||||||
|
end
|
||||||
|
return names
|
||||||
|
end
|
||||||
|
|
||||||
|
local function diag_formatter(opts)
|
||||||
|
return function(_, buffer, counts)
|
||||||
|
local items = {}
|
||||||
|
local icons = {
|
||||||
|
["errors"] = { opts.icon_err or "E", opts.hl_err },
|
||||||
|
["warnings"] = { opts.icon_warn or "W", opts.hl_warn },
|
||||||
|
["infos"] = { opts.icon_info or "I", opts.hl_info },
|
||||||
|
["hints"] = { opts.icon_hint or "H", opts.hl_hint },
|
||||||
|
}
|
||||||
|
for _, k in ipairs({ "errors", "warnings", "infos", "hints" }) do
|
||||||
|
if counts[k] > 0 then
|
||||||
|
table.insert(items,
|
||||||
|
set_hl(icons[k][2], ("%s:%s"):format(icons[k][1], counts[k])))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local fmt = opts.fmt or "%s"
|
||||||
|
local lsp_name = opts.lsp and lsp_srvname(buffer.bufnr)
|
||||||
|
if not lsp_name and vim.tbl_isempty(items) then
|
||||||
|
return ""
|
||||||
|
else
|
||||||
|
local contents = lsp_name
|
||||||
|
if not vim.tbl_isempty(items) then
|
||||||
|
contents = ("%s %s"):format(lsp_name, table.concat(items, " "))
|
||||||
|
end
|
||||||
|
return fmt:format(contents)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local get_buffer_counts = function(diagnostic, _, buffer)
|
||||||
|
local counts = { 0, 0, 0, 0 }
|
||||||
|
local diags = diagnostic.get(buffer.bufnr)
|
||||||
|
if diags and not vim.tbl_isempty(diags) then
|
||||||
|
for _, d in ipairs(diags) do
|
||||||
|
if tonumber(d.severity) then
|
||||||
|
counts[d.severity] = counts[d.severity] + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return {
|
||||||
|
errors = counts[1],
|
||||||
|
warnings = counts[2],
|
||||||
|
infos = counts[3],
|
||||||
|
hints = counts[4],
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
M.diagnostics = function(opts)
|
||||||
|
opts = opts or {}
|
||||||
|
local formatter = opts.formatter or diag_formatter(opts)
|
||||||
|
return el_sub.buf_autocmd("el_buf_diagnostic", "LspAttach,DiagnosticChanged",
|
||||||
|
wrap_fnc(opts, function(window, buffer)
|
||||||
|
return formatter(window, buffer, get_buffer_counts(vim.diagnostic, window, buffer))
|
||||||
|
end))
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
@ -1,73 +1,48 @@
|
|||||||
|
local function auto(event, opts)
|
||||||
|
a.nvim_create_autocmd(event, opts)
|
||||||
|
end
|
||||||
|
|
||||||
a.nvim_create_augroup('bufcheck', {clear = true})
|
a.nvim_create_augroup('bufcheck', {clear = true})
|
||||||
|
|
||||||
-- highlight yanks
|
-- highlight yanks
|
||||||
a.nvim_create_autocmd('TextYankPost', {
|
auto('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', {
|
|
||||||
group = 'bufcheck',
|
group = 'bufcheck',
|
||||||
pattern = 'term://*',
|
pattern = '*',
|
||||||
command = 'call nvim_input("<CR>")'
|
callback = function()
|
||||||
|
vim.highlight.on_yank{ timeout = 250 }
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- start git messages in insert mode
|
-- start git messages in insert mode
|
||||||
a.nvim_create_autocmd('FileType', {
|
auto('FileType', {
|
||||||
group = 'bufcheck',
|
group = 'bufcheck',
|
||||||
pattern = { 'gitcommit', 'gitrebase', },
|
pattern = { 'gitcommit', 'gitrebase', },
|
||||||
command = 'startinsert | 1'
|
command = 'startinsert | 1'
|
||||||
})
|
})
|
||||||
|
|
||||||
-- return to last place
|
-- return to last place
|
||||||
a.nvim_create_autocmd('BufRead', {
|
auto('BufRead', {
|
||||||
pattern = '*',
|
pattern = '*',
|
||||||
command = [[call setpos(".", getpos("'\""))]]
|
command = [[call setpos(".", getpos("'\""))]]
|
||||||
})
|
})
|
||||||
|
|
||||||
-- disable color column in certain files
|
-- start terminal in insert mode
|
||||||
a.nvim_create_autocmd('FileType', {
|
auto('TermOpen', {
|
||||||
pattern = {
|
group = 'bufcheck',
|
||||||
'netrw',
|
pattern = '*',
|
||||||
"help",
|
callback = function()
|
||||||
"term",
|
vim.cmd('startinsert | set winfixheight')
|
||||||
"gitcommit",
|
o.winfixheight = true
|
||||||
"packer",
|
o.cmdheight = 0
|
||||||
"vim",
|
end
|
||||||
"Trouble",
|
|
||||||
"norg",
|
|
||||||
"alpha"
|
|
||||||
},
|
|
||||||
command = 'set colorcolumn=0'
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- disable intent markers in certain files
|
-- close terminal buffers after shell dies
|
||||||
a.nvim_create_autocmd('FileType', {
|
auto('TermClose', {
|
||||||
pattern = {
|
group = 'bufcheck',
|
||||||
'netrw',
|
pattern = 'term://*',
|
||||||
"help",
|
callback = function()
|
||||||
"term",
|
vim.cmd('call nvim_input("<CR>")')
|
||||||
"gitcommit",
|
o.cmdheight = 1
|
||||||
"packer",
|
end
|
||||||
"vim",
|
|
||||||
"Trouble",
|
|
||||||
"norg",
|
|
||||||
"alpha"
|
|
||||||
},
|
|
||||||
command = 'IndentBlanklineDisable'
|
|
||||||
})
|
|
||||||
|
|
||||||
-- disable extra tildas in certain files
|
|
||||||
a.nvim_create_autocmd('FileType', {
|
|
||||||
pattern = '*',
|
|
||||||
command = 'hi NonText guifg=bg'
|
|
||||||
})
|
})
|
||||||
|
148
lua/core/binds.lua
Normal file
148
lua/core/binds.lua
Normal 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
6
lua/core/cmds.lua
Normal 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
7
lua/core/handler.lua
Normal 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
50
lua/core/highlight.lua
Normal 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' })
|
@ -1,6 +0,0 @@
|
|||||||
require('core.plugins')
|
|
||||||
require('core.opts')
|
|
||||||
require('core.maps')
|
|
||||||
require('core.auto')
|
|
||||||
require("core.snippets.init")
|
|
||||||
require('core.overrides.init')
|
|
@ -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})
|
|
@ -1,116 +1,57 @@
|
|||||||
---------------
|
-- better ui ------------------------------------------------------------------
|
||||||
-- better ui --
|
vim.notify = require("notify")
|
||||||
---------------
|
o.colorcolumn = { 80 }
|
||||||
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
|
|
||||||
|
|
||||||
o.wrap = true -- wrap lines
|
-- buffer
|
||||||
|
o.scrolloff = 5
|
||||||
|
o.wrap = true -- wraping lines
|
||||||
o.linebreak = true -- fix where line is wraped
|
o.linebreak = true -- fix where line is wraped
|
||||||
o.emoji = false -- something to do with the spacing of emojis
|
o.cursorline = true
|
||||||
o.clipboard = 'unnamedplus' -- use system clipboard
|
|
||||||
|
|
||||||
-- 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.expandtab = true
|
||||||
o.smarttab = true
|
o.smarttab = true
|
||||||
o.cindent = true
|
o.cindent = true
|
||||||
o.autoindent = true
|
o.autoindent = true
|
||||||
o.tabstop = 2
|
o.tabstop = tabwidth
|
||||||
o.shiftwidth = 2
|
o.shiftwidth = tabwidth
|
||||||
o.softtabstop = -1 -- If negative, shiftwidth value is used
|
o.softtabstop = tabwidth
|
||||||
|
|
||||||
-- spelling
|
-- colorscheme
|
||||||
o.spelllang = { 'en_us' }
|
|
||||||
|
|
||||||
-- colors
|
|
||||||
o.termguicolors = true
|
o.termguicolors = true
|
||||||
cmd('colorscheme jellybeans-nvim')
|
vim.cmd('colorscheme mellow')
|
||||||
|
|
||||||
-- diagnostics w/o virtual text
|
-- better editing -------------------------------------------------------------
|
||||||
vim.diagnostic.config({
|
o.clipboard = 'unnamedplus' -- system clipboard (on unix like)
|
||||||
underline = true,
|
|
||||||
virtual_text = false
|
|
||||||
})
|
|
||||||
|
|
||||||
colors = {
|
-- file saving ----------------------------------------------------------------
|
||||||
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 --
|
|
||||||
------------
|
|
||||||
o.swapfile = false
|
o.swapfile = false
|
||||||
o.undofile = true
|
o.undofile = true
|
||||||
o.confirm = true
|
o.confirm = true
|
||||||
|
|
||||||
------------
|
-- searching ------------------------------------------------------------------
|
||||||
-- search --
|
|
||||||
------------
|
|
||||||
o.ignorecase = true
|
o.ignorecase = true
|
||||||
o.smartcase = true
|
o.smartcase = true
|
||||||
o.wrapscan = true
|
o.wrapscan = true
|
||||||
o.showmatch = true
|
o.showmatch = true
|
||||||
|
o.incsearch = true
|
||||||
|
|
||||||
----------------
|
-- wild menus -----------------------------------------------------------------
|
||||||
-- wild menus --
|
|
||||||
----------------
|
|
||||||
o.wildoptions = 'pum'
|
o.wildoptions = 'pum'
|
||||||
o.pumblend = 3
|
o.pumblend = 3
|
||||||
o.pumheight = 20
|
o.pumheight = 20
|
||||||
@ -118,101 +59,9 @@ o.pumheight = 20
|
|||||||
o.wildignorecase = true
|
o.wildignorecase = true
|
||||||
o.wildignore = '*.o'
|
o.wildignore = '*.o'
|
||||||
|
|
||||||
-----------
|
-- netrw ----------------------------------------------------------------------
|
||||||
-- netrw --
|
g.netrw_banner = 1
|
||||||
-----------
|
|
||||||
g.netrw_banner = 0
|
|
||||||
g.netrw_localcopydircmd = 'cp -r'
|
g.netrw_localcopydircmd = 'cp -r'
|
||||||
g.netrw_winsize = 30
|
g.netrw_winsize = 30
|
||||||
g.netrw_liststyle = 1
|
g.netrw_liststyle = 1
|
||||||
|
g.netrw_preview = 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 })
|
|
||||||
|
@ -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 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)
|
|
@ -1,3 +0,0 @@
|
|||||||
require('cmp_luasnip_choice').setup {
|
|
||||||
auto_open = true,
|
|
||||||
}
|
|
@ -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
|
|
||||||
}
|
|
@ -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
|
|
@ -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')
|
|
@ -1 +0,0 @@
|
|||||||
require('lspkind').init()
|
|
@ -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()
|
|
@ -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'},
|
|
||||||
},
|
|
||||||
}
|
|
@ -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, },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
@ -1,9 +0,0 @@
|
|||||||
require('neoclip').setup {
|
|
||||||
keys = {
|
|
||||||
telescope = {
|
|
||||||
i = {
|
|
||||||
paste_behind = ' '
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
@ -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'] = {},
|
|
||||||
}
|
|
||||||
}
|
|
@ -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",
|
|
||||||
}
|
|
||||||
)
|
|
@ -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,
|
|
||||||
}
|
|
||||||
})
|
|
@ -1,7 +0,0 @@
|
|||||||
require('smart-splits').setup {
|
|
||||||
resize_mode = {
|
|
||||||
hooks = {
|
|
||||||
on_leave = require('bufresize').register
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
@ -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
|
|
@ -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,
|
|
||||||
},
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
require('treesj').setup({
|
|
||||||
use_default_keymaps = false,
|
|
||||||
})
|
|
@ -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",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
require("which-key").setup {
|
|
||||||
icons = {
|
|
||||||
breadcrumb = '>>',
|
|
||||||
separator = '->',
|
|
||||||
},
|
|
||||||
window = { winblend = 3, },
|
|
||||||
layout = { align = 'center', },
|
|
||||||
}
|
|
@ -1,111 +1,70 @@
|
|||||||
-- make sure lazy is installed
|
require 'dep' {
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
-- dep manages dep ----------------------------------------------------------
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
{ 'squibid/dep',
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
url = 'https://git.squi.bid/dep',
|
||||||
vim.fn.system({ "git", "clone", "--filter=blob:none",
|
branch = 'dev'
|
||||||
"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('lazy').setup{
|
-- preformance --------------------------------------------------------------
|
||||||
{ 'tamton-aquib/essentials.nvim' },
|
{ 'lewis6991/impatient.nvim' },
|
||||||
|
|
||||||
-- only the most useless plugins (some of these are also ui related)
|
-- ui -----------------------------------------------------------------------
|
||||||
{ 'goolord/alpha-nvim' },
|
{ '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' },
|
{ '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
|
-- functional plugins -------------------------------------------------------
|
||||||
{ 'metalelf0/jellybeans-nvim',
|
{ 'lewis6991/gitsigns.nvim' },
|
||||||
dependencies = 'rktjmp/lush.nvim',
|
{ 'chentoast/marks.nvim' },
|
||||||
lazy = false,
|
{ 'pta2002/intellitab.nvim' },
|
||||||
priority = 1000,
|
{ 'mbbill/undotree' }, -- careful this one is written in vimscript
|
||||||
},
|
{ 'windwp/nvim-autopairs' },
|
||||||
{ 'nvim-lualine/lualine.nvim' },
|
{ 'numToStr/Comment.nvim' },
|
||||||
{ 'utilyre/barbecue.nvim',
|
{ 'jghauser/mkdir.nvim' }, -- mkdir's when they dont exist
|
||||||
version = '*',
|
{ 'numtostr/BufOnly.nvim' }, -- kill the other buffers with :BufOnly
|
||||||
dependencies = {
|
{ 'ahmedkhalf/project.nvim' }, -- cd into root of project
|
||||||
'SmiteshP/nvim-navic',
|
{ 'akinsho/toggleterm.nvim' },
|
||||||
},
|
|
||||||
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' }
|
|
||||||
},
|
|
||||||
--
|
|
||||||
|
|
||||||
-- careful the following plugins might be considered useful proceed with caution
|
-- note taking --------------------------------------------------------------
|
||||||
-- muh fzf
|
{ 'nvim-neorg/neorg' },
|
||||||
|
|
||||||
|
-- fzf ----------------------------------------------------------------------
|
||||||
{ 'nvim-telescope/telescope.nvim',
|
{ 'nvim-telescope/telescope.nvim',
|
||||||
version = '0.1.*',
|
requires = 'nvim-lua/plenary.nvim',
|
||||||
dependencies = {
|
deps = {
|
||||||
'nvim-telescope/telescope-file-browser.nvim',
|
'nvim-telescope/telescope-file-browser.nvim',
|
||||||
'nvim-telescope/telescope-ui-select.nvim',
|
'nvim-telescope/telescope-ui-select.nvim',
|
||||||
'nvim-lua/plenary.nvim',
|
|
||||||
'debugloop/telescope-undo.nvim',
|
|
||||||
'AckslD/nvim-neoclip.lua',
|
'AckslD/nvim-neoclip.lua',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
--
|
|
||||||
|
|
||||||
-- movement
|
-- treesitter + colorizing --------------------------------------------------
|
||||||
{ '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
|
|
||||||
{ 'nvim-treesitter/nvim-treesitter',
|
{ 'nvim-treesitter/nvim-treesitter',
|
||||||
dependencies = {
|
deps = {
|
||||||
{ 'm-demare/hlargs.nvim', config = true },
|
{ 'm-demare/hlargs.nvim' },
|
||||||
'Wansmer/treesj',
|
{ 'Wansmer/treesj' },
|
||||||
|
{ 'nvim-treesitter/nvim-treesitter-context' },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ 'lewis6991/hover.nvim' },
|
{ 'NvChad/nvim-colorizer.lua' },
|
||||||
{ 'nvchad/nvim-colorizer.lua' },
|
|
||||||
{ 'VonHeikemen/lsp-zero.nvim' },
|
-- cmp ----------------------------------------------------------------------
|
||||||
{ 'hrsh7th/nvim-cmp',
|
{ 'hrsh7th/nvim-cmp',
|
||||||
dependencies = {
|
deps = {
|
||||||
'hrsh7th/cmp-buffer',
|
'hrsh7th/cmp-buffer',
|
||||||
'hrsh7th/cmp-path',
|
'hrsh7th/cmp-path',
|
||||||
'hrsh7th/cmp-calc',
|
'hrsh7th/cmp-calc',
|
||||||
@ -116,14 +75,35 @@ require('lazy').setup{
|
|||||||
'onsails/lspkind.nvim',
|
'onsails/lspkind.nvim',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{ 'ray-x/lsp_signature.nvim' },
|
||||||
|
|
||||||
|
-- snippets -----------------------------------------------------------------
|
||||||
{ 'L3MON4D3/LuaSnip',
|
{ 'L3MON4D3/LuaSnip',
|
||||||
version = 'v1.*',
|
deps = 'rafamadriz/friendly-snippets',
|
||||||
dependencies = 'rafamadriz/friendly-snippets',
|
|
||||||
},
|
},
|
||||||
{ 'doxnit/cmp-luasnip-choice' },
|
{ 'doxnit/cmp-luasnip-choice' },
|
||||||
|
|
||||||
|
-- lsp ----------------------------------------------------------------------
|
||||||
{ 'neovim/nvim-lspconfig' },
|
{ 'neovim/nvim-lspconfig' },
|
||||||
{ 'williamboman/mason.nvim' },
|
{ 'j-hui/fidget.nvim' }, -- shows lsp progress
|
||||||
{ 'williamboman/mason-lspconfig.nvim' },
|
{ 'folke/trouble.nvim' },
|
||||||
{ 'windwp/nvim-autopairs', config = true, },
|
|
||||||
--
|
-- 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' },
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,3 @@ parse = require("luasnip.util.parser").parse_snippet
|
|||||||
ri = function (insert_node_id)
|
ri = function (insert_node_id)
|
||||||
return f(function (args) return args[1][1] end, insert_node_id)
|
return f(function (args) return args[1][1] end, insert_node_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
require('core.snippets.c')
|
|
||||||
require('core.snippets.makefile')
|
|
||||||
require('core.snippets.lua')
|
|
BIN
pics/alpha.png
BIN
pics/alpha.png
Binary file not shown.
Before Width: | Height: | Size: 32 KiB |
Binary file not shown.
Before Width: | Height: | Size: 121 KiB |
BIN
spell/en.utf-8.add.spl
Normal file
BIN
spell/en.utf-8.add.spl
Normal file
Binary file not shown.
Reference in New Issue
Block a user