Created
November 10, 2022 10:26
-
-
Save S1M0N38/99bd728d1d25e7de77db8ef53213e58e to your computer and use it in GitHub Desktop.
Minimal configuration for vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Improving on minimal vim configuration at | |
" | |
" https://github.com/lemonase/dotfiles/blob/ | |
" ab2d279804a8a6b5e6862012c13bd22b64076431/ | |
" config/vim/.vim/vimrc.min | |
" | |
"load system defaults | |
if filereadable(expand('$VIMRUNTIME/defaults.vim')) | |
unlet! g:skip_defaults_vim | |
source $VIMRUNTIME/defaults.vim | |
endif | |
"regular settings | |
"---------------- | |
" leader | |
nnoremap <SPACE> <Nop> | |
let mapleader=" " | |
" ui | |
set number | |
set ruler | |
set wildmenu | |
set showcmd | |
set showmatch | |
" cursor shape based on mode | |
if exists('$TMUX') | |
let &t_SI = "\ePtmux;\e\e[5 q\e\\" | |
let &t_EI = "\ePtmux;\e\e[2 q\e\\" | |
else | |
let &t_SI = "\e[5 q" | |
let &t_EI = "\e[2 q" | |
endif | |
" encoding/format | |
set encoding=utf-8 | |
set fileformats=unix,dos,mac | |
" searching | |
set hlsearch! | |
set incsearch | |
set ignorecase | |
set smartcase | |
nnoremap <silent> <leader>h :noh<CR> | |
" indent | |
set expandtab | |
set shiftwidth=4 | |
set tabstop=4 | |
set autoindent | |
" key timeout values | |
set esckeys | |
set ttimeoutlen=20 | |
set timeoutlen=1000 | |
" allow syntax and filetype plugins | |
syntax enable | |
filetype plugin indent on | |
runtime macros/matchit.vim | |
" disable caches | |
set viminfo= | |
set noswapfile | |
set nobackup | |
set nowritebackup | |
" disable bell | |
set belloff=all | |
" autocmds | |
"--------- | |
augroup general | |
autocmd! | |
"keep equal proportions when windows resized | |
autocmd VimResized * wincmd = | |
"save cursor position in a file | |
autocmd BufReadPost * if line("'\"") > 1 && line("'\"") | |
\ <= line("$") | exe "normal! g'\"" | endif | |
augroup END | |
augroup languages | |
autocmd! | |
autocmd BufNewFile,BufRead *.bash set syntax=sh | |
autocmd FileType html :syntax sync fromstart | |
autocmd FileType html,javascript,css,json,yaml,sh,vim | |
\ setlocal ts=2 sts=2 sw=2 expandtab | |
augroup END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From your $HOME directory download with