Giter Site home page Giter Site logo

vim-fle-syntax's Introduction

vim-fle-syntax

Vim syntax plugin for writing Fast Log Entry (https://df3cb.com/fle/) compatible log files in Vim.

Screenshot

screenshot

Why?

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.

Extras / Shortcuts

You can insert the current time in UTC and HHMM format by pressing and the current date string by pressing if you add the following lines to your .vimrc file:

" set timezone to UTC
let $TZ='UTC'

" insert current time in HHMM format with <F5>
:nnoremap <F5> "=strftime("%H%M ")<CR>P
:inoremap <F5> <C-R>=strftime("%H%M ")<CR>

" insert current date with <F6>
:nnoremap <F6> "=strftime("date %G-%m-%d")<CR>P
:inoremap <F6> <C-R>=strftime("date %G-%m-%d")<CR>

Install

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

vim-fle-syntax's People

Watchers

Nic Heath avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.