Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

25 January 2026

The list of all the format options of the gq command in vim?

In Vim, the
'formatoptions' setting controls how automatic text formatting is performed. It accepts a string of single-character flags, each enabling a specific behavior. You can view the current value in your Vim session with the command :set fo? or get a detailed explanation of all flags using the Vim help documentation via :help fo-table. 
The common and widely recognized formatoptions flags are:
  • t: Auto-wrap text at the width specified by the 'textwidth' option.
  • c: Auto-wrap comments at 'textwidth', automatically inserting the current comment leader character(s) (defined by 'comments' or 'commentstring').
  • q: Allow formatting with the gq operator.
  • r: Automatically insert the current comment leader after pressing <Enter> in Insert mode.
  • o: Automatically insert the current comment leader after pressing o or O in Normal mode.
  • n: Recognize numbered lists when formatting, using the pattern defined in 'formatlistpat'. This helps avoid joining list items into a single paragraph.
  • b: Auto-wrap text (backwards) when a line grows longer than 'textwidth'. The line is broken at the last white space before 'textwidth'.
  • v: Vi-compatible auto-wrapping (wraps at 'textwidth' in Insert mode).
  • j: Delete comment characters when joining lines using the J command.
  • l: Leave long lines as they are when entering Insert mode; only format if a line explicitly exceeds 'textwidth' due to typing.
  • m: Join with a space between the joined lines if there isn't one already.
  • p: Do not auto-wrap paste. When pasting text in Insert mode, do not apply auto-wrapping based on 'textwidth'.
  • u: Undo separate; make an undo command revert one line at a time instead of the entire paragraph formatting operation.
  • 2: Keep the indent of the second line when a paragraph is formatted (useful for some programming styles).
  • 1: Do not break a line after a single character (e.g., prevent single-letter words from being alone on the next line). 
  • a: Automatic formatting of paragraphs (changes are immediately reformatted). 
The default value is typically tcq. To add an option, you can use :set formatoptions+=<char>, and to remove one, use :set formatoptions-=<char>. 

08 September 2025

How to Install and Use Prettier on Ubuntu?

# npm install -g prettier
 
How to make html and css and javaScript files
prettier?
 
$ prettier --tab-width 4 --write test.html 

How to update prettier

# npm update -g prettier

Note: -g means global

11 February 2019

Download, Extract, Convert videos

Download video with youtube-dl.exe

youtube-dl https://www.youtube.com/watch?v=S277aJyUehw


Converting video formats with ffmpeg.exe

ffmpeg -i input -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k \
-movflags +faststart -vf scale=-2:720,format=yuv420p output.mp4
ffmpeg -i test.mp4 -codec:v libtheora -qscale:v 6 -codec:a libvorbis -qscale:a 6 test.ogv


Extract part of a video with ffmpeg

ffmpeg -ss 00:00:30 -i orginalfile -t 00:00:05 -vcodec copy -acodec copy newfile




Converting files online

www.online-convert.com

www.ilovepdf.com

24 July 2018

How to convert mp4 videos into flv ones with ffmpeg?

How to convert mp4 videos into flv ones with ffmpeg?

I'm late, but if this can help somebody, it's time well spent.
If I understand correctly, you want to convert MP4 to FLV using FFMPEG. Here are two command lines to help you do that; I'm currently using them myself (you can adjust them to your needs too) :
ffmpeg -i source.mp4 -c:v libx264 -crf 19 destinationfile.flv
and if the first one doesn't work :
ffmpeg -i source.mp4 -c:v libx264 -ar 22050 -crf 28 destinationfile.flv
Please note that -crf XX is the quality of the video you will create. It's between 0 and 51 (but between 17 and 23 is a reasonable range and the lower the number is, the better quality the video is going to be).
The -ar 22050 is for adjusting the audio sample range (audio quality). You can choose 11025, 22050 or 44100.
I suggest you read this Tutorial for FFMPEG . It's really complete and has many useful tips.
Hope this will help you or somebody in the same situation.

16 January 2017

USB Device - Advanced Repair

USB Device - Advanced Repair

Problems:

Your computer can not find your Flash drive or SD card? or any other problem of your USB devices?

Solution:

U盘为什么要量产?


Step 1: Download ChipGenius, software for assisting users in extracting information about their USB devices, finding out details they need to repair broken flash drives.

Step 2: Run ChipGenius, and find the model number (e.g. PS 2251-07) of the control chip of a USB device (e.g. flash drive).

Step 3: Go to U盘量产网 and find the specific mass production tool for that specific control chip model (e.g. 'PS 2251-07'). Download the tool (e.g. the one on the page - 群联MPALL 7F V5.03.0A量产工具DL07中文版 )

Step 4: Find the tutorial for using the tool (e.g. 金士顿U盘PS2251-07东芝闪存白片量产CDROM成功教程 )

Step 5: Run the tool. Follow the tutorial. The bad flash drive or SD card will be repaired.

(Done)

07 December 2010

How to extract audio from video?

Best method - Format Factory 格式工厂

Method 2 - The latest version of QQ Player has the function.

Method 3 - http://www.flv2mp3.com/