Commits

esaurito committed e31bfba

Refactoring

  • Participants
  • Parent commits 6773ae4

Comments (0)

Files changed (5)

File .VimballRecord

-loremipsum.vba: call delete('/home/alex/.vim/autoload/loremipsum.vim')|call delete('/home/alex/.vim/autoload/loremipsum.txt')|call delete('/home/alex/.vim/plugin/loremipsum.vim')|call delete('/home/alex/.vim/doc/loremipsum.txt')
-bexec-v0.3.vba: call delete('/home/alex/.vim/plugin/bexec.vim')|call delete('/home/alex/.vim/doc/bexec.txt')
-conque_1.1.vba: call delete('/home/alex/.vim/autoload/conque_term.vim')|call delete('/home/alex/.vim/doc/conque_term.txt')|call delete('/home/alex/.vim/plugin/conque_term.vim')|call delete('/home/alex/.vim/syntax/conque_term.vim')

File MangleImageTag.vim

-" MangleImageTag() - updates an <IMG>'s width and height tags.
-"
-" Requirements:
-"       VIM 7 or later
-"
-" Copyright (C) 2004-2008 Christian J. Robinson <infynity@onewest.net>
-"
-" Based on "mangleImageTag" by Devin Weaver <ktohg@tritarget.com>
-"
-" This program is free software; you can  redistribute  it  and/or  modify  it
-" under the terms of the GNU General Public License as published by  the  Free
-" Software Foundation; either version 2 of the License, or  (at  your  option)
-" any later version.
-"
-" This program is distributed in the hope that it will be useful, but  WITHOUT
-" ANY WARRANTY; without  even  the  implied  warranty  of  MERCHANTABILITY  or
-" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General  Public  License  for
-" more details.
-"
-" You should have received a copy of the GNU General Public License along with
-" this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-" Place - Suite 330, Boston, MA 02111-1307, USA.
-"
-" RCS info: -------------------------------------------------------------- {{{
-" $Id: MangleImageTag.vim,v 1.12 2008/05/30 00:53:28 infynity Exp $
-" $Log: MangleImageTag.vim,v $
-" Revision 1.12  2008/05/30 00:53:28  infynity
-" - Clarify an error message
-" - Don't move the cursor when updating the tag
-"
-" Revision 1.11  2008/05/26 01:11:25  infynity
-" *** empty log message ***
-"
-" Revision 1.10  2008/05/01 05:01:02  infynity
-" Code changed for Vim 7:
-"  - Computed sizes should always be correct now
-"  - Code is a bit cleaner, but unfortunately slower
-"
-" Revision 1.9  2007/05/04 02:03:42  infynity
-" Computed sizes were very wrong when 'encoding' was set to UTF8 or similar
-"
-" Revision 1.8  2007/05/04 01:32:27  infynity
-" Missing quotes
-"
-" Revision 1.7  2007/01/04 04:29:55  infynity
-" Enclose the values of the width/height in quotes by default
-"
-" Revision 1.6  2006/09/22 06:25:14  infynity
-" Search for the image file in the current directory and the buffer's directory.
-"
-" Revision 1.5  2006/06/09 07:56:08  infynity
-" Was resetting 'autoindent' globally, switch it to locally.
-"
-" Revision 1.4  2006/06/08 04:16:17  infynity
-" Temporarily reset 'autoindent' (required for Vim7)
-"
-" Revision 1.3  2005/05/19 18:31:31  infynity
-" SizeGif was returning width as height and vice-versa.
-"
-" Revision 1.2  2004/03/22 10:04:24  infynity
-" Update the right tag if more than one IMG tag appears on the line.
-"
-" Revision 1.1  2004/03/22 05:58:34  infynity
-" Initial revision
-" ------------------------------------------------------------------------ }}}
-
-if v:version < 700 || exists("*MangleImageTag")
-	finish
-endif
-
-function! MangleImageTag() "{{{1
-	let start_linenr = line('.')
-	let end_linenr = start_linenr
-	let col = col('.') - 1
-	let line = getline(start_linenr)
-
-	if line !~? '<img'
-		echohl ErrorMsg
-		echomsg "The current line does not contain an image tag (see :help ;mi)."
-		echohl None
-
-		return
-	endif
-
-	" Get the rest of the tag if we have a partial tag:
-	while line =~? '<img\_[^>]*$'
-		let end_linenr = end_linenr + 1
-		let line = line . "\n" . getline(end_linenr)
-	endwhile
-
-	" Make sure we modify the right tag if more than one is on the line:
-	if line[col] != '<'
-		let tmp = strpart(line, 0, col)
-		let tagstart = strridx(tmp, '<')
-	else
-		let tagstart = col
-	endif
-	let savestart = strpart(line, 0, tagstart)
-	let tag = strpart(line, tagstart)
-	let tagend = stridx(tag, '>') + 1
-	let saveend = strpart(tag, tagend)
-	let tag = strpart(tag, 0, tagend)
-
-	if tag[0] != '<' || col > strlen(savestart . tag) - 1
-		echohl ErrorMsg
-		echomsg "Cursor isn't on an IMG tag."
-		echohl None
-
-		return
-	endif
-
-	if tag =~? "src=\\(\".\\{-}\"\\|'.\\{-}\'\\)"
-		let src = substitute(tag, ".\\{-}src=\\([\"']\\)\\(.\\{-}\\)\\1.*", '\2', '')
-		if tag =~# 'src'
-			let case = 0
-		else
-			let case = 1
-		endif
-	else
-		echohl ErrorMsg
-		echomsg "Image src not specified in the tag."
-		echohl None
-
-		return
-	endif
-
-	if ! filereadable(src)
-		if filereadable(expand("%:p:h") . '/' . src)
-			let src = expand("%:p:h") . '/' . src
-		else
-			echohl ErrorMsg
-			echomsg "Can't find image file: " . src
-			echohl None
-
-			return
-		endif
-	endif
-
-	let size = s:ImageSize(src)
-	if len(size) != 2
-		return
-	endif
-
-	if tag =~? "height=\\(\"\\d\\+\"\\|'\\d\\+\'\\|\\d\\+\\)"
-		let tag = substitute(tag,
-			\ "\\c\\(height=\\)\\([\"']\\=\\)\\(\\d\\+\\)\\(\\2\\)",
-			\ '\1\2' . size[1] . '\4', '')
-	else
-		let tag = substitute(tag,
-			\ "\\csrc=\\([\"']\\)\\(.\\{-}\\|.\\{-}\\)\\1",
-			\ '\0 ' . (case ? 'HEIGHT' : 'height') . '="' . size[1] . '"', '')
-	endif
-
-	if tag =~? "width=\\(\"\\d\\+\"\\|'\\d\\+\'\\|\\d\\+\\)"
-		let tag = substitute(tag,
-			\ "\\c\\(width=\\)\\([\"']\\=\\)\\(\\d\\+\\)\\(\\2\\)",
-			\ '\1\2' . size[0] . '\4', '')
-	else
-		let tag = substitute(tag,
-			\ "\\csrc=\\([\"']\\)\\(.\\{-}\\|.\\{-}\\)\\1",
-			\ '\0 ' . (case ? 'WIDTH' : 'width') . '="' . size[0] . '"', '')
-	endif
-
-	let line = savestart . tag . saveend
-
-	let saveautoindent=&autoindent
-	let &l:autoindent=0
-
-	call setline(start_linenr, split(line, "\n"))
-
-	let &l:autoindent=saveautoindent
-endfunction
-
-function! s:ImageSize(image) "{{{1
-	let ext = fnamemodify(a:image, ':e')
-
-	if ext !~? 'png\|gif\|jpe\?g'
-		echohl ErrorMsg
-		echomsg "Image type not recognized: " . tolower(ext)
-		echohl None
-
-		return
-	endif
-
-	if filereadable(a:image)
-		let ldsave=&lazyredraw
-		set lazyredraw
-
-		let buf=readfile(a:image, 'b', 1024)
-		let buf2=[]
-
-		let i=0
-		for l in buf
-			let string = split(l, '\zs')
-			for c in string
-				let char = char2nr(c)
-				call add(buf2, (char == 10 ? '0' : char))
-
-				" Keep the script from being too slow, but could cause a JPG
-				" (and GIF/PNG?) to return as "malformed":
-				let i+=1
-				if i > 1024 * 4
-					break
-				endif
-			endfor
-			call add(buf2, '10')
-		endfor
-
-		if ext ==? 'png'
-			let size = s:SizePng(buf2)
-		elseif ext ==? 'gif'
-			let size = s:SizeGif(buf2)
-		elseif ext ==? 'jpg' || ext ==? 'jpeg'
-			let size = s:SizeJpg(buf2)
-		endif
-	else
-		echohl ErrorMsg
-		echomsg "Can't read file: " . a:image
-		echohl None
-
-		return
-	endif
-
-	return size
-endfunction
-
-function! s:SizeGif(lines) "{{{1
-	let i=0
-	let len=len(a:lines)
-	while i <= len
-		if join(a:lines[i : i+9], ' ') =~ '^71 73 70\( \d\+\)\{7}'
-			let width=s:Vec(reverse(a:lines[i+6 : i+7]))
-			let height=s:Vec(reverse(a:lines[i+8 : i+9]))
-
-			return [width, height]
-		endif
-		let i+=1
-	endwhile
-
-	echohl ErrorMsg
-	echomsg "Malformed GIF file."
-	echohl None
-
-	return
-endfunction
-
-function! s:SizeJpg(lines) "{{{1
-	let i=0
-	let len=len(a:lines)
-	while i <= len
-		if join(a:lines[i : i+8], ' ') =~ '^255 192\( \d\+\)\{7}'
-			let height = s:Vec(a:lines[i+5 : i+6])
-			let width = s:Vec(a:lines[i+7 : i+8])
-
-			return [width, height]
-		endif
-		let i+=1
-	endwhile
-
-	echohl ErrorMsg
-	echomsg "Malformed JPEG file."
-	echohl None
-
-	return
-endfunction
-
-function! s:SizePng(lines) "{{{1
-	let i=0
-	let len=len(a:lines)
-	while i <= len
-		if join(a:lines[i : i+11], ' ') =~ '^73 72 68 82\( \d\+\)\{8}'
-			let width = s:Vec(a:lines[i+4 : i+7])
-			let height = s:Vec(a:lines[i+8 : i+11])
-
-			return [width, height]
-		endif
-		let i+=1
-	endwhile
-
-	echohl ErrorMsg
-	echomsg "Malformed PNG file."
-	echohl None
-
-	return
-endfunction
-
-function! s:Vec(nums) "{{{1
-	let n = 0
-	for i in a:nums
-		let n = n * 256 + i
-	endfor
-	return n
-endfunction
-
-" vim:ts=4:sw=4:
-" vim600:fdm=marker:fdc=2:cms=\ \"%s:
 'snippets'	snipMate.txt	/*'snippets'*
 .snippet	snipMate.txt	/*.snippet*
 .snippets	snipMate.txt	/*.snippets*
+:CommandT	command-t.txt	/*:CommandT*
+:CommandTFlush	command-t.txt	/*:CommandTFlush*
 :FufAddBookmark	fuf.txt	/*:FufAddBookmark*
 :FufAddBookmarkAsSelectedText	fuf.txt	/*:FufAddBookmarkAsSelectedText*
 :FufBookmark	fuf.txt	/*:FufBookmark*
 b:match_wholeBR	matchit.txt	/*b:match_wholeBR*
 b:match_word	matchit.txt	/*b:match_word*
 b:match_words	matchit.txt	/*b:match_words*
+command-t	command-t.txt	/*command-t*
+command-t-authors	command-t.txt	/*command-t-authors*
+command-t-commands	command-t.txt	/*command-t-commands*
+command-t-contents	command-t.txt	/*command-t-contents*
+command-t-donations	command-t.txt	/*command-t-donations*
+command-t-history	command-t.txt	/*command-t-history*
+command-t-installation	command-t.txt	/*command-t-installation*
+command-t-intro	command-t.txt	/*command-t-intro*
+command-t-license	command-t.txt	/*command-t-license*
+command-t-mappings	command-t.txt	/*command-t-mappings*
+command-t-options	command-t.txt	/*command-t-options*
+command-t-pathogen	command-t.txt	/*command-t-pathogen*
+command-t-requirements	command-t.txt	/*command-t-requirements*
+command-t-trouble-shooting	command-t.txt	/*command-t-trouble-shooting*
+command-t-usage	command-t.txt	/*command-t-usage*
+command-t-website	command-t.txt	/*command-t-website*
+command-t-wildignore	command-t.txt	/*command-t-wildignore*
+command-t.txt	command-t.txt	/*command-t.txt*
 conque_term-bugs	conque_term.txt	/*conque_term-bugs*
 conque_term-changelog	conque_term.txt	/*conque_term-changelog*
 conque_term-contribute	conque_term.txt	/*conque_term-contribute*
 fuf.txt	fuf.txt	/*fuf.txt*
 fuzzyfinder	fuf.txt	/*fuzzyfinder*
 g%	matchit.txt	/*g%*
+g:CommandTAcceptSelectionMap	command-t.txt	/*g:CommandTAcceptSelectionMap*
+g:CommandTAcceptSelectionSplitMap	command-t.txt	/*g:CommandTAcceptSelectionSplitMap*
+g:CommandTAcceptSelectionTabMap	command-t.txt	/*g:CommandTAcceptSelectionTabMap*
+g:CommandTAcceptSelectionVSplitMap	command-t.txt	/*g:CommandTAcceptSelectionVSplitMap*
+g:CommandTAlwaysShowDotFiles	command-t.txt	/*g:CommandTAlwaysShowDotFiles*
+g:CommandTBackspaceMap	command-t.txt	/*g:CommandTBackspaceMap*
+g:CommandTCancelMap	command-t.txt	/*g:CommandTCancelMap*
+g:CommandTClearMap	command-t.txt	/*g:CommandTClearMap*
+g:CommandTCursorEndMap	command-t.txt	/*g:CommandTCursorEndMap*
+g:CommandTCursorLeftMap	command-t.txt	/*g:CommandTCursorLeftMap*
+g:CommandTCursorRightMap	command-t.txt	/*g:CommandTCursorRightMap*
+g:CommandTCursorStartMap	command-t.txt	/*g:CommandTCursorStartMap*
+g:CommandTDeleteMap	command-t.txt	/*g:CommandTDeleteMap*
+g:CommandTMatchWindowAtTop	command-t.txt	/*g:CommandTMatchWindowAtTop*
+g:CommandTMaxDepth	command-t.txt	/*g:CommandTMaxDepth*
+g:CommandTMaxFiles	command-t.txt	/*g:CommandTMaxFiles*
+g:CommandTMaxHeight	command-t.txt	/*g:CommandTMaxHeight*
+g:CommandTNeverShowDotFiles	command-t.txt	/*g:CommandTNeverShowDotFiles*
+g:CommandTScanDotDirectories	command-t.txt	/*g:CommandTScanDotDirectories*
+g:CommandTSelectNextMap	command-t.txt	/*g:CommandTSelectNextMap*
+g:CommandTSelectPrevMap	command-t.txt	/*g:CommandTSelectPrevMap*
+g:CommandTToggleFocusMap	command-t.txt	/*g:CommandTToggleFocusMap*
 g:fuf_abbrevMap	fuf.txt	/*g:fuf_abbrevMap*
 g:fuf_bookmark_keyDelete	fuf.txt	/*g:fuf_bookmark_keyDelete*
 g:fuf_bookmark_prompt	fuf.txt	/*g:fuf_bookmark_prompt*
+if has("gui_macvim")
+  set fuoptions=maxvert,maxhorz "fullscreen options (MacVim only), resized window when changed to fullscreen
+  set guifont=Monaco:h13
+  set guioptions-=T  "remove toolbar
+  set stal=2 "turn on tabs by default
+elseif has("gui_gtk2")
+  set guifont=Monaco
+  set guioptions-=T  " remove toolbar
+elseif has("x11")
+elseif has("gui_win32")
+    set go=agmrbetT
+end
+
+"""""""""""""""""""""""""""""GENERAL"""""""""""""""""""""""""""""""
+set anti " Antialias font
+" Default size of window
+set columns=179 
+set lines=50
+" Tab headings 
+set gtl=%t gtt=%F
+set visualbell t_vb=
+
+"""""""""""""""""""""""""""""CUSTOM MENU"""""""""""""""""""""""""""""""
+amenu &MyVim.HTML\ mode <Esc><Esc>:set filetype=html<cr>
+amenu &MyVim.Markdown\ mode <Esc><Esc>:set filetype=mkd<cr>
+amenu &MyVim.Insert.Last\ &Modified<Tab>,L <Esc><Esc>:let @z=TimeStamp()<CR>"zpa
+amenu &MyVim.-SEP1- <nul>
+
+menu &MyVim.Current\ File.Convert\ Format.To\ Dos :set fileformat=dos<cr> :w<cr>
+
+menu &MyVim.Current\ File.Convert\ Format.To\ Unix :set fileformat=unix<cr> :w<cr>
+
+menu &MyVim.Current\ File.Remove\ Trailing\ Spaces\ and\ Tabs :%s/[  ]*$//g<cr>
+
+menu &MyVim.Current\ File.Remove\ Ctrl-M <Esc>:%s/
+menu &MyVim.Current\ File.Remove\ All\ Tabs :retab<cr>
+
+menu &MyVim.Current\ File.Lines.Sort :sort<cr> 
+menu &MyVim.Current\ File.Lines.Reverse :sort!<cr> 
+menu &MyVim.Current\ File.Lines.Sort\ and\ delete\ duplicated\ lines :sort u<cr> 
+menu &MyVim.Current\ File.Lines.Delete\ blank\ lines :g/^\s*$/d<cr>
+
+set mousehide "Hide the mouse when characters are typed
+
+"Right mouse button pops up a menu.  
+"The shifted left mouse button extends a selection.  
+"This works like with Microsoft Windows.
+set mousemodel=popup
+
 ".vimrc
 
-" 1. GENERAL OPTIONS
+" 1. GENERAL SETTINGS
 " 2. TABS AND INDENT
 " 3. SCROLL
 " 4. WINDOWS
 " 5. SEARCH
 " 6. COLORS AND SYNTAX
+" 7. STATUS LINE
+" 8. INVISIBLE CHARS
+" 9. MAPPINGS
+" 10. OMNICOMPLETION
+" 11. AUTOCOMMANDS
+" 12. PLUGINS CONFIGURATION
+" 13. WRAP MODE
 
-" GENERAL OPTIONS
+" GENERAL SETTINGS
 set nocompatible        " We're running Vim, not Vi!
 
 " On Windows, also use '.vim' instead of 'vimfiles'; this makes synchronization
 set backupdir=~/.vim/sessions
 set dir=~/.vim/sessions
 let mapleader="," " Change the mapleader from \ to ,
+set cursorline "Hilight current cursor line
+set backspace=indent,eol,start "Makes backspace key more powerful. 
+set number "Display line numbers
+set nobackup "Do not keep a backup files 
+set nowritebackup "Do not keep a backup files 
+set history=1000 "Keep 1000 lines of command line history
+set undolevels=1000 "Use many levels of undo
+set wildignore=*.swp,*.bak,*.pyc,*.class "Ignore this files in wildmenu
+set showmatch "Show the matching bracket for the last ')'
+set noerrorbells "Don't beep
+set visualbell t_vb= "Don't flash. This must be reset in gvimrc. help visualbell
+set matchpairs+=<:> "allow to jump with % between < and > like for parenthesis
+" Sets what is saved when you save a session
+set sessionoptions=blank,buffers,curdir,folds,help,resize,tabpages,winsize
+"System clipboard and Vim clipboard are the same
+"set clipboard=unnamed "If clipboard is set to unnamed yanking will not work
+
+filetype on             "Enable filetype detection
+filetype indent on      "Enable filetype-specific indenting
+filetype plugin on      "Enable filetype-specific plugins 
+
+"set spelllang=en_gb
+set spelllang=it_it
 
 " 2. TABS AND INDENT
 set tabstop=4 " Tab key indent of four spaces
 set incsearch  " incremental search, search as you type
 set ignorecase " Ignore case when searching 
 set smartcase " Ignore case when searching lowercase
-nmap <silent> ,<space> :let @/=""<CR> "Clear hilighted search
+nmap <silent> ,<space> :let @/=''<cr> " Clear hilighted search
 
 " 6. COLORS AND SYNTAX
 set background=dark " This must be set before colorscheme. See help background
 "colorscheme wombat
 syntax on " Syntax highlighting
 
-"""""""""""""""""""""""""""""""""""STATUS LINE"""""""""""""""""""""""""""""""
+" 7. STATUS LINE
 set wildmenu "Show some autocomplete options in status bar
 set ruler "Show the cursor position all the time
 "Set information to display in status line
-set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
+set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
 set laststatus=2 "Always display status line
 
-"""""""""""""""""""""""""""""""""""INVISIBLE CHARS"""""""""""""""""""""""""""""""
+" 8. INVISIBLE CHARS
 set listchars=trail:.,tab:>-,eol:$
 set nolist
 noremap ,i :set list!<CR> "Toggle invisible chars
 
-"""""""""""""""""""""""""""""""""""OTHER SETTINGS"""""""""""""""""""""""""""""""
-set cursorline "Hilight current cursor line
-set backspace=indent,eol,start "Makes backspace key more powerful. 
-set number "Display line numbers
-set nobackup "Do not keep a backup files 
-set nowritebackup "Do not keep a backup files 
-set history=1000 "Keep 50 lines of command line history
-set undolevels=1000 "Use many muchos levels of undo
-set wildignore=*.swp,*.bak,*.pyc,*.class "Ignore this files in wildmenu
-set showmatch "Show the matching bracket for the last ')'
-set noerrorbells "Don't beep
-set visualbell "Don't beep
-set matchpairs+=<:> "allow to jump with % between < and > linke for parenthesis
-" Sets what is saved when you save a session
-set sessionoptions=blank,buffers,curdir,folds,help,resize,tabpages,winsize
-"System clipboard and Vim clipboard are the same
-"set clipboard=unnamed "If clipboard is set to unnamed yanking will not work
 
-"""""""""""""""""""""""""""""""""""MAPPINGS"""""""""""""""""""""""""""""""
+" 9. MAPPINGS
 "Quick alignment of text
 nmap ,al :left<CR>
 nmap ,ar :right<CR>
 nmap ,ac :center<CR>
 
-map <C-a> ggVG "Select all.
+nmap <C-a> ggVG "Select all.
 imap <C-z> <C-o>u "Undo in insert mode.
 
 "Insert date datetime or last modified
-"map ,L mz1G/Last modified:/e<Cr>CYDATETIME<Esc>`z
 "map ,datetime :let @z=strftime("%d %b %Y %X")<Cr>"zpa
 "map ,date :let @z=strftime("%d %b %Y")<Cr>"zpa
-map ,L  :let @z=TimeStamp()<Cr>"zpa
 
 "Make tab in visual mode indent the selected block
 vmap <tab> >gv
 "Switch to directory of current file
 command! CD cd %:p:h
 
-"Move between tabs
-map <S-Left> :tabprevious<cr>
-map! <S-Left> <Esc>:tabprevious<cr>
-map <S-Right> :tabnext<cr>
-map! <S-Right> <Esc>:tabnext<cr>
-map <C-t> :tabnew<cr> 
-map! <C-t> <Esc>:tabnew<cr> 
-
 "Count chars in the selected area
 map <F7> <Esc>:%s/\%V./&/gn<cr>
 
 vmap Q gq
 nmap Q gqap
 
-"""""""""""""""""""""""""""""""""""FILES"""""""""""""""""""""""""""""""
-filetype on             "Enable filetype detection
-filetype indent on      "Enable filetype-specific indenting
-filetype plugin on      "Enable filetype-specific plugins 
+let g:miniBufExplMapCTabSwitchBufs = 1 " Switch between buffer with ctrl+tab
 
-"""""""""""""""""""""""""""""""""""SPELLING"""""""""""""""""""""""""""""""
-" Set spelling language.
-"set spelllang=en_gb
-set spelllang=it_it
+" Fuzzy Finder
+map <leader>f :FufFile<CR>
+map <leader>d :FufDir<CR>
 
+noremap ,n :NERDTreeToggle<CR> " NerdTree
 
-"""""""""""""""""""""""""""""OMNICOMPLETION"""""""""""""""""""""""""""""""
+
+" 10. OMNICOMPLETION
 autocmd FileType html :set omnifunc=htmlcomplete#CompleteTags
 autocmd FileType python set omnifunc=pythoncomplete#Complete
 autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
 autocmd FileType css set omnifunc=csscomplete#CompleteCSS
 autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
 autocmd FileType php set omnifunc=phpcomplete#CompletePHP
-autocmd FileType c set omnifunc=ccomplete#Complete
 
-"""""""""""""""""""""""""""""ABBREVIATION"""""""""""""""""""""""""""""""
-"no abbreviation
 
-"""""""""""""""""""""""""""""AUTOCOMMANDS"""""""""""""""""""""""""""""""
+" 11. AUTOCOMMANDS
 if has("autocmd")
     "closetab.vim
     let g:closetag_default_xml=1
     " Don't do it when the position is invalid or when inside an event handler
     " (happens when dropping a file on gvim).
     autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g`\"" | endif
-
-    " Add an autocommand to update an existing time stamp when writing the file 
-    " It uses the functions above to replace the time stamp and restores cursor 
-    " position afterwards (this is from the FAQ) 
-    autocmd BufWritePre,FileWritePre *   ks|call UpdateTimeStamp()|'s
-
 endif " has("autocmd)"
 
+" 12. PLUGINS CONFIGURATION
 
-"""""""""""""""""""""""""""""NERD TREE"""""""""""""""""""""""""""""""
-:noremap ,n :NERDTreeToggle<CR>
-
-" User instead of Netrw when doing an edit /foobar
+" NerdTree
 let NERDTreeHijackNetrw=1
-
-" Single click for everything
 let NERDTreeMouseMode=1
 
-"""""""""""""""""""""""""""""NERD TREE"""""""""""""""""""""""""""""""
+" Mini Buffer Explorer
 let g:miniBufExplMapWindowNavVim = 1
 let g:miniBufExplMapWindowNavArrows = 1
-let g:miniBufExplMapCTabSwitchBufs = 1
 let g:miniBufExplModSelTarget = 1 
 
-
-"""""""""""""""""""""""""""FUNCTIONS"""""""""""""""""""""""""""""""
-
-"First add a function that returns a time stamp in the desired format 
-if !exists("*TimeStamp")
-    fun TimeStamp()
-        return "Last-modified: " . strftime("%d %b %Y %X")
-    endfun
-endif
-
-"Searches the first ten lines for the timestamp and updates using the
-"TimeStamp function
-if !exists("*UpdateTimeStamp")
-function! UpdateTimeStamp()
-
-   "Do the update only if the current buffer is modified 
-   if &modified == 1
-       " go to the first line
-       exec "1"
-
-      "Search for Last modified: 
-      let modified_line_no = search("Last-modified:")
-      if modified_line_no != 0 && modified_line_no < 10
-
-         "There is a match in first 10 lines 
-         "Go to the : in modified: 
-         exe "s/Last-modified: .*/" . TimeStamp()
-     endif
-
- endif
- endfunction
-endif
-
-"****************************************
-"       SPECIAL MAPPINGS FOR WRAP MODE 
-"***************************************
+" 13. SPECIAL MAPPINGS FOR WRAP MODE 
 "This need to be at the bottom of .vimrc
 
 noremap <silent> <Leader>w :call ToggleWrap()<CR>
+
 function! ToggleWrap()
   if &wrap
     echo "Wrap OFF"