Source

dotfiles / .vimrc.after

Full commit
" .vimrc.after
"
" Gustavo Picon - https://tabo.pe/
"
" This file is adapted from the old .vimrc I've been maintaining since the late
" 90s. I switched to Janus in 2012, and this is where I'm personalizing and
" fixing Janus' defaults.
"
" Share and enjoy.


" we like security
set nomodeline

" abbrev. of messages
set shortmess+=a

" display the current mode
set showmode

" min num of lines to keep above/below the cursor
set scrolloff=2

" disable the line numbering column
set nonumber

" also ignore these while opening and filtering
set wildignore+=.hg,*.pyc

" a tab is 4 spaces
set tabstop=4

" autoindent is 4 spaces
set shiftwidth=4

" the text width
set textwidth=79

" wrap long lines
set wrap

set nobackup

" show partial commands in status line and selected characters/lines in
" visual mode
set showcmd

" The default statusline in janus is pretty bad, improve it
if has("statusline")
    " taken from janus/vim/core/before/plugin/statuline.vim (63c0aac004)

    " Start the status line
    set statusline=%f

    " Add fugitive if enabled
    if janus#is_plugin_enabled('fugitive')
        set statusline+=%{fugitive#statusline()}
    endif

    " Add syntastic if enabled
    if janus#is_plugin_enabled('syntastic')
        set statusline+=%#warningmsg#
        set statusline+=%{SyntasticStatuslineFlag()}
        set statusline+=%*
    endif

    " end of janus copy&paste, we use our own ruler, a useful one

    " begin right section
    set statusline+=%=

    " buffer
    set statusline+=\:\b%n

    " some properties
    set statusline+=%M " modifiable?
    set statusline+=%R " read only?
    set statusline+=%H " help buffer?
    set statusline+=%W " preview window?
    set statusline+=%Y " file type
    set statusline+=,%{&encoding},%{&fileformat}
    set statusline+=\ %l,%c%V\ %P " classic vim ruler
endif

if has('gui_running')
    " really, no numbers
    "set nonumber

    " remove the toolbar
    set guioptions-=T

    " highlight the current line
    set cursorline

    " disable janus cmd/ctrl-t mappings for ctrlp.vim
    unmap <D-t>
    iunmap <D-t>
    map <silent><D-t> :tabnew<CR>

else
    " disable janus cmd/ctrl-t mappings for ctrlp.vim
    unmap <C-t>
    iunmap <C-t>
endif

" to please the gods
iabbrev cthuf Ia! Ia! Cthulhu fhtagn! Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn! Cthulhu fhtagn! Cthulhu fhtagn!