rcfiles/.vimrc

50 lines
1.3 KiB
VimL
Raw Normal View History

2016-01-22 03:42:10 +00:00
" Preferred global default settings:
2016-01-22 03:36:44 +00:00
set number
set background=dark
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set spell spelllang=en_au
syntax enable
match ErrorMsg '\s\+$'
2016-01-22 03:42:10 +00:00
" Removes trailing spaces:
2016-01-22 03:36:44 +00:00
function! TrimWhiteSpace()
%s/\s\+$//e
endfunction
nnoremap <silent> <Leader>RemoveTrailingWhiteSpace :call TrimWhiteSpace()<CR>
autocmd FileWritePre * :call TrimWhiteSpace()
autocmd FileAppendPre * :call TrimWhiteSpace()
autocmd FilterWritePre * :call TrimWhiteSpace()
autocmd BufWritePre * :call TrimWhiteSpace()
2016-01-22 03:42:10 +00:00
" Add files ending in md to the list of files recognised as markdown:
2016-01-22 03:36:44 +00:00
autocmd BufNewFile,BufFilePre,BufRead *.md set filetype=markdown
2016-01-22 03:42:10 +00:00
" Settings for my Haskell environment:
2016-01-22 03:36:44 +00:00
function! HaskellSettings()
set tabstop=8
set shiftwidth=8
set expandtab
endfunction
autocmd BufNewFile,BufFilePre,BufRead *.hs :call HaskellSettings()
2016-01-22 03:42:10 +00:00
" Settings for my Golang environment:
2016-01-22 03:36:44 +00:00
function! GoSettings()
set tabstop=7
set shiftwidth=7
set noexpandtab
endfunction
autocmd BufNewFile,BufFilePre,BufRead *.go :call GoSettings()
2016-01-22 03:42:10 +00:00
" Settings for my Python environment:
2016-01-22 03:36:44 +00:00
function! PythonSettings()
set tabstop=4
set shiftwidth=4
set expandtab
set textwidth=79
endfunction
autocmd BufNewFile,BufFilePre,BufRead *.py :call PythonSettings()