2014-04-09 08:07:12 -04:00
|
|
|
"============================================================"
|
|
|
|
" "
|
|
|
|
" Darkcloud Vim Config: main settings "
|
|
|
|
" "
|
2014-06-17 01:49:46 -04:00
|
|
|
" By: Kevin MacMartin (prurigro@gmail.com) "
|
2014-04-09 08:07:12 -04:00
|
|
|
" Website: https://github.com/prurigro/darkcloud-vimconfig "
|
|
|
|
" "
|
|
|
|
" License: MIT "
|
|
|
|
" "
|
|
|
|
"============================================================"
|
2014-02-20 23:24:20 -05:00
|
|
|
|
2014-07-21 02:36:50 -04:00
|
|
|
"GVIM SETTINGS: {{{
|
|
|
|
set guicursor+=a:blinkon0 "disable the blinking cursor
|
|
|
|
set guioptions=aegip "enable some good defaults for gvim
|
|
|
|
set guioptions+=lRb "enable scrollbars (right only when a split is present)
|
|
|
|
"}}}
|
|
|
|
|
|
|
|
"COMPATIBILITY SETTINGS: {{{
|
|
|
|
set nocompatible "disable vi-compatibility settings
|
|
|
|
set backspace=indent,eol,start "enables/configures standard backspace behaviour
|
2014-02-20 23:24:20 -05:00
|
|
|
|
2014-07-21 02:36:50 -04:00
|
|
|
"use the '*' register as well as the the '+' register if it's available too
|
|
|
|
set clipboard=unnamed
|
|
|
|
if has('unnamedplus')|set clipboard+=unnamedplus|endif
|
|
|
|
|
|
|
|
"fancy mouse reporting with xterm2 fallback
|
|
|
|
if has("mouse_sgr")|set ttymouse=sgr|else|set ttymouse=xterm2|endif
|
2014-04-09 15:05:42 -04:00
|
|
|
set mouse=a "enables mouse functionality with extended capabilities
|
|
|
|
|
2014-07-21 02:36:50 -04:00
|
|
|
"8 colours in $TERM=linux, 256 elsewhere
|
|
|
|
if $TERM =~ '^linux'|set t_Co=8|elseif !has("gui_running")|set t_Co=256|endif
|
|
|
|
set ttyfast "assume a fast connection to the terminal for better rendering
|
|
|
|
|
|
|
|
"configure to primarily use utf8
|
|
|
|
if has("multi_byte")
|
|
|
|
if &termencoding == ""|let &termencoding = &encoding|endif
|
|
|
|
set encoding=utf-8
|
|
|
|
setglobal fileencoding=utf-8
|
2014-03-11 03:05:09 -04:00
|
|
|
endif
|
2014-07-21 02:36:50 -04:00
|
|
|
set fileformats=unix,dos,mac "set compatible line endings in order of preference
|
2014-03-11 03:05:09 -04:00
|
|
|
"}}}
|
2014-02-20 23:24:20 -05:00
|
|
|
|
2014-07-21 02:36:50 -04:00
|
|
|
"GENERAL SETTINGS: {{{
|
|
|
|
"FILETYPES: {{{
|
|
|
|
filetype plugin indent on "enable filetype-based auto-indentation
|
|
|
|
syntax on "enable syntax highlighting
|
|
|
|
set formatoptions=roqnl12 "how automatic formatting is to be done
|
|
|
|
set diffopt=foldcolumn:0,filler "vimdiff default settings
|
|
|
|
set foldmethod=syntax foldcolumn=1 foldlevel=5 "fold layers 5 or more deep
|
|
|
|
"}}}
|
2014-02-21 02:34:23 -05:00
|
|
|
|
2014-07-21 02:36:50 -04:00
|
|
|
"USER INTERFACE: {{{
|
|
|
|
set laststatus=2 showcmd statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v] "statusline init and config
|
|
|
|
set number "enable line numbers
|
|
|
|
set nowrap "disable line wrapping
|
|
|
|
set cursorline cursorcolumn "enable row/column highlighting
|
|
|
|
set visualbell "notify visually instead of with an audible bell
|
|
|
|
set splitright "add new tiles on the right (and not left) when added
|
|
|
|
set scrolloff=0 sidescrolloff=0 "start scrolling if the cursor is one position away from the edge
|
|
|
|
set list listchars=tab:>-,trail:- "display tabs as: >-- and trailing spaces as: -
|
|
|
|
set showmatch "show matching open bracket when closed bracket is inserted
|
|
|
|
set matchtime=5 "the amount of time before the matching bracket will highlight
|
|
|
|
let &showbreak="" "character to prepend to wrapped lines when linewrapping is enabled
|
2014-02-20 23:24:20 -05:00
|
|
|
|
2014-07-21 02:36:50 -04:00
|
|
|
"enable tab completion in command mode and configure how it handles extensions
|
|
|
|
set completeopt=longest,menuone
|
|
|
|
set wildmenu
|
|
|
|
set wildmode=list:longest,full
|
|
|
|
set wildignore=*.dll,*.o,*.obj,*.bak,*.exe,*.pyc,*.jpg,*.gif,*.png
|
|
|
|
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
|
|
|
|
"}}}
|
2014-04-02 11:17:12 -04:00
|
|
|
|
2014-07-21 02:36:50 -04:00
|
|
|
"BEHAVIOUR: {{{
|
|
|
|
set autochdir "change to a file's directory when it's opened
|
|
|
|
set history=250 "size of the undo history
|
|
|
|
set whichwrap=b,s,<,>,[,] "scrolling left/right off current line wraps to the next/previous
|
|
|
|
set smarttab expandtab autoindent tabstop=4 shiftwidth=4 "configure tabs
|
|
|
|
set hlsearch incsearch ignorecase smartcase "configure how search behaves
|
|
|
|
set timeoutlen=500 ttimeoutlen=0 "shorten the timeout length of escapes
|
2014-03-28 07:36:19 -04:00
|
|
|
|
2014-07-21 02:36:50 -04:00
|
|
|
"enable the auto-creation of missing folders in a save path
|
|
|
|
function s:MakeNewDir(fullpath, buf)
|
|
|
|
if empty(getbufvar(a:buf,'&buftype')) && a:fullpath!~#'\v^\w+\:\/'
|
|
|
|
let dirpath=fnamemodify(a:fullpath,':h')
|
|
|
|
if !isdirectory(dirpath)|call mkdir(dirpath,'p')|endif
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
augroup WriteDir
|
|
|
|
autocmd!
|
|
|
|
autocmd BufWritePre * :call s:MakeNewDir(expand('<afile>'),+expand('<abuf>'))
|
|
|
|
augroup END
|
|
|
|
"}}}
|
2014-03-11 03:05:09 -04:00
|
|
|
"}}}
|