:set tabstop=4
如果要設定縮排,是:
:set shiftwidth=4
設完這兩個,縮排就會是 4
:~$ vim --version | grep xterm +balloon_eval +folding +mouse_xterm +termguicolors +eval +mouse_dec +statusline +xterm_clipboard +ex_extra +mouse_gpm -sun_workshop -xterm_saveref:
find /home/user -type f -name 'important'
-exec vi {} \;
其中有說明..
" a combination of spaces and tabs are
" used to simulate tab stops at a width
" other than the (hard)tabstop
set softtabstop=4
:JavaBrowser:set ffs=unixcolorscheme pablo
gvim () { command gvim --remote-tab-silent $@ || command gvim $@; }
這樣以後每次在 command line 用 gvim 開啟檔案時,都會自動加上 --remote-tab-silent 選項。 ctags -RCtrl-]Ctrl-T
在函数中移动光标的快捷键:
[{ 转到上一个位于第一列的"{"
}] 转到下一个位于第一列的"{"
{ 转到上一个空行
} 转到下一个空行
gd 转到当前光标所指的局部变量的定义
* 转到当前光标所指的单词下一次出现的地方
# 转到当前光标所指的单词上一次出现的地方:set ls=2
可以把這個寫在 vimrc 裡。:mksession
會把目前得的狀態存在目前目錄下的 Session.vim vi -S session.vim
就會回到剛剛的狀態。:mksession!
:mksession ~/mysession1.vim
#!/bin/sh
find . \
-path "arch/arm/*" -prune \
-o -path "include/asm-*" \
! -path "include/asm-i386*" -prune \
-o -path "tmp*" -prune \
-o -path "Documentation*" -prune \
-o -path "scripts*" -prune \
-o -path "drivers*" -prune \
-o -name "*.[chxsS]" -print > cscope.files
在 kernel source folder 執行完 script ,會在目錄下產生 cscope.files。cscope -b -q -k
Ctrl \ + g
到 定義的地方。Ctrl \ + d
列出這個 function 所有呼叫到的 function,讓你挑選。Ctrl \ + c
到 call 這個 function 的 code 去。Ctrl t
:cs help列出command....
find : Query for a pattern (Usage: find c|d|e|f|g|i|s|t name)
c: Find functions calling this function
d: Find functions called by this function
e: Find this egrep pattern
f: Find this file
g: Find this definition
i: Find files #including this file
s: Find this C symbol
t: Find assignments to
vi -p serial_core.c mxc_uart.c
:tabn
下一個 tab:tabp
上一個 tab :tabn 2
後2 個 tabtabc
set diffopt+=iwhiteCtrl-z
$fg
加上 enter: vsplit file
Ctrl-W W
: hide
hi DiffAdd term=reverse cterm=bold ctermbg=green ctermfg=white
hi DiffChange term=reverse cterm=bold ctermbg=cyan ctermfg=black
hi DiffText term=reverse cterm=bold ctermbg=gray ctermfg=black
hi DiffDelete term=reverse cterm=bold ctermbg=red ctermfg=black