Add jetporch automation platform #16

Closed
joao.dubas wants to merge 8 commits from jpd-add-jetporch into main
3 changed files with 129 additions and 38 deletions

View File

@ -143,16 +143,6 @@ RUN curl https://mise.jdx.dev/install.sh | sh \
&& curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash \ && curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash \
&& git clone https://github.com/tmux-plugins/tpm.git ${XDG_CONFIG_HOME}/tmux/plugins/tpm && git clone https://github.com/tmux-plugins/tpm.git ${XDG_CONFIG_HOME}/tmux/plugins/tpm
# git configuration
COPY ./patch/kickstart.nvim/updates.patch /tmp
COPY ./config/nvim/lua/custom/plugins/init.lua /tmp
RUN git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME}"/nvim \
&& cd ${XDG_CONFIG_HOME}/nvim \
&& git reset --hard 2510c29d62d39d63bb75f1a613d2ae628a2af4ee \
&& git apply /tmp/updates.patch \
&& cp /tmp/init.lua ${XDG_CONFIG_HOME}/nvim/lua/custom/plugins \
&& nvim --headless "+Lazy! sync" +qa
# configure fish and bash # configure fish and bash
RUN fish -c true \ RUN fish -c true \
&& echo 'starship init fish | source' >> ${XDG_CONFIG_HOME}/fish/config.fish \ && echo 'starship init fish | source' >> ${XDG_CONFIG_HOME}/fish/config.fish \
@ -163,12 +153,15 @@ RUN fish -c true \
&& echo 'alias ll="l -Fahl"' >> ${XDG_CONFIG_HOME}/fish/config.fish \ && echo 'alias ll="l -Fahl"' >> ${XDG_CONFIG_HOME}/fish/config.fish \
&& echo 'alias la="l -a"' >> ${XDG_CONFIG_HOME}/fish/config.fish && echo 'alias la="l -a"' >> ${XDG_CONFIG_HOME}/fish/config.fish
# configure git # git configuration
ARG GIT_USER_EMAIL COPY ./patch/kickstart.nvim/updates.patch /tmp
ARG GIT_USER_NAME COPY ./config/nvim/lua/custom/plugins/init.lua /tmp
RUN git config --global user.email "${GIT_USER_EMAIL}" \ RUN git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME}"/nvim \
&& git config --global user.name "${GIT_USER_NAME}" \ && cd ${XDG_CONFIG_HOME}/nvim \
&& git config --global core.editor nvim && git reset --hard b11581491671ed49b1dfdb1ea777932ade7ff2e5 \
&& git apply /tmp/updates.patch \
&& cp /tmp/init.lua ${XDG_CONFIG_HOME}/nvim/lua/custom/plugins \
&& nvim --headless "+Lazy! sync" +qa
# install rtx plugins # install rtx plugins
RUN ${LOCAL_BIN_HOME}/mise plugins install --force --yes \ RUN ${LOCAL_BIN_HOME}/mise plugins install --force --yes \
@ -194,5 +187,12 @@ RUN ${LOCAL_BIN_HOME}/mise plugins install --force --yes \
yarn \ yarn \
zoxide zoxide
# configure git
ARG GIT_USER_EMAIL
ARG GIT_USER_NAME
RUN git config --global user.email "${GIT_USER_EMAIL}" \
&& git config --global user.name "${GIT_USER_NAME}" \
&& git config --global core.editor nvim
COPY ./scripts/docker-entrypoint.sh /usr/local/bin/docker-entrypoint COPY ./scripts/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
COPY ./scripts/elixir-ls-setup.sh /usr/local/bin/elixir-ls-setup COPY ./scripts/elixir-ls-setup.sh /usr/local/bin/elixir-ls-setup

View File

@ -3,6 +3,14 @@
-- --
-- See the kickstart.nvim README for more information -- See the kickstart.nvim README for more information
return { return {
{
'mgoral/vim-bw',
url = 'https://git.goral.net.pl/mgoral/vim-bw.git',
priority = 1000,
config = function ()
vim.cmd.colorscheme 'bw-onedark'
end
},
{ {
'joaodubas/gitlinker.nvim', 'joaodubas/gitlinker.nvim',
config = function () config = function ()
@ -24,6 +32,65 @@ return {
}) })
end end
}, },
'nvim-treesitter/nvim-treesitter-context',
{
'kevinhwang91/nvim-ufo',
dependencies = { 'kevinhwang91/promise-async' },
event = 'BufRead',
keys = function ()
local ufo = require('ufo')
return {
{ 'zR', ufo.openAllFolds, { desc = "Open all folds" } },
{ 'zM', ufo.closeAllFolds, { desc = "Close all folds" } },
{ 'zr', ufo.openFoldsExceptKinds, { desc = "Open fold" } },
{ 'zm', ufo.closeFoldsWith, { desc = "Close fold" } },
}
end,
opts = function ()
local handler = function (virtText, lnum, endLnum, width, truncate)
local newVirtText = {}
local suffix = (' 󰁂 %d '):format(endLnum - lnum)
local sufWidth = vim.fn.strdisplaywidth(suffix)
local targetWidth = width - sufWidth
local curWidth = 0
for _, chunk in ipairs(virtText) do
local chunkText = chunk[1]
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
if targetWidth > curWidth + chunkWidth then
table.insert(newVirtText, chunk)
else
chunkText = truncate(chunkText, targetWidth - curWidth)
local hlGroup = chunk[2]
table.insert(newVirtText, {chunkText, hlGroup})
chunkWidth = vim.fn.strdisplaywidth(chunkText)
-- str width returned from truncate() may less than 2nd argument, need padding
if curWidth + chunkWidth < targetWidth then
suffix = suffix .. (' '):rep(targetWidth - curWidth - chunkWidth)
end
break
end
curWidth = curWidth + chunkWidth
end
table.insert(newVirtText, { suffix, 'MoreMsg' })
return newVirtText
end
return {
fold_virt_text_handler = handler,
provider_selector = function (_, _, _)
return { 'treesitter', 'indent' }
end
}
end,
},
{
'stevearc/oil.nvim',
dependencies = { "nvim-tree/nvim-web-devicons" },
keys = {
{ '-', '<cmd>Oil<cr>', desc = "Open parent directory" },
},
opts = {},
},
{ {
'rest-nvim/rest.nvim', 'rest-nvim/rest.nvim',
dependencies = { 'nvim-lua/plenary.nvim' }, dependencies = { 'nvim-lua/plenary.nvim' },
@ -69,7 +136,6 @@ return {
} }
end end
}, },
'nvim-treesitter/nvim-treesitter-context',
{ {
'akinsho/toggleterm.nvim', 'akinsho/toggleterm.nvim',
opts = { opts = {
@ -110,12 +176,4 @@ return {
} }
end end
}, },
{
'stevearc/oil.nvim',
dependencies = { "nvim-tree/nvim-web-devicons" },
keys = {
{ '-', '<cmd>Oil<cr>', desc = "Open parent directory" },
},
opts = {},
},
} }

View File

@ -1,8 +1,41 @@
diff --git a/init.lua b/init.lua diff --git a/init.lua b/init.lua
index 1ff16af..2ef9591 100644 index 6c6ae02..233e6b1 100644
--- a/init.lua --- a/init.lua
+++ b/init.lua +++ b/init.lua
@@ -266,7 +266,7 @@ require('lazy').setup({ @@ -189,19 +189,19 @@ require('lazy').setup({
},
},
- {
- -- Theme inspired by Atom
- 'navarasu/onedark.nvim',
- priority = 1000,
- lazy = false,
- config = function()
- require('onedark').setup {
- -- Set a style preset. 'dark' is default.
- style = 'dark', -- dark, darker, cool, deep, warm, warmer, light
- }
- require('onedark').load()
- end,
- },
+ -- {
+ -- -- Theme inspired by Atom
+ -- 'navarasu/onedark.nvim',
+ -- priority = 1000,
+ -- lazy = false,
+ -- config = function()
+ -- require('onedark').setup {
+ -- -- Set a style preset. 'dark' is default.
+ -- style = 'dark', -- dark, darker, cool, deep, warm, warmer, light
+ -- }
+ -- require('onedark').load()
+ -- end,
+ -- },
{
-- Set lualine as statusline
@@ -271,7 +271,7 @@ require('lazy').setup({
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- --
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
@ -11,7 +44,7 @@ index 1ff16af..2ef9591 100644
}, {}) }, {})
-- [[ Setting options ]] -- [[ Setting options ]]
@@ -276,11 +276,12 @@ require('lazy').setup({ @@ -281,11 +281,12 @@ require('lazy').setup({
-- Set highlight on search -- Set highlight on search
vim.o.hlsearch = false vim.o.hlsearch = false
@ -27,22 +60,22 @@ index 1ff16af..2ef9591 100644
-- Sync clipboard between OS and Neovim. -- Sync clipboard between OS and Neovim.
-- Remove this option if you want your OS clipboard to remain independent. -- Remove this option if you want your OS clipboard to remain independent.
@@ -310,6 +311,14 @@ vim.o.completeopt = 'menuone,noselect' @@ -315,6 +316,14 @@ vim.o.completeopt = 'menuone,noselect'
-- NOTE: You should make sure your terminal supports this -- NOTE: You should make sure your terminal supports this
vim.o.termguicolors = true vim.o.termguicolors = true
+-- Set foldmethod +-- Set foldmethod
+-- See `:help foldmethod` +-- See `:help foldmethod`
+vim.opt.foldmethod = 'expr' +vim.o.foldcolumn = '1'
+vim.opt.foldexpr = 'v:lua.vim.treesitter.foldexpr()' +vim.o.foldlevel = 99
+vim.opt.foldnestmax = 5 +vim.o.foldlevelstart = 99
+vim.opt.foldlevel = 1 +vim.o.foldenable = true
+vim.opt.foldenable = false +vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
+ +
-- [[ Basic Keymaps ]] -- [[ Basic Keymaps ]]
-- Keymaps for better default experience -- Keymaps for better default experience
@@ -423,8 +432,31 @@ vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = @@ -428,8 +437,31 @@ vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc =
vim.defer_fn(function() vim.defer_fn(function()
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter -- Add languages to be installed here that you want installed for treesitter
@ -76,7 +109,7 @@ index 1ff16af..2ef9591 100644
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false, auto_install = false,
-- Install languages synchronously (only applied to `ensure_installed`) -- Install languages synchronously (only applied to `ensure_installed`)
@@ -568,13 +600,16 @@ require('mason-lspconfig').setup() @@ -573,13 +605,16 @@ require('mason-lspconfig').setup()
-- If you want to override the default filetypes that your language server will attach to you can -- If you want to override the default filetypes that your language server will attach to you can
-- define the property 'filetypes' to the map in question. -- define the property 'filetypes' to the map in question.
local servers = { local servers = {
@ -100,7 +133,7 @@ index 1ff16af..2ef9591 100644
lua_ls = { lua_ls = {
Lua = { Lua = {
workspace = { checkThirdParty = false }, workspace = { checkThirdParty = false },
@@ -583,6 +618,8 @@ local servers = { @@ -588,6 +623,8 @@ local servers = {
-- diagnostics = { disable = { 'missing-fields' } }, -- diagnostics = { disable = { 'missing-fields' } },
}, },
}, },
@ -109,7 +142,7 @@ index 1ff16af..2ef9591 100644
} }
-- Setup neovim lua configuration -- Setup neovim lua configuration
@@ -601,12 +638,23 @@ mason_lspconfig.setup { @@ -606,12 +643,23 @@ mason_lspconfig.setup {
mason_lspconfig.setup_handlers { mason_lspconfig.setup_handlers {
function(server_name) function(server_name)