Skip to content

Instantly share code, notes, and snippets.

@dichotomies
Last active March 14, 2018 18:26
Show Gist options
  • Save dichotomies/6871bd03acff5f28666a7f681100e8a7 to your computer and use it in GitHub Desktop.
Save dichotomies/6871bd03acff5f28666a7f681100e8a7 to your computer and use it in GitHub Desktop.
VIM settings for OS X and other Unix derivatives
" use clipboard of either osx or other unix derivatives
if has("unix")
let s:uname = system("uname")
set clipboard=unnamedplus " for ubuntu, ...
if s:uname == "Darwin\n"
" Do Mac stuff here
set clipboard=unnamed " need other clipboard
endif
endif
" related to python: PEP8
set tabstop=4 " The width of a TAB is set to 4.
" Still it is a \t. It is just that
" Vim will interpret it to be having
" a width of 4.
set shiftwidth=4 " Indents will have a width of 4
set softtabstop=4 " Sets the number of columns for a TAB
set expandtab " Expand TABs to spaces
" set autoindent and word wrap
set cc=79 " color column 79 ... not working with word wrapping
set columns=84 " necessary for word wrapping; includes 4 lines for line
" number
" if number has more than 4 digits, then not wrapped at 79
" enable folding
" set foldmethod=indent
" set foldcolumn=1
" word wrap see /resources/vim/break-indent.pdf
set breakindent showbreak=..
set linebreak
" set trackpad/mosue scroll speed to 1 line per scroll
noremap <ScrollWheelUp> <C-Y>
noremap <ScrollWheelDown> <C-E>
" related to python: python3: encoding
set encoding=utf-8
" related to vim
syntax on
filetype plugin indent on
" enable line numbers
set number
" delete any character with backspace
set backspace=2
" related to vim: enable mouse for e.g. pane resizing in tmux session
set mouse+=a
if filereadable(expand("~/.vimrc_background"))
let base16colorspace=256
source ~/.vimrc_background
endif
" enable status line, i.e. name of file
set laststatus=2
set statusline+=%8*\ %=\ %02p%%\ "Rownumber/total (%)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment