├── .github ├── dependabot.yml └── workflows │ ├── sync-repo.yaml │ ├── update-readme-nightly.yaml │ └── update-readme.yaml ├── .gitignore ├── LICENSE ├── README.md └── snap ├── local └── nvim-wrapper └── snapcraft.yaml /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | commit-message: 8 | prefix: "ci" 9 | -------------------------------------------------------------------------------- /.github/workflows/sync-repo.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Sync repo to Launchpad 4 | on: 5 | workflow_dispatch: 6 | workflow_call: 7 | secrets: 8 | GIT_SSH_PRIVATE_KEY: 9 | required: true 10 | GIT_SSH_KNOWN_HOSTS: 11 | required: true 12 | push: 13 | 14 | 15 | jobs: 16 | to_launchpad: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/checkout@v4 20 | with: 21 | fetch-depth: 0 22 | - uses: yesolutions/mirror-action@master 23 | with: 24 | REMOTE: 'ssh://neovim-snap@git.launchpad.net/neovim-snap' 25 | GIT_SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_PRIVATE_KEY }} 26 | #GIT_SSH_KNOWN_HOSTS: ${{ secrets.GIT_SSH_KNOWN_HOSTS }} 27 | GIT_SSH_NO_VERIFY_HOST: "true" 28 | DEBUG: "true" 29 | -------------------------------------------------------------------------------- /.github/workflows/update-readme-nightly.yaml: -------------------------------------------------------------------------------- 1 | name: automation-nightly 2 | on: 3 | workflow_dispatch: 4 | # Run daily at 11:45 UTC. 5 | schedule: 6 | - cron: '45 11 * * *' 7 | 8 | jobs: 9 | # Updates the timestamp in README.md, which triggers a "push" event. 10 | bump_timestamp: 11 | permissions: 12 | contents: write 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v4 16 | with: 17 | ref: nightly 18 | 19 | - name: Set update date variable 20 | run: | 21 | UPDATE_DATE=$(date) 22 | echo "UPDATE_DATE=${UPDATE_DATE}" >> $GITHUB_ENV 23 | 24 | - name: Update last sync date to launchpad 25 | env: 26 | BEGIN_TAG: "" 27 | END_TAG: "" 28 | run: | 29 | UPDATE=$(cat README.md | perl -0777 -pe 's#(${{ env.BEGIN_TAG }})(?:.|\n)*?(${{ env.END_TAG }})#${1}\nLast sync to launchpad: ${{ env.UPDATE_DATE }}\n${2}#g') 30 | echo "${UPDATE}" > README.md 31 | 32 | - uses: EndBug/add-and-commit@v9 33 | with: 34 | message: "bump timestamp" 35 | default_author: github_actions 36 | 37 | call-sync-repo: 38 | uses: ./.github/workflows/sync-repo.yaml 39 | secrets: 40 | GIT_SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_PRIVATE_KEY }} 41 | GIT_SSH_KNOWN_HOSTS: ${{ secrets.GIT_SSH_KNOWN_HOSTS }} 42 | -------------------------------------------------------------------------------- /.github/workflows/update-readme.yaml: -------------------------------------------------------------------------------- 1 | name: automation 2 | on: 3 | workflow_dispatch: 4 | # Run weekly at 11:45 UTC Wednesday. 5 | schedule: 6 | - cron: '45 11 * * 3' 7 | 8 | jobs: 9 | # Updates the timestamp in README.md, which triggers a "push" event. 10 | bump_timestamp: 11 | permissions: 12 | contents: write 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v4 16 | 17 | - name: Set update date variable 18 | run: | 19 | UPDATE_DATE=$(date) 20 | echo "UPDATE_DATE=${UPDATE_DATE}" >> $GITHUB_ENV 21 | 22 | - name: Update last sync date to launchpad 23 | env: 24 | BEGIN_TAG: "" 25 | END_TAG: "" 26 | run: | 27 | UPDATE=$(cat README.md | perl -0777 -pe 's#(${{ env.BEGIN_TAG }})(?:.|\n)*?(${{ env.END_TAG }})#${1}\nLast sync to launchpad: ${{ env.UPDATE_DATE }}\n${2}#g') 28 | echo "${UPDATE}" > README.md 29 | 30 | - uses: EndBug/add-and-commit@v9 31 | with: 32 | message: "bump timestamp" 33 | default_author: github_actions 34 | 35 | call-sync-repo: 36 | uses: ./.github/workflows/sync-repo.yaml 37 | secrets: 38 | GIT_SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_PRIVATE_KEY }} 39 | GIT_SSH_KNOWN_HOSTS: ${{ secrets.GIT_SSH_KNOWN_HOSTS }} 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.snap 2 | *.swp 3 | *.txt 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Carlos Hernandez 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | nvim 3 |
4 |

5 | 6 |

This is the snap for nvim. It works on Ubuntu, Fedora, Debian, and other major Linux 7 | distributions.

8 | 9 | ## Install 10 | 11 | ### Stable release 12 | 13 | ```sh 14 | sudo snap install nvim --classic 15 | ``` 16 | 17 | ### Nightly release 18 | ```sh 19 | sudo snap install nvim --edge --classic 20 | ``` 21 | 22 | [![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/nvim) 23 | 24 | ## How this repo works 25 | 26 | 1. This repo defines time-triggered CI jobs which poke its [master](./.github/workflows/update-readme.yaml) and [nightly](./.github/workflows/update-readme-nightly.yaml) branches. 27 | 2. The workflow pushes a [timestamp commit](https://github.com/neovim/neovim-snap/commit/752cca5b7c2d8371f54825c61d0c8ebfedbf6711) 28 | to "tickle" the external Snapcraft service. 29 | 3. Snapcraft fetches the `master` or `nightly` branch of this repo and processes `snap/snapcraft.yaml`. 30 | 4. Snapcraft builds Nvim (in its own, external service) as defined in `snap/snapcraft.yaml`. 31 | - The `snap/snapcraft.yaml` in the `nightly` branch is [slightly different](https://github.com/neovim/neovim-snap/compare/master...nightly) 32 | from the `master` branch. This is a limitation/requirement of Snapcraft's 33 | design. 34 | 35 | ## Last Launchpad Sync 36 | 37 | 38 | Last sync to launchpad: Wed Jun 4 11:45:47 UTC 2025 39 | 40 | -------------------------------------------------------------------------------- /snap/local/nvim-wrapper: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # As discussed here: 4 | # - https://forum.snapcraft.io/t/egl-using-snaps-on-impish-seem-to-be-broken-when-using-the-nvidia-proprietary-driver/25715 5 | export LD_LIBRARY_PATH="${LD_LIBRARY_PATH#$SNAP_LIBRARY_PATH:}" 6 | export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${SNAP_LIBRARY_PATH}" 7 | 8 | exec "${@}" 9 | -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: nvim 2 | base: core22 3 | adopt-info: nvim 4 | summary: Vim-fork focused on extensibility and agility. 5 | architectures: 6 | - build-on: s390x 7 | - build-on: ppc64el 8 | - build-on: arm64 9 | - build-on: armhf 10 | - build-on: amd64 11 | - build-on: i386 12 | description: | 13 | Neovim is a project that seeks to aggressively refactor Vim in order to: 14 | 15 | Simplify maintenance and encourage contributions Split the work between 16 | multiple developers Enable the implementation of new/modern user interfaces 17 | without any modifications to the core source Improve extensibility with a new 18 | plugin architecture For lots more details, see the wiki! 19 | 20 | grade: stable # must be 'stable' to release into candidate/stable channels 21 | confinement: classic 22 | 23 | apps: 24 | nvim: 25 | command: usr/bin/nvim 26 | command-chain: 27 | - bin/nvim-wrapper 28 | environment: 29 | HOME: /home/$USER 30 | VIM: $SNAP/usr/share/nvim 31 | VIMRUNTIME: $SNAP/usr/share/nvim/runtime 32 | desktop: usr/share/applications/nvim.desktop 33 | 34 | parts: 35 | nvim: 36 | source: https://github.com/neovim/neovim.git 37 | override-pull: | 38 | craftctl default 39 | branch="stable" 40 | git checkout tags/${branch} -b ${branch} 41 | major="$(awk '/NVIM_VERSION_MAJOR/{gsub(")","",$2); print $2}' CMakeLists.txt)" 42 | minor="$(awk '/NVIM_VERSION_MINOR/{gsub(")","",$2); print $2}' CMakeLists.txt)" 43 | patch="$(awk '/NVIM_VERSION_PATCH/{gsub(")","",$2); print $2}' CMakeLists.txt)" 44 | version="v$major.$minor.$patch" 45 | craftctl set version="${version}" 46 | plugin: make 47 | override-build: | 48 | echo "Building on $SNAP_ARCH" 49 | set -x 50 | case "$SNAP_ARCH" in 51 | "ppc64el" | "s390x") 52 | make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}" \ 53 | CMAKE_BUILD_TYPE=RelWithDebInfo \ 54 | CMAKE_INSTALL_PREFIX=/usr \ 55 | CMAKE_FLAGS=-DPREFER_LUA=ON \ 56 | DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_LUA=ON -DUSE_BUNDLED_LUAJIT=OFF" 57 | ;; 58 | *) 59 | make -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}" \ 60 | CMAKE_BUILD_TYPE=RelWithDebInfo \ 61 | CMAKE_INSTALL_PREFIX=/usr 62 | ;; 63 | esac 64 | make DESTDIR="$SNAPCRAFT_PART_INSTALL" install 65 | # Fix Desktop file 66 | sed -i 's|^Exec=nvim|Exec=/snap/bin/nvim.nvim|' \ 67 | ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop 68 | sed -i 's|^TryExec=nvim|TryExec=/snap/bin/nvim.nvim|' \ 69 | ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop 70 | sed -i 's|^Icon=.*|Icon=${SNAP}/usr/share/icons/hicolor/128x128/apps/nvim.png|' \ 71 | ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/nvim.desktop 72 | build-packages: 73 | - ninja-build 74 | - libtool 75 | - libtool-bin 76 | - autoconf 77 | - automake 78 | - cmake 79 | - gawk 80 | - g++ 81 | - git 82 | - gettext 83 | - pkg-config 84 | - unzip 85 | - wget 86 | prime: 87 | - -usr/share/man 88 | nvim-wrapper: 89 | plugin: dump 90 | after: 91 | - nvim 92 | source: snap/local/ 93 | organize: 94 | nvim-wrapper: bin/ 95 | treesitter-parsers: 96 | plugin: nil 97 | after: 98 | - nvim 99 | override-build: | 100 | mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start 101 | git clone https://github.com/nvim-treesitter/nvim-treesitter ~/.local/share/nvim/site/pack/nvim-treesitter/start/nvim-treesitter 102 | mkdir -p ~/.local/share/nvim/site/pack/plenary.nvim/start 103 | git clone https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/plenary.nvim/start/plenary.nvim 104 | $CRAFT_STAGE/usr/bin/nvim --headless -c "TSInstallSync all" -c "q" 105 | parser_dest="$CRAFT_PART_INSTALL/usr/share/nvim/runtime/parser/" 106 | mkdir -p "$parser_dest" 107 | cp ~/.local/share/nvim/site/pack/nvim-treesitter/start/nvim-treesitter/parser/* "$parser_dest" 108 | patchelf: 109 | after: 110 | - treesitter-parsers 111 | plugin: nil 112 | build-packages: 113 | - patchelf 114 | - file 115 | override-prime: | 116 | # patchelf 117 | # 118 | # To allow for a classic snap that works across multiple operating system 119 | # runtime environments, we need to ensure all shipped binaries consume 120 | # libraries from the core or shipped snap. We accomplish this by 121 | # patching RPATH or interpreter into dynamically linked binaries. 122 | # 123 | # /snap/core22/current/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 124 | # /snap/core22/current/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1 125 | # /snap/core22/current/lib/powerpc64le-linux-gnu/ld64.so.2 126 | # /snap/core22/current/lib/s390x-linux-gnu/ld64.so.1 127 | interp_prefix=/snap/core22/current/lib/$CRAFT_ARCH_TRIPLET 128 | ld_arch=$(echo $CRAFT_TARGET_ARCH | sed -e 's,amd64,x86-64,' -e 's,arm64,aarch64,') 129 | for interp in "ld-linux-${ld_arch}.so.?" "ld64.so.?" "/dev/null"; do 130 | if [ -e ${interp_prefix}/${interp} ]; then 131 | break 132 | fi 133 | done 134 | if [ $interp = /dev/null ]; then 135 | echo "Unable to determine name of shared library interpreter." 136 | exit 1 137 | fi 138 | for binary in \ 139 | $(find . -exec file {} \; | awk -F\: '/ELF.*dynamic/{print$1}'); do 140 | patchelf \ 141 | --force-rpath \ 142 | --set-rpath /snap/core22/current/usr/lib/$CRAFT_ARCH_TRIPLET:/snap/$CRAFT_PROJECT_NAME/current/lib:/snap/$CRAFT_PROJECT_NAME/current/lib/$SNAPCRAFT_ARCH_TRIPLET:/snap/$CRAFT_PROJECT_NAME/current/usr/lib:/snap/$CRAFT_PROJECT_NAME/current/usr/lib/$SNAPCRAFT_ARCH_TRIPLET \ 143 | $binary 144 | echo "Patching: $binary with $interp_prefix/$interp" 145 | patchelf --set-interpreter $interp_prefix/$interp $binary || true 146 | done 147 | --------------------------------------------------------------------------------