i use vim with snipMate But I find this problemif (true) {|};在TextMate中,按Enter键后.查看光标in TextMate After pressing Enter key .. Look at the cursorif (true) { |};在vim中按Enter键后.查看光标in vim After pressing Enter key .. Look at the cursorif (true) {|};如何制作vim,例如TextMateHow to Make vim , such as TextMate谢谢 编辑edit这是我的vimrcfiletype on " Enable filetype detectionfiletype indent on " Enable filetype-specific indentingfiletype plugin on " Enable filetype-specific plugins" New Tabnnoremap <silent> <C-t> :tabnew<CR>" Next Tabnnoremap <silent> <C-Right> :tabnext<CR>" Previous Tabnnoremap <silent> <C-Left> :tabprevious<CR>abbrev ff :! Open -a Firefox.app %:p<cr>abbrev gc :! Open -a Chrome.app %:p<cr>" Set off the other parenhighlight MatchParen ctermbg=4" }}}"{{{Look and Feel" Favorite Color Scheme colorscheme sunburst set guioptions-=T" When I close a tab, remove the bufferset nohidden" Highlight things that we find with the searchset hlsearch" Incremental searching is sexyset incsearch" This is totally awesome - remap jj to escape in insert mode. You'll never type jj anyway, so it's great!inoremap jj <Esc>" And so is Artificial Intellegence!set smartcase" Enable mouse support in consoleset mouse=a" Got backspace?set backspace=2" Line Numbers PWN!set number" Ignoring case is a fun trickset ignorecase" Who wants an 8 character tab? Not me!set shiftwidth=3set softtabstop=3" Spaces are better than a tab characterset expandtabset smarttab" Who doesn't like autoindent?set autoindentset smartindentset tabstop=4set shiftwidth=4set expandtab" Needed for Syntax Highlighting and stufffiletype onfiletype plugin onsyntax enableset grepprg=grep\ -nH\ $*set foldmethod=indentset foldnestmax=10set nofoldenableset foldlevel=1" This shows what you are typing as a command. I love this!set showcmdset culhi CursorLine term=none cterm=none ctermbg=3set tabstop=2set ruler " show the line number on the barset autoread " watch for file changesset backspace=indent,eol,startset cmdheight=2 " command line two lines highset undolevels=1000 " 1000 undos"map a change directory in desktopnmap ,d :cd C:\Users\Tarek\Desktop<cr>:e.<cr>""""""""""""""""""""""""""""""" => Visual mode related""""""""""""""""""""""""""""""" Really useful!" In visual mode when you press * or # to search for the current selectionvnoremap <silent> * :call VisualSearch('f')<CR>vnoremap <silent> # :call VisualSearch('b')<CR>" When you press gv you vimgrep after the selected textvnoremap <silent> gv :call VisualSearch('gv')<CR>map <leader>g :vimgrep // **/*.<left><left><left><left><left><left><left>function! CmdLine(str) exe "menu Foo.Bar :" . a:str emenu Foo.Bar unmenu Fooendfunction" From an idea by Michael Naumannfunction! VisualSearch(direction) range let l:saved_reg = @" execute "normal! vgvy" let l:pattern = escape(@", '\\/.*$^~[]') let l:pattern = substitute(l:pattern, "\n$", "", "") if a:direction == 'b' execute "normal ?" . l:pattern . "^M" elseif a:direction == 'gv' call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.') elseif a:direction == 'f' execute "normal /" . l:pattern . "^M" endif let @/ = l:pattern let @" = l:saved_regendfunction"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" => Command mode related"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Smart mappings on the command linecno $h e ~/cno $d e ~/Desktop/cno $j e ./cno $c e <C-\>eCurrentFileDir("e")<cr>cno $u e ftp://[email protected]/www/" $q is super useful when browsing on the command linecno $q <C-\>eDeleteTillSlash()<cr>" Bash like keys for the command linecnoremap <C-A> <Home>cnoremap <C-E> <End>cnoremap <C-K> <C-U>cnoremap <C-P> <Up>cnoremap <C-N> <Down>"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Opens file in buffer in Chromeabbrev ch :! @start "" /b "C:\Program Files\Google\Chrome\Application\chrome.exe" %:p"Opens file in buffer in Firefoxabbrev fc :! @start "" /b "C:\Program Files\Mozilla Firefox\firefox.exe" %:p""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""imap <C-e> <C-y>,imap <C-j> <C-x><C-o>"" set guifont=Inconsolata\ 16set nocp if version >= 600 filetype plugin indent on endif let g:netrw_alto = 1" Use menu to show command-line completion (in 'full' case)set wildmenu" Set command-line completion mode:" - on first <Tab>, when more than one match, list all matches and complete" the longest common string" - on second <Tab>, complete the next full match and show menuset wildmode=list:longest,full" Show the bookmarks table on startuplet NERDTreeShowBookmarks=1let b:surround_indent = 1au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquerylet g:js_indent_log = 0推荐答案将其放入您的.vimrc文件:Put this into your .vimrc file:inoremap {<cr> {<CR><CR>}<Esc>-cc 这篇关于我想像TextMate一样做vim snipMate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的..
09-07 01:08