-" GVIM Configuration
+" GVIM Configuration {{{
+
+" Basic {{{
set background=light
set mouse=a
set guioptions-=m " remove menu bar
set guioptions-=T " remove toolbar
+" }}}
-" GVIM IDE Configuration
+" GVIM IDE Configuration {{{
set nocompatible " must be the first line
filetype on
filetype indent on
filetype plugin on
set laststatus=2
set statusline=%<%f\%h%m%r%=%-20.(line=%l\ \ col=%c%V\ \ totlin=%L%)\ \ \%h%m%r%=%-40(bytval=0x%B,%n%Y%)\%P
+" }}}
-" Change to the current file's folder
+" Change to the current file's folder {{{
map <leader>cd :cd %:p:h>cr<
+" }}}
-" Font configuration
+" Font configuration {{{
+"
" Terminus is currently rendering slowly
"set gfn=Terminus\ 8
"set gfn=PowerlineFont\ 8
set gfn=Monospace\ 8
+" }}}
-" 256 colors support
+" 256 colors support {{{
set t_Co=256
+" }}}
-" Color scheme
+" Color scheme {{{
"colorscheme solarized
colorscheme xoria256
+" }}}
-" Powerline
+" Powerline {{{
"set showtabline=1 " Do not display the tabline if there's just one tab
"let g:Powerline_symbols='fancy'
"python from powerline.vim import setup as powerline_setup
"python powerline_setup()
"python del powerline_setup
+" }}}
-" Vim support file to detect file types
+" Vim support file to detect file types {{{
" Check if file type config is already loaded {{{
if exists("did_load_filetypes")
-" auto_file.vim - Automatically file reading, saving; directory changer.
+" auto_file.vim - Automatically file reading, saving; directory change {{{
" Autoread {{{
"
-" key_mappings.vim - Custom Key Mappings
+" key_mappings.vim - Custom Key Mappings {{{
"
" Author: Silvio Rhatto <rhatto@riseup.net>
"
" Remove trailing whitespaces {{{
noremap <leader>w :call TrimWhitespace()<CR>
" }}}
+"
-" lib.vim - Miscelaneous functions
+" lib.vim - Miscelaneous functions {{{
"
" Author: Silvio Rhatto <rhatto@riseup.net>
"
-" Checkbox handling
+" Checkbox handling {{{
"
" This is commented out because vitalk/vim-simple-todo is being used instead.
"
" call setline('.', substitute(line, '- ', '- \[ \] ', ''))
" endif
"endf
+" }}}
-" Remove trailing spaces
+" Remove trailing spaces {{{
"
" Thanks https://vi.stackexchange.com/a/456
fun! TrimWhitespace()
endfun
command! TrimWhitespace call TrimWhitespace()
+" }}}
-" nedtree_customizations.vim - NERDTree customizations
+" nedtree_customizations.vim - NERDTree customizations {{{
"
" Initially adapted from
" http://stackoverflow.com/questions/1447334/how-do-you-add-nerdtree-to-your-vimrc
"
" Author: Silvio Rhatto <rhatto@riseup.net>
+" Use the minimal UI {{{
let NERDTreeMinimalUI=1
+" }}}
+" NERDTree autogroup {{{
augroup nerdtree
autocmd!
autocmd FileType nerdtree set relativenumber
autocmd FileType taglist set relativenumber
augroup END
+" }}}
+" TabNew {{{
function TabNew(address)
execute ":tabnew"
execute ":NERDTree " a:address
endfunction
+" }}}
+" TabNewBookmark {{{
function TabNewBookmark(bookmark)
execute ":tabnew"
execute ":NERDTreeFromBookmark " a:bookmark
endfunction
+" }}}
+" OpenNERDTree {{{
function OpenNERDTree()
execute ":NERDTree"
endfunction
+" }}}
-" Shortcuts
+" Shortcuts {{{
cnoreabbrev t NERDTree
cnoreabbrev b NERDTreeFromBookmark
cnoreabbrev s OpenSession
command -nargs=1 -complete=dir T :call TabNew(<f-args>)
command -nargs=1 -complete=customlist,nerdtree#completeBookmarks B :call TabNewBookmark(<f-args>)
command -nargs=0 OpenNERDTree :call OpenNERDTree()
+" }}}
-" session_workarounds.vim - Session restoration workarounds
+" session_workarounds.vim - Session restoration workarounds {{{
"
" Author: Silvio Rhatto <rhatto@riseup.net>
"
-" ui.vim - UI customization
+" ui.vim - UI customization {{{
"
" Author: Silvio Rhatto <rhatto@riseup.net>
-" Status and tab lines
+" Status and tab lines {{{
set laststatus=2 " Always display the statusline in all windows
set showtabline=2 " Always display the tabline, even if there is only one tab
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
+" }}}
-" Powerline
+" Powerline {{{
"python from powerline.vim import setup as powerline_setup
"python powerline_setup()
"python del powerline_setup
-"
+" }}}
-" Airline
+" Airline {{{
if $WINDOWID != ""
let g:airline_powerline_fonts=1
let g:airline#extensions#tabline#enabled=1
else
let g:loaded_airline = 1
endif
+" }}}
-" Color scheme
+" Color scheme {{{
"colorscheme github
"colorscheme solarized
"colorscheme gentooish
else
colorscheme zenburn
endif
+" }}}
-" window_title.vim - Window title handling
+" window_title.vim - Window title handling {{{
"
" Author: Silvio Rhatto <rhatto@riseup.net>
-" Basic settings
+" Basic settings {{{
set title
set titleold="terminal"
set titlestring=vim:\ %F
+" }}}
-" Handling titles when vim is embedded in specific programs
+" Handling titles when vim is embedded in specific programs {{{
augroup vimleave
autocmd!
au VimLeave *mutt/* silent call ResetTitle("mutt")
au VimLeave *remind/* silent call ResetTitle("calendar")
augroup END
+" }}}
-" Reset window titles
+" Reset window titles {{{
"
" Thanks to http://stackoverflow.com/questions/1673649/vimrc-action-onclose
function! ResetTitle(title)
"exec ":!echo -e '\033kbash\033\\'\<CR>"
exec ":!xtitle -q " a:title
endfunction
+" }}}
-" VIM configuration
+" VIM configuration {{{
" Basic options {{{
syn on