new info!

This commit is contained in:
gre-ilya 2025-06-22 20:08:10 +05:00
parent 23ae985636
commit 1ee1d875da

View File

@ -211,12 +211,47 @@ Commands:
other direction. other direction.
Type few letters in command mode and press CTRL-D to see overview. Type few letters in command mode and press CTRL-D to see overview.
:se<Up> -- go to previous command which starts with se :se<Up> -- go to previous command which starts with se
Go away and come back (21):
CTRL-Z -- suspends vim, after that you can use `fg` to restore vim CTRL-Z -- suspends vim, after that you can use `fg` to restore vim
:!{program} -- execute program
:r !{program} -- execute program and print its output to vim
'0 '1 ... -- Come back to the place, where you left Vim previous time '0 '1 ... -- Come back to the place, where you left Vim previous time
:oldfiles than :e #<2 to edit the second file :oldfiles than :e #<2 to edit the second file; :split #<3
:browse oldfiles than q than number of file -- to open previous file :browse oldfiles than q than number of file -- to open previous file
:wviminfo! ~/tmp/viminfo in 1 vim than :rviminfo ~/tmm/viminfo in 2 vim :wviminfo! ~/tmp/viminfo in 1 vim than :rviminfo ~/tmm/viminfo in 2 vim
-- to save and restore information while still running Vim -- to save and restore information while still running Vim
:mksession vimbook.vim -- create a session file
:source vimbook.vim or vim -S vimbook.vim -- restore session
Example of project switching:
:wall
:mksession! ~/.vim/secret.vim
:source ~/.vim/boring.vim
Finding the file to edit (22):
edit . -- browse current directory
:cd -- changes current directory
:pwd -- show current directory
:lcd -- to change current directory, unti :lcd usage all windows points
to same directory
gf -- finds file with same name in current directory or in the PATH
:buffers -- list active buffers
:ls -- -||-
There is also information about buffer editing and switching over them,
but I'am too lazy to conspect it.
Editing other files:
vim -x exam.txt -- create, edit and save encrypted file
:set key= -- to turn off encryption
:X -- encrypt current file
Change binary file example:
vim -b datafile -- open file for binary editing
:%!xxd -- translate to HEX view
:%!xxd -r -- back to raw binary view
BTW it's possible to edit compressed formats (.Z, .gz, .bz2)
Hints: Hints:
There is lowercase and uppercase marks. Uppercase marks are global, they There is lowercase and uppercase marks. Uppercase marks are global, they
can help you to switch between the files. Lowercase marks are local for can help you to switch between the files. Lowercase marks are local for