From 3469aa57e642e11071cc5187f58b874240d8113b Mon Sep 17 00:00:00 2001 From: Hizenberg469 Date: Mon, 25 Aug 2025 19:53:48 +0300 Subject: [PATCH] env setup --- .vimrc | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++ env_setup.sh | 23 ++++++++ 2 files changed, 182 insertions(+) create mode 100644 .vimrc create mode 100644 env_setup.sh diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..c73ff96 --- /dev/null +++ b/.vimrc @@ -0,0 +1,159 @@ +" c: Automatically break comments using the textwidth value. +" r: Automatically insert the comment leader when hitting in insert mode. +" o: Automatically insert the comment leader when hitting 'o' or 'O' in normal mode. +" n: Recognize numbered lists. When hitting in insert mode. +" m: Automatically break the current line before inserting a new comment line. +set formatoptions+=cronm + +" This sets the width of a tab character to 4 spaces. +set tabstop=4 + +" This sets the number of spaces used when the key is pressed in insert +" mode to 4. +set softtabstop=4 + +" This sets the number of spaces used for each indentation level when using +" the '>' and '<' commands, as well as the autoindent feature. +set shiftwidth=4 + +" This setting enables automatic indentation, which will copy the indentation +" of the current line when starting a new line. +set autoindent +set smartindent + +" This disables the automatic conversion of tabs to spaces when you press the +" key. +set expandtab +set smarttab + +" Save 1,000 items in history +set history=1000 + +" Show the line and column number of the cursor position +set ruler + +" Display the incomplete commands in the bottom right-hand side of your screen. +set showcmd + +" Display completion matches on your status line +set wildmenu + +" Show a few lines of context around the cursor +set scrolloff=5 + +" Highlight search matches +set hlsearch + +" Enable incremental searching +set incsearch + +" Ignore case when searching +set ignorecase + +" Override the 'ignorecase' option if the search pattern contains upper case characters. +set smartcase + +" This enables the use of the mouse in all modes (normal, visual, insert, +" command-line, etc.). +set mouse=a + +" This displays line numbers in the left margin. +set number + +" This disables the creation of backup files. +set nobackup + +set hidden + + +" This disables the creation of swap files. +set noswapfile + +" Automatically reload files when they change +set autoread + +" Enable spell checking +set spell +set spelllang=en + +" Highlight the current line +set cursorline + +" Highlight the 100th column +set colorcolumn=100 + +" Set text width to 100 +set textwidth=100 + +" This maps the '<' and '>' keys in visual mode to shift the selected text one +" shift width to the left or right and reselect the shifted text. +vnoremap < >gv + +" The next four lines define key mappings for switching between windows using +" Ctrl + hjkl keys +nmap :wincmd k +nmap :wincmd j +nmap :wincmd h +nmap :wincmd l + +" The next four lines define key mappings for resizing windows using Alt + +" hjkl keys: +map :vertical res -5 +map :vertical res +5 +map :res -5 +map :res +5 + +" These lines define key mappings for moving the cursor 10 spaces at a time +" using Shift + arrow keys: +nmap 10l +nmap 10h +nmap 10j +nmap 10k + +" Enable folding +set foldenable +" Configure fold method +set foldmethod=marker +" Set the fold level to start with all folds open +set foldlevelstart=99 +" Set the fold nesting level (default is 20) +set foldnestmax=10 +" Automatically close folds when the cursor leaves them +set foldclose=all +" Open folds upon all motion events +set foldopen=all + + + + + +" To install vim-plug +let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' +if empty(glob(data_dir . '/autoload/plug.vim')) + silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC +endif + + + +" To install the plugin + + +call plug#begin() + + Plug 'dense-analysis/ale' " linting and fixing code. + Plug 'airblade/vim-gitgutter' " a git diff in the sign colomn. + Plug 'habamax/vim-asciidoctor' " Feature-full environment for ASCII Docs. + Plug 'majutsushi/tagbar' " Utility to easily browse the tag. + Plug 'mbbill/undotree' " Utility to view undo history + Plug 'morhetz/gruvbox' " retro-inspired color scheme + Plug 'luochen1990/rainbow' " For rainbow coloring of Parentheses + +call plug#end() + + +" Plugin enable option + +" For rainbow coloring of Parentheses +let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle diff --git a/env_setup.sh b/env_setup.sh new file mode 100644 index 0000000..df31c71 --- /dev/null +++ b/env_setup.sh @@ -0,0 +1,23 @@ +#!/bin/bash + + + + +# To setup the environment + +function env_setup{ + + # Setting up the .vimrc + + VIMRC_LOCATION = $(find $HOME/ -iwholename .vimrc) + if [ "$HOME/.vimrc" = "$VIMRC_LOCATION" ]; then + + mv $HOME/.vimrc $HOME/.vimrc.bck + + fi + + + mv $(pwd)/.vimrc $HOME/.vimrc + + source $HOME/.vimrc +}