vim file.c +10
: Openfile.c
directly at line 10 (doesn't work withvi
, onlyvim
)git diff | vim -
: View the output of a command in vim (git diff
command in this example)
gg
: go to file startGG
: go to file end0
: go to line start$
: go to line end:10
: go to line number 10[[
,]]
: jump to previous/next of the class or functiongf
: Go To File, open the file with the file name under the cursor
:vs
: Vertical Split:split
: Horizontal Split:%bd
: close all buffers
- Go to a function definition using ctags:
- Run ":ctags -R" to create an index of symbols (classes, functions, variables)
- Put the cursor on a symbol:
CTRL+[
goes to the symbol defintion
- Open a file from encoding cp850:
:e ++enc=cp850 document.txt
- Number of lines of a selection:
- Create a section
- Press
g
and thenCTRL+g
.
- gvim configuration files for user
vstinner
:C:\Users\vstinner\_vimrc
: vim configuration, same than~/.vimrc
on UnixC:\Users\vstinner\_gvimrc
: gvim configuration, same than~/.gvimrc
on Unix
Create a symbol link for configuration files using python:
C:\Users\vstinner>python Python 3.8.0 >>> import os >>> os.symlink(r'\vstinner\misc\conf\vimrc', '_vimrc') >>> os.symlink(r'\vstinner\misc\conf\gvimrc', '_gvimrc')
Create a symbol links:
- from
C:\vstinner\misc\conf\vimrc
toC:\Users\vstinner\_vimrc
- from
C:\vstinner\misc\conf\gvimrc
toC:\Users\vstinner\_gvimrc