nvim install script fixes

This commit is contained in:
vlnko 2026-01-28 17:51:32 +03:00
parent f368f39fec
commit ec42872f7a
3 changed files with 22 additions and 8 deletions

View File

@ -12,6 +12,6 @@ on_black='\e[40m'; on_red='\e[41m'; on_green='\e[42m'; on_yellow='\e[43m'
on_blue='\e[44m'; on_purple='\e[45m'; on_cyan='\e[46m'; on_white='\e[47m'
printf "%b\n" "${on_red}On red:${reset} watafa"
printf "%b\n" "${on_black}On black:${reset} watafa"
printf "%b\n" "${on_purple}On purple:${reset} ${purple}watafa"
printf "%b\n" "${on_red}On red:${reset} word"
printf "%b\n" "${on_black}On black:${reset} word"
printf "%b\n" "${on_purple}On purple:${reset} ${purple}word"

View File

@ -26,19 +26,19 @@ fi
echo "🔎 Determined OS: $OS"
# Step 1: Install Neovim
if [[$OS == "macos"]]; then
if [[ $OS == "macos" ]]; then
brew install neovim
elif [[$OS == "ubuntu"]]; then
elif [[ $OS == "ubuntu" ]]; then
sudo apt install neovim -y
elif [[$OS == "arch"]]; then
elif [[ $OS == "arch" ]]; then
sudo pacman -Sy --noconfirm neovim xclip wl-clipboard
fi
echo "✅ Neovim installed"
# Step 2: Create the Neovim config directory
CONFIG_DIR = ~/.config/nvim
CONFIG = $CONFIG_DIR/init.lua
CONFIG_DIR="$HOME/.config/nvim"
CONFIG="$CONFIG_DIR/init.lua"
mkdir -p $CONFIG_DIR
# Step 3: Write your custom init.lua configuration

14
~/.config/nvim/init.lua Normal file
View File

@ -0,0 +1,14 @@
vim.cmd("set expandtab")
vim.cmd("set tabstop=4")
vim.cmd("set softtabstop=4")
vim.cmd("set shiftwidth=4")
vim.cmd("set number relativenumber")
vim.cmd("highlight Normal guibg=transparent")
vim.opt.clipboard = "unnamedplus"
-- Clipboard alternative fix
vim.g.mapleader = " "
vim.keymap.set({"n", "v"}, "<leader>y", "\"+y")
vim.keymap.set({"n", "v"}, "<leader>p", "\"+p")
-- Moving lines up and down
vim.keymap.set({"n", "v"}, "<leader>u", ":m -2<Enter>")
vim.keymap.set({"n", "v"}, "<leader>d", ":m +1<Enter>")