From 5ca9a327255b956674a92594b549bc5c78e48515 Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Thu, 28 Dec 2023 19:17:49 +0100 Subject: [PATCH 01/10] remove ruby, R --- Dockerfile | 14 +++----------- README.md | 10 ++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3f36c2f..ecaac4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,10 +27,6 @@ ENV PYTHON_DEVEL_PKGS="\ ENV BUILD_ONLY_PKGS="python3-devel" -ENV R_DEVEL_PKGS="R-core R-core-devel cmake" - -ENV RUBY_DEVEL_PKGS="ruby-devel rubygems" - ENV MASON_PKGS=" \ bash-language-server \ css-lsp \ @@ -50,19 +46,15 @@ ENV MASON_PKGS=" \ sqlls \ typescript-language-server \ yaml-language-server \ - markdownlint\ - ansible-language-server \ - standardrb \ - ruby-lsp \ - solargraph" + markdownlint \ + ansible-language-server" ENV PIP_PKGS="pynvim ansible ansible-lint" COPY . /root/.config/nvim # install system dependencies RUN dnf install -y \ - ${GENERAL_PKGS} ${NEOVIM_PKGS} ${PYTHON_DEVEL_PKGS} ${R_DEVEL_PKGS} ${RUBY_DEVEL_PKGS} ${BUILD_ONLY_PKGS} && \ - R -e 'install.packages("languageserver", repos = "http://cran.us.r-project.org")' && \ + ${GENERAL_PKGS} ${NEOVIM_PKGS} ${PYTHON_DEVEL_PKGS} ${BUILD_ONLY_PKGS} && \ pip install ${PIP_PKGS} && \ dnf remove -y ${BUILD_ONLY_PKGS} && \ dnf -y autoremove && \ diff --git a/README.md b/README.md index f8b0021..6b99555 100644 --- a/README.md +++ b/README.md @@ -183,6 +183,16 @@ And then in neovim: :MasonInstall perlnavigator ``` +### Ruby + +```bash +dnf install -y ruby-devel rubygems +``` + +```bash +:MasonInstall standardrb ruby-lsp solargraph +``` + ## Inside vim ```vim From 3cac886e406dd4e05a409a135a91366499fd7bb8 Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Sun, 31 Dec 2023 10:47:43 +0100 Subject: [PATCH 02/10] reduce build frequency --- .gitea/workflows/build-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build-images.yml b/.gitea/workflows/build-images.yml index 841ff33..d90720a 100644 --- a/.gitea/workflows/build-images.yml +++ b/.gitea/workflows/build-images.yml @@ -4,7 +4,7 @@ on: push: branches: [ "main" ] schedule: - - cron: '30 3 */3 * *' + - cron: '30 3 */10 * *' jobs: build-neovim-arm64: From 3662e7009227ff305e3369fbfde6e3d51513858f Mon Sep 17 00:00:00 2001 From: Szwendacz Date: Thu, 4 Jan 2024 12:37:23 +0100 Subject: [PATCH 03/10] yamls add kubernetes yaml globs --- lua/plugins/nvim-lspconfig.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/plugins/nvim-lspconfig.lua b/lua/plugins/nvim-lspconfig.lua index 265a943..ed7d405 100644 --- a/lua/plugins/nvim-lspconfig.lua +++ b/lua/plugins/nvim-lspconfig.lua @@ -189,6 +189,11 @@ return { require 'lspconfig'.yamlls.setup { on_attach = on_attach, capabilities = capabilities, + settings = { + yaml = { + schemas = { kubernetes = "*{deployment,cron,service,volume,secret,ingress,svc,pvc}*.yaml" }, + } + } } require 'lspconfig'.lemminx.setup { From e92a7ee2c5bef26ad7a2dec3f52c1127fa9bcaf2 Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Thu, 11 Jan 2024 21:45:14 +0100 Subject: [PATCH 04/10] make Telescope grep hidden files --- README.md | 8 +++++++ lua/plugins/nvim-telescope.lua | 40 +++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b99555..c4b9b17 100644 --- a/README.md +++ b/README.md @@ -275,6 +275,14 @@ All that is saved in image, so that is why image is so heavy. |Ctrl+v | Open selection as a vsplit| |Ctrl+t | Open selection in new tab | +##### Usefull Telescope commands + +Find files including hidden + +```bash +Telescope find_files hidden=true +``` + #### Markdown Preview Mardkown Preview plugin commands: diff --git a/lua/plugins/nvim-telescope.lua b/lua/plugins/nvim-telescope.lua index b00bdc0..12b1741 100644 --- a/lua/plugins/nvim-telescope.lua +++ b/lua/plugins/nvim-telescope.lua @@ -5,5 +5,43 @@ return { vim.keymap.set('n', 'fg', builtin.live_grep, {}) vim.keymap.set('n', 'fb', builtin.buffers, {}) vim.keymap.set('n', 'fh', builtin.help_tags, {}) - end + require('telescope').setup { + defaults = { + vimgrep_arguments = { + 'rg', + '--color=never', + '--no-heading', + '--with-filename', + '--line-number', + '--column', + '--smart-case', + '--no-ignore', + '--hidden', + '--glob', + '!{**/.git/*,**/node_modules/*,**/package-lock.json,**/yarn.lock}', + }, + } } + end, + opts = { + --defaults = { + --vimgrep_arguments = { + --'rg', + --'--color=never', + --'--no-heading', + --'--with-filename', + --'--line-number', + --'--column', + --'--smart-case', + --'--no-ignore', + ----'--hidden', + --} + --}, + pickers = { + live_grep = { + additional_args = function(opts) + return { "--hidden" } + end + }, + }, + } } From 26ab69834f557b613785db3637b7c199ce3a9b31 Mon Sep 17 00:00:00 2001 From: Szwendacz Date: Fri, 12 Jan 2024 10:44:25 +0100 Subject: [PATCH 05/10] bashrc cleaning --- Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ecaac4e..713012d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -75,8 +75,6 @@ RUN nvim --headless +TSUpdateSync \ +qa; \ chown -R root:root /root/.local/share/nvim/mason/packages/sqlls/node_modules/sql-language-server/ -RUN echo $'[ -f /usr/share/fzf/key-bindings.bash ] && source /usr/share/fzf/key-bindings.bash \n\ -[ -f /usr/share/fzf/shell/key-bindings.bash ] && source /usr/share/fzf/shell/key-bindings.bash \n\ -[ -f /usr/share/fzf/completion.bash ] && source /usr/share/fzf/completion.bash' >> /root/.bashrc +RUN echo '[ -f /usr/share/fzf/shell/key-bindings.bash ] && source /usr/share/fzf/shell/key-bindings.bash' >> /root/.bashrc ENTRYPOINT [ "/usr/bin/nvim" ] From 7f244b2acec020e6c80eda5a8889f3143471578a Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Sat, 13 Jan 2024 08:58:00 +0100 Subject: [PATCH 06/10] fix treesitter on start --- Dockerfile => Containerfile | 0 lua/lazy-load.lua | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename Dockerfile => Containerfile (100%) diff --git a/Dockerfile b/Containerfile similarity index 100% rename from Dockerfile rename to Containerfile diff --git a/lua/lazy-load.lua b/lua/lazy-load.lua index 1f50eee..9213941 100644 --- a/lua/lazy-load.lua +++ b/lua/lazy-load.lua @@ -17,7 +17,7 @@ require("lazy").setup({ -- treesitter need to be configured after load, -- so let here be init, not config init = require('plugins.treesitter'), - build = ':TSUpdate', + --build = ':TSUpdate', -- not needed in Container workflow priority = 400 }, -- neovim lsp plugins and depencencies From 18d319ad460ee25be221950813998bf59c632693 Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Sat, 13 Jan 2024 09:00:44 +0100 Subject: [PATCH 07/10] fix building Containerfile --- .gitea/workflows/build-images.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build-images.yml b/.gitea/workflows/build-images.yml index d90720a..dcab79e 100644 --- a/.gitea/workflows/build-images.yml +++ b/.gitea/workflows/build-images.yml @@ -16,7 +16,7 @@ jobs: - name: Check out repository code uses: actions/checkout@v3 - run: | - podman build . --file Dockerfile --tag gitea.maciej.cloud/packages/neovim:arm64 + podman build . --tag gitea.maciej.cloud/packages/neovim:arm64 - name: login to registry run: | podman login -u "${{ secrets.PACKAGES_USERNAME }}" -p "${{ secrets.PACKAGES_PASSWD }}" gitea.maciej.cloud @@ -41,7 +41,7 @@ jobs: - name: Check out repository code uses: actions/checkout@v3 - run: | - podman build . --file Dockerfile --tag gitea.maciej.cloud/packages/neovim:amd64 + podman build . --tag gitea.maciej.cloud/packages/neovim:amd64 - name: login to registry run: | podman login -u "${{ secrets.PACKAGES_USERNAME }}" -p "${{ secrets.PACKAGES_PASSWD }}" gitea.maciej.cloud From 9dc0b5db5a98bf47abace5b22d1a5af05e5e743c Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Sat, 13 Jan 2024 21:09:21 +0100 Subject: [PATCH 08/10] more treesitter conf adjustments for nvim-in-container workflow --- Containerfile | 10 +++++----- lua/plugins/treesitter.lua | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Containerfile b/Containerfile index 713012d..d3935ee 100644 --- a/Containerfile +++ b/Containerfile @@ -62,16 +62,16 @@ RUN dnf install -y \ RUN rm /root/.config/nvim/lazy-lock.json || true # install lsp and linters using mason -RUN nvim --headless +TSUpdateSync \ +RUN nvim --headless +TSInstall all \ +"MasonInstall ${MASON_PKGS}" \ +qa ; \ - nvim --headless +TSUpdateSync \ + nvim --headless +TSInstall all \ +qa; \ - nvim --headless +TSUpdateSync \ + nvim --headless +TSInstall all \ +qa; \ - nvim --headless +TSUpdateSync \ + nvim --headless +TSInstall all \ +qa; \ - nvim --headless +TSUpdateSync \ + nvim --headless +TSInstall all \ +qa; \ chown -R root:root /root/.local/share/nvim/mason/packages/sqlls/node_modules/sql-language-server/ diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index f5063f1..5c95d7c 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,7 +1,7 @@ return function() require 'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" - ensure_installed = "all", + ensure_installed = "", -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = true, From adfc5e748906e9077dad2876f36e7566dca1ade2 Mon Sep 17 00:00:00 2001 From: Szwendacz Date: Mon, 15 Jan 2024 13:43:50 +0100 Subject: [PATCH 09/10] mount shada dir, treesitter reverse/fix --- Containerfile | 10 ++-------- README.md | 12 ++++++------ lua/plugins/treesitter.lua | 2 +- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Containerfile b/Containerfile index d3935ee..bbf5cd9 100644 --- a/Containerfile +++ b/Containerfile @@ -62,16 +62,10 @@ RUN dnf install -y \ RUN rm /root/.config/nvim/lazy-lock.json || true # install lsp and linters using mason -RUN nvim --headless +TSInstall all \ +RUN nvim --headless '+TSInstall all' \ +"MasonInstall ${MASON_PKGS}" \ +qa ; \ - nvim --headless +TSInstall all \ - +qa; \ - nvim --headless +TSInstall all \ - +qa; \ - nvim --headless +TSInstall all \ - +qa; \ - nvim --headless +TSInstall all \ + nvim --headless '+TSInstall all' \ +qa; \ chown -R root:root /root/.local/share/nvim/mason/packages/sqlls/node_modules/sql-language-server/ diff --git a/README.md b/README.md index c4b9b17..1984123 100644 --- a/README.md +++ b/README.md @@ -89,17 +89,17 @@ function nvim() { local MOUNT_FOLDER=(--workdir "/data$base_path" -v "$base_path:/data$base_path:rw") fi # make sure there is a folder for sessions on default path - mkdir -p ~/.local/share/nvim/sessions ~/.local/state/nvim/shada/ - touch ~/.local/state/nvim/shada/main.shada + mkdir -p ~/.local/share/nvim/sessions ~/.local/state/nvim/shada echo "Files mount options: ${MOUNT_FILE[*]}" echo "Folder mount options: ${MOUNT_FOLDER[*]}" podman run --privileged -it --rm \ + --network host \ -e XDG_RUNTIME_DIR=/runtime_dir \ -e WAYLAND_DISPLAY="$WAYLAND_DISPLAY" \ -v "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/runtime_dir/$WAYLAND_DISPLAY:rw" \ -v ~/.local/share/nvim/sessions:/root/.local/share/nvim/sessions:rw \ - -v ~/.local/state/nvim/shada/main.shada:/root/.local/state/nvim/shada/main.shada:rw \ + -v ~/.local/state/nvim/shada/:/root/.local/state/nvim/shada/:rw \ "${MOUNT_FILE[@]}" \ "${MOUNT_FOLDER[@]}" \ neovim:latest "$@" @@ -140,17 +140,17 @@ function nvim_project() { local MOUNT_FOLDER=(--workdir "/data$base_path" -v "$base_path:/data$base_path:rw") fi # make sure there is a folder for sessions on default path - mkdir -p ~/.local/share/nvim/sessions ~/.local/state/nvim/shada/ - touch ~/.local/state/nvim/shada/main.shada + mkdir -p ~/.local/share/nvim/sessions ~/.local/state/nvim/shada echo "Files mount options: ${MOUNT_FILE[*]}" echo "Folder mount options: ${MOUNT_FOLDER[*]}" podman run --privileged -it \ + --network host \ -e XDG_RUNTIME_DIR=/runtime_dir \ -e WAYLAND_DISPLAY="$WAYLAND_DISPLAY" \ -v "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/runtime_dir/$WAYLAND_DISPLAY:rw" \ -v ~/.local/share/nvim/sessions:/root/.local/share/nvim/sessions:rw \ - -v ~/.local/state/nvim/shada/main.shada:/root/.local/state/nvim/shada/main.shada:rw \ + -v ~/.local/state/nvim/shada/:/root/.local/state/nvim/shada/:rw \ "${MOUNT_FILE[@]}" \ "${MOUNT_FOLDER[@]}" \ --entrypoint bash \ diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 5c95d7c..f5063f1 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,7 +1,7 @@ return function() require 'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" - ensure_installed = "", + ensure_installed = "all", -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = true, From 636942d6bc268bd0f43618f5176db4fdea7ddcbf Mon Sep 17 00:00:00 2001 From: Szwendacz Date: Wed, 17 Jan 2024 16:40:05 +0100 Subject: [PATCH 10/10] add helm lsp --- Containerfile | 3 ++- lua/plugins/nvim-lspconfig.lua | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Containerfile b/Containerfile index bbf5cd9..9f7d601 100644 --- a/Containerfile +++ b/Containerfile @@ -47,7 +47,8 @@ ENV MASON_PKGS=" \ typescript-language-server \ yaml-language-server \ markdownlint \ - ansible-language-server" + ansible-language-server \ + helm-ls" ENV PIP_PKGS="pynvim ansible ansible-lint" diff --git a/lua/plugins/nvim-lspconfig.lua b/lua/plugins/nvim-lspconfig.lua index ed7d405..1f41c07 100644 --- a/lua/plugins/nvim-lspconfig.lua +++ b/lua/plugins/nvim-lspconfig.lua @@ -229,5 +229,9 @@ return { on_attach = on_attach, capabilities = capabilities, } + require 'lspconfig'.helm_ls.setup { + on_attach = on_attach, + capabilities = capabilities, + } end }