update nvim
parent
3338d39206
commit
786b0e0970
@ -0,0 +1,83 @@
|
|||||||
|
-- autoformat.lua
|
||||||
|
--
|
||||||
|
-- Use your language server to automatically format your code on save.
|
||||||
|
-- Adds additional commands as well to manage the behavior
|
||||||
|
|
||||||
|
return {
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
config = function()
|
||||||
|
-- Switch for controlling whether you want autoformatting.
|
||||||
|
-- Use :KickstartFormatToggle to toggle autoformatting on or off
|
||||||
|
local format_is_enabled = true
|
||||||
|
vim.api.nvim_create_user_command('KickstartFormatToggle', function()
|
||||||
|
format_is_enabled = not format_is_enabled
|
||||||
|
print('Setting autoformatting to: ' .. tostring(format_is_enabled))
|
||||||
|
end, {})
|
||||||
|
|
||||||
|
-- Create an augroup that is used for managing our formatting autocmds.
|
||||||
|
-- We need one augroup per client to make sure that multiple clients
|
||||||
|
-- can attach to the same buffer without interfering with each other.
|
||||||
|
local _augroups = {}
|
||||||
|
local get_augroup = function(client)
|
||||||
|
if not _augroups[client.id] then
|
||||||
|
local group_name = 'kickstart-lsp-format-' .. client.name
|
||||||
|
local id = vim.api.nvim_create_augroup(group_name, { clear = true })
|
||||||
|
_augroups[client.id] = id
|
||||||
|
end
|
||||||
|
|
||||||
|
return _augroups[client.id]
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Whenever an LSP attaches to a buffer, we will run this function.
|
||||||
|
--
|
||||||
|
-- See `:help LspAttach` for more information about this autocmd event.
|
||||||
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }),
|
||||||
|
-- This is where we attach the autoformatting for reasonable clients
|
||||||
|
callback = function(args)
|
||||||
|
local client_id = args.data.client_id
|
||||||
|
local client = vim.lsp.get_client_by_id(client_id)
|
||||||
|
local bufnr = args.buf
|
||||||
|
|
||||||
|
if client == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Only attach to clients that support document formatting
|
||||||
|
if not client.server_capabilities.documentFormattingProvider then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Tsserver usually works poorly. Sorry you work with bad languages
|
||||||
|
-- You can remove this line if you know what you're doing :)
|
||||||
|
if client.name == 'ts_ls' then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- i want prettier to format json files
|
||||||
|
if client.name == 'jsonls' then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Create an autocmd that will run *before* we save the buffer.
|
||||||
|
-- Run the formatting command for the LSP that has just attached.
|
||||||
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
|
group = get_augroup(client),
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = function()
|
||||||
|
if not format_is_enabled then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.lsp.buf.format {
|
||||||
|
async = false,
|
||||||
|
filter = function(c)
|
||||||
|
return c.id == client.id
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
local hsl = require('phoenix.utils.color').hsl
|
||||||
|
|
||||||
|
local Colors = {}
|
||||||
|
|
||||||
|
Colors.dark = {
|
||||||
|
black = hsl(240, 7, 13),
|
||||||
|
bblack = hsl(240, 7, 16),
|
||||||
|
red = hsl(1, 83, 40),
|
||||||
|
bred = hsl(1, 83, 50),
|
||||||
|
bgreen = hsl(156, 100, 48),
|
||||||
|
green = hsl(172, 100, 34),
|
||||||
|
yellow = hsl(40, 100, 74),
|
||||||
|
byellow = hsl(40, 100, 84),
|
||||||
|
blue = hsl(220, 100, 56),
|
||||||
|
bblue = hsl(220, 100, 66),
|
||||||
|
magenta = hsl(264, 100, 64),
|
||||||
|
bmagenta = hsl(264, 100, 72),
|
||||||
|
cyan = hsl(180, 98, 26),
|
||||||
|
bcyan = hsl(180, 100, 32),
|
||||||
|
white = hsl(240, 7, 84),
|
||||||
|
bwhite = hsl(240, 7, 94),
|
||||||
|
}
|
||||||
|
|
||||||
|
Colors.dark.status_bg = Colors.dark.black
|
||||||
|
Colors.dark.dimmed_text = hsl(240, 7, 25)
|
||||||
|
|
||||||
|
return Colors
|
@ -0,0 +1,301 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.colors = {
|
||||||
|
['red.100'] = '#fef8f9',
|
||||||
|
['red.130'] = '#fef4f4',
|
||||||
|
['red.160'] = '#feeaea',
|
||||||
|
['red.200'] = '#fdddde',
|
||||||
|
['red.230'] = '#fbcdce',
|
||||||
|
['red.260'] = '#fbbabb',
|
||||||
|
['red.300'] = '#fba6a8',
|
||||||
|
['red.330'] = '#fa9193',
|
||||||
|
['red.345'] = '#fa777b',
|
||||||
|
['red.360'] = '#f85b5f',
|
||||||
|
['red.400'] = '#f23f43',
|
||||||
|
['red.430'] = '#da373c',
|
||||||
|
['red.460'] = '#bb3033',
|
||||||
|
['red.500'] = '#a12829',
|
||||||
|
['red.530'] = '#8f2022',
|
||||||
|
['red.560'] = '#7f1c1e',
|
||||||
|
['red.600'] = '#70181a',
|
||||||
|
['red.630'] = '#651517',
|
||||||
|
['red.660'] = '#5a1314',
|
||||||
|
['red.700'] = '#501012',
|
||||||
|
['red.730'] = '#460e0f',
|
||||||
|
['red.760'] = '#3f0b0c',
|
||||||
|
['red.800'] = '#360a0b',
|
||||||
|
['red.830'] = '#2e090a',
|
||||||
|
['red.860'] = '#280808',
|
||||||
|
['red.900'] = '#220606',
|
||||||
|
['orange.100'] = '#fff8f5',
|
||||||
|
['orange.130'] = '#fff4ed',
|
||||||
|
['orange.160'] = '#feeadf',
|
||||||
|
['orange.200'] = '#fddecd',
|
||||||
|
['orange.230'] = '#fccfb2',
|
||||||
|
['orange.260'] = '#fcbd95',
|
||||||
|
['orange.300'] = '#fbab70',
|
||||||
|
['orange.330'] = '#fa9746',
|
||||||
|
['orange.345'] = '#f1882a',
|
||||||
|
['orange.360'] = '#db7628',
|
||||||
|
['orange.400'] = '#c46926',
|
||||||
|
['orange.430'] = '#ac591f',
|
||||||
|
['orange.460'] = '#9b4c19',
|
||||||
|
['orange.500'] = '#8c4013',
|
||||||
|
['orange.530'] = '#7b3710',
|
||||||
|
['orange.560'] = '#6d300e',
|
||||||
|
['orange.600'] = '#5f2b0b',
|
||||||
|
['orange.630'] = '#56260a',
|
||||||
|
['orange.660'] = '#4c2209',
|
||||||
|
['orange.700'] = '#431e09',
|
||||||
|
['orange.730'] = '#3b1a07',
|
||||||
|
['orange.760'] = '#331606',
|
||||||
|
['orange.800'] = '#2d1305',
|
||||||
|
['orange.830'] = '#261005',
|
||||||
|
['orange.860'] = '#200e05',
|
||||||
|
['orange.900'] = '#190d04',
|
||||||
|
['yellow.100'] = '#fff8ef',
|
||||||
|
['yellow.130'] = '#fff4e8',
|
||||||
|
['yellow.160'] = '#ffebd3',
|
||||||
|
['yellow.200'] = '#fee0b6',
|
||||||
|
['yellow.230'] = '#fdd18c',
|
||||||
|
['yellow.260'] = '#fcc145',
|
||||||
|
['yellow.300'] = '#f0b232',
|
||||||
|
['yellow.330'] = '#e1a42a',
|
||||||
|
['yellow.345'] = '#d49824',
|
||||||
|
['yellow.360'] = '#bf861c',
|
||||||
|
['yellow.400'] = '#af7615',
|
||||||
|
['yellow.430'] = '#9a650d',
|
||||||
|
['yellow.460'] = '#8a5709',
|
||||||
|
['yellow.500'] = '#7c4b04',
|
||||||
|
['yellow.530'] = '#6d4104',
|
||||||
|
['yellow.560'] = '#613803',
|
||||||
|
['yellow.600'] = '#543203',
|
||||||
|
['yellow.630'] = '#4c2d03',
|
||||||
|
['yellow.660'] = '#432803',
|
||||||
|
['yellow.700'] = '#3b2303',
|
||||||
|
['yellow.730'] = '#351e02',
|
||||||
|
['yellow.760'] = '#2e1a02',
|
||||||
|
['yellow.800'] = '#271602',
|
||||||
|
['yellow.830'] = '#221302',
|
||||||
|
['yellow.860'] = '#1c1002',
|
||||||
|
['yellow.900'] = '#160e02',
|
||||||
|
['green.100'] = '#ecfef1',
|
||||||
|
['green.130'] = '#defee7',
|
||||||
|
['green.160'] = '#bdfcd3',
|
||||||
|
['green.200'] = '#88fbb5',
|
||||||
|
['green.230'] = '#58f39c',
|
||||||
|
['green.260'] = '#48e58b',
|
||||||
|
['green.300'] = '#3bd67f',
|
||||||
|
['green.330'] = '#2dc771',
|
||||||
|
['green.345'] = '#26b968',
|
||||||
|
['green.360'] = '#23a55a',
|
||||||
|
['green.400'] = '#24934e',
|
||||||
|
['green.430'] = '#248045',
|
||||||
|
['green.460'] = '#1f703c',
|
||||||
|
['green.500'] = '#1a6334',
|
||||||
|
['green.530'] = '#15562b',
|
||||||
|
['green.560'] = '#124c24',
|
||||||
|
['green.600'] = '#0e431f',
|
||||||
|
['green.630'] = '#0c3c1c',
|
||||||
|
['green.660'] = '#0a3618',
|
||||||
|
['green.700'] = '#072f15',
|
||||||
|
['green.730'] = '#052910',
|
||||||
|
['green.760'] = '#03240e',
|
||||||
|
['green.800'] = '#031f0c',
|
||||||
|
['green.830'] = '#031b0a',
|
||||||
|
['green.860'] = '#041708',
|
||||||
|
['green.900'] = '#051307',
|
||||||
|
['blue.100'] = '#f6fafe',
|
||||||
|
['blue.130'] = '#f0f7fe',
|
||||||
|
['blue.160'] = '#e2f0fd',
|
||||||
|
['blue.200'] = '#cde8fd',
|
||||||
|
['blue.230'] = '#b2ddfc',
|
||||||
|
['blue.260'] = '#94d2fc',
|
||||||
|
['blue.300'] = '#66c4fd',
|
||||||
|
['blue.330'] = '#2eb6ff',
|
||||||
|
['blue.345'] = '#00aafc',
|
||||||
|
['blue.360'] = '#0097f2',
|
||||||
|
['blue.400'] = '#0082eb',
|
||||||
|
['blue.430'] = '#006be7',
|
||||||
|
['blue.460'] = '#005cd1',
|
||||||
|
['blue.500'] = '#0051b6',
|
||||||
|
['blue.530'] = '#00489b',
|
||||||
|
['blue.560'] = '#004088',
|
||||||
|
['blue.600'] = '#003976',
|
||||||
|
['blue.630'] = '#00336a',
|
||||||
|
['blue.660'] = '#002d5f',
|
||||||
|
['blue.700'] = '#002855',
|
||||||
|
['blue.730'] = '#002348',
|
||||||
|
['blue.760'] = '#001e3f',
|
||||||
|
['blue.800'] = '#001a36',
|
||||||
|
['blue.830'] = '#001630',
|
||||||
|
['blue.860'] = '#00132b',
|
||||||
|
['blue.900'] = '#001024',
|
||||||
|
['teal.100'] = '#f4fbfd',
|
||||||
|
['teal.130'] = '#e9f9fd',
|
||||||
|
['teal.160'] = '#d3f4fb',
|
||||||
|
['teal.200'] = '#b1eff9',
|
||||||
|
['teal.230'] = '#7ee7f7',
|
||||||
|
['teal.260'] = '#5edbef',
|
||||||
|
['teal.300'] = '#47cbe2',
|
||||||
|
['teal.330'] = '#35bcd5',
|
||||||
|
['teal.345'] = '#2eb0c9',
|
||||||
|
['teal.360'] = '#289fb6',
|
||||||
|
['teal.400'] = '#248da1',
|
||||||
|
['teal.430'] = '#207a8d',
|
||||||
|
['teal.460'] = '#1b6b7c',
|
||||||
|
['teal.500'] = '#175e6d',
|
||||||
|
['teal.530'] = '#13525f',
|
||||||
|
['teal.560'] = '#0f4954',
|
||||||
|
['teal.600'] = '#0c4049',
|
||||||
|
['teal.630'] = '#0a3942',
|
||||||
|
['teal.660'] = '#08333a',
|
||||||
|
['teal.700'] = '#062d34',
|
||||||
|
['teal.730'] = '#05272d',
|
||||||
|
['teal.760'] = '#042227',
|
||||||
|
['teal.800'] = '#031d21',
|
||||||
|
['teal.830'] = '#02191d',
|
||||||
|
['teal.860'] = '#021619',
|
||||||
|
['teal.900'] = '#011215',
|
||||||
|
['white.100'] = '#ffffff',
|
||||||
|
['white.130'] = '#ffffff',
|
||||||
|
['white.160'] = '#ffffff',
|
||||||
|
['white.200'] = '#ffffff',
|
||||||
|
['white.230'] = '#ffffff',
|
||||||
|
['white.260'] = '#ffffff',
|
||||||
|
['white.300'] = '#ffffff',
|
||||||
|
['white.330'] = '#ffffff',
|
||||||
|
['white.345'] = '#ffffff',
|
||||||
|
['white.360'] = '#ffffff',
|
||||||
|
['white.400'] = '#ffffff',
|
||||||
|
['white.430'] = '#ffffff',
|
||||||
|
['white.460'] = '#ffffff',
|
||||||
|
['white.500'] = '#ffffff',
|
||||||
|
['white.530'] = '#e8e8e8',
|
||||||
|
['white.560'] = '#cfcfcf',
|
||||||
|
['white.600'] = '#adadad',
|
||||||
|
['white.630'] = '#969696',
|
||||||
|
['white.660'] = '#838383',
|
||||||
|
['white.700'] = '#666666',
|
||||||
|
['white.730'] = '#5f5f5f',
|
||||||
|
['white.760'] = '#585858',
|
||||||
|
['white.800'] = '#4d4d4d',
|
||||||
|
['white.830'] = '#3b3b3b',
|
||||||
|
['white.860'] = '#262626',
|
||||||
|
['white.900'] = '#0d0d0d',
|
||||||
|
['black.100'] = '#f2f2f2',
|
||||||
|
['black.130'] = '#e8e8e8',
|
||||||
|
['black.160'] = '#dadada',
|
||||||
|
['black.200'] = '#cccccc',
|
||||||
|
['black.230'] = '#bdbdbd',
|
||||||
|
['black.260'] = '#acacac',
|
||||||
|
['black.300'] = '#999999',
|
||||||
|
['black.330'] = '#7a7a7a',
|
||||||
|
['black.345'] = '#666666',
|
||||||
|
['black.360'] = '#5c5c5c',
|
||||||
|
['black.400'] = '#333333',
|
||||||
|
['black.430'] = '#252525',
|
||||||
|
['black.460'] = '#141414',
|
||||||
|
['black.500'] = '#000000',
|
||||||
|
['black.530'] = '#000000',
|
||||||
|
['black.560'] = '#000000',
|
||||||
|
['black.600'] = '#000000',
|
||||||
|
['black.630'] = '#000000',
|
||||||
|
['black.660'] = '#000000',
|
||||||
|
['black.700'] = '#000000',
|
||||||
|
['black.730'] = '#000000',
|
||||||
|
['black.760'] = '#000000',
|
||||||
|
['black.800'] = '#000000',
|
||||||
|
['black.830'] = '#000000',
|
||||||
|
['black.860'] = '#000000',
|
||||||
|
['black.900'] = '#000000',
|
||||||
|
['brand.100'] = '#f7f7fe',
|
||||||
|
['brand.130'] = '#f0f1fe',
|
||||||
|
['brand.160'] = '#e7e9fd',
|
||||||
|
['brand.200'] = '#dee0fc',
|
||||||
|
['brand.230'] = '#d4d7fc',
|
||||||
|
['brand.260'] = '#c9cdfb',
|
||||||
|
['brand.300'] = '#bcc1fa',
|
||||||
|
['brand.330'] = '#a8aff8',
|
||||||
|
['brand.345'] = '#9ba3f7',
|
||||||
|
['brand.360'] = '#949cf7',
|
||||||
|
['brand.400'] = '#7984f5',
|
||||||
|
['brand.430'] = '#707bf4',
|
||||||
|
['brand.460'] = '#6571f3',
|
||||||
|
['brand.500'] = '#5865f2',
|
||||||
|
['brand.530'] = '#505cdc',
|
||||||
|
['brand.560'] = '#4752c4',
|
||||||
|
['brand.600'] = '#3c45a5',
|
||||||
|
['brand.630'] = '#343b8f',
|
||||||
|
['brand.660'] = '#2d347d',
|
||||||
|
['brand.700'] = '#232861',
|
||||||
|
['brand.730'] = '#21265b',
|
||||||
|
['brand.760'] = '#1e2353',
|
||||||
|
['brand.800'] = '#1a1e49',
|
||||||
|
['brand.830'] = '#141738',
|
||||||
|
['brand.860'] = '#0d0f24',
|
||||||
|
['brand.900'] = '#04050c',
|
||||||
|
['primary.100'] = '#f9f9f9',
|
||||||
|
['primary.130'] = '#f2f3f5',
|
||||||
|
['primary.160'] = '#ebedef',
|
||||||
|
['primary.200'] = '#e3e5e8',
|
||||||
|
['primary.230'] = '#dbdee1',
|
||||||
|
['primary.260'] = '#d2d5d9',
|
||||||
|
['primary.300'] = '#c4c9ce',
|
||||||
|
['primary.330'] = '#b5bac1',
|
||||||
|
['primary.345'] = '#a5abb3',
|
||||||
|
['primary.360'] = '#949ba4',
|
||||||
|
['primary.400'] = '#80848e',
|
||||||
|
['primary.430'] = '#6d6f78',
|
||||||
|
['primary.460'] = '#5c5e66',
|
||||||
|
['primary.500'] = '#4e5058',
|
||||||
|
['primary.530'] = '#41434a',
|
||||||
|
['primary.560'] = '#383a40',
|
||||||
|
['primary.600'] = '#313338',
|
||||||
|
['primary.630'] = '#2b2d31',
|
||||||
|
['primary.645'] = '#282a2e',
|
||||||
|
['primary.660'] = '#232428',
|
||||||
|
['primary.700'] = '#1e1f22',
|
||||||
|
['primary.730'] = '#1a1b1e',
|
||||||
|
['primary.760'] = '#161719',
|
||||||
|
['primary.800'] = '#111214',
|
||||||
|
['primary.830'] = '#0c0c0d',
|
||||||
|
['primary.860'] = '#060607',
|
||||||
|
['primary.900'] = '#020202',
|
||||||
|
['plum.0'] = '#f9f9fa',
|
||||||
|
['plum.1'] = '#f3f3f4',
|
||||||
|
['plum.2'] = '#ecedef',
|
||||||
|
['plum.3'] = '#e4e5e8',
|
||||||
|
['plum.4'] = '#dddee1',
|
||||||
|
['plum.5'] = '#d3d5d9',
|
||||||
|
['plum.6'] = '#c7c8ce',
|
||||||
|
['plum.7'] = '#b8bac1',
|
||||||
|
['plum.8'] = '#a8aab4',
|
||||||
|
['plum.9'] = '#9597a3',
|
||||||
|
['plum.10'] = '#828391',
|
||||||
|
['plum.11'] = '#6d6f7e',
|
||||||
|
['plum.12'] = '#5c5d6e',
|
||||||
|
['plum.13'] = '#4e4f5f',
|
||||||
|
['plum.14'] = '#414252',
|
||||||
|
['plum.15'] = '#383948',
|
||||||
|
['plum.16'] = '#31323f',
|
||||||
|
['plum.17'] = '#2b2c38',
|
||||||
|
['plum.18'] = '#262732',
|
||||||
|
['plum.19'] = '#21222b',
|
||||||
|
['plum.20'] = '#1c1d26',
|
||||||
|
['plum.21'] = '#181921',
|
||||||
|
['plum.22'] = '#15161d',
|
||||||
|
['plum.23'] = '#121319',
|
||||||
|
['plum.24'] = '#0f1015',
|
||||||
|
['plum.25'] = '#0c0c10',
|
||||||
|
['plum.26'] = '#08080b',
|
||||||
|
}
|
||||||
|
|
||||||
|
M.themes = {}
|
||||||
|
|
||||||
|
M.themes.darker = {
|
||||||
|
bg_primary = M.colors['plum.20'],
|
||||||
|
bg_secondary = M.colors['plum.18'],
|
||||||
|
}
|
||||||
|
|
||||||
|
return M
|
@ -0,0 +1,301 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.colors = {
|
||||||
|
['red.100'] = '#fef8f9',
|
||||||
|
['red.130'] = '#fef4f4',
|
||||||
|
['red.160'] = '#feeaea',
|
||||||
|
['red.200'] = '#fdddde',
|
||||||
|
['red.230'] = '#fbcdce',
|
||||||
|
['red.260'] = '#fbbabb',
|
||||||
|
['red.300'] = '#fba6a8',
|
||||||
|
['red.330'] = '#fa9193',
|
||||||
|
['red.345'] = '#fa777b',
|
||||||
|
['red.360'] = '#f85b5f',
|
||||||
|
['red.400'] = '#f23f43',
|
||||||
|
['red.430'] = '#da373c',
|
||||||
|
['red.460'] = '#bb3033',
|
||||||
|
['red.500'] = '#a12829',
|
||||||
|
['red.530'] = '#8f2022',
|
||||||
|
['red.560'] = '#7f1c1e',
|
||||||
|
['red.600'] = '#70181a',
|
||||||
|
['red.630'] = '#651517',
|
||||||
|
['red.660'] = '#5a1314',
|
||||||
|
['red.700'] = '#501012',
|
||||||
|
['red.730'] = '#460e0f',
|
||||||
|
['red.760'] = '#3f0b0c',
|
||||||
|
['red.800'] = '#360a0b',
|
||||||
|
['red.830'] = '#2e090a',
|
||||||
|
['red.860'] = '#280808',
|
||||||
|
['red.900'] = '#220606',
|
||||||
|
['orange.100'] = '#fff8f5',
|
||||||
|
['orange.130'] = '#fff4ed',
|
||||||
|
['orange.160'] = '#feeadf',
|
||||||
|
['orange.200'] = '#fddecd',
|
||||||
|
['orange.230'] = '#fccfb2',
|
||||||
|
['orange.260'] = '#fcbd95',
|
||||||
|
['orange.300'] = '#fbab70',
|
||||||
|
['orange.330'] = '#fa9746',
|
||||||
|
['orange.345'] = '#f1882a',
|
||||||
|
['orange.360'] = '#db7628',
|
||||||
|
['orange.400'] = '#c46926',
|
||||||
|
['orange.430'] = '#ac591f',
|
||||||
|
['orange.460'] = '#9b4c19',
|
||||||
|
['orange.500'] = '#8c4013',
|
||||||
|
['orange.530'] = '#7b3710',
|
||||||
|
['orange.560'] = '#6d300e',
|
||||||
|
['orange.600'] = '#5f2b0b',
|
||||||
|
['orange.630'] = '#56260a',
|
||||||
|
['orange.660'] = '#4c2209',
|
||||||
|
['orange.700'] = '#431e09',
|
||||||
|
['orange.730'] = '#3b1a07',
|
||||||
|
['orange.760'] = '#331606',
|
||||||
|
['orange.800'] = '#2d1305',
|
||||||
|
['orange.830'] = '#261005',
|
||||||
|
['orange.860'] = '#200e05',
|
||||||
|
['orange.900'] = '#190d04',
|
||||||
|
['yellow.100'] = '#fff8ef',
|
||||||
|
['yellow.130'] = '#fff4e8',
|
||||||
|
['yellow.160'] = '#ffebd3',
|
||||||
|
['yellow.200'] = '#fee0b6',
|
||||||
|
['yellow.230'] = '#fdd18c',
|
||||||
|
['yellow.260'] = '#fcc145',
|
||||||
|
['yellow.300'] = '#f0b232',
|
||||||
|
['yellow.330'] = '#e1a42a',
|
||||||
|
['yellow.345'] = '#d49824',
|
||||||
|
['yellow.360'] = '#bf861c',
|
||||||
|
['yellow.400'] = '#af7615',
|
||||||
|
['yellow.430'] = '#9a650d',
|
||||||
|
['yellow.460'] = '#8a5709',
|
||||||
|
['yellow.500'] = '#7c4b04',
|
||||||
|
['yellow.530'] = '#6d4104',
|
||||||
|
['yellow.560'] = '#613803',
|
||||||
|
['yellow.600'] = '#543203',
|
||||||
|
['yellow.630'] = '#4c2d03',
|
||||||
|
['yellow.660'] = '#432803',
|
||||||
|
['yellow.700'] = '#3b2303',
|
||||||
|
['yellow.730'] = '#351e02',
|
||||||
|
['yellow.760'] = '#2e1a02',
|
||||||
|
['yellow.800'] = '#271602',
|
||||||
|
['yellow.830'] = '#221302',
|
||||||
|
['yellow.860'] = '#1c1002',
|
||||||
|
['yellow.900'] = '#160e02',
|
||||||
|
['green.100'] = '#ecfef1',
|
||||||
|
['green.130'] = '#defee7',
|
||||||
|
['green.160'] = '#bdfcd3',
|
||||||
|
['green.200'] = '#88fbb5',
|
||||||
|
['green.230'] = '#58f39c',
|
||||||
|
['green.260'] = '#48e58b',
|
||||||
|
['green.300'] = '#3bd67f',
|
||||||
|
['green.330'] = '#2dc771',
|
||||||
|
['green.345'] = '#26b968',
|
||||||
|
['green.360'] = '#23a55a',
|
||||||
|
['green.400'] = '#24934e',
|
||||||
|
['green.430'] = '#248045',
|
||||||
|
['green.460'] = '#1f703c',
|
||||||
|
['green.500'] = '#1a6334',
|
||||||
|
['green.530'] = '#15562b',
|
||||||
|
['green.560'] = '#124c24',
|
||||||
|
['green.600'] = '#0e431f',
|
||||||
|
['green.630'] = '#0c3c1c',
|
||||||
|
['green.660'] = '#0a3618',
|
||||||
|
['green.700'] = '#072f15',
|
||||||
|
['green.730'] = '#052910',
|
||||||
|
['green.760'] = '#03240e',
|
||||||
|
['green.800'] = '#031f0c',
|
||||||
|
['green.830'] = '#031b0a',
|
||||||
|
['green.860'] = '#041708',
|
||||||
|
['green.900'] = '#051307',
|
||||||
|
['blue.100'] = '#f6fafe',
|
||||||
|
['blue.130'] = '#f0f7fe',
|
||||||
|
['blue.160'] = '#e2f0fd',
|
||||||
|
['blue.200'] = '#cde8fd',
|
||||||
|
['blue.230'] = '#b2ddfc',
|
||||||
|
['blue.260'] = '#94d2fc',
|
||||||
|
['blue.300'] = '#66c4fd',
|
||||||
|
['blue.330'] = '#2eb6ff',
|
||||||
|
['blue.345'] = '#00aafc',
|
||||||
|
['blue.360'] = '#0097f2',
|
||||||
|
['blue.400'] = '#0082eb',
|
||||||
|
['blue.430'] = '#006be7',
|
||||||
|
['blue.460'] = '#005cd1',
|
||||||
|
['blue.500'] = '#0051b6',
|
||||||
|
['blue.530'] = '#00489b',
|
||||||
|
['blue.560'] = '#004088',
|
||||||
|
['blue.600'] = '#003976',
|
||||||
|
['blue.630'] = '#00336a',
|
||||||
|
['blue.660'] = '#002d5f',
|
||||||
|
['blue.700'] = '#002855',
|
||||||
|
['blue.730'] = '#002348',
|
||||||
|
['blue.760'] = '#001e3f',
|
||||||
|
['blue.800'] = '#001a36',
|
||||||
|
['blue.830'] = '#001630',
|
||||||
|
['blue.860'] = '#00132b',
|
||||||
|
['blue.900'] = '#001024',
|
||||||
|
['teal.100'] = '#f4fbfd',
|
||||||
|
['teal.130'] = '#e9f9fd',
|
||||||
|
['teal.160'] = '#d3f4fb',
|
||||||
|
['teal.200'] = '#b1eff9',
|
||||||
|
['teal.230'] = '#7ee7f7',
|
||||||
|
['teal.260'] = '#5edbef',
|
||||||
|
['teal.300'] = '#47cbe2',
|
||||||
|
['teal.330'] = '#35bcd5',
|
||||||
|
['teal.345'] = '#2eb0c9',
|
||||||
|
['teal.360'] = '#289fb6',
|
||||||
|
['teal.400'] = '#248da1',
|
||||||
|
['teal.430'] = '#207a8d',
|
||||||
|
['teal.460'] = '#1b6b7c',
|
||||||
|
['teal.500'] = '#175e6d',
|
||||||
|
['teal.530'] = '#13525f',
|
||||||
|
['teal.560'] = '#0f4954',
|
||||||
|
['teal.600'] = '#0c4049',
|
||||||
|
['teal.630'] = '#0a3942',
|
||||||
|
['teal.660'] = '#08333a',
|
||||||
|
['teal.700'] = '#062d34',
|
||||||
|
['teal.730'] = '#05272d',
|
||||||
|
['teal.760'] = '#042227',
|
||||||
|
['teal.800'] = '#031d21',
|
||||||
|
['teal.830'] = '#02191d',
|
||||||
|
['teal.860'] = '#021619',
|
||||||
|
['teal.900'] = '#011215',
|
||||||
|
['white.100'] = '#ffffff',
|
||||||
|
['white.130'] = '#ffffff',
|
||||||
|
['white.160'] = '#ffffff',
|
||||||
|
['white.200'] = '#ffffff',
|
||||||
|
['white.230'] = '#ffffff',
|
||||||
|
['white.260'] = '#ffffff',
|
||||||
|
['white.300'] = '#ffffff',
|
||||||
|
['white.330'] = '#ffffff',
|
||||||
|
['white.345'] = '#ffffff',
|
||||||
|
['white.360'] = '#ffffff',
|
||||||
|
['white.400'] = '#ffffff',
|
||||||
|
['white.430'] = '#ffffff',
|
||||||
|
['white.460'] = '#ffffff',
|
||||||
|
['white.500'] = '#ffffff',
|
||||||
|
['white.530'] = '#e8e8e8',
|
||||||
|
['white.560'] = '#cfcfcf',
|
||||||
|
['white.600'] = '#adadad',
|
||||||
|
['white.630'] = '#969696',
|
||||||
|
['white.660'] = '#838383',
|
||||||
|
['white.700'] = '#666666',
|
||||||
|
['white.730'] = '#5f5f5f',
|
||||||
|
['white.760'] = '#585858',
|
||||||
|
['white.800'] = '#4d4d4d',
|
||||||
|
['white.830'] = '#3b3b3b',
|
||||||
|
['white.860'] = '#262626',
|
||||||
|
['white.900'] = '#0d0d0d',
|
||||||
|
['black.100'] = '#f2f2f2',
|
||||||
|
['black.130'] = '#e8e8e8',
|
||||||
|
['black.160'] = '#dadada',
|
||||||
|
['black.200'] = '#cccccc',
|
||||||
|
['black.230'] = '#bdbdbd',
|
||||||
|
['black.260'] = '#acacac',
|
||||||
|
['black.300'] = '#999999',
|
||||||
|
['black.330'] = '#7a7a7a',
|
||||||
|
['black.345'] = '#666666',
|
||||||
|
['black.360'] = '#5c5c5c',
|
||||||
|
['black.400'] = '#333333',
|
||||||
|
['black.430'] = '#252525',
|
||||||
|
['black.460'] = '#141414',
|
||||||
|
['black.500'] = '#000000',
|
||||||
|
['black.530'] = '#000000',
|
||||||
|
['black.560'] = '#000000',
|
||||||
|
['black.600'] = '#000000',
|
||||||
|
['black.630'] = '#000000',
|
||||||
|
['black.660'] = '#000000',
|
||||||
|
['black.700'] = '#000000',
|
||||||
|
['black.730'] = '#000000',
|
||||||
|
['black.760'] = '#000000',
|
||||||
|
['black.800'] = '#000000',
|
||||||
|
['black.830'] = '#000000',
|
||||||
|
['black.860'] = '#000000',
|
||||||
|
['black.900'] = '#000000',
|
||||||
|
['brand.100'] = '#f7f7fe',
|
||||||
|
['brand.130'] = '#f0f1fe',
|
||||||
|
['brand.160'] = '#e7e9fd',
|
||||||
|
['brand.200'] = '#dee0fc',
|
||||||
|
['brand.230'] = '#d4d7fc',
|
||||||
|
['brand.260'] = '#c9cdfb',
|
||||||
|
['brand.300'] = '#bcc1fa',
|
||||||
|
['brand.330'] = '#a8aff8',
|
||||||
|
['brand.345'] = '#9ba3f7',
|
||||||
|
['brand.360'] = '#949cf7',
|
||||||
|
['brand.400'] = '#7984f5',
|
||||||
|
['brand.430'] = '#707bf4',
|
||||||
|
['brand.460'] = '#6571f3',
|
||||||
|
['brand.500'] = '#5865f2',
|
||||||
|
['brand.530'] = '#505cdc',
|
||||||
|
['brand.560'] = '#4752c4',
|
||||||
|
['brand.600'] = '#3c45a5',
|
||||||
|
['brand.630'] = '#343b8f',
|
||||||
|
['brand.660'] = '#2d347d',
|
||||||
|
['brand.700'] = '#232861',
|
||||||
|
['brand.730'] = '#21265b',
|
||||||
|
['brand.760'] = '#1e2353',
|
||||||
|
['brand.800'] = '#1a1e49',
|
||||||
|
['brand.830'] = '#141738',
|
||||||
|
['brand.860'] = '#0d0f24',
|
||||||
|
['brand.900'] = '#04050c',
|
||||||
|
['primary.100'] = '#f9f9f9',
|
||||||
|
['primary.130'] = '#f2f3f5',
|
||||||
|
['primary.160'] = '#ebedef',
|
||||||
|
['primary.200'] = '#e3e5e8',
|
||||||
|
['primary.230'] = '#dbdee1',
|
||||||
|
['primary.260'] = '#d2d5d9',
|
||||||
|
['primary.300'] = '#c4c9ce',
|
||||||
|
['primary.330'] = '#b5bac1',
|
||||||
|
['primary.345'] = '#a5abb3',
|
||||||
|
['primary.360'] = '#949ba4',
|
||||||
|
['primary.400'] = '#80848e',
|
||||||
|
['primary.430'] = '#6d6f78',
|
||||||
|
['primary.460'] = '#5c5e66',
|
||||||
|
['primary.500'] = '#4e5058',
|
||||||
|
['primary.530'] = '#41434a',
|
||||||
|
['primary.560'] = '#383a40',
|
||||||
|
['primary.600'] = '#313338',
|
||||||
|
['primary.630'] = '#2b2d31',
|
||||||
|
['primary.645'] = '#282a2e',
|
||||||
|
['primary.660'] = '#232428',
|
||||||
|
['primary.700'] = '#1e1f22',
|
||||||
|
['primary.730'] = '#1a1b1e',
|
||||||
|
['primary.760'] = '#161719',
|
||||||
|
['primary.800'] = '#111214',
|
||||||
|
['primary.830'] = '#0c0c0d',
|
||||||
|
['primary.860'] = '#060607',
|
||||||
|
['primary.900'] = '#020202',
|
||||||
|
['plum.0'] = '#f9f9fa',
|
||||||
|
['plum.1'] = '#f3f3f4',
|
||||||
|
['plum.2'] = '#ecedef',
|
||||||
|
['plum.3'] = '#e4e5e8',
|
||||||
|
['plum.4'] = '#dddee1',
|
||||||
|
['plum.5'] = '#d3d5d9',
|
||||||
|
['plum.6'] = '#c7c8ce',
|
||||||
|
['plum.7'] = '#b8bac1',
|
||||||
|
['plum.8'] = '#a8aab4',
|
||||||
|
['plum.9'] = '#9597a3',
|
||||||
|
['plum.10'] = '#828391',
|
||||||
|
['plum.11'] = '#6d6f7e',
|
||||||
|
['plum.12'] = '#5c5d6e',
|
||||||
|
['plum.13'] = '#4e4f5f',
|
||||||
|
['plum.14'] = '#414252',
|
||||||
|
['plum.15'] = '#383948',
|
||||||
|
['plum.16'] = '#31323f',
|
||||||
|
['plum.17'] = '#2b2c38',
|
||||||
|
['plum.18'] = '#262732',
|
||||||
|
['plum.19'] = '#21222b',
|
||||||
|
['plum.20'] = '#1c1d26',
|
||||||
|
['plum.21'] = '#181921',
|
||||||
|
['plum.22'] = '#15161d',
|
||||||
|
['plum.23'] = '#121319',
|
||||||
|
['plum.24'] = '#0f1015',
|
||||||
|
['plum.25'] = '#0c0c10',
|
||||||
|
['plum.26'] = '#08080b',
|
||||||
|
}
|
||||||
|
|
||||||
|
M.themes = {}
|
||||||
|
|
||||||
|
M.themes.darker = {
|
||||||
|
bg_primary = M.colors['plum.20'],
|
||||||
|
bg_secondary = M.colors['plum.18'],
|
||||||
|
}
|
||||||
|
|
||||||
|
return M
|
@ -0,0 +1,112 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
-- Autocompletion
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
dependencies = {
|
||||||
|
-- Snippet Engine & its associated nvim-cmp source
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
'saadparwaiz1/cmp_luasnip',
|
||||||
|
|
||||||
|
-- Adds LSP completion capabilities
|
||||||
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
|
|
||||||
|
-- Adds a number of user-friendly snippets
|
||||||
|
'rafamadriz/friendly-snippets',
|
||||||
|
|
||||||
|
'hrsh7th/cmp-buffer',
|
||||||
|
'hrsh7th/cmp-path',
|
||||||
|
'hrsh7th/cmp-cmdline',
|
||||||
|
'petertriho/cmp-git',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- [[ Configure nvim-cmp ]]
|
||||||
|
-- See `:help cmp`
|
||||||
|
local cmp = require 'cmp'
|
||||||
|
local luasnip = require 'luasnip'
|
||||||
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
|
luasnip.config.setup {}
|
||||||
|
|
||||||
|
cmp.setup {
|
||||||
|
view = {
|
||||||
|
entries = { name = 'custom', selection_order = 'near_cursor' },
|
||||||
|
},
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert {
|
||||||
|
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||||
|
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||||
|
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-Space>'] = cmp.mapping.complete {},
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||||
|
|
||||||
|
-- ['<CR>'] = cmp.mapping(function(fallback)
|
||||||
|
-- if cmp.visible() and cmp.get_active_entry() then
|
||||||
|
-- cmp.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true }
|
||||||
|
-- else
|
||||||
|
-- fallback()
|
||||||
|
-- end
|
||||||
|
-- end, { 'i', 's' }),
|
||||||
|
-- ['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
-- if cmp.visible() and has_words_before() then
|
||||||
|
-- cmp.select_next_item()
|
||||||
|
-- elseif luasnip.expand_or_locally_jumpable() then
|
||||||
|
-- luasnip.expand_or_jump()
|
||||||
|
-- else
|
||||||
|
-- fallback()
|
||||||
|
-- end
|
||||||
|
-- end, { 'i', 's' }),
|
||||||
|
-- ['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
-- if cmp.visible() then
|
||||||
|
-- cmp.select_prev_item()
|
||||||
|
-- elseif luasnip.locally_jumpable(-1) then
|
||||||
|
-- luasnip.jump(-1)
|
||||||
|
-- else
|
||||||
|
-- fallback()
|
||||||
|
-- end
|
||||||
|
-- end, { 'i', 's' }),
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{ name = 'nvim_lsp', priority = 100 },
|
||||||
|
-- { name = 'luasnip' },
|
||||||
|
{ name = 'buffer', keyword_length = 3 },
|
||||||
|
{ name = 'path' },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Set configuration for specific filetype.
|
||||||
|
cmp.setup.filetype('gitcommit', {
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
|
||||||
|
}, {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||||
|
cmp.setup.cmdline({ '/', '?' }, {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' },
|
||||||
|
}, {
|
||||||
|
{ name = 'cmdline' },
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
config = function()
|
||||||
|
require("nvim-autopairs").setup {}
|
||||||
|
end,
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'zbirenbaum/copilot.lua',
|
||||||
|
cmd = 'Copilot',
|
||||||
|
event = "InsertEnter",
|
||||||
|
build = ':Copilot auth',
|
||||||
|
config = function()
|
||||||
|
require('copilot').setup {
|
||||||
|
-- panel = {
|
||||||
|
-- enabled = false, -- using nvim-cmp to do this
|
||||||
|
-- -- enabled = true,
|
||||||
|
-- -- keymap = { open = '<C-t>' },
|
||||||
|
-- -- layout = { position = "right", ratio = 0.2 }
|
||||||
|
-- },
|
||||||
|
suggestion = { enabled = true, auto_trigger = true, keymap = { accept = '<Tab>' } },
|
||||||
|
-- filetypes = { markdown = true, gitcommit = true, help = true },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'CopilotC-Nvim/CopilotChat.nvim',
|
||||||
|
branch = 'canary',
|
||||||
|
dependencies = {
|
||||||
|
{ 'zbirenbaum/copilot.lua' }, -- or github/copilot.vim
|
||||||
|
{ 'nvim-lua/plenary.nvim' }, -- for curl, log wrapper
|
||||||
|
},
|
||||||
|
opts = {},
|
||||||
|
keys = {
|
||||||
|
-- lazy.nvim keys
|
||||||
|
|
||||||
|
-- Quick chat with Copilot
|
||||||
|
{
|
||||||
|
'<leader>ccq',
|
||||||
|
function()
|
||||||
|
local input = vim.fn.input 'Quick Chat: '
|
||||||
|
if input ~= '' then
|
||||||
|
require('CopilotChat').ask(input, { selection = require('CopilotChat.select').buffer })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = 'CopilotChat - Quick chat',
|
||||||
|
},
|
||||||
|
|
||||||
|
-- lazy.nvim keys
|
||||||
|
|
||||||
|
-- Show help actions with telescope
|
||||||
|
{
|
||||||
|
'<leader>cch',
|
||||||
|
function()
|
||||||
|
local actions = require 'CopilotChat.actions'
|
||||||
|
require('CopilotChat.integrations.telescope').pick(actions.help_actions())
|
||||||
|
end,
|
||||||
|
desc = 'CopilotChat - Help actions',
|
||||||
|
},
|
||||||
|
-- Show prompts actions with telescope
|
||||||
|
{
|
||||||
|
'<leader>ccp',
|
||||||
|
function()
|
||||||
|
local actions = require 'CopilotChat.actions'
|
||||||
|
require('CopilotChat.integrations.telescope').pick(actions.prompt_actions())
|
||||||
|
end,
|
||||||
|
desc = 'CopilotChat - Prompt actions',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
"phaazon/hop.nvim",
|
||||||
|
config = function()
|
||||||
|
require("hop").setup {
|
||||||
|
keys = "arstgmneiodh",
|
||||||
|
}
|
||||||
|
vim.keymap.set("n", "<C-e>", "<cmd>lua require'hop'.hint_words()<cr>", { noremap = true, silent = true })
|
||||||
|
end
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"kylechui/nvim-surround",
|
||||||
|
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
require("nvim-surround").setup({
|
||||||
|
-- Configuration here, or leave empty to use defaults
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,138 @@
|
|||||||
|
local colors = require('phoenix.bleed-purple.colors').dark
|
||||||
|
local fish_like_path = require 'phoenix.utils.fish_like_path'
|
||||||
|
|
||||||
|
local dark_theme = {
|
||||||
|
normal = {
|
||||||
|
a = { bg = colors.bmagenta, fg = colors.bblack, gui = 'bold' },
|
||||||
|
b = { bg = colors.bblack, fg = colors.black },
|
||||||
|
c = { bg = colors.status_bg, fg = colors.white },
|
||||||
|
},
|
||||||
|
insert = { a = { bg = colors.green, fg = colors.black, gui = 'bold' } },
|
||||||
|
visual = { a = { bg = colors.yellow, fg = colors.black, gui = 'bold' } },
|
||||||
|
replace = { a = { bg = colors.red, fg = colors.black, gui = 'bold' } },
|
||||||
|
command = { a = { bg = colors.bblue, fg = colors.black, gui = 'bold' } },
|
||||||
|
inactive = {
|
||||||
|
a = { bg = colors.status_bg, fg = colors.dimmed_text },
|
||||||
|
b = { bg = colors.status_bg, fg = colors.dimmed_text },
|
||||||
|
c = { bg = colors.status_bg, fg = colors.dimmed_text },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local light_theme = {
|
||||||
|
normal = {
|
||||||
|
a = { bg = colors.bmagenta, fg = colors.bblack, gui = 'bold' },
|
||||||
|
b = { bg = colors.bgreen, fg = colors.black },
|
||||||
|
c = { bg = colors.white, fg = colors.black },
|
||||||
|
},
|
||||||
|
insert = { a = { bg = colors.green, fg = colors.black, gui = 'bold' } },
|
||||||
|
visual = { a = { bg = colors.yellow, fg = colors.black, gui = 'bold' } },
|
||||||
|
replace = { a = { bg = colors.red, fg = colors.black, gui = 'bold' } },
|
||||||
|
command = { a = { bg = colors.bblue, fg = colors.black, gui = 'bold' } },
|
||||||
|
inactive = {
|
||||||
|
a = { bg = colors.white, fg = colors.dimmed_text },
|
||||||
|
b = { bg = colors.white, fg = colors.dimmed_text },
|
||||||
|
c = { bg = colors.white, fg = colors.dimmed_text },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local file_status = function(is_modified)
|
||||||
|
if is_modified then
|
||||||
|
return '·'
|
||||||
|
else
|
||||||
|
return ''
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local fishpath = function(level)
|
||||||
|
return function()
|
||||||
|
local path = fish_like_path(vim.fn.expand '%:p', level)
|
||||||
|
local status = file_status(vim.bo.modified)
|
||||||
|
|
||||||
|
if #status == 0 then
|
||||||
|
return path
|
||||||
|
end
|
||||||
|
|
||||||
|
return path .. ' ' .. status
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local get_theme = function(bg)
|
||||||
|
if bg == 'light' then
|
||||||
|
return light_theme
|
||||||
|
end
|
||||||
|
return dark_theme
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.cmd [[
|
||||||
|
autocmd ColorScheme * lua require'phoenix.plugins.lualine'.config()
|
||||||
|
autocmd OptionSet background lua require'phoenix.plugins.lualine'.config()
|
||||||
|
]]
|
||||||
|
|
||||||
|
return {
|
||||||
|
-- Set lualine as statusline
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
-- See `:help lualine.txt`
|
||||||
|
config = function()
|
||||||
|
require('lualine').setup {
|
||||||
|
options = {
|
||||||
|
icons_enabled = false,
|
||||||
|
globalstatus = true,
|
||||||
|
-- theme = 'onedark',
|
||||||
|
component_separators = '|',
|
||||||
|
section_separators = '',
|
||||||
|
-- theme = get_theme(vim.o.background),
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = { 'mode' },
|
||||||
|
lualine_b = { 'diff' },
|
||||||
|
lualine_c = { fishpath(4) },
|
||||||
|
lualine_x = { 'filetype' },
|
||||||
|
lualine_y = {},
|
||||||
|
lualine_z = { 'location' },
|
||||||
|
},
|
||||||
|
inactive_sections = {
|
||||||
|
lualine_a = {},
|
||||||
|
lualine_b = {},
|
||||||
|
lualine_c = { fishpath(2) },
|
||||||
|
lualine_x = { 'location' },
|
||||||
|
lualine_y = {},
|
||||||
|
lualine_z = {},
|
||||||
|
},
|
||||||
|
winbar = {
|
||||||
|
lualine_a = {},
|
||||||
|
lualine_b = {},
|
||||||
|
lualine_c = { fishpath(3) },
|
||||||
|
lualine_x = {},
|
||||||
|
lualine_y = {},
|
||||||
|
lualine_z = {},
|
||||||
|
},
|
||||||
|
inactive_winbar = {
|
||||||
|
lualine_a = {},
|
||||||
|
lualine_b = {},
|
||||||
|
lualine_c = { fishpath(3) },
|
||||||
|
lualine_x = {},
|
||||||
|
lualine_y = {},
|
||||||
|
lualine_z = {},
|
||||||
|
},
|
||||||
|
tabline = {
|
||||||
|
lualine_a = {
|
||||||
|
{
|
||||||
|
'tabs',
|
||||||
|
mode = 1,
|
||||||
|
max_length = vim.o.columns / 3,
|
||||||
|
tabs_color = {
|
||||||
|
-- Same values as the general color option can be used here.
|
||||||
|
-- active = 'TabLineSel', -- Color for active tab.
|
||||||
|
-- inactive = 'TabLine', -- Color for inactive tab.
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lualine_b = {},
|
||||||
|
lualine_c = {},
|
||||||
|
-- lualine_x = { "require'phoenix.utils.lsp'.get_attached_clients()" },
|
||||||
|
-- lualine_y = {"require'lsp-status'.status()"},
|
||||||
|
lualine_z = { { 'branch', icons_enabled = true } },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
local keymap = require 'phoenix.utils.keymap'
|
||||||
|
|
||||||
|
return {
|
||||||
|
'nvim-neo-tree/neo-tree.nvim',
|
||||||
|
branch = 'v3.x',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||||
|
'MunifTanjim/nui.nvim',
|
||||||
|
{
|
||||||
|
-- only needed if you want to use the commands with "_with_window_picker" suffix
|
||||||
|
's1n7ax/nvim-window-picker',
|
||||||
|
name = 'window-picker',
|
||||||
|
event = 'VeryLazy',
|
||||||
|
version = '2.*',
|
||||||
|
config = function()
|
||||||
|
require('window-picker').setup {
|
||||||
|
hint = 'statusline-winbar',
|
||||||
|
selection_chars = 'arstgmneiodh',
|
||||||
|
|
||||||
|
autoselect_one = true,
|
||||||
|
include_current_win = false,
|
||||||
|
filter_rules = {
|
||||||
|
bo = {
|
||||||
|
-- if the file type is one of following, the window will be ignored
|
||||||
|
filetype = { 'neo-tree', 'neo-tree-popup', 'notify' },
|
||||||
|
|
||||||
|
-- if the buffer type is one of following, the window will be ignored
|
||||||
|
buftype = { 'terminal', 'quickfix' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- other_win_hl_color = '#e35e4f',
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- Unless you are still migrating, remove the deprecated commands from v1.x
|
||||||
|
vim.cmd [[ let g:neo_tree_remove_legacy_commands = 1 ]]
|
||||||
|
|
||||||
|
require('neo-tree').setup {
|
||||||
|
window = {
|
||||||
|
position = 'left',
|
||||||
|
},
|
||||||
|
filesystem = {
|
||||||
|
bind_to_cwd = true,
|
||||||
|
cwd_target = {
|
||||||
|
sidebar = 'window',
|
||||||
|
current = 'window',
|
||||||
|
float = "window"
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
mappings = {
|
||||||
|
['o'] = 'open',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
keymap('n', '<leader>kk', ':Neotree toggle reveal_force_cwd position=float<cr>')
|
||||||
|
keymap('n', '<leader>kc', ':Neotree toggle position=current<cr>')
|
||||||
|
keymap('n', '<leader>kb', ':Neotree toggle reveal position=left<cr>')
|
||||||
|
keymap('n', '<leader>kq', ':Neotree close<cr>')
|
||||||
|
end,
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
"folke/neoconf.nvim"
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
local keymap = require 'phoenix.utils.keymap'
|
||||||
|
|
||||||
|
return {
|
||||||
|
'danymat/neogen',
|
||||||
|
dependencies = 'nvim-treesitter/nvim-treesitter',
|
||||||
|
config = function()
|
||||||
|
require("neogen").setup({})
|
||||||
|
|
||||||
|
keymap('n', '<leader>nf', ":lua require('neogen').generate()<CR>")
|
||||||
|
end,
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
return {
|
||||||
|
'nvimtools/none-ls.nvim',
|
||||||
|
config = function()
|
||||||
|
local null_ls = require 'null-ls'
|
||||||
|
local b = null_ls.builtins
|
||||||
|
|
||||||
|
local sources = {
|
||||||
|
-- formatting
|
||||||
|
-- b.formatting.prettierd,
|
||||||
|
b.formatting.biome.with {
|
||||||
|
condition = function(utils)
|
||||||
|
return utils.root_has_file { 'biome.jsonc' }
|
||||||
|
end,
|
||||||
|
filetypes = { 'javascript', 'javascriptreact', 'json', 'jsonc', 'typescript', 'typescriptreact' },
|
||||||
|
args = {
|
||||||
|
'check',
|
||||||
|
'--apply-unsafe',
|
||||||
|
'--formatter-enabled=true',
|
||||||
|
'--organize-imports-enabled=true',
|
||||||
|
'--skip-errors',
|
||||||
|
'--stdin-file-path=$FILENAME',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
b.formatting.stylua.with {
|
||||||
|
condition = function(utils)
|
||||||
|
return utils.root_has_file { 'stylua.toml', '.stylua.toml' }
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- b.formatting.goimports.with({
|
||||||
|
-- args = {
|
||||||
|
-- "-srcdir", "$DIRNAME", "-w", "cmd", "errorutils", "internal", "loaders", "resolvers"
|
||||||
|
-- }
|
||||||
|
-- }),
|
||||||
|
|
||||||
|
-- b.formatting.beautysh,
|
||||||
|
|
||||||
|
-- require("typescript.extensions.null-ls.code-actions"),
|
||||||
|
|
||||||
|
-- b.formatting.eslint_d,
|
||||||
|
|
||||||
|
-- b.diagnostics.eslint_d,
|
||||||
|
-- b.code_actions.eslint_d,
|
||||||
|
}
|
||||||
|
|
||||||
|
null_ls.setup {
|
||||||
|
-- debug = true,
|
||||||
|
sources = sources,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
|||||||
|
return {
|
||||||
|
"dbakker/vim-projectroot",
|
||||||
|
config = function()
|
||||||
|
vim.keymap.set(
|
||||||
|
"n",
|
||||||
|
"<C-f>",
|
||||||
|
":<C-u>ProjectRootExe lua require('telescope.builtin').live_grep({debounce=100})<cr>",
|
||||||
|
{ noremap = true, silent = true })
|
||||||
|
end
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
local keymap = require 'phoenix.utils.keymap'
|
||||||
|
|
||||||
|
return {
|
||||||
|
'ThePrimeagen/refactoring.nvim',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require('refactoring').setup {}
|
||||||
|
-- prompt for a refactor to apply when the remap is triggered
|
||||||
|
keymap({ 'n', 'x' }, '<leader>rr', require('refactoring').select_refactor)
|
||||||
|
end,
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
"themaxmarchuk/tailwindcss-colors.nvim",
|
||||||
|
config = function()
|
||||||
|
require("tailwindcss-colors").setup()
|
||||||
|
end
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
local keymap = require 'phoenix.utils.keymap'
|
||||||
|
|
||||||
|
return {
|
||||||
|
'akinsho/toggleterm.nvim',
|
||||||
|
config = function()
|
||||||
|
require('toggleterm').setup {
|
||||||
|
open_mapping = [[<leader>tt]],
|
||||||
|
insert_mappings = false,
|
||||||
|
direction = 'float',
|
||||||
|
shade_terminals = false,
|
||||||
|
}
|
||||||
|
|
||||||
|
keymap('n', '<leader>tr', ':ToggleTerm 2 direction=vertical<cr>', { desc = 'Toggle terminal right' })
|
||||||
|
keymap('n', '<leader>tb', ':ToggleTerm 3 direction=horizontal<cr>', { desc = 'Toggle terminal bottom' })
|
||||||
|
end,
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
---@type function
|
||||||
|
---comment
|
||||||
|
---@param mode any
|
||||||
|
---@param keymap any
|
||||||
|
---@param trouble_fn any
|
||||||
|
---@param desc any
|
||||||
|
local map = function(mode, keymap, trouble_fn, desc)
|
||||||
|
vim.keymap.set(mode, keymap, function()
|
||||||
|
require('trouble').open(trouble_fn)
|
||||||
|
end, { desc = "Trouble: " .. desc })
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
'folke/trouble.nvim',
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
|
opts = {
|
||||||
|
auto_preview = false,
|
||||||
|
icons = false,
|
||||||
|
fold_open = 'v', -- icon used for open folds
|
||||||
|
fold_closed = '>', -- icon used for closed folds
|
||||||
|
signs = {
|
||||||
|
-- icons / text used for a diagnostic
|
||||||
|
error = 'error',
|
||||||
|
warning = 'warn',
|
||||||
|
hint = 'hint',
|
||||||
|
information = 'info',
|
||||||
|
},
|
||||||
|
use_diagnostic_signs = false, -- enabling this will use the signs defined in your lsp client
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
map('n', '<leader>xx', nil, "show window")
|
||||||
|
map('n', '<leader>xw', 'workspace_diagnostics', "show [w]orkspace diagnostics")
|
||||||
|
map('n', '<leader>xd', 'document_diagnostics', "show [d]ocument diagnostics")
|
||||||
|
map('n', '<leader>xq', 'quickfix', "show [q]uickfix list")
|
||||||
|
map('n', '<leader>xl', 'loclist', "show [l]ocation list")
|
||||||
|
map('n', 'gR', 'lsp_references', "")
|
||||||
|
end,
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'dmmulroy/tsc.nvim',
|
||||||
|
lazy = false,
|
||||||
|
ft = { 'typescript', 'typescriptreact' },
|
||||||
|
config = function()
|
||||||
|
require('tsc').setup {
|
||||||
|
auto_open_qflist = true,
|
||||||
|
pretty_errors = true,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
@ -0,0 +1,137 @@
|
|||||||
|
-- UI related plugins, mostly fancy stuff
|
||||||
|
return {
|
||||||
|
-- Better `vim.notify()`
|
||||||
|
-- {
|
||||||
|
-- 'rcarriga/nvim-notify',
|
||||||
|
-- keys = {
|
||||||
|
-- {
|
||||||
|
-- '<leader>un',
|
||||||
|
-- function()
|
||||||
|
-- require('notify').dismiss { silent = true, pending = true }
|
||||||
|
-- end,
|
||||||
|
-- desc = 'Dismiss all Notifications',
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- opts = {
|
||||||
|
-- timeout = 3000,
|
||||||
|
-- max_height = function()
|
||||||
|
-- return math.floor(vim.o.lines * 0.75)
|
||||||
|
-- end,
|
||||||
|
-- max_width = function()
|
||||||
|
-- return math.floor(vim.o.columns * 0.75)
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
|
||||||
|
-- better vim.ui
|
||||||
|
{
|
||||||
|
'stevearc/dressing.nvim',
|
||||||
|
config = function()
|
||||||
|
require('dressing').setup {
|
||||||
|
input = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
select = {
|
||||||
|
enabled = true,
|
||||||
|
backend = { 'telescope', 'builtin' },
|
||||||
|
telescope = require('telescope.themes').get_cursor(),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- noicer ui
|
||||||
|
-- {
|
||||||
|
-- 'folke/noice.nvim',
|
||||||
|
-- event = 'VeryLazy',
|
||||||
|
-- opts = {
|
||||||
|
-- cmdline = {
|
||||||
|
-- enabled = true,
|
||||||
|
-- },
|
||||||
|
-- lsp = {
|
||||||
|
-- override = {
|
||||||
|
-- ['vim.lsp.util.convert_input_to_markdown_lines'] = true,
|
||||||
|
-- ['vim.lsp.util.stylize_markdown'] = true,
|
||||||
|
-- ['cmp.entry.get_documentation'] = true,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- routes = {
|
||||||
|
-- {
|
||||||
|
-- filter = {
|
||||||
|
-- event = 'msg_show',
|
||||||
|
-- find = '%d+L, %d+B',
|
||||||
|
-- },
|
||||||
|
-- view = 'mini',
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- presets = {
|
||||||
|
-- bottom_search = true,
|
||||||
|
-- -- command_palette = true,
|
||||||
|
-- long_message_to_split = true,
|
||||||
|
-- inc_rename = true,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- keys = {
|
||||||
|
-- {
|
||||||
|
-- '<S-Enter>',
|
||||||
|
-- function()
|
||||||
|
-- require('noice').redirect(vim.fn.getcmdline())
|
||||||
|
-- end,
|
||||||
|
-- mode = 'c',
|
||||||
|
-- desc = 'Redirect Cmdline',
|
||||||
|
-- },
|
||||||
|
-- {
|
||||||
|
-- '<leader>snl',
|
||||||
|
-- function()
|
||||||
|
-- require('noice').cmd 'last'
|
||||||
|
-- end,
|
||||||
|
-- desc = 'Noice Last Message',
|
||||||
|
-- },
|
||||||
|
-- {
|
||||||
|
-- '<leader>snh',
|
||||||
|
-- function()
|
||||||
|
-- require('noice').cmd 'history'
|
||||||
|
-- end,
|
||||||
|
-- desc = 'Noice History',
|
||||||
|
-- },
|
||||||
|
-- {
|
||||||
|
-- '<leader>sna',
|
||||||
|
-- function()
|
||||||
|
-- require('noice').cmd 'all'
|
||||||
|
-- end,
|
||||||
|
-- desc = 'Noice All',
|
||||||
|
-- },
|
||||||
|
-- {
|
||||||
|
-- '<leader>snd',
|
||||||
|
-- function()
|
||||||
|
-- require('noice').cmd 'dismiss'
|
||||||
|
-- end,
|
||||||
|
-- desc = 'Dismiss All',
|
||||||
|
-- },
|
||||||
|
-- {
|
||||||
|
-- '<c-f>',
|
||||||
|
-- function()
|
||||||
|
-- if not require('noice.lsp').scroll(4) then
|
||||||
|
-- return '<c-f>'
|
||||||
|
-- end
|
||||||
|
-- end,
|
||||||
|
-- silent = true,
|
||||||
|
-- expr = true,
|
||||||
|
-- desc = 'Scroll forward',
|
||||||
|
-- mode = { 'i', 'n', 's' },
|
||||||
|
-- },
|
||||||
|
-- {
|
||||||
|
-- '<c-b>',
|
||||||
|
-- function()
|
||||||
|
-- if not require('noice.lsp').scroll(-4) then
|
||||||
|
-- return '<c-b>'
|
||||||
|
-- end
|
||||||
|
-- end,
|
||||||
|
-- silent = true,
|
||||||
|
-- expr = true,
|
||||||
|
-- desc = 'Scroll backward',
|
||||||
|
-- mode = { 'i', 'n', 's' },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
-- this needs to be here because doing it in init.lua is late for this plugin to work
|
||||||
|
vim.o.undofile = true
|
||||||
|
vim.o.undodir = '/tmp/.phoenix/undo'
|
||||||
|
|
||||||
|
return {
|
||||||
|
'pixelastic/vim-undodir-tree',
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
-- Helper function to return a character from a string.
|
||||||
|
-- @param str {string}
|
||||||
|
-- @param index {number}
|
||||||
|
-- @returns {string}
|
||||||
|
local char_at = function(str, index)
|
||||||
|
return string.sub(str, index, index)
|
||||||
|
end
|
||||||
|
|
||||||
|
return char_at
|
@ -0,0 +1,45 @@
|
|||||||
|
local hsl_convert = require 'lush.vivid.hsl.convert'
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.hsl = function(h, s, l)
|
||||||
|
return hsl_convert.hsl_to_hex { h = h, s = s, l = l }
|
||||||
|
end
|
||||||
|
|
||||||
|
M.hex_to_rgb = function(hex)
|
||||||
|
hex = hex:gsub('#', '')
|
||||||
|
return {
|
||||||
|
r = tonumber('0x' .. hex:sub(1, 2)) / 255,
|
||||||
|
g = tonumber('0x' .. hex:sub(3, 4)) / 255,
|
||||||
|
b = tonumber('0x' .. hex:sub(5, 6)) / 255,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
M.rgb_to_hex = function(rgb)
|
||||||
|
return string.format('#%02x%02x%02x', rgb.r * 255, rgb.g * 255, rgb.b * 255)
|
||||||
|
end
|
||||||
|
|
||||||
|
M.rgb_to_hsl = function(rgb)
|
||||||
|
local r, g, b = rgb.r, rgb.g, rgb.b
|
||||||
|
local max, min = math.max(r, g, b), math.min(r, g, b)
|
||||||
|
local h, s, l = (max + min) / 2, (max + min) / 2, (max + min) / 2
|
||||||
|
|
||||||
|
if max == min then
|
||||||
|
-- achromatic
|
||||||
|
h, s = 0, 0
|
||||||
|
else
|
||||||
|
local delta = max - min
|
||||||
|
s = l > 0.5 and delta / (2 - max - min) or delta / (max + min)
|
||||||
|
if max == r then
|
||||||
|
h = (g - b) / delta + (g < b and 6 or 0)
|
||||||
|
elseif max == g then
|
||||||
|
h = (b - r) / delta + 2
|
||||||
|
elseif max == b then
|
||||||
|
h = (r - g) / delta + 4
|
||||||
|
end
|
||||||
|
h = h / 6
|
||||||
|
end
|
||||||
|
return { h = h, s = s, l = l }
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
@ -0,0 +1,43 @@
|
|||||||
|
local slice_table = require("phoenix.utils.slice_table")
|
||||||
|
local char_at = require("phoenix.utils.char_at")
|
||||||
|
|
||||||
|
local shrink_path = function(path)
|
||||||
|
if char_at(path, 1) == "." then
|
||||||
|
return char_at(path, 1) .. char_at(path, 2)
|
||||||
|
else
|
||||||
|
return char_at(path, 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local substitute_home = function(path)
|
||||||
|
return vim.fn.substitute(path, vim.fn.expand("$HOME"), "~", "")
|
||||||
|
end
|
||||||
|
|
||||||
|
local fish_like_path = function(path, level)
|
||||||
|
if path == "" then
|
||||||
|
return "[No Name]"
|
||||||
|
end
|
||||||
|
|
||||||
|
local paths = vim.fn.split(substitute_home(path), "/")
|
||||||
|
|
||||||
|
if #paths == 0 then
|
||||||
|
return "/"
|
||||||
|
elseif #paths == 1 then
|
||||||
|
if paths[1] == "~" then
|
||||||
|
return "~/"
|
||||||
|
else
|
||||||
|
return path
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local after = slice_table(paths, -level)
|
||||||
|
local before = slice_table(paths, 1, -level)
|
||||||
|
|
||||||
|
for key, value in pairs(before) do
|
||||||
|
before[key] = shrink_path(value)
|
||||||
|
end
|
||||||
|
|
||||||
|
return vim.fn.join(before, "/") .. "/" .. vim.fn.join(after, "/")
|
||||||
|
end
|
||||||
|
|
||||||
|
return fish_like_path
|
@ -0,0 +1,14 @@
|
|||||||
|
---@param mode string Mode short-name, see |nvim_set_keymap()|. Can also be list of modes to create mapping on multiple modes.
|
||||||
|
---@param lhs string|table Left-hand side |{lhs}| of the mapping.
|
||||||
|
---@param rhs string|function Right-hand side |{rhs}| of the mapping, can be a Lua function.
|
||||||
|
---@param opts table|nil Table of |:map-arguments|. Defaults to `{noremap = true, silent = true}`.
|
||||||
|
---@see |nvim_set_keymap()|
|
||||||
|
local keymap = function(mode, key, action, opts)
|
||||||
|
local options = { noremap = true, silent = true }
|
||||||
|
if opts then
|
||||||
|
options = vim.tbl_extend('force', options, opts)
|
||||||
|
end
|
||||||
|
vim.keymap.set(mode, key, action, options)
|
||||||
|
end
|
||||||
|
|
||||||
|
return keymap
|
@ -0,0 +1,36 @@
|
|||||||
|
local checkers = require("phoenix.utils.type-checkers")
|
||||||
|
|
||||||
|
-- Returns a shallow copy of a portion of a table into a new table
|
||||||
|
-- @param obj {table}
|
||||||
|
-- @param start {number} start value
|
||||||
|
-- @param finish {number} end value
|
||||||
|
-- @return {boolean}
|
||||||
|
local slice_table = function(obj, start, finish)
|
||||||
|
if checkers.is_empty(obj) or start == finish then
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
|
||||||
|
local output = {}
|
||||||
|
local _finish = #obj
|
||||||
|
local _start = 1
|
||||||
|
|
||||||
|
if start >= 0 then
|
||||||
|
_start = start
|
||||||
|
elseif checkers.is_nil(finish) and start < 0 then
|
||||||
|
_start = #obj + start + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if finish and finish >= 0 then
|
||||||
|
_finish = finish - 1
|
||||||
|
elseif finish and finish < 0 then
|
||||||
|
_finish = #obj + finish
|
||||||
|
end
|
||||||
|
|
||||||
|
for i = _start, _finish do
|
||||||
|
table.insert(output, obj[i])
|
||||||
|
end
|
||||||
|
|
||||||
|
return output
|
||||||
|
end
|
||||||
|
|
||||||
|
return slice_table
|
@ -0,0 +1,43 @@
|
|||||||
|
local checkers = {}
|
||||||
|
|
||||||
|
-- Helper function to check if value passed by parameter is a table
|
||||||
|
-- @obj {table}
|
||||||
|
-- @returns {boolean}
|
||||||
|
checkers.is_table = function(obj)
|
||||||
|
return type(obj) == "table"
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Verify if table object works as an array
|
||||||
|
-- @param obj {table}
|
||||||
|
-- @return {boolean}
|
||||||
|
checkers.is_array = function(obj)
|
||||||
|
if not checkers.is_table(obj) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
local i = 0
|
||||||
|
for _ in pairs(obj) do
|
||||||
|
i = i + 1
|
||||||
|
if obj[i] == nil then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Checks wether value is nil
|
||||||
|
-- @obj {any}
|
||||||
|
-- @returns {boolean}
|
||||||
|
checkers.is_nil = function(value)
|
||||||
|
return value == nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Checks if parameter is an empty table
|
||||||
|
-- @param obj {table}
|
||||||
|
-- @return {boolean}
|
||||||
|
checkers.is_empty = function(obj)
|
||||||
|
return checkers.is_array(obj) and #obj == 0
|
||||||
|
end
|
||||||
|
|
||||||
|
return checkers
|
Loading…
Reference in New Issue