vim之基礎配置


vim之基礎配置

安裝方式

sudo apt-get install vim

無插件配置(簡單配置)

.vimrc文件

""""""""""""""""""""""""""""""""
"Interface
""""""""""""""""""""""""""""""""
set nu		"show line number
syntax enable	"syntax highlight  
syntax on

""""""""""""""""""""""""""""""""
"Key command
""""""""""""""""""""""""""""""""    
set tabstop=4	"set Tab = 4
set softtabstop=4   	"indent= 4
set shiftwidth=4 

""""""""""""""""""""""""""""""""
"Compile
""""""""""""""""""""""""""""""""
map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
    exec "w"
    if &filetype == 'c'
        exec "!g++ % -o %<"
	exec "! ./%<"
    elseif &filetype == 'cpp'
        exec "!g++ % -o %<"
        exec "! ./%<"
    elseif &filetype == 'java' 
        exec "!javac %" 
        exec "!java %<"
    elseif &filetype == 'sh'
        :!./%
    endif
endfunc

"""""""""""""""""""""""""""""""""
"Debug
"""""""""""""""""""""""""""""""""	
map <F8> :call Rungdb()<CR>
func! Rungdb()
    exec "w"
    exec "!g++ % -g -o %<"
    exec "!gdb ./%<"
endfunc

""""""""""""""""""""""""""""""""""
"Others
""""""""""""""""""""""""""""""""""
filetype plugin indent on
set autowrite				
set ruler           
set cursorline              
set magic                   
set guioptions-=T           
set guioptions-=m           
set autoindent
set cindent
set mouse=a  " always use mouse 

我的界面


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM