Просмотр исходного кода

add mapping for yank to end of line for vim

Weiyi Lou 13 лет назад
Родитель
Сommit
3422d813a1
1 измененных файлов с 19 добавлено и 74 удалено
  1. 19 74
      vim/vimrc

+ 19 - 74
vim/vimrc

@@ -137,21 +137,24 @@ set magic       " enables wildcard searching
 
 
 """"""""
-"" Key Remaps and Shortcuts 
+"" Key Remaps
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""
 
 let mapleader = "," "Leader key lets you make more kinds of shortcuts!
 
-" Edit .vimrc
-map <leader>v   :e $MYVIMRC<CR>
-
 " More convenient escape
 imap ii <Esc>
 imap II <Esc>
 
+" Yank to end of line, like D
+nmap Y y$
+
 " Add extra lines up and down
-nmap <leader>j o<Esc>k
-nmap <leader>k O<Esc>j
+nmap <leader>j    o<Esc>k
+nmap <leader>k    O<Esc>j
+
+" Edit .vimrc
+nmap <leader>v    :e $MYVIMRC<CR>
 
 nmap <silent> <leader>n    :set number!<CR>
 nmap <silent> <leader>w    :set wrap!<CR>
@@ -166,23 +169,24 @@ nmap <silent> <leader>l    :set list!<CR>
 nmap <silent> <leader>s    :set scrollbind! scrollbind?<CR>
 
 " Toggle mouse support.
-nnoremap <leader>m         :call ToggleMouse()<CR>
+nmap <silent> <leader>m    :call ToggleMouse()<CR>
 
 " Toggle NERDTree file browser
-nnoremap <silent> <leader>d    :NERDTreeToggle<CR>
+nmap <silent> <leader>d    :NERDTreeToggle<CR>
 
 " Toggle Commenting out lines with NERDCommenter
-nnoremap <silent> <leader>,    :call NERDComment("n", "toggle")<CR>
-vnoremap <silent> <leader>,    <ESC>:call NERDComment("x", "toggle")<CR>
+nmap <silent> <leader>,    :call NERDComment("n", "toggle")<CR>
+vmap <silent> <leader>,    <ESC>:call NERDComment("x", "toggle")<CR>
 
 " Traverse undo tree with Gundo!
-nnoremap <leader>u :GundoToggle<CR>
+nmap <silent> <leader>u    :GundoToggle<CR>
 
 " Git blame with Fugitive!
-nnoremap <leader>b :Gblame<CR>
+nmap <silent> <leader>b    :Gblame<CR>
 
 " Code heirarchy with Tagbar!
-nnoremap <leader>t :TagbarToggle<CR>
+nmap <silent> <leader>t    :TagbarToggle<CR>
+
 
 """"""""
 "" Key Remaps - Movement and Windows
@@ -240,7 +244,8 @@ let g:did_auto_closetag = 1  " Disable html autoclose plugin
 
 
 """"""""" Powerline
-let g:Powerline_symbols = 'compatible'
+let g:Powerline_symbols = 'compatible' " alternatives: fancy, unicode
+
 
 """"""""
 "" Functions, the Givers of Power (in order of use)
@@ -272,63 +277,3 @@ function! ScreenMovement(movement)
         return a:movement
     endif
 endfunction
-
-
-""""""""
-"" Graveyard
-""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-
-"Old statusline options
-"set statusline=%f\  " short filepath
-"set statusline+=%h  " help flag
-"set statusline+=%w  " preview flag
-"set statusline+=%r  " read-only flag
-"set statusline+=%m  " modified flag
-"set statusline+=%=  " left-right aligned item separator
-""set statusline+=Chr:%B/%b " character value under cursor
-"set statusline+=%{fugitive#statusline()}
-"if exists("*strftime")
-  "set statusline+=\ \ %{strftime('%a\ %d\ %b\ %H:%M')}
-"endif
-"set statusline+=\ \ %-14(Line:%l/%L%)
-"set statusline+=%-11(Col:%c%V%)
-"set statusline+=Scroll:%P
-
-" Colemak layout for INSERT mode only
-" Qwerty  - qwertyuiopasdfghjkl;'zxcvbnm,./
-" Colemak - qwfpgjluy;arstdhneio'zxcvbkm,./
-"inoremap <silent> e f
-"inoremap <silent> r p
-"inoremap <silent> t g
-"inoremap <silent> y j
-"inoremap <silent> u l
-"inoremap <silent> i u
-"inoremap <silent> o y
-"inoremap <silent> p ;
-"inoremap <silent> s r
-"inoremap <silent> d s
-"inoremap <silent> f t
-"inoremap <silent> g d
-"inoremap <silent> j n
-"inoremap <silent> k e
-"inoremap <silent> l i
-"inoremap <silent> ; o
-"inoremap <silent> n k
-
-"inoremap <silent> E F
-"inoremap <silent> R P
-"inoremap <silent> T G
-"inoremap <silent> Y J
-"inoremap <silent> U L
-"inoremap <silent> I U
-"inoremap <silent> O Y
-"inoremap <silent> P :
-"inoremap <silent> S R
-"inoremap <silent> D S
-"inoremap <silent> F T
-"inoremap <silent> G D
-"inoremap <silent> J N
-"inoremap <silent> K E
-"inoremap <silent> L I
-"inoremap <silent> : O
-"inoremap <silent> N K