vim-fle-syntax/README.md

70 lines
2.2 KiB
Markdown
Raw Permalink Normal View History

2022-10-28 13:38:32 +00:00
# vim-fle-syntax
2022-10-31 11:02:48 +00:00
Vim syntax plugin for writing Fast Log Entry (https://df3cb.com/fle/) compatible log files in Vim.
2022-10-28 13:45:25 +00:00
2022-10-28 19:46:01 +00:00
# Screenshot
2022-10-28 19:44:11 +00:00
2023-10-24 14:14:33 +00:00
![screenshot](/screenshot.png?raw=true "screenshot")
2022-10-28 19:44:11 +00:00
2022-10-28 19:10:58 +00:00
## Why?
2022-10-31 11:02:48 +00:00
Because it's nice to take a small GNU/Linux based laptop with me on portable operations, just log everything with Vim and do the rest at home.
2022-10-28 19:10:58 +00:00
2022-10-31 09:00:06 +00:00
## Extras / Shortcuts
2022-10-31 08:40:06 +00:00
2022-10-31 09:00:06 +00:00
You can insert the current time in UTC and HHMM format by pressing <F5> and the current date string by pressing <F6> if you add the following lines to your .vimrc file:
2022-10-31 08:40:06 +00:00
2022-10-31 09:02:00 +00:00
" set timezone to UTC
2022-10-31 08:40:06 +00:00
let $TZ='UTC'
2022-10-31 09:02:00 +00:00
" insert current time in HHMM format with <F5>
2022-10-31 08:42:31 +00:00
:nnoremap <F5> "=strftime("%H%M ")<CR>P
:inoremap <F5> <C-R>=strftime("%H%M ")<CR>
2022-10-31 09:02:00 +00:00
" insert current date with <F6>
2022-10-31 09:00:06 +00:00
:nnoremap <F6> "=strftime("date %G-%m-%d")<CR>P
:inoremap <F6> <C-R>=strftime("date %G-%m-%d")<CR>
2022-10-31 08:40:06 +00:00
2022-10-28 19:10:58 +00:00
## Install
2022-10-28 13:45:25 +00:00
Copy or symlink these files to your _$VIMRUNTIME/syntax_ and _$VIMRUNTIME/ftdetect_ directory or to _~/.vim/syntax_ and _~/.vim/ftdetect_ directories:
# cd ~/
# git clone https://codeberg.org/mclemens/vim-fle-syntax.git
# mkdir -p ~/.vim/syntax
# mkdir -p ~/.vim/ftdetect
# ln -s ~/vim-fle-syntax/syntax/fle.vim ~/.vim/syntax/fle.vim
# ln -s ~/vim-fle-syntax/ftdetect/fle.vim ~/.vim/ftdetect/fle.vim
# vim ~/.vimrc # <<- optional: paste above lines into this file
## Update
# cd ~/vim-fle-syntax
# git pull
## Usage
Just open any text file ending with .fle in vim:
# vim ~/mylog.fle
Press F5 to enter timestamp, press F6 to enter current date string.
## Colors
If you are unhappy with the default colors, please feel free to edit _~/.vim/syntax/fle.vim_ and change the colors in the following code block:
" mapping of above matches/keywords to colors
" customize to your liking
hi def fle_call ctermfg=blue
hi def fle_date ctermfg=blue
hi def fle_other ctermfg=blue
hi def fle_time ctermfg=green
hi def fle_loc ctermfg=green
hi def fle_name ctermfg=cyan
hi def fle_header ctermfg=red
hi def fle_freq ctermfg=red
hi def fle_mode ctermfg=red
hi def fle_band ctermfg=red
hi def fle_sota ctermfg=yellow
hi def fle_pota ctermfg=yellow