feat: add templating for laptop dotfiles
This commit is contained in:
parent
caf6e25e43
commit
bdf7e407cb
21 changed files with 437 additions and 52 deletions
|
|
@ -0,0 +1,9 @@
|
|||
{{- if has "desktop" .class | not }}
|
||||
hydras.lua
|
||||
plugins/aesthetics.lua
|
||||
plugins/lion.lua
|
||||
plugins/markdown-preview.lua
|
||||
plugins/split-focus.lua
|
||||
plugins/treesitter.lua
|
||||
plugins/zen-mode.lua
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
local Hydra = require('hydra')
|
||||
local cmd = require('hydra.keymap-util').cmd
|
||||
|
||||
local telescope_hint = [[
|
||||
_f_: files _g_: live grep
|
||||
🭇🬭🬭🬭🬭🬭🬭🬭🬭🬼 _o_: old files _/_: search in file
|
||||
🭉🭁🭠🭘 🭣🭕🭌🬾
|
||||
🭅█ >▁ █🭐 _r_: resume _T_: TODO comments
|
||||
██🬿 🭊██ _h_: vim help _c_: execute command
|
||||
🭋█🬝🮄🮄🮄🮄🮄🮄🮄🮄🬆█🭀 _k_: keymaps _;_: commands history
|
||||
🭤🭒🬺🬹🬱🬭🬭🬭🬭🬵🬹🬹🭝🭙 _O_: options _?_: search history
|
||||
^
|
||||
_<Enter>_: Telescope _<Esc>_
|
||||
|
||||
]]
|
||||
|
||||
Hydra({
|
||||
name = 'Telescope',
|
||||
hint = telescope_hint,
|
||||
config = {
|
||||
color = 'teal',
|
||||
invoke_on_body = true,
|
||||
hint = {
|
||||
position = 'middle',
|
||||
border = 'rounded',
|
||||
},
|
||||
},
|
||||
mode = 'n',
|
||||
body = '<leader>F',
|
||||
heads = {
|
||||
{ 'f', cmd 'Telescope find_files' },
|
||||
{ 'g', cmd 'Telescope live_grep' },
|
||||
{ 'o', cmd 'Telescope oldfiles', { desc = 'recently opened files' } },
|
||||
{ 'h', cmd 'Telescope help_tags', { desc = 'vim help' } },
|
||||
{ 'k', cmd 'Telescope keymaps' },
|
||||
{ 'O', cmd 'Telescope vim_options' },
|
||||
{ 'r', cmd 'Telescope resume' },
|
||||
{ '/', cmd 'Telescope current_buffer_fuzzy_find', { desc = 'search in file' } },
|
||||
{ '?', cmd 'Telescope search_history', { desc = 'search history' } },
|
||||
{ ';', cmd 'Telescope command_history', { desc = 'command-line history' } },
|
||||
{ 'c', cmd 'Telescope commands', { desc = 'execute command' } },
|
||||
{ 'T', cmd 'TodoTelescope', { desc = 'todo comments' } },
|
||||
{ '<Enter>', cmd 'Telescope', { exit = true, desc = 'list all pickers' } },
|
||||
{ '<Esc>', nil, { exit = true, nowait = true } },
|
||||
}
|
||||
})
|
||||
|
||||
local lsp_hint = [[
|
||||
_K_: hover
|
||||
🭇🬭🬭🬭🬭🬭🬭🬭🬭🬼
|
||||
🭉🭁🭠🭘 🭣🭕🭌🬾 _gd_: definition _gD_: declaration
|
||||
🭅█ >▁ █🭐 _gi_: implementation _go_: typedef
|
||||
██🬿 🭊██ _gr_: references _gs_: signature
|
||||
🭋█🬝🮄🮄🮄🮄🮄🮄🮄🮄🬆█🭀
|
||||
🭤🭒🬺🬹🬱🬭🬭🬭🬭🬵🬹🬹🭝🭙 _<F2>_: rename _<F4>_: code actions
|
||||
^
|
||||
_gl_: diagnostic float
|
||||
_[d_: prev _]d_: next
|
||||
]]
|
||||
Hydra({
|
||||
name = 'LSP Actions',
|
||||
hint = lsp_hint,
|
||||
config = {
|
||||
color = 'teal',
|
||||
invoke_on_body = true,
|
||||
hint = {
|
||||
position = 'middle',
|
||||
border = 'rounded',
|
||||
}
|
||||
},
|
||||
mode = 'n',
|
||||
body = '<leader>L',
|
||||
heads = {
|
||||
{ 'K', cmd 'lua vim.lsp.buf.hover()' },
|
||||
{ 'gd', cmd 'lua vim.lsp.buf.definition()' },
|
||||
{ 'gD', cmd 'lua vim.lsp.buf.declaration()' },
|
||||
{ 'gi', cmd 'lua vim.lsp.buf.implementation()' },
|
||||
{ 'go', cmd 'lua vim.lsp.buf.type_definition()' },
|
||||
{ 'gr', cmd 'lua vim.lsp.buf.references()' },
|
||||
{ 'gs', cmd 'lua vim.lsp.buf.signature_help()' },
|
||||
{ '<F2>', cmd 'lua vim.lsp.buf.rename()' },
|
||||
{ '<F4>', cmd 'lua vim.lsp.buf.code_action()' },
|
||||
{ 'gl', cmd 'lua vim.diagnostic.open_float()' },
|
||||
{ '[d', cmd 'lua vim.diagnostic.goto_prev()' },
|
||||
{ ']d', cmd 'lua vim.diagnostic.goto_next()' },
|
||||
{ '<Esc>', nil, { exit = true, nowait = true } },
|
||||
}
|
||||
})
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
return {
|
||||
-- pretty statusline
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
config = function()
|
||||
vim.o.showmode = false
|
||||
require 'lualine'.setup {
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
component_separators = { left = '⡇⡷', right = '⢾⢸' },
|
||||
section_separators = { left = '▓▓▒', right = '▒▓▓' },
|
||||
globalstatus = true,
|
||||
theme = 'catppuccin',
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = { 'filename' },
|
||||
lualine_c = { 'branch', 'diff' },
|
||||
lualine_x = { 'encoding', 'filetype' },
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'location' },
|
||||
},
|
||||
inactive_sections = {},
|
||||
}
|
||||
end
|
||||
},
|
||||
|
||||
-- cutesy indent lines
|
||||
{
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
dependencies = { 'catppuccin' },
|
||||
config = function()
|
||||
local highlight = {
|
||||
"RainbowRed",
|
||||
"RainbowYellow",
|
||||
"RainbowBlue",
|
||||
"RainbowOrange",
|
||||
"RainbowGreen",
|
||||
"RainbowViolet",
|
||||
"RainbowCyan",
|
||||
}
|
||||
|
||||
local hooks = require "ibl.hooks"
|
||||
-- create the highlight groups in the highlight setup hook, so they are reset
|
||||
-- every time the colorscheme changes
|
||||
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||||
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
|
||||
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
|
||||
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
|
||||
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
|
||||
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
|
||||
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
|
||||
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
|
||||
end)
|
||||
|
||||
require("ibl").setup { indent = { highlight = highlight } }
|
||||
end
|
||||
},
|
||||
|
||||
-- highlighted TODO comments
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
highlight = {
|
||||
pattern = [[.*<(KEYWORDS)\s*:?]]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
return {
|
||||
{ 'tpope/vim-vinegar' }
|
||||
'tpope/vim-eunuch', --Delete/Rename/Move/&c commands that sync with the buffer
|
||||
'tpope/vim-vinegar', --netrw upgrades
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
-- cool command-nesting
|
||||
{
|
||||
'anuvyklack/hydra.nvim',
|
||||
dependencies = { 'catppuccin' },
|
||||
config = function()
|
||||
package.loaded['hydras'] = nil
|
||||
require 'hydras'
|
||||
end
|
||||
},
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
return {
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
init = function() vim.o.showmode = false end,
|
||||
opts = {
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
component_separators = { left = '⧽', right = '⧼'},
|
||||
section_separators = { left = '', right = ''},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
init = function() vim.o.showmode = false end,
|
||||
opts = {
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
component_separators = { left = '⧽', right = '⧼'},
|
||||
section_separators = { left = '', right = ''},
|
||||
globalstatus = true,
|
||||
{{- if has "desktop" .class }}
|
||||
theme = 'catppuccin-nvim',
|
||||
{{- end }}
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = { 'filename' },
|
||||
lualine_c = { 'branch', 'diff' },
|
||||
lualine_x = { 'encoding', 'filetype' },
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'location' },
|
||||
},
|
||||
inactive_sections = {},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
{
|
||||
'tommcdo/vim-lion', --gl/gL to align block on character
|
||||
lazy = false,
|
||||
config = function() end
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
{
|
||||
'iamcco/markdown-preview.nvim',
|
||||
cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' },
|
||||
ft = { 'markdown' },
|
||||
build = function() vim.fn['mkdp#util#install']() end,
|
||||
keys = {
|
||||
{ '<C-p>', ':MarkdownPreviewToggle<CR>' }
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
return {
|
||||
{ "tpope/vim-repeat" },
|
||||
{ "tpope/vim-surround" },
|
||||
{ url = "https://codeberg.org/andyg/leap.nvim",
|
||||
config = function()
|
||||
vim.keymap.set({'n', 'x', 'o'}, 's', '<Plug>(leap)')
|
||||
vim.keymap.set('n', 'S', '<Plug>(leap-from-window)')
|
||||
end
|
||||
}
|
||||
{ "tpope/vim-repeat" }, --make . behave more predictably
|
||||
{ "tpope/vim-surround" }, --change and set (){}[]<>''
|
||||
{ "wellle/targets.vim" }, --provides text objs for brackets, quotes, tags, etc
|
||||
{ url = "https://codeberg.org/andyg/leap.nvim",
|
||||
config = function()
|
||||
vim.keymap.set({'n', 'x', 'o'}, 's', '<Plug>(leap)')
|
||||
vim.keymap.set('n', 'S', '<Plug>(leap-from-window)')
|
||||
end
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
{
|
||||
'beauwilliams/focus.nvim', --dynamically sized splits
|
||||
config = function()
|
||||
require 'focus'.setup()
|
||||
end
|
||||
},
|
||||
}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
return {
|
||||
{ "catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
opts = {
|
||||
flavor ="frappe"
|
||||
}
|
||||
{ "catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
opts = {
|
||||
flavor = "frappe"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
return {
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
lazy = false,
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
require('nvim-treesitter').install({
|
||||
"astro", "bash", "c", "cmake", "css", "dockerfile", "fish", "go", "html", "java",
|
||||
"javascript", "json", "json5", "latex", "lua", "make", "perl", "python", "regex",
|
||||
"ruby", "rust", "typescript", "vim", "yaml"
|
||||
}):wait(300000)
|
||||
end
|
||||
},
|
||||
|
||||
-- show block headers at top of scrollzone
|
||||
{
|
||||
'romgrk/nvim-treesitter-context',
|
||||
config = function()
|
||||
require 'treesitter-context'.setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
return {
|
||||
{
|
||||
'folke/zen-mode.nvim',
|
||||
dependencies = {
|
||||
'junegunn/limelight.vim',
|
||||
},
|
||||
opts = {
|
||||
window = {
|
||||
width = 60,
|
||||
height = 20,
|
||||
options = {
|
||||
winbar = '',
|
||||
signcolumn = "no", -- disable signcolumn
|
||||
number = false, -- disable number column
|
||||
relativenumber = false, -- disable relative numbers
|
||||
cursorline = false, -- disable cursorline
|
||||
cursorcolumn = false, -- disable cursor column
|
||||
foldcolumn = "0", -- disable fold column
|
||||
textwidth = 55,
|
||||
linebreak = true,
|
||||
},
|
||||
},
|
||||
on_open = function(_win)
|
||||
vim.o.cmdheight = 2
|
||||
vim.o.textwidth = 55
|
||||
vim.cmd('Limelight')
|
||||
end,
|
||||
on_close = function(_win)
|
||||
vim.o.cmdheight = 1
|
||||
vim.o.textwidth = 88
|
||||
vim.cmd('Limelight!')
|
||||
end
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue