Monday, August 07, 2023

VIM underlining a title

 

HOW TO MAKE A CAPTION?

----------------------


(instead of keep tapping '-' to reach the desired length,

 one easy(?) way to achieve the same as above:

 go to the line)


0v$gU        # caption to uppercase

yyp          # duplicate the line

v$r-         # replace the line
ESC



(if same length not care, simply

80i- {escape}

Labels:

Sunday, October 31, 2021

Manjaro linux: syntax/source highlighing/coloring in vim/bash terminal

if you are a text tool user like me, syntax coloring or source code highlighting can be helpful.


# 1. use GUI add/remove software to install 2 packages:


    syntax-highlighting

    source-highlight


# 2. edit  ~/.bashrc  and add below  

# (if other linux distro, use other path of src-hilite-lesspipe.sh)


export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s"

export LESS=" -R "

alias less='less -m -N -g -i -J --underline-special --SILENT'


# 3. edit  ~/.vimrc  and add


if &t_Co > 2 || has("gui_running")

    syntax on

    set hlsearch

endif



* * * 

# to test

open a terminal


$ ls 

$ less test.cpp

$ less test.py

$ vim test.py




Labels: , , ,