aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOxbian <oxbian@mailbox.org>2025-09-07 10:27:25 +0200
committerOxbian <oxbian@mailbox.org>2025-09-07 10:27:25 +0200
commita92789e8707d2a077bc6d3fedfcdf377bc6ceba1 (patch)
tree04c01305c62f8e3c353beb5e62da08845d3df230
parent08dcec61aef0fed78b6d94ff97faeb1312d862e7 (diff)
downloadvimrc-a92789e8707d2a077bc6d3fedfcdf377bc6ceba1.tar.gz
vimrc-a92789e8707d2a077bc6d3fedfcdf377bc6ceba1.zip
feat: vim install script + theme update
-rw-r--r--README.md9
-rw-r--r--conf/options.vim4
-rw-r--r--conf/plugins.vim3
-rwxr-xr-xinstall.sh41
4 files changed, 54 insertions, 3 deletions
diff --git a/README.md b/README.md
index 4eef469..ccf2c92 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,14 @@ You will need `vim` and `git` to be able to use this configuration.
**Since VIM 9.1.0327, vim can now read config from $XDG_CONFIG_HOME/vim**
```sh
-git clone https://git.arka.rocks/Oxbian/vimrc.git ~/config/vim
+git clone https://git.arka.rocks/vimrc.git ~/config/vim
+```
+
+**If you use older vim version which do not support $XDG_CONFIG_HOME/vim, use
+the install.sh script and clone the config inside ~/.vim**
+
+```sh
+git clone https://git.arka.rocks/vimrc.git ~/.vim
```
## Plugins
diff --git a/conf/options.vim b/conf/options.vim
index f36ac55..07774de 100644
--- a/conf/options.vim
+++ b/conf/options.vim
@@ -7,7 +7,9 @@ set hlsearch " Highlight all match search pattern
" Graphics options
syntax on " Show syntax color
set number " Show line number
-colorscheme onedark " Set vim theme to onedark
+colorscheme everforest " Set vim theme to everforest
+set termguicolors
+set background=light
set colorcolumn=80 " Add an indicator for 80 char limit
set textwidth=80 " Set max text width
"autocmd BufNewFile,BufRead * setlocal formatoptions=cropt " Linebreak at 80 char
diff --git a/conf/plugins.vim b/conf/plugins.vim
index e56d72d..28de1fd 100644
--- a/conf/plugins.vim
+++ b/conf/plugins.vim
@@ -15,7 +15,7 @@ autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
call plug#begin('~/.config/vim/plugged')
" UI & Themes
-Plug 'joshdick/onedark.vim' " Onedark themes for vim
+Plug 'sainnhe/everforest' " Everforest theme for vim
Plug 'liuchengxu/vim-which-key' " Show leader mapping cheatsheet
" Git integration
@@ -89,6 +89,7 @@ set statusline+=\ \|\ %{coc#status()}%{get(b:,'coc_current_function','')}
set statusline+=\ \|\ %l:%c
set statusline+=\ [%p%%]\
+let g:gruvbox_termcolors=16
" Which Key
call which_key#register('<Space>', "g:which_key_map")
diff --git a/install.sh b/install.sh
new file mode 100755
index 0000000..5691fc4
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env sh
+# POSIX script for setting up VIM
+
+set -euo pipefail
+
+# Variables
+script_name="$(basename "${0}")"
+title='\033[1;36m'
+red='\033[1;31m'
+green='\033[1;32m'
+reset='\033[0m'
+
+readonly script_name title red green reset
+
+clean_exit() {
+
+ local status="${?}"
+
+ if [ "${status}" != 0 ]; then
+ printf "${red}%s (code: %s)${reset}\n" "VIM install failed" ${status}
+ else
+ printf "${green}%s${reset}\n" "VIM install succeed"
+ fi
+}
+
+trap clean_exit EXIT
+
+# Ask if user want to copy the project in ~/.vim
+printf "${title}Do you want to copy VIM config in ~/.vim ? [N/y]${reset}\n"
+read -r choice
+case "$choice" in
+ y|Y)
+ cp -r . ~/.vim
+ printf "${green}%s${reset}\n" "VIM config copied in ~/.vim"
+ ;;
+ *)
+ ;;
+esac
+
+sed -i s#\.config\/vim#\.vim## ~/.vim/conf/plugins.vim
+sed -i s#\.config\/vim#\.vim## ~/.vim/vimrc
ArKa projects. All rights to me, and your next child right arm.