Skip to content

Instantly share code, notes, and snippets.

@rlee287
Created April 15, 2019 03:08
Show Gist options
  • Save rlee287/b00816bdb909bb49ad73bc2fba93d732 to your computer and use it in GitHub Desktop.
Save rlee287/b00816bdb909bb49ad73bc2fba93d732 to your computer and use it in GitHub Desktop.
dotfiles
" Setting some decent VIM settings for programming
ru! defaults.vim
set ai " set auto-indenting on for programming
set showmatch " automatically show matching brackets. works like it does in bbedit.
set vb " turn on the "visual bell" - which is much quieter than the "audio blink"
set ruler " show the cursor position all the time
set laststatus=2 " make the last line where the status is two lines deep so you can see status always
set backspace=indent,eol,start " make that backspace key work the way it should
"set nocompatible " vi compatible is LAME
set background=dark " Use colours that work well on a dark background (Console is usually black)
set showmode " show the current mode
"set clipboard=unnamed " set clipboard to unnamed to access the system clipboard under windows
" Will need to adjust this after checking linux clipboard stuff
syntax on " turn syntax highlighting on by default
" Show EOL type and last modified timestamp, right after the filename
set statusline=%<%F%h%m%r\ [%{&ff}]\ (%{strftime(\"%H:%M\ %d/%m/%Y\",getftime(expand(\"%:p\")))})%=%l,%c%V\ %P
"------------------------------------------------------------------------------
" Only do this part when compiled with support for autocommands.
if has("autocmd")
"Set UTF-8 as the default encoding for commit messages
autocmd BufReadPre COMMIT_EDITMSG,git-rebase-todo setlocal fileencodings=utf-8
"Remember the positions in files with some git-specific exceptions"
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$")
\ && expand("%") !~ "COMMIT_EDITMSG"
\ && expand("%") !~ "ADD_EDIT.patch"
\ && expand("%") !~ "addp-hunk-edit.diff"
\ && expand("%") !~ "git-rebase-todo" |
\ exe "normal g`\"" |
\ endif
autocmd BufNewFile,BufRead *.patch set filetype=diff
autocmd BufNewFile,BufRead *.diff set filetype=diff
autocmd Syntax diff
\ highlight WhiteSpaceEOL ctermbg=red |
\ match WhiteSpaceEOL /\(^+.*\)\@<=\s\+$/
autocmd Syntax gitcommit setlocal textwidth=74
endif " has("autocmd")
"------------------------------------------------------------------------------
" :se nocompatible " Set above
set mouse=a
set ttymouse=xterm2
:se number
set splitbelow
set splitright
filetype plugin on
let python_space_error_highlight = 1
if has("autocmd")
" Set indentation
autocmd FileType python setlocal expandtab
autocmd FileType make setlocal noexpandtab
endif "has("autocmd")
"setlocal expandtab
set softtabstop=4 tabstop=4 shiftwidth=4
"setlocal softtabstop=0
"setlocal shiftwidth=4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment