Skip to content

Instantly share code, notes, and snippets.

@virtualdreams
Last active October 7, 2021 14:27
Show Gist options
  • Save virtualdreams/1f8cd2c8e8750a892047 to your computer and use it in GitHub Desktop.
Save virtualdreams/1f8cd2c8e8750a892047 to your computer and use it in GitHub Desktop.
Standard .vimrc
" set nocompatible
set nocompatible
" enable syntax highligting
syntax on
" suppress welcome screen
set shortmess+=I
" some useful options
set backspace=indent,eol,start
set showcmd
set showmatch
set showmode
set wrap
set linebreak
set ruler
set encoding=utf-8
set wildmenu
set background=light
set autoread
set hidden
set laststatus=2
set clipboard^=unnamed,unnamedplus
"set noerrorbells
"set cursorline
"set cursorcolumn
"set autowrite
"set colorcolumn=80
" search options
set hlsearch
set ignorecase
set incsearch
set smartcase
" mouse support
set mouse=a
" tab indentation
set ts=4
set sw=0
set autoindent
" line numbers
set number
" command history
set history=100
" undo
set undolevels=1000
set undofile
set undodir=~/.vimundo
" whitespaceset
"set list
"set showbreak=\\
set listchars=tab:→\ ,eol:$,nbsp:·,trail:·,space:·,extends:›,precedes:‹
" tabs
set showtabline=1
"nnoremap <c-t> :tabnew<cr>
"nnoremap <F7> :tabn<cr>
"nnoremap <F8> :tabp<cr>
" toggle line number / relative line number
"nnoremap <F2> :set rnu! <bar> set nu!<CR>
nnoremap <F2> :set rnu!<CR>
nnoremap <F3> :set nu!<CR>
nnoremap <F4> :set list!<CR>
" buffers
nnoremap <c-n> :bnext<cr>
nnoremap <c-b> :buffers<CR>:buffer<space>
" override some settings
au BufNewFile,BufRead,BufEnter *.py setlocal expandtab
au BufNewFile,BufRead,BufEnter *.yml setlocal expandtab ts=2
au BufNewFile,BufRead,BufEnter *.py nmap <F5> :!clear; python %<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment