作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 Vim 中,如何用换行符分隔文本行?
例如,我处于 INSERT
模式,我想从这里开始...
$('#toggle_contact_search_mode').click([CURSOR IS HERE]);
到这里...
$('#toggle_contact_search_mode').click(
[CURSOR IS HERE]
);
我得到的结果是,当我处于插入模式并且光标位于上面的第一个位置并按回车键时...
$('.edit_phone_number').ajaxForm({
success: function(response) {
$('input, select, textarea', '.edit_phone_number').removeClass('updating');
}
});
$('input, select, textarea', '.edit_phone_number').focus(function(event) {
$(event.target).removeClass('updating').addClass('focussed');
});
我根本不想进行任何重新格式化。我只想让 Vim 输入换行符并保持插入模式。
更新
当我暂时删除 .vimrc
文件时,Vim 的行为符合预期。我的.vimrc
:
" ==================================================================================
" Global stuff
" ==================================================================================
" Prevent Vim from emulating vi bugs and limitations
:set nocompatible
" Custom status line based on one from here:
" http://www.linux.com/archive/feature/120126
:set statusline=\ \ %f\ \ [FORMAT=%{&ff}]\ \ [TYPE=%Y]\ \ [POS=%04l,%04v][%p%%]\ \ [LEN=%L]
" Set status line colors
highlight StatusLine term=reverse ctermfg=DarkBlue ctermbg=Grey
" Set status line to be shown above the command buffer.
:set laststatus=2
" Enable syntax highlighting
:syntax on
" Enable line numbering, taking up 6 spaces
:set number
" Allow <BkSpc> to delete line breaks, beyond the start of the current
" insertion, and over indentations
" set backspace=eol,start,indent
" ==================================================================================
" Searching
" ==================================================================================
" Highlight matches as you type in the search string
:set incsearch
:set showmatch
" When searching ignore case (except explicit caps)
:set ignorecase
:set smartcase
" ==================================================================================
" Indenting
" ==================================================================================
" Copy indent from current line when starting a new line
" :set autoindent
"
" :set smartindent
" :filetype plugin on
" indent depends on filetype
" :filetype indent on
:set tabstop=2
:set softtabstop=2
:set shiftwidth=2
:set expandtab
" ==================================================================================
" Mappings
" ==================================================================================
" ESC
imap <C-k> <ESC>
" Go to the next tab
nmap <C-j> gt
imap <C-j> <ESC>gt
" Auto indent entire file.
" Sets a mark ("mt""), moves across the whole file to indent it ("gg=G"),
" then returns to the mark ("'t").
nmap <C-m> mtgg=G't
imap <C-m> <ESC><C-m>
最佳答案
您的问题是imap <C-m>
映射——control-M 在逻辑上等同于在终端上输入。
关于vim - 如何在行的中间输入换行符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1652416/
我是一名优秀的程序员,十分优秀!