-/* Copyright YEAR NAME <EMAIL>
+/* Copyright YEAR EMAIL
* Licensed for distribution under the GPL version 2.
*
* ___Program purpose...
-# Copyright YEAR NAME <EMAIL>
+# Copyright YEAR EMAIL
# Licensed for distribution under the GPL version 2, check COPYING for details
# ___Program purpose
import time, os, os.path, sys
+# To override the defaults, set these variables
+EMAIL = ""
+
macros = {}
macros["YDATE"] = lambda: time.strftime("%Y-%m-%d")
macros["YEAR"] = lambda: time.strftime("%Y")
-macros["NAME"] = lambda: "Put your name in ~/.vim/abbrs2out.vim"
-macros["EMAIL"] = lambda: "Then run that script"
+macros["EMAIL"] = lambda: EMAIL or os.environ.get("EMAIL")
vimdir = os.path.join(os.environ.get("HOME"), ".vim")
" Unhighlight search results
map <C-l> :nohlsearch<CR>:redraw!<CR>
-" Commenting of lines! Stolen & modified from vim.org's ToggleCommentify
-map <C-c> :call ToggleCommentify()<CR>j
-imap <C-c> <ESC>:call ToggleCommentify()<CR>j
-" The nice thing about these mapping is that you don't have to select a visual block to comment
-" ... just keep the CTRL-key pressed down and tap on 'c' as often as you need.
+" Map Y to be consistent with D, C, etc
+noremap Y y$
-function! ToggleCommentify()
- let lineString = getline(".")
- if lineString != $ " don't comment empty lines
- let isCommented = strpart(lineString,0,3) " getting the first 3 symbols
- let fileType = &ft " finding out the file-type, and specifying the comment symbol
- if fileType == 'ox' || fileType == 'java' || fileType == 'cpp' || fileType == 'c' || fileType == 'php'
- let commentSymbol = '///'
- elseif fileType == 'vim'
- let commentSymbol = '"""'
- elseif fileType == 'python' || fileType == 'sh'
- let commentSymbol = '###'
- else
- execute 'echo "ToggleCommentify has not (yet) been implemented for this file-type"'
- let commentSymbol = ''
- endif
- if isCommented == commentSymbol
- call UnCommentify(commentSymbol) " if the line is already commented, uncomment
- else
- call Commentify(commentSymbol) " if the line is uncommented, comment
- endif
- endif
-endfunction
+" CTRL-n and CTRL-p to go forwards and backwards through files
+nnoremap <C-n> :next<CR>
+nnoremap <C-p> :prev<CR>
-function! Commentify(commentSymbol)
- execute ':s+^+'.a:commentSymbol.'+'
- nohlsearch
-endfunction
-
-function! UnCommentify(commentSymbol)
- execute ':s+'.a:commentSymbol.'++'
- nohlsearch
-endfunction
--- /dev/null
+" Commenting of lines! Stolen & modified from vim.org's ToggleCommentify
+map <C-c> :call ToggleCommentify()<CR>j
+imap <C-c> <ESC>:call ToggleCommentify()<CR>j
+" The nice thing about these mapping is that you don't have to select a visual block to comment
+" ... just keep the CTRL-key pressed down and tap on 'c' as often as you need.
+
+function! ToggleCommentify()
+ let lineString = getline(".")
+ if lineString != $ " don't comment empty lines
+ let isCommented = strpart(lineString,0,3) " getting the first 3 symbols
+ let fileType = &ft " finding out the file-type, and specifying the comment symbol
+ if fileType == 'ox' || fileType == 'java' || fileType == 'cpp' || fileType == 'c' || fileType == 'php'
+ let commentSymbol = '///'
+ elseif fileType == 'vim'
+ let commentSymbol = '"""'
+ elseif fileType == 'python' || fileType == 'sh'
+ let commentSymbol = '###'
+ else
+ execute 'echo "ToggleCommentify has not (yet) been implemented for this file-type"'
+ let commentSymbol = ''
+ endif
+ if isCommented == commentSymbol
+ call UnCommentify(commentSymbol) " if the line is already commented, uncomment
+ else
+ call Commentify(commentSymbol) " if the line is uncommented, comment
+ endif
+ endif
+endfunction
+
+function! Commentify(commentSymbol)
+ execute ':s+^+'.a:commentSymbol.'+'
+ nohlsearch
+endfunction
+
+function! UnCommentify(commentSymbol)
+ execute ':s+'.a:commentSymbol.'++'
+ nohlsearch
+endfunction
+
source ~/.vim/mouse.vim
source ~/.vim/indent.vim
source ~/.vim/search.vim
-source ~/.vim/abbrsout.vim
source ~/.vim/commands.vim
+source ~/.vim/commenter.vim
+if !filereadable(expand("~/.vim/abbrsout.vim"))
+ !python ~/.vim/abbrs2vim.py
+endif
+source ~/.vim/abbrsout.vim