2014-02-20 23:24:20 -05:00
|
|
|
"==============================="
|
|
|
|
" Vim Settings Configuration: "
|
|
|
|
"==============================="
|
|
|
|
|
2014-03-11 03:05:09 -04:00
|
|
|
"COMPATIBILITY SETTINGS: DOCUMENT AND ENVIRONMENT SETTINGS {{{
|
2014-03-28 07:36:19 -04:00
|
|
|
set nocompatible "enable vim specific capabilities
|
|
|
|
set encoding=utf-8 "set encoding
|
|
|
|
set fileformats=unix,dos,mac "set compatible line endings in order of preference
|
|
|
|
set backspace=indent,eol,start "enables backspacing
|
|
|
|
set mouse=a "enables extended mouse capabilities
|
|
|
|
set clipboard=unnamedplus "enable copy/paste support between vim and the environment's clipboard
|
|
|
|
|
|
|
|
set lazyredraw "only redraw what needs to be redrawn
|
|
|
|
set ttyfast "assume a fast connection to the terminal for better rendering
|
2014-02-20 23:24:20 -05:00
|
|
|
|
2014-03-11 03:05:09 -04:00
|
|
|
if $TERM =~ '^linux'
|
|
|
|
set t_Co=8 "use 8 colours when a vterm is detected
|
|
|
|
elseif !has("gui_running")
|
|
|
|
set t_Co=256 "assume 256 colours when any other terminal is detected
|
2014-03-28 07:36:19 -04:00
|
|
|
set ttymouse=xterm2 "sets the type of mouse to one we can expect in most gui envs
|
2014-03-11 03:05:09 -04:00
|
|
|
endif
|
|
|
|
"}}}
|
2014-02-20 23:24:20 -05:00
|
|
|
|
2014-03-11 03:05:09 -04:00
|
|
|
"GENERAL: ANYTHING THAT DOESN'T FIT ELSEWHERE {{{
|
|
|
|
set number "enable line numbers
|
|
|
|
set nowrap "disable line wrapping
|
2014-03-28 07:36:19 -04:00
|
|
|
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=1 sidescrolloff=1 "start scrolling if the cursor is one position away from the edge
|
|
|
|
set list listchars=tab:>-,trail:- "display tabs as >--- and trailing spaces as -
|
2014-03-11 03:05:09 -04:00
|
|
|
set autochdir "current dir is file dir
|
2014-03-28 07:36:19 -04:00
|
|
|
set history=250 "undo history
|
2014-03-29 19:52:05 -04:00
|
|
|
set timeoutlen=1000 ttimeoutlen=0 "shorten the timeout length of escapes
|
2014-03-11 03:05:09 -04:00
|
|
|
set whichwrap=b,s,<,>,[,] "allow the cursor to wrap lines
|
2014-03-28 07:36:19 -04:00
|
|
|
set textwidth=0 "set an unlimited text width before breaking the line when line breaks are enabled
|
2014-03-11 03:05:09 -04:00
|
|
|
set nolinebreak "disable linebreaks, though this will be overridden by filetype plugins
|
|
|
|
set showmatch "show matching open bracket when closed bracket is inserted
|
|
|
|
set matchtime=5 "the amount of time the matching bracket will highlight
|
|
|
|
set smarttab expandtab autoindent tabstop=4 shiftwidth=4 "configure tabs
|
|
|
|
set laststatus=2 showcmd statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v] "statusline init and config
|
|
|
|
set hlsearch incsearch ignorecase smartcase "configure search
|
2014-04-01 23:21:03 -04:00
|
|
|
let &showbreak="+++ " "when linewrap is enabled, show wrapped lines with +++
|
2014-02-20 23:24:20 -05:00
|
|
|
|
2014-03-11 03:05:09 -04:00
|
|
|
"load the system version of matchit if another hasn't already been
|
|
|
|
if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# ''
|
|
|
|
runtime! macros/matchit.vim
|
|
|
|
endif
|
2014-02-21 02:34:23 -05:00
|
|
|
|
2014-03-28 07:36:19 -04:00
|
|
|
"enable tab completion in command mode and configure how it handles extensions
|
2014-03-11 03:05:09 -04:00
|
|
|
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-02-20 23:24:20 -05:00
|
|
|
|
2014-03-28 07:36:19 -04:00
|
|
|
|
|
|
|
"SYNTAX: INDENTING, HIGHLIGHTING, FOLDING {{{
|
|
|
|
filetype plugin indent on
|
|
|
|
syntax on "turn syntax highlighting on
|
|
|
|
set formatoptions=roqnl12 "configure format options
|
2014-03-28 22:12:13 -04:00
|
|
|
set foldmethod=syntax foldcolumn=1 foldlevel=3 "fold layers 3 or more deep
|
|
|
|
|
|
|
|
"disable folding by default in vimdiff
|
|
|
|
if &diff
|
|
|
|
au VimEnter * windo set nofoldenable
|
|
|
|
endif
|
2014-03-28 07:36:19 -04:00
|
|
|
"}}}
|
|
|
|
|
|
|
|
"FILETYPES: SETTINGS SPECIFIC TO A FILETYPE {{{
|
|
|
|
au FileType mail setl spell "enable spellcheck for e-mail (mutt)
|
|
|
|
au FileType gitcommit setl spell "enable spellcheck in git commits
|
Added a new script that can be used to update the repo if bash is
available. Updated the README. Improved the theme by adding a bunch
of syntax highlighting definitions (mostly rooted in html, though
a bunch of other languages base their colours on it), as well as
tweaking visual selection to longer invert on the block with the cursor,
and parenthesis matching to look the same at both ends. Added a plugin
that improves the theme and adds some keyboard shortcuts to markdown,
which is what the README.md files in Github are written in. I realized
that the h,j,k,l shortcuts equivalent to the ones with arrow keys I'd
added were overwriting other shortcuts with the shift combinations, so
I removed those and the ctrl-ones for consistency. The diff shortcuts
weren't intuitive or easy on the hands, so I tried something else and
I think it works much better now (check vim/keyboard.vim). An update
script has also been added to simplify updating submodules; I'm not
completely clear as to whether following this method will properly
update the submodules in certain conditions like when one is removed,
but this should add new ones and update the existing ones after pulling
from the repo.
2014-04-01 00:03:52 -04:00
|
|
|
au FileType mkd setl spell "enable spellcheck in markdown (ie: README.md)
|
2014-03-28 07:36:19 -04:00
|
|
|
au BufNewFile,BufRead *.txt setl spell "enable spellcheck for text files (*.txt)
|
|
|
|
au BufNewFile,BufRead *tmux.conf setf sh "set syntax for *tmux.conf to sh (bash)
|
|
|
|
au BufNewFile,BufRead pacman.conf setf sh "set syntax for *tmux.conf to sh (bash)
|
|
|
|
au BufNewFile,BufRead yaourtrc setf sh "set syntax for *tmux.conf to sh (bash)
|
|
|
|
au BufNewFile,BufRead cjdroute.conf setf javascript "set syntax for *cjdroute.conf to javascript
|
|
|
|
au BufNewFile,BufRead ircd.conf setf javascript "set syntax for *ircd.conf to javascript
|
|
|
|
"}}}
|
|
|
|
|
2014-03-11 03:05:09 -04:00
|
|
|
"GVIM: GUI CONFIG OPTIONS {{{
|
2014-03-28 07:36:19 -04:00
|
|
|
set guicursor+=a:blinkon0 "disable the blinking cursor
|
|
|
|
|
2014-03-11 03:05:09 -04:00
|
|
|
set guioptions-=T "remove the toolbar
|
2014-03-28 07:36:19 -04:00
|
|
|
set guioptions-=m "remove the toolbar
|
2014-02-20 23:24:20 -05:00
|
|
|
|
2014-03-11 03:05:09 -04:00
|
|
|
if &wrap
|
2014-03-28 07:36:19 -04:00
|
|
|
set go-=b "disable the bottom scrollbar on launch iff text wrapping is enabled
|
2014-03-11 03:05:09 -04:00
|
|
|
else
|
2014-03-28 07:36:19 -04:00
|
|
|
set go+=b "enable the bottom scrollbar on launch iff text wrapping is disabled
|
2014-03-11 03:05:09 -04:00
|
|
|
endif
|
|
|
|
"}}}
|