vim-settings/.vimrc
2021-12-03 21:38:06 +01:00

149 lines
4.5 KiB
VimL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

" Show line numbers on the left
:set number
" 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
" Highlight cursor line underneath the cursor horizontally.
set cursorline
" 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
" Enable auto completion menu after pressing TAB.
set wildmenu
" Make wildmenu behave like similar to Bash completion.
set wildmode=list:longest
" Allow Mouse Clicks to move cursor
:set mouse=a
" 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
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
" VIM Plugin Manager
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
call plug#begin('~/.vim/plugged')
Plug 'https://git.gc4.at/linux/vim-easy-align' "Plug 'junegunn/vim-easy-align'
Plug 'https://git.gc4.at/linux/vim-one' "Plug 'rakr/vim-one'
Plug 'https://git.gc4.at/linux/vim-code-dark' "Plug 'tomasiser/vim-code-dark'
Plug 'https://git.gc4.at/linux/nerdtree' "Plug 'scrooloose/nerdtree'
Plug 'https://git.gc4.at/linux/vim-airline' "Plug 'vim-airline/vim-airline'
Plug 'https://git.gc4.at/linux/vim-airline-themes' "Plug 'vim-airline/vim-airline-themes'
Plug 'https://git.gc4.at/linux/base16-vim' "Plug 'chriskempson/base16-vim'
Plug 'https://git.gc4.at/linux/tender.vim' "Plug 'jacoborus/tender.vim'
Plug 'https://git.gc4.at/linux/onehalf', { 'rtp': 'vim' } "The rtp option is necessary as the vim theme resides in a subdirectory of the git repo.
call plug#end()
"Easy Align
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
" NerdTree File Browser
" Start NERDTree. If a file is specified, move the cursor to its window.
"autocmd StdinReadPre * let s:std_in=1
"autocmd VimEnter * NERDTree | if argc() > 0 || exists("s:std_in") | wincmd p | endif
" Exit Vim if NERDTree is the only window remaining in the only tab.
"autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
" Airline Statusbar
let g:airline_theme='base16'
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline#extensions#tabline#formatter = 'default'
" Color Schema Base 16 Dark (=Atom)
colorscheme base16-default-dark
let base16colorspace=256 " Access colors present in 256 colorspacet
" Color Schema CodeDark
" colorscheme codedark
" Color Schema One
" colorscheme one
" set background=dark " for the light version
" let g:one_allow_italics = 1 " I love italic for comments
" Colorschema Tender
" If you have vim >=8.0 or Neovim >= 0.1.5
" if (has("termguicolors"))
" set termguicolors
" endif
" syntax enable
" colorscheme tender
" Colorschema OneHalf
"syntax on
"set t_Co=256
"set cursorline
"colorscheme onehalfdark
"let g:airline_theme='onehalfdark'
" 256 Colors Support
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif