mirror of
https://github.com/amix/vimrc
synced 2025-07-06 16:05:01 +08:00
pre final status
This commit is contained in:
@ -52,33 +52,6 @@ catch
|
||||
endtry
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Command mode related
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Smart mappings on the command line
|
||||
cno $h e ~/
|
||||
cno $d e ~/Desktop/
|
||||
cno $j e ./
|
||||
cno $c e <C-\>eCurrentFileDir("e")<cr>
|
||||
|
||||
" $q is super useful when browsing on the command line
|
||||
" it deletes everything until the last slash
|
||||
cno $q <C-\>eDeleteTillSlash()<cr>
|
||||
|
||||
" Bash like keys for the command line
|
||||
cnoremap <C-A> <Home>
|
||||
cnoremap <C-E> <End>
|
||||
cnoremap <C-K> <C-U>
|
||||
|
||||
cnoremap <C-P> <Up>
|
||||
cnoremap <C-N> <Down>
|
||||
|
||||
" Map ½ to something useful
|
||||
map ½ $
|
||||
cmap ½ $
|
||||
imap ½ $
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Parenthesis/bracket
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
@ -115,25 +88,6 @@ autocmd FileType css set omnifunc=csscomplete#CompleteCSS
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Helper functions
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
func! DeleteTillSlash()
|
||||
let g:cmd = getcmdline()
|
||||
|
||||
if has("win16") || has("win32")
|
||||
let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\]\\).*", "\\1", "")
|
||||
else
|
||||
let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*", "\\1", "")
|
||||
endif
|
||||
|
||||
if g:cmd == g:cmd_edited
|
||||
if has("win16") || has("win32")
|
||||
let g:cmd_edited = substitute(g:cmd, "\\(.*\[\\\\\]\\).*\[\\\\\]", "\\1", "")
|
||||
else
|
||||
let g:cmd_edited = substitute(g:cmd, "\\(.*\[/\]\\).*/", "\\1", "")
|
||||
endif
|
||||
endif
|
||||
|
||||
return g:cmd_edited
|
||||
endfunc
|
||||
|
||||
func! CurrentFileDir(cmd)
|
||||
return a:cmd . " " . expand("%:p:h") . "/"
|
||||
|
Reference in New Issue
Block a user