feat: initial commit; NixOS Era
This commit is contained in:
18
pkgs/neovim/lua/plugins/additions.lua
Normal file
18
pkgs/neovim/lua/plugins/additions.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
{
|
||||
'vyfor/cord.nvim',
|
||||
event = 'VeryLazy',
|
||||
build = ':Cord update',
|
||||
opts = {},
|
||||
cond = vim.env.CORDLESS ~= 'true',
|
||||
},
|
||||
{
|
||||
'tpope/vim-fugitive',
|
||||
cmd = { 'Git' },
|
||||
},
|
||||
{
|
||||
dir = '~/dev/share.nvim/',
|
||||
opts = {},
|
||||
enabled = false,
|
||||
},
|
||||
}
|
||||
32
pkgs/neovim/lua/plugins/deco.lua
Normal file
32
pkgs/neovim/lua/plugins/deco.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
local common = require('BluePlum.lazy')
|
||||
|
||||
return {
|
||||
{ common.icons, opts = {} },
|
||||
{
|
||||
'folke/todo-comments.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
opts = {},
|
||||
event = common.event.BufWinEnter,
|
||||
},
|
||||
{
|
||||
'OXY2DEV/markview.nvim',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter', common.icons },
|
||||
ft = 'markdown',
|
||||
opts = {
|
||||
preview = {
|
||||
icon_provider = 'mini',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'sphamba/smear-cursor.nvim',
|
||||
opts = {
|
||||
time_interval = 17,
|
||||
anticipation = 0,
|
||||
damping = 0.8,
|
||||
|
||||
cursor_color = '#b7bcb9',
|
||||
legacy_computing_symbols_support = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
81
pkgs/neovim/lua/plugins/format.lua
Normal file
81
pkgs/neovim/lua/plugins/format.lua
Normal file
@@ -0,0 +1,81 @@
|
||||
local common = require('BluePlum.lazy')
|
||||
|
||||
---@param exe string
|
||||
---@param args { [number]: string, path: boolean? }
|
||||
local function formatter(exe, args)
|
||||
return {
|
||||
function()
|
||||
local argv = {}
|
||||
|
||||
for _, val in ipairs(args) do
|
||||
table.insert(argv, val)
|
||||
end
|
||||
|
||||
if args.path ~= false then
|
||||
table.insert(argv, vim.fn.shellescape(vim.api.nvim_buf_get_name(0)))
|
||||
end
|
||||
|
||||
return {
|
||||
exe = exe,
|
||||
args = argv,
|
||||
stdin = true,
|
||||
}
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
local prettier = formatter('prettier', {
|
||||
'--config-precedence prefer-file',
|
||||
'--single-quote',
|
||||
'--use-tabs',
|
||||
'--trailing-comma es5',
|
||||
'--bracket-same-line',
|
||||
'--stdin-filepath',
|
||||
})
|
||||
|
||||
return {
|
||||
{
|
||||
'mhartington/formatter.nvim',
|
||||
event = common.event.BufWritePost,
|
||||
opts = {
|
||||
filetype = {
|
||||
javascript = prettier,
|
||||
typescript = prettier,
|
||||
markdown = prettier,
|
||||
css = prettier,
|
||||
json = prettier,
|
||||
html = prettier,
|
||||
scss = prettier,
|
||||
rust = formatter('rustfmt', { path = false }),
|
||||
lua = formatter('stylua', {
|
||||
'--indent-type Tabs',
|
||||
'--line-endings Unix',
|
||||
'--quote-style AutoPreferSingle',
|
||||
'--column-width' .. ' ' .. vim.o.columns,
|
||||
'-',
|
||||
}),
|
||||
nix = formatter('nixfmt', {
|
||||
'--indent=4',
|
||||
'--strict',
|
||||
}),
|
||||
|
||||
['*'] = {
|
||||
function()
|
||||
if vim.lsp.buf.formatting then
|
||||
vim.lsp.buf.format()
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(lazy)
|
||||
require('formatter').setup(lazy.opts)
|
||||
|
||||
vim.api.nvim_create_augroup('__formatter__', { clear = true })
|
||||
vim.api.nvim_create_autocmd(common.event.BufWritePost, {
|
||||
group = '__formatter__',
|
||||
command = ':FormatWriteLock',
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
87
pkgs/neovim/lua/plugins/lsp.lua
Normal file
87
pkgs/neovim/lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,87 @@
|
||||
local common = require('BluePlum.lazy')
|
||||
|
||||
return {
|
||||
-- Mason
|
||||
{ 'mason-org/mason.nvim', opts = {} },
|
||||
{
|
||||
'mason-org/mason-lspconfig.nvim',
|
||||
version = '1.*',
|
||||
config = function(lazy)
|
||||
local mason_lspconfig = require('mason-lspconfig')
|
||||
|
||||
mason_lspconfig.setup(lazy.opts)
|
||||
mason_lspconfig.setup_handlers({
|
||||
vim.lsp.enable
|
||||
})
|
||||
|
||||
vim.lsp.enable('nixd')
|
||||
vim.lsp.enable('rust_analyzer')
|
||||
end,
|
||||
dependencies = {
|
||||
'mason-org/mason.nvim',
|
||||
},
|
||||
},
|
||||
{
|
||||
'Saghen/blink.cmp',
|
||||
dependencies = { common.icons },
|
||||
version = '1.*',
|
||||
build = 'cargo build --release',
|
||||
opts = {
|
||||
keymap = {
|
||||
preset = 'default',
|
||||
|
||||
['<Up>'] = { 'select_prev', 'fallback' },
|
||||
['<Down>'] = { 'select_next', 'fallback' },
|
||||
|
||||
['<Tab>'] = { 'accept', 'fallback' },
|
||||
},
|
||||
appearance = {
|
||||
nerd_font_variant = 'normal',
|
||||
},
|
||||
sources = {
|
||||
default = { 'lsp', 'buffer', 'path', 'omni' },
|
||||
},
|
||||
completion = {
|
||||
list = { selection = { auto_insert = false } },
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 700,
|
||||
},
|
||||
ghost_text = { enabled = true },
|
||||
menu = {
|
||||
auto_show = true,
|
||||
draw = {
|
||||
columns = { { 'kind_icon' }, { 'label', 'label_description', gap = 1 }, { 'kind' } },
|
||||
components = {
|
||||
kind_icon = {
|
||||
text = function(ctx)
|
||||
local icon, _, _ = common.icons_require().get('lsp', ctx.kind)
|
||||
return icon
|
||||
end,
|
||||
},
|
||||
kind = {
|
||||
text = function(ctx)
|
||||
return '(' .. ctx.kind .. ')'
|
||||
end,
|
||||
highlight = 'SpecialKey',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
cmdline = {
|
||||
enabled = true,
|
||||
keymap = { preset = 'inherit' },
|
||||
sources = { 'buffer', 'cmdline' },
|
||||
completion = {
|
||||
list = { selection = { preselect = true, auto_insert = false } },
|
||||
ghost_text = { enabled = true },
|
||||
menu = {
|
||||
auto_show = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
signature = { enabled = true, window = { show_documentation = true } },
|
||||
},
|
||||
},
|
||||
}
|
||||
50
pkgs/neovim/lua/plugins/nav.lua
Normal file
50
pkgs/neovim/lua/plugins/nav.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
local common = require('BluePlum.lazy')
|
||||
local telescope = {
|
||||
find_files = function()
|
||||
require('telescope.builtin').find_files({ show_hidden = true })
|
||||
end,
|
||||
live_grep = function()
|
||||
require('telescope.builtin').live_grep()
|
||||
end,
|
||||
buffers = function()
|
||||
require('telescope.builtin').buffers()
|
||||
end,
|
||||
}
|
||||
|
||||
return {
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = { common.plenary },
|
||||
keys = {
|
||||
{ '<leader>ff', telescope.find_files },
|
||||
{ '<leader>fs', telescope.live_grep },
|
||||
{ '<leader>bb', telescope.buffers },
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
'stevearc/oil.nvim',
|
||||
opts = {
|
||||
default_file_explorer = true,
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
},
|
||||
},
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ '<leader>ex', vim.cmd.Oil },
|
||||
},
|
||||
},
|
||||
{
|
||||
'Kaiser-Yang/flash.nvim',
|
||||
branch = 'develop',
|
||||
event = common.event.VeryLazy,
|
||||
opts = {
|
||||
modes = {
|
||||
char = {
|
||||
multi_line = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
43
pkgs/neovim/lua/plugins/theme.lua
Normal file
43
pkgs/neovim/lua/plugins/theme.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
return {
|
||||
{
|
||||
'nyoom-engineering/oxocarbon.nvim',
|
||||
priority = 999,
|
||||
config = function()
|
||||
vim.cmd.colorscheme('oxocarbon')
|
||||
|
||||
local groups = {
|
||||
Text = 'Identifier',
|
||||
Method = '@function.builtin',
|
||||
Function = 'Function',
|
||||
Constructor = '@character',
|
||||
Field = '@property',
|
||||
Variable = '@label',
|
||||
Class = 'Todo',
|
||||
Interface = 'Type',
|
||||
Module = 'Macro',
|
||||
Property = '@property',
|
||||
Unit = 'Type',
|
||||
Value = 'Number',
|
||||
Enum = 'String',
|
||||
Keyword = 'Identifier',
|
||||
Snippet = 'Identifier',
|
||||
Color = 'Identifier',
|
||||
File = 'Identifier',
|
||||
Folder = 'identifier',
|
||||
Reference = 'Identifier',
|
||||
EnumMember = 'String',
|
||||
Constant = '@constant.builtin',
|
||||
Struct = 'Type',
|
||||
Event = '@constant',
|
||||
Operator = 'Structure',
|
||||
TypeParameter = 'Type',
|
||||
}
|
||||
|
||||
for key, value in pairs(groups) do
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpKind' .. key, { link = value })
|
||||
end
|
||||
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpMenuSelection', { link = 'IncSearch' })
|
||||
end,
|
||||
},
|
||||
}
|
||||
19
pkgs/neovim/lua/plugins/treesitter.lua
Normal file
19
pkgs/neovim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
local common = require('BluePlum.lazy')
|
||||
|
||||
return {
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
branch = 'main',
|
||||
event = common.event.VeryLazy,
|
||||
build = ':TSUpdate',
|
||||
opts = {
|
||||
ensure_installed = { 'lua', 'markdown', 'typescript', 'javascript', 'rust', 'json', 'toml' },
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
auto_install = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user