Skip to content

Instantly share code, notes, and snippets.

@Tholkappiar
Created July 14, 2024 18:12
Show Gist options
  • Save Tholkappiar/8cd7b338bd5cf48b524fabe2c906fe59 to your computer and use it in GitHub Desktop.
Save Tholkappiar/8cd7b338bd5cf48b524fabe2c906fe59 to your computer and use it in GitHub Desktop.
vim dot file
" Configuration file for vim
set modelines=0 " CVE-2007-2438
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=2 " more powerful backspacing
" Don't write backup file if vim is being called by "crontab -e"
au BufWrite /private/tmp/crontab.* set nowritebackup nobackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup nobackup
let skip_defaults_vim=1
" ---------- Basics ---------
set encoding=utf8
set autoindent
set smartindent
set shiftwidth=4
set smarttab
set clipboard=unnamed
set number
" set relativenumber
set incsearch " jump to search match as typing
set nohlsearch " don't highlight my searches
set ignorecase
set smartcase
set noswapfile
autocmd BufWritePre * %s/\s\+$//e "Auto-remove trailing whitespace on save
" ---------- Theme ---------
" Display tabs and trailing spaces visually
set list listchars=tab:\ \ ,trail:·
syntax enable
" --------- Auto Braces ----------
inoremap {<CR> {<CR>}<Esc>ko<tab>
inoremap [<CR> [<CR>]<Esc>ko<tab>
inoremap (<CR> (<CR>)<Esc>ko<tab>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment