From 89f514b5b98bbc47753b2b17aa9cafff94e34071 Mon Sep 17 00:00:00 2001 From: TrudeEH Date: Mon, 24 Jun 2024 22:37:40 +0100 Subject: [PATCH] Neovim config update; Allow users to skip Nvim compilation --- dotfiles/.config/nvim/init.lua | 38 ++++++++++++++++++- .../nvim/lua/kickstart/plugins/autopairs.lua | 16 -------- install.sh | 30 +++++++++------ 3 files changed, 55 insertions(+), 29 deletions(-) delete mode 100644 dotfiles/.config/nvim/lua/kickstart/plugins/autopairs.lua diff --git a/dotfiles/.config/nvim/init.lua b/dotfiles/.config/nvim/init.lua index 7fd1b5c2..2ffa795a 100644 --- a/dotfiles/.config/nvim/init.lua +++ b/dotfiles/.config/nvim/init.lua @@ -644,6 +644,42 @@ require('lazy').setup({ -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations. + { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + -- Optional dependency + dependencies = { 'hrsh7th/nvim-cmp' }, + config = function() + require('nvim-autopairs').setup {} + -- If you want to automatically add `(` after selecting a function or method + local cmp_autopairs = require 'nvim-autopairs.completion.cmp' + local cmp = require 'cmp' + cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) + end, + }, + + { + 'nvim-neo-tree/neo-tree.nvim', + version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended + 'MunifTanjim/nui.nvim', + }, + cmd = 'Neotree', + keys = { + { '\\', ':Neotree reveal', { desc = 'NeoTree reveal' } }, + }, + opts = { + filesystem = { + window = { + mappings = { + ['\\'] = 'close_window', + }, + }, + }, + }, + }, -- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart -- -- Here are some example plugins that I've included in the Kickstart repository. @@ -652,8 +688,6 @@ require('lazy').setup({ -- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` diff --git a/dotfiles/.config/nvim/lua/kickstart/plugins/autopairs.lua b/dotfiles/.config/nvim/lua/kickstart/plugins/autopairs.lua deleted file mode 100644 index 87a7e5ff..00000000 --- a/dotfiles/.config/nvim/lua/kickstart/plugins/autopairs.lua +++ /dev/null @@ -1,16 +0,0 @@ --- autopairs --- https://github.com/windwp/nvim-autopairs - -return { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - -- Optional dependency - dependencies = { 'hrsh7th/nvim-cmp' }, - config = function() - require('nvim-autopairs').setup {} - -- If you want to automatically add `(` after selecting a function or method - local cmp_autopairs = require 'nvim-autopairs.completion.cmp' - local cmp = require 'cmp' - cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) - end, -} diff --git a/install.sh b/install.sh index 0abdd424..117b81c8 100755 --- a/install.sh +++ b/install.sh @@ -16,9 +16,9 @@ dialog --erase-on-exit \ "3" "Install GitHub CLI" "off"\ "4" "Install AI Tools" "off"\ "5" "Install MultiMC" "off"\ - "6" "Enable bluetooth support" "off" 2> main.tmp -main_menu=$( cat main.tmp ) -rm main.tmp + "6" "Enable bluetooth support" "off" 2> choice.tmp +main_menu=$( cat choice.tmp ) +rm choice.tmp mkdir logs rm logs/compile.log @@ -179,14 +179,22 @@ for selection in $main_menu; do dialogDotfiles 75 5 5 5 5 5 7 4 4 4 # Neovim - sudo apt-get install -y ninja-build gettext cmake unzip curl build-essential - git clone https://github.com/neovim/neovim --depth 1 2>/dev/null - cd neovim - git checkout stable - make CMAKE_BUILD_TYPE=RelWithDebInfo - sudo make install - cd .. - rm -rf neovim + dialog --erase-on-exit \ + --backtitle "$BACKTITLE" \ + --title "Install/Update Neovim?" \ + --yesno "Nvim will be compiled from source. This may take a long time, depending on your device. If unsure, select yes." 10 40 + + if [ "$?" -eq 0 ]; then + # NVIM has to be compiled from source to support arm64 and i386 devices, for example. + sudo apt-get install -y ninja-build gettext cmake unzip curl build-essential + git clone https://github.com/neovim/neovim --depth 1 2>/dev/null + cd neovim + git checkout stable + make CMAKE_BUILD_TYPE=RelWithDebInfo + sudo make install + cd .. + rm -rf neovim + fi dialogDotfiles 80 5 5 5 5 5 5 7 4 4 # Utilities