Skip to content

Instantly share code, notes, and snippets.

@muppetjones
Last active April 9, 2022 15:01
Show Gist options
  • Save muppetjones/b975517f5efdd3d1f097b356d67972e3 to your computer and use it in GitHub Desktop.
Save muppetjones/b975517f5efdd3d1f097b356d67972e3 to your computer and use it in GitHub Desktop.
Simple vimrc
syntax enable
filetype plugin indent on
colorscheme delek
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" ================ General Config ====================
set number "Line numbers are good.
set ruler "Show row/column position.
set backspace=indent,eol,start "Allow backspace in insert mode
set history=1000 "Store lots of :cmdline history
set showcmd "Show incomplete cmds down the bottom
set showmode "Show current mode down the bottom
set gcr=a:blinkon0 "Disable cursor blink
set visualbell "No sounds
set autoread "Reload files changed outside vim
" JSON
autocmd BufNewFile,BufRead *.json set ft=javascript
" MD
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
" ================ Turn Off Swap Files ==============
set noswapfile
set nobackup
set nowb
" ================ Peristent Position ===============
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Remember info about open buffers on close
set viminfo^=%
" ================ Indentation ======================
set autoindent
set smartindent
set smarttab
set shiftwidth=4
set softtabstop=4
set tabstop=4
set expandtab " Use spaces
filetype plugin on
filetype indent on
" Display tabs and trailing spaces visually
set list listchars=tab:\ \ ,trail:·
set nowrap "Don't wrap lines
set linebreak "Wrap lines at convenient points
" ================ Folds ============================
set foldmethod=indent "fold based on indent
set foldnestmax=3 "deepest fold is 3 levels
set nofoldenable "dont fold by default
" ================ Scrolling ========================
set scrolloff=8 "Start scrolling when we're 8 lines away from margins
set sidescrolloff=15
set sidescroll=1
" ================ Powerline ========================
set laststatus=2 " Always display the statusline in all windows
set showtabline=2 " Always display the tabline, even if there is only one tab
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment