Skip to content

Instantly share code, notes, and snippets.

@Walcriz
Last active August 6, 2023 13:25
Show Gist options
  • Save Walcriz/27b7f74b941ab15952e18450971f2208 to your computer and use it in GitHub Desktop.
Save Walcriz/27b7f74b941ab15952e18450971f2208 to your computer and use it in GitHub Desktop.
Minimal .vimrc's:
:execute "bufdo set relativenumber | set number | set encoding=utf-8 | set ruler | set confirm | set fileencoding=utf-8 | set ignorecase | set smartcase | set incsearch | set paste | set smartindent | set tabstop=2 | set shiftwidth=2 | set nobackup | set formatoptions=tcrqn | set clipboard^=unnamed,unnamedplus | set hidden | set scrolloff=12 | inoremap <C-H> <C-\\><C-o>db"
" This is the truly minimal config.
set relativenumber
set number
set encoding=utf-8
set ruler
set confirm
set fileencoding=utf-8
set nobackup
set hidden
set ignorecase
set smartcase
set incsearch
filetype on
filetype plugin on
filetype indent on
syntax enable
set paste
set smartindent
set tabstop=2
set shiftwidth=2
set formatoptions=tcrqn
set guioptions-=T
set clipboard^=unnamed,unnamedplus
set scrolloff=12
colorscheme shine
" Make CTRL-Backspace work
inoremap <C-BS> <C-\><C-o>db
" Configuration file for Vi Improved, save as ~/.vimrc to use.
" A heavly modified version of Miko Bartnicki's .vimrc by Walcriz.
" use Vim mode instead of pure Vi, it must be the first instruction
set nocompatible
" display settings
set encoding=utf-8 " encoding used for displaying file
set ruler " show the cursor position all the time
set showmatch " highlight matching braces
set showmode " show insert/replace/visual mode
" Line numbers (Change to "relativenumber" if you want that)
set number
" write settings
set confirm " confirm :q in case of unsaved changes
set fileencoding=utf-8 " encoding used when saving file
set nobackup " do not keep the backup~ file
" search settings
set ignorecase " do case insensitive search...
set incsearch " do incremental search
set smartcase " ...unless capital letters are used
" file type specific settings
filetype on " enable file type detection
filetype plugin on " load the plugins for specific file types
filetype indent on " automatically indent code
" syntax highlighting " set color scheme, must be installed first
set background=dark " dark background for console
syntax enable " enable syntax highlighting
" characters for displaying non-printable characters
set listchars=eol:$,tab:>-,trail:.,nbsp:_,extends:+,precedes:+
" automatic commands
if has('autocmd')
" file type specific automatic commands
" don't replace Tabs with spaces when editing makefiles
autocmd Filetype makefile setlocal noexpandtab
" disable automatic code indentation when editing TeX and XML files
autocmd FileType tex,xml setlocal indentexpr=
" clean-up commands that run automatically on write; use with caution
" delete empty or whitespaces-only lines at the end of file
autocmd BufWritePre * :%s/\(\s*\n\)\+\%$//ge
" replace groups of empty or whitespaces-only lines with one empty line
autocmd BufWritePre * :%s/\(\s*\n\)\{3,}/\r\r/ge
" delete any trailing whitespaces
autocmd BufWritePre * :%s/\s\+$//ge
endif
" fix pasting (Disable if you run into problems)
set paste
" General settings
set smartindent
set tabstop=4
set shiftwidth=4
set formatoptions=tcrqn
" center view on the search result
noremap n nzz
noremap N Nzz
if !has('gui_running')
set t_Co=256
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment