commit 319e87099c6d2bafa8d095c2bd60df27a66e732e Author: serxoz Date: Wed Oct 11 16:25:46 2023 +0200 first commit diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..6eea323 --- /dev/null +++ b/.vimrc @@ -0,0 +1,177 @@ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" ██╗ ██╗██╗███╗ ███╗██████╗ ██████╗ +" ██║ ██║██║████╗ ████║██╔══██╗██╔════╝ +" ██║ ██║██║██╔████╔██║██████╔╝██║ +" ╚██╗ ██╔╝██║██║╚██╔╝██║██╔══██╗██║ +" ╚████╔╝ ██║██║ ╚═╝ ██║██║ ██║╚██████╗ +" ╚═══╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +" Disable compatibility with vi which can cause unexpected issues. +set nocompatible + +" Enable type file detection. Vim will be able to try to detect the type of file in use. +filetype on + +" Enable plugins and load plugin for the detected file type. +filetype plugin on + +" Load an indent file for the detected file type. +filetype indent on + +" Turn syntax highlighting on. +syntax on + +" Add numbers to each line on the left-hand side. +"set number + +" Show numbers relative to current line. +"set relativenumber + +" Highlight cursor line underneath the cursor horizontally. +"set cursorline + +" Highlight cursor line underneath the cursor vertically. +"set cursorcolumn + +" Set shift width to 4 spaces. +set shiftwidth=4 + +" Set tab width to 4 columns. +set tabstop=4 + +" Use space characters instead of tabs. +set expandtab + +" Do not save backup files. +set nobackup + +" Do not let cursor scroll below or above N number of lines when scrolling. +set scrolloff=10 + +" Do not wrap lines. Allow long lines to extend as far as the line goes. +set nowrap + +" While searching though a file incrementally highlight matching characters as +" you type. +set incsearch + +" Ignore capital letters during search. +set ignorecase + +" Override the ignorecase option if searching for capital letters. +" This will allow you to search specifically for capital letters. +set smartcase + +" Show partial command you type in the last line of the screen. +set showcmd + +" Show the mode you are on the last line. +set showmode + +" Show matching words during a search. +set showmatch + +" Use highlighting when doing a search. +set hlsearch + +" Set the commands to save in history default number is 20. +set history=1000 + +" Set the max undos +set undolevels=1000 + +" Enable auto completion menu after pressing TAB. +set wildmenu + +" Make wildmenu behave like similar to Bash completion. +set wildmode=list:longest + +" There are certain files that we would never want to edit with Vim. +" Wildmenu will ignore files with these extensions. +set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Visuals +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set title +set ruler +set novisualbell +set noerrorbells +set lazyredraw +set laststatus=2 +" set colorcolumn=85 +set background=dark +set encoding=utf-8 +colorscheme desert + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Mappings +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +let mapleader = " " + +" Turn off search highlighting by pressing space after leader (double space) +nnoremap :nohlsearch + +" Map Ctrl+[hjkl] to navigate windows vim style +nnoremap h +nnoremap j +nnoremap k +nnoremap l + +" Map Ctrl+[arrow] to navigate windows` +nnoremap h +nnoremap j +nnoremap k +nnoremap l + +" Increase/descrease window split size +if bufwinnr(1) + map + + + map - - +endif + +" Pageup/down will scroll half-page and center the current line on the screen +nnoremap zz +vnoremap zz +inoremap zz + +nnoremap zz +vnoremap zz +inoremap zz + +" Open netrw filebrowser in current window, with current file selected +nmap e :25Lex + +" Rotate windows +nmap r r + +" Close buffer without affecting splits +nmap d :bprevious:bdelete # + +" Easy buffer navigation +nmap n :bn +nmap p :bp +nmap b :buffer + +" Load vimrc +nmap v :e ~/.vimrc + +" Toggle/cycle line number modes +nmap l :call CycleLineNumbers() + +function! CycleLineNumbers() + if (&number == 1 && &relativenumber == 0) + set relativenumber + else + if (&relativenumber == 1 && &number == 1) + set norelativenumber + set nonumber + else + set number + set norelativenumber + endif + endif +endfunc diff --git a/README.md b/README.md new file mode 100644 index 0000000..538b67f --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# vimrc-simple + +Simple .vimrc for use on servers. + +- No pluggins +- Buffer navigation +- Window navigation