Nếu bạn muốn có một sắp xếp, danh sách tìm kiếm của ánh xạ hiện tại của bạn, trong đó để tìm kiếm chìa khóa không sử dụng, bạn có thể làm như sau:
function! s:ShowMaps()
let old_reg = getreg("a") " save the current content of register a
let old_reg_type = getregtype("a") " save the type of the register as well
try
redir @a " redirect output to register a
" Get the list of all key mappings silently, satisfy "Press ENTER to continue"
silent map | call feedkeys("\<CR>")
redir END " end output redirection
vnew " new buffer in vertical window
put a " put content of register
" Sort on 4th character column which is the key(s)
%!sort -k1.4,1.4
finally " Execute even if exception is raised
call setreg("a", old_reg, old_reg_type) " restore register a
endtry
endfunction
com! ShowMaps call s:ShowMaps() " Enable :ShowMaps to call the function
nnoremap \m :ShowMaps<CR> " Map keys to call the function
Đây là một mạnh mẽ để tạo ra một phân chia theo chiều dọc với đầu ra được sắp xếp của :maps
. Tôi đặt nó trong vimrc
của tôi.
Dòng cuối cùng ánh xạ hai phím \m để gọi hàm, thay đổi điều này theo ý muốn.
Lưu ý: Như @romainl đề cập, điều này sẽ không bao gồm các lệnh như i để chèn văn bản
Nguồn
2016-08-03 06:02:57
Câu trả lời này có thể giúp http://stackoverflow.com/a/5391019/32090 –
': giúp đỡ index' có vẻ tốt, nhưng nó không hiển thị các phím tắt plugin của tôi. – daniloisr