How to Change File Format from DOS to UNIX in Vim

Checking file format in Vim

Type “:set ff?” in command mode to see what the file format is.

:set ff?

Changing file format in Vim

If you want to change the file format to Unix, type the following command:

:set ff=unix

Check the result.

:set ff?

Type the following command to change back to Dos format:

:set ff=dos


Vim: How to Copy Text into a Specific Register in Command Mode


:[range]y[ank] [x]

The yank command yanks (copies) selected text into the register x.

:[line]pu[t] [x]

The put command pastes the text from register x after a specified line.


:1,10y a

Copies text from the line 1 to line 10 into the register a.


Copies text from the line 1 to line 10 into the unnamed register.

:23pu a

Puts the text from register a after line 23.


Puts the text in the unnamed register after line 23.

Displaying the contents of registers

Display the register list with :reg.



How to Open a Local PDF File at a Specific Page in Chrome

#page=[page number]

To open a specific page in a PDF file, add “#page=[page number]” to the end of the file’s URL.

#page=[page number]

The example

This URL in Chrome opens page 151 of a PDF file named example.pdf:



How to Remove Pages in a PDF File Using pdftk Command

Installing pdftk on Ubuntu

Install a command line tool pdftk on Ubuntu.

sudo apt update

sudo apt install pdftk-java

Removing pages of .PDF document

Here is the example of a command to keep pages 6-12 and 24-end of the original file.

pdftk oldfile.pdf cat 6-12 24-end output newfile.pdf

The “end” in “24-end” means end page.

Before and After