my .vimrc
0
Here is my .vimrc file on a SUSE SLE11-SP3 box
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
set nu
set laststatus=10
set autoindent
set tabstop=2
set shiftwidth=2
set smartindent
set expandtab
syntax on
set textwidth=79
set formatoptions=qrn1
“if version >= 703
if exists(‘+colorcolumn’)
set colorcolumn=80
endif
set history=500
set nobackup
set noswapfile
“set list
“set listchars=tab:.\ ,trail:.,extends:#,nbsp:.
set listchars=tab:▸\ ,eol:¬,extends:#,nbsp:.,trail:.
if has(“gui_running“)
set guifont=DEC\ Terminal
“colorscheme darkblue
colorscheme evening
set guioptions-=r
set go-=L
set go-=T
else
colorscheme darkblue
endif
“line tracking
set numberwidth=5
set cursorline
set cursorcolumn
“ turn off cursor blinking
set guicursor+=a:blinkon0
|
working with 1st or last characters of every line in vim
Remove the last char from every line
1
|
:%s/.$//g
|
Insert a * in the beginning/end of every line
1
2
3
4
5
6
|
:%norm I*
% = for every line
norm = type the following commands
A* = append ‘*’ to the end of every line
I* = insert ‘*’ to the beginning of every line
|
Block insert with vim
Vi block insert (i.e // in front of a block of lines)
1
2
3
4
5
6
7
8
9
10
11
|
Method #1)
– vi sameple_file.txt
– Ctrl + V
– Make selection by moving the cursor (j/k/l/h)
– Shift + i
– insert the text “//”
– Press ESC to finish.
Method #2)
– visually select the text rows (using V as usual)
– :norm i#
|