dotfiles/dot_vimrc

110 lines
3.2 KiB
Text
Raw Normal View History

2023-05-25 15:28:22 +02:00
" All system-wide defaults are set in $VIMRUNTIME/archlinux.vim (usually just
" /usr/share/vim/vimfiles/archlinux.vim) and sourced by the call to :runtime
" you can find below. If you wish to change any of those settings, you should
" do it in this file (/etc/vimrc), since archlinux.vim will be overwritten
" everytime an upgrade of the vim packages is performed. It is recommended to
" make changes after sourcing archlinux.vim since it alters the value of the
" 'compatible' option.
2023-02-01 06:38:24 +01:00
" This line should not be removed as it ensures that various options are
2023-05-25 15:28:22 +02:00
" properly set to work with the Vim-related packages.
2023-02-01 06:38:24 +01:00
runtime! archlinux.vim
2023-05-25 15:28:22 +02:00
" If you prefer the old-style vim functionalty, add 'runtime! vimrc_example.vim'
" Or better yet, read /usr/share/vim/vim80/vimrc_example.vim or the vim manual
" and configure vim to your own liking!
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" do not load defaults if ~/.vimrc is missing
"let skip_defaults_vim=1
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Disable compatibility with vi which can cause unexpected issues.
set nocompatible
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Enable type file detection. Vim will be able to try to detect the type of file in use.
filetype on
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Enable plugins and load plugin for the detected file type.
filetype plugin on
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Load an indent file for the detected file type.
filetype indent on
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Turn syntax highlighting on.
syntax on
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Add numbers to each line on the left-hand side.
2023-07-14 20:00:13 +02:00
set number
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Highlight cursor line underneath the cursor horizontally.
2023-07-14 20:00:13 +02:00
set cursorline
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Highlight cursor line underneath the cursor vertically.
"set cursorcolumn
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Set shift width to 4 spaces.
set shiftwidth=4
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Set tab width to 4 columns.
set tabstop=4
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Use space characters instead of tabs.
set expandtab
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Do not save backup files.
set nobackup
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Do not let cursor scroll below or above N number of lines when scrolling.
set scrolloff=10
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Do not wrap lines. Allow long lines to extend as far as the line goes.
set nowrap
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" While searching though a file incrementally highlight matching characters as you type.
set incsearch
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Ignore capital letters during search.
set ignorecase
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Override the ignorecase option if searching for capital letters.
" This will allow you to search specifically for capital letters.
set smartcase
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Show partial command you type in the last line of the screen.
set showcmd
2023-02-01 06:38:24 +01:00
2023-05-25 15:28:22 +02:00
" Show the mode you are on the last line.
set showmode
2023-02-01 07:17:03 +01:00
2023-05-25 15:28:22 +02:00
" Show matching words during a search.
set showmatch
2023-02-01 07:17:03 +01:00
2023-05-25 15:28:22 +02:00
" Use highlighting when doing a search.
set hlsearch
2023-02-01 07:17:03 +01:00
2023-05-25 15:28:22 +02:00
" Set the commands to save in history default number is 20.
set history=1000
2023-02-01 07:17:03 +01:00
2023-05-25 15:28:22 +02:00
" Enable auto completion menu after pressing TAB.
set wildmenu
2023-02-01 07:17:03 +01:00
2023-05-25 15:28:22 +02:00
" Make wildmenu behave like similar to Bash completion.
set wildmode=list:longest
2023-02-01 07:17:03 +01:00
2023-05-25 15:28:22 +02:00
" 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
2023-02-01 07:17:03 +01:00
2023-05-25 15:28:22 +02:00
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
2023-02-01 07:17:03 +01:00
2023-05-25 15:28:22 +02:00
" https://vimawesome.com/
2023-02-01 07:17:03 +01:00
2023-05-25 15:28:22 +02:00
call plug#begin()
2023-02-01 07:17:03 +01:00
2023-05-25 15:28:22 +02:00
Plug 'scrooloose/nerdtree'
2023-02-01 07:17:03 +01:00
call plug#end()