Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add append char functionality #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion plugin/insert-char.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ function! <SID>InsertChar(char, count)
endfunction

nnoremap <silent> <Plug>InsertChar :<C-U>exec "normal i".<SID>InsertChar(nr2char(getchar()), v:count1)<CR>
nnoremap <silent> <Plug>AppendChar :<C-U>exec "normal a".<SID>InsertChar(nr2char(getchar()), v:count1)<CR>

if !exists('g:insert_char_no_default_mapping') || (g:insert_char_no_default_mapping == 0)
nmap <Space> <Plug>InsertChar
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave this as <Space>. It's not wise to change existing defaults without a good reason.

nmap _ <Plug>InsertChar
end

if !exists('g:append_char_no_default_mapping') || (g:append_char_no_default_mapping == 0)
nmap - <Plug>AppendChar
end