Automatic date stamp in text document
Hi guys,
I am a recent convert from Windows to Linux and am currently using Fedora 5. In Windows, there was a functionality in notepad that was really cool. You create a new Notepad document and enter ".LOG" at the top of the document, then close it. Now each time you open that document it automatically enters a datetime stamp on a new line. I used it for keeping notes. All I had to do was open it and start typing. It would put a new date-and-time stamp on a new line below which I could write my notes. My question is: is there something like that available in any of the usual Linux/KDE text editors (KWrite, KEdit, Kate)? That would be really handy. Thanks guys. |
is there something like that available in any of the usual Linux/KDE text editors
In Vi (~/.vimrc) adding these lines: Code:
function! InsertDate() |
Quote:
Anybody else know of something that would work without having to type anything? And hopefully with a texst editor in KDE. |
_vimrc changes for emulating notepad .LOG behavior
I use the .LOG datestamp behavior in notepad on Windows frequently, but my editor of choice is vim or gvim, so I wanted to emulate notepad's behavoir more precisely than the solution suggested by unSpawn.
Although modifying .vimrc (or _vimrc on Windows) was fairly new to me, I used unSpawn's approach as a starting point (writing an InsertDate function) and combined it with an autocmd which looks for the .LOG at the beginning of any file: Code:
function! InsertDate() |
All times are GMT -5. The time now is 03:18 AM. |