.vimrc
流浪
posted @ 2008年5月05日 06:02
in Vim tips
, 6597 阅读
"进入用户目录
cd ~/.
"支持中文
let &termencoding=&encoding
set fileencodings=utf-8,gbk,cp936,big5
"颜色主题
"colorscheme chela_light
colorscheme two2tango
"字体设置
"set guifont=Bitstream\ Vera\ Sans\ Mono\ 10
"set guifont=Monaco
set guifont=Courier_New
"支持鼠标
set mouse=a
"设置文件浏览器目录为当前目录
set bsdir=buffer
set autochdir
"状态栏属性值一直存在
set laststatus=2
"show time in status
set statusline=%<%t%*\ %y\ %2*%r%m%*\ %l,%c\ %=%{strftime('%m/%d/%y-%H:%M')}\ \ %l/%L\ (%p%%)%*L
"the new window show bottle
set sb
"the new window show right
set spr
"退格键可以删除光标之前的字符
set backspace=indent,eol,start
"show line number
set number
"关闭工具条
set guioptions-=T
"关闭菜单栏
"set guioptions-=m
"打开状态栏标尺
set ru
"搜索时高亮显示
syntax on
"自动缩进时缩进为四个字符
set sw=4
"Tabp宽度为4个字符
set ts=4
"编辑时将所有TAB换成空格
set et
set smarttab "在上面的情况下一次可以删除四个空格
"
"不在单词中间断行
set lbr
"允许在两个汉字之间断行
set fo+=mB
"GVIM启动最大化
"au GUIEnter * simalt ~x
"不产生备份文件
set nobackup
"不要响铃
set vb t_vb=
"粘贴时保留原有格式
set paste
"优先使用中文文档
if version >= 603
set helplang=cn
endif
"关闭插入时跳来跳去的括号匹配
set nosm
"目录浏览 (这个有问题,会对vim下面提示造成影响)
"set nocp
"允许使用插件
filetype plugin indent on
"闭关开启画面
set shortmess+=I
"if has("gvim")
" colorscheme two2tango
"else
" colorscheme tango
"endif
"colorscheme two2tango
"高亮配置当前行
" set cursorline
" hi cursorline guibg=black
"允许光标在句子之间的移动
set whichwrap=b,s,<,> "普通模式有效
set whichwrap=b,s,<,>,[,] "插入模式有效
"查找高亮显示
set hls
set is
""python编程相关
""if has("autocmd")
""
"" " 自动检测文件类型并加载相应的设置
"" filetype plugin indent on
""
"" " Python 文件的一般设置,比如不要 tab 等
"" autocmd FileType python setlocal et | setlocal sta | setlocal sw=4
""
"" " Python Unittest 的一些设置
"" " 可以让我们在编写 Python 代码及 unittest 测试时不需要离开 vim
"" " 键入 :make 或者点击 gvim 工具条上的 make 按钮就自动执行测试用例
"" autocmd FileType python compiler pyunit
"" autocmd FileType python setlocal makeprg=python
"" "autocmd FileType python setlocal makeprg=python\ alltests.py
"" "autocmd BufNewFile,BufRead test*.py setlocal makeprg=python\ %
""
"" "" 自动使用新文件模板
"" "autocmd BufNewFile test*.py 0r ~/.vim/skeleton/test.py
"" "autocmd BufNewFile alltests.py 0r ~/.vim/skeleton/alltests.py
"" "autocmd BufNewFile *.py 0r ~/.vim/skeleton/skeleton.py
""
""endif
"
""调用python来编译当前py文件
""set makeprg=python\ %<.py
""set makeprg=deplate -m zh-cn -t bright.html -f html --css bright -d ~/publish/viki\ %<.viki
"
"输入字符时隐藏鼠标指针
set mousehide
"在normal模式下先后按下,s重新加载.vimrc配置文件
nmap ,s :source ~/.vimrc<cr>
""config viki
"let g:vikiNameSuffix=".viki"
"augr viki
"au!
"autocmd! BufRead,BufNewFile *.viki set filetype=viki
"augr END
"
"set nocompatible
"在键盘大写开的情况下以下命令仍有用
command! Q quit
command! W write
command! Wq wq
"avoid the "Hit ENTER to contunue" prompt
set shortmess=a
"增加命令行高度为2
"set cmdheight=2
"光标移动时识别物理上的一行。
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
nnoremap <Down> gj
nnoremap <Up> gk
vnoremap <Down> gj
vnoremap <Up> gk
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk
"设置工作目录为当前目录
function! CHANGE_CURR_DIR()
let _dir = expand("%:p:h")
exec "cd " . _dir
unlet _dir
endfunction
autocmd BufEnter * call CHANGE_CURR_DIR()
"编辑html时标签设为小写
let g:html_tag_case = "lowercase"
"搜索时忽略大小写
set ignorecase
"区分大小写
"set noignorecase
"编写html的相关设置closetag.vim
au Filetype html,xml,xsl source ~/.vim/plugin/closetag.vim
"set makeprg=firefox\ %<.html
"map <F10> :make<cr>
"gvim着色设置
"about perl program
set makeprg=perl
map <F10> :make %<cr>
"用<F9>保存并更新当前文件
map <F9> <ESC>:w<cr>:e %<cr>
"用<F4>来取代:noh
map <F4> :noh<cr>
"用<F5>来取代:hide
map <F5> :hide<cr>
"给TAB加上编号,可以用ALT+O~1切换到相应的tab
map <M-1> 1gt
map <M-2> 2gt
map <M-3> 3gt
map <M-4> 4gt
cd ~/.
"支持中文
let &termencoding=&encoding
set fileencodings=utf-8,gbk,cp936,big5
"颜色主题
"colorscheme chela_light
colorscheme two2tango
"字体设置
"set guifont=Bitstream\ Vera\ Sans\ Mono\ 10
"set guifont=Monaco
set guifont=Courier_New
"支持鼠标
set mouse=a
"设置文件浏览器目录为当前目录
set bsdir=buffer
set autochdir
"状态栏属性值一直存在
set laststatus=2
"show time in status
set statusline=%<%t%*\ %y\ %2*%r%m%*\ %l,%c\ %=%{strftime('%m/%d/%y-%H:%M')}\ \ %l/%L\ (%p%%)%*L
"the new window show bottle
set sb
"the new window show right
set spr
"退格键可以删除光标之前的字符
set backspace=indent,eol,start
"show line number
set number
"关闭工具条
set guioptions-=T
"关闭菜单栏
"set guioptions-=m
"打开状态栏标尺
set ru
"搜索时高亮显示
syntax on
"自动缩进时缩进为四个字符
set sw=4
"Tabp宽度为4个字符
set ts=4
"编辑时将所有TAB换成空格
set et
set smarttab "在上面的情况下一次可以删除四个空格
"
"不在单词中间断行
set lbr
"允许在两个汉字之间断行
set fo+=mB
"GVIM启动最大化
"au GUIEnter * simalt ~x
"不产生备份文件
set nobackup
"不要响铃
set vb t_vb=
"粘贴时保留原有格式
set paste
"优先使用中文文档
if version >= 603
set helplang=cn
endif
"关闭插入时跳来跳去的括号匹配
set nosm
"目录浏览 (这个有问题,会对vim下面提示造成影响)
"set nocp
"允许使用插件
filetype plugin indent on
"闭关开启画面
set shortmess+=I
"if has("gvim")
" colorscheme two2tango
"else
" colorscheme tango
"endif
"colorscheme two2tango
"高亮配置当前行
" set cursorline
" hi cursorline guibg=black
"允许光标在句子之间的移动
set whichwrap=b,s,<,> "普通模式有效
set whichwrap=b,s,<,>,[,] "插入模式有效
"查找高亮显示
set hls
set is
""python编程相关
""if has("autocmd")
""
"" " 自动检测文件类型并加载相应的设置
"" filetype plugin indent on
""
"" " Python 文件的一般设置,比如不要 tab 等
"" autocmd FileType python setlocal et | setlocal sta | setlocal sw=4
""
"" " Python Unittest 的一些设置
"" " 可以让我们在编写 Python 代码及 unittest 测试时不需要离开 vim
"" " 键入 :make 或者点击 gvim 工具条上的 make 按钮就自动执行测试用例
"" autocmd FileType python compiler pyunit
"" autocmd FileType python setlocal makeprg=python
"" "autocmd FileType python setlocal makeprg=python\ alltests.py
"" "autocmd BufNewFile,BufRead test*.py setlocal makeprg=python\ %
""
"" "" 自动使用新文件模板
"" "autocmd BufNewFile test*.py 0r ~/.vim/skeleton/test.py
"" "autocmd BufNewFile alltests.py 0r ~/.vim/skeleton/alltests.py
"" "autocmd BufNewFile *.py 0r ~/.vim/skeleton/skeleton.py
""
""endif
"
""调用python来编译当前py文件
""set makeprg=python\ %<.py
""set makeprg=deplate -m zh-cn -t bright.html -f html --css bright -d ~/publish/viki\ %<.viki
"
"输入字符时隐藏鼠标指针
set mousehide
"在normal模式下先后按下,s重新加载.vimrc配置文件
nmap ,s :source ~/.vimrc<cr>
""config viki
"let g:vikiNameSuffix=".viki"
"augr viki
"au!
"autocmd! BufRead,BufNewFile *.viki set filetype=viki
"augr END
"
"set nocompatible
"在键盘大写开的情况下以下命令仍有用
command! Q quit
command! W write
command! Wq wq
"avoid the "Hit ENTER to contunue" prompt
set shortmess=a
"增加命令行高度为2
"set cmdheight=2
"光标移动时识别物理上的一行。
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
nnoremap <Down> gj
nnoremap <Up> gk
vnoremap <Down> gj
vnoremap <Up> gk
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk
"设置工作目录为当前目录
function! CHANGE_CURR_DIR()
let _dir = expand("%:p:h")
exec "cd " . _dir
unlet _dir
endfunction
autocmd BufEnter * call CHANGE_CURR_DIR()
"编辑html时标签设为小写
let g:html_tag_case = "lowercase"
"搜索时忽略大小写
set ignorecase
"区分大小写
"set noignorecase
"编写html的相关设置closetag.vim
au Filetype html,xml,xsl source ~/.vim/plugin/closetag.vim
"set makeprg=firefox\ %<.html
"map <F10> :make<cr>
"gvim着色设置
"about perl program
set makeprg=perl
map <F10> :make %<cr>
"用<F9>保存并更新当前文件
map <F9> <ESC>:w<cr>:e %<cr>
"用<F4>来取代:noh
map <F4> :noh<cr>
"用<F5>来取代:hide
map <F5> :hide<cr>
"给TAB加上编号,可以用ALT+O~1切换到相应的tab
map <M-1> 1gt
map <M-2> 2gt
map <M-3> 3gt
map <M-4> 4gt
2022年9月14日 16:16
Bihar School Examination, Patna Board and various private school teaching staff of the state have designed and suggested the Secondary Education Class 8th Standard study & learning material as Bihar Board 8th Class Model Paper 2023 with Mock Test and Practice Questions for Paper-1 & Papert-2 Exams held under Term1 & Term2 of the Course through BSEB STD-8 Model Set 2023 to Theory, Objective (MCQ) and Bit Questions. Bihar Board Question Paper Class 8 Every Secondary Education Student who studying their High School Level Class 8th Standard in BSEB Government or Private schools can download the BSEB 8th Class Question Paper 2023.
2022年11月21日 17:20
Your article is very useful, the content is great
2022年12月13日 18:20
I sincerely appreciate you sharing this fantastic article. You worked really hard to provide us with engaging content. I've learned so much by reading this post.
2024年10月02日 17:15
The command 进入用户目录 translates to "Enter the user directory," which is an essential step in navigating a system's file structure. Using cd ~/ allows users to quickly access their home directory, streamlining the workflow, especially in environments like Linux or macOS.
2024年11月06日 14:03
This post is really engaging! The content is well-written and kept me hooked from start to finish. It offers a great perspective and is thoughtfully written.
2025年4月14日 09:18
Thank you! I'm glad you found it engaging. Crafting compelling content is a passion. A well-structured narrative can truly capture attention and deliver a valuable perspective. Speaking of engaging experiences, have you tried online tetris lately? If you're looking for a new challenge or just want to relive the classic, check out https://tetris.one/. It offers various modes and keeps the iconic gameplay fresh. It's a great place to experience classic tetris.
2025年5月27日 21:09
I sincerely appreciate you sharing this fantastic article. You worked really hard to provide us with engaging content. I've learned so much by reading this post.check out http://papasgames3d.com/
2025年5月27日 21:10
I sincerely appreciate you sharing this fantastic article. You worked really hard to provide us with engaging content. I've learned so much by reading this post.check out <a href="http://papasgames3d.com/">Papa's Games</a>
2025年6月28日 16:04
In today's digital age, having access to reliable calculation tools is more important than ever. Whether you're a student, professional, or everyday user, online calculators have become indispensable tools in our daily lives.
2025年7月28日 19:10
What is Monkey Mart?
Monkey Mart is a modern retail store that offers a wide variety of products ranging from fresh produce and groceries to household items and personal care products. Strategically designed to enhance the shopping experience, Monkey Mart provides a vibrant atmosphere where customers can find high-quality essentials at competitive prices. Whether you’re looking for your weekly groceries or last-minute necessities, Monkey Mart is your one-stop destination for convenience and freshness
2025年8月12日 08:00
Introduction to Make QR Code
If you're looking for a fast and simple way to generate QR codes, Make QR is a great tool to try. This free and user-friendly website allows you to create custom QR codes for links, text, contact info, and more — all without needing to sign up or install anything.
With just a few clicks, you can generate a QR code and download it instantly. Whether you're promoting a website, sharing a Wi-Fi password, or storing personal information, Make QR provides a convenient and efficient solution.
Try it now: [make qr](https://make-qr.github.io/)
2025年8月12日 08:01
Introduction to Make QR Code
If you're looking for a fast and simple way to generate QR codes, Make QR is a great tool to try. This free and user-friendly website allows you to create custom QR codes for links, text, contact info, and more — all without needing to sign up or install anything.
With just a few clicks, you can generate a QR code and download it instantly. Whether you're promoting a website, sharing a Wi-Fi password, or storing personal information, Make QR provides a convenient and efficient solution.
Try it now: [url=https://make-qr.github.io/]make qr[/url]
2026年7月11日 08:09
The Serendipitous Click: How a Random Chat on Omegle Chat Changed My World
In a digital landscape crowded with curated feeds, perfectly filtered photos, and calculated algorithms, there is a certain magic to the unplanned. Most of our online interactions today are predictable. We know who we are messaging, what they look like, and generally what to expect.
2026年8月24日 22:31
This is a useful Vim configuration for Python developers who want to make unit testing faster and more convenient. The setup connects unittest with Vim’s :make command and Quickfix functionality, allowing test errors to be parsed and reviewed directly inside the editor. Vim’s documentation confirms that the pyunit compiler can parse Python test output, while makeprg can be configured to run either individual tests or an entire test suite.
This also connects nicely with Omezy, where you can talk to strangers, meet new people, and discover new conversations. Developers can exchange Vim tips, testing techniques, and programming experiences with people from different backgrounds, turning technical discussions into useful connections and fresh ideas.
2026年9月10日 12:08
If you told me a few months ago that I’d be ditching mainline Pokémon titles to grind an endless, browser-based roguelite fusion, I would have laughed you out of the room. Yet here I am, bleary-eyed at 2 AM, agonizing over whether to take a Multi-Lens or a Silk Scarf after clearing floor 150 of Classic Mode. If you haven't dived into PokéRogue yet, stop whatever you're doing. It takes everything we love about traditional turn-based Pokémon combat, strips away the hand-holding, and throws it into a meat-grinder of shifting biomes, brutal boss fights, and agonizing RNG.
2026年9月25日 23:43
Random Chat on Omezy Turned Into My Favorite Story
We’ve all had those late nights. You know the ones—where you’re staring at your phone screen, exhausted yet wired, craving a real human connection or just someone to bounce thoughts off of without any judgment.
A few months ago, on one of those quiet Tuesdays, I decided to try something different. A friend had mentioned <a href="https://omezy.love/">omezy</a>
, an online platform designed for meeting and talking with strangers instantly. Honestly, I was skeptical. Would it just be endless skips, awkward silences, or bot messages?
2026年9月25日 23:44
Random Chat on Omezy Turned Into My Favorite Story
We’ve all had those late nights. You know the ones—where you’re staring at your phone screen, exhausted yet wired, craving a real human connection or just someone to bounce thoughts off of without any judgment.
A few months ago, on one of those quiet Tuesdays, I decided to try something different. A friend had mentioned Omezy, an online platform designed for meeting and talking with strangers instantly. Honestly, I was skeptical. Would it just be endless skips, awkward silences, or bot messages?
2026年10月05日 21:20
Welcome to Monkey Mart: The Ultimate Supermarket Management Game If you enjoy engaging management games that combine fun gameplay with satisfying progression, Monkey Mart is the perfect game for you. Designed to keep players entertained for hours, this popular idle management simulator lets you take charge of your very own supermarket, growing a humble fruit stand into a bustling retail empire. How to Play https://cookie-clicker.one/The core gameplay of Monkey Mart is simple, intuitive, and highly addictive. You play as an energetic monkey entrepreneur responsible for running all daily store operations
2026年10月05日 21:21
2026年10月05日 21:27
is the perfect game for you. Designed to keep players entertained for hours, this popular idle management simulator lets you take charge of your very own supermarket, growing a humble fruit stand into a bustling retail empire.
2026年10月05日 21:29
Setting up proper Vim encodings like UTF-8 alongside comfortable font configurations ensures a seamless workflow for any programmer. Whenever you need a short breather after customizing your text editor environment, stepping back for a lighthearted pause keeps you sharp. Enjoy a fun and relaxing gaming session playing cookie clicker on https://cookie-clicker.one.
2026年10月08日 06:25
How an Omegle Chat Turned a Stranger into a Lifelong Friend
The internet has fundamentally transformed how we connect with the world around us. Meeting someone new no longer requires stepping into a crowded room or attending formal networking events. With random online chat platforms inspired by Omegle, a meaningful conversation with someone thousands of miles away is just a single click away.
https://omeglechat.online/
While many interactions on these sites last only a few fleeting moments, occasionally, a chance encounter turns into something extraordinary. This is the story of how one simple decision to talk with stranger online ended up changing two lives forever.