Skip to content

Commit 63a707f

Browse files
committed
Merge pull request #32 (use *noremap commands to define mappings)
2 parents 6107bdf + 563ddd6 commit 63a707f

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

autoload/xolox/notes.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
" Note: This file is encoded in UTF-8 including a byte order mark so
77
" that Vim loads the script using the right encoding transparently.
88

9-
let g:xolox#notes#version = '0.17.7'
9+
let g:xolox#notes#version = '0.17.8'
1010
let s:scriptdir = expand('<sfile>:p:h')
1111

1212
call xolox#misc#compat#check('notes', 1)

ftplugin/notes.vim

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,31 +57,31 @@ set completeopt+=longest
5757

5858
" Change double-dash to em-dash as it is typed. {{{1
5959
if g:notes_smart_quotes && xolox#notes#unicode_enabled()
60-
imap <buffer> --
60+
inoremap <buffer> --
6161
let b:undo_ftplugin .= ' | execute "iunmap <buffer> --"'
6262
endif
6363

6464
" Change plain quotes to curly quotes as they're typed. {{{1
6565
if g:notes_smart_quotes
66-
imap <buffer> <expr> ' xolox#notes#insert_quote(1)
67-
imap <buffer> <expr> " xolox#notes#insert_quote(2)
66+
inoremap <buffer> <expr> ' xolox#notes#insert_quote(1)
67+
inoremap <buffer> <expr> " xolox#notes#insert_quote(2)
6868
let b:undo_ftplugin .= ' | execute "iunmap <buffer> ''"'
6969
let b:undo_ftplugin .= ' | execute ''iunmap <buffer> "'''
7070
endif
7171

7272
" Change ASCII style arrows to Unicode arrows. {{{1
7373
if g:notes_smart_quotes && xolox#notes#unicode_enabled()
74-
imap <buffer> ->
75-
imap <buffer> <-
74+
inoremap <buffer> ->
75+
inoremap <buffer> <-
7676
let b:undo_ftplugin .= ' | execute "iunmap <buffer> ->"'
7777
let b:undo_ftplugin .= ' | execute "iunmap <buffer> <-"'
7878
endif
7979

8080
" Convert ASCII list bullets to Unicode bullets. {{{1
8181
if g:notes_smart_quotes
82-
imap <buffer> <expr> * xolox#notes#insert_bullet('*')
83-
imap <buffer> <expr> - xolox#notes#insert_bullet('-')
84-
imap <buffer> <expr> + xolox#notes#insert_bullet('+')
82+
inoremap <buffer> <expr> * xolox#notes#insert_bullet('*')
83+
inoremap <buffer> <expr> - xolox#notes#insert_bullet('-')
84+
inoremap <buffer> <expr> + xolox#notes#insert_bullet('+')
8585
let b:undo_ftplugin .= ' | execute "iunmap <buffer> *"'
8686
let b:undo_ftplugin .= ' | execute "iunmap <buffer> -"'
8787
let b:undo_ftplugin .= ' | execute "iunmap <buffer> +"'
@@ -92,22 +92,22 @@ inoremap <buffer> *** <C-o>:call xolox#notes#insert_ruler()<CR>
9292
let b:undo_ftplugin .= ' | execute "iunmap <buffer> ***"'
9393

9494
" Indent list items using <Tab> and <Shift-Tab>. {{{1
95-
imap <buffer> <silent> <Tab> <C-o>:call xolox#notes#indent_list(1, line('.'), line('.'))<CR>
96-
smap <buffer> <silent> <Tab> <C-o>:<C-u>call xolox#notes#indent_list(1, line("'<"), line("'>"))<CR><C-o>gv
95+
inoremap <buffer> <silent> <Tab> <C-o>:call xolox#notes#indent_list(1, line('.'), line('.'))<CR>
96+
snoremap <buffer> <silent> <Tab> <C-o>:<C-u>call xolox#notes#indent_list(1, line("'<"), line("'>"))<CR><C-o>gv
9797
let b:undo_ftplugin .= ' | execute "iunmap <buffer> <Tab>"'
9898
let b:undo_ftplugin .= ' | execute "sunmap <buffer> <Tab>"'
99-
imap <buffer> <silent> <S-Tab> <C-o>:call xolox#notes#indent_list(-1, line('.'), line('.'))<CR>
100-
smap <buffer> <silent> <S-Tab> <C-o>:<C-u>call xolox#notes#indent_list(-1, line("'<"), line("'>"))<CR><C-o>gv
99+
inoremap <buffer> <silent> <S-Tab> <C-o>:call xolox#notes#indent_list(-1, line('.'), line('.'))<CR>
100+
snoremap <buffer> <silent> <S-Tab> <C-o>:<C-u>call xolox#notes#indent_list(-1, line("'<"), line("'>"))<CR><C-o>gv
101101
let b:undo_ftplugin .= ' | execute "iunmap <buffer> <S-Tab>"'
102102
let b:undo_ftplugin .= ' | execute "sunmap <buffer> <S-Tab>"'
103103

104104
" Indent list items using <Alt-Left> and <Alt-Right>. {{{1
105-
imap <buffer> <silent> <A-Right> <C-o>:call xolox#notes#indent_list(1, line('.'), line('.'))<CR>
106-
smap <buffer> <silent> <A-Right> <C-o>:<C-u>call xolox#notes#indent_list(1, line("'<"), line("'>"))<CR><C-o>gv
105+
inoremap <buffer> <silent> <A-Right> <C-o>:call xolox#notes#indent_list(1, line('.'), line('.'))<CR>
106+
snoremap <buffer> <silent> <A-Right> <C-o>:<C-u>call xolox#notes#indent_list(1, line("'<"), line("'>"))<CR><C-o>gv
107107
let b:undo_ftplugin .= ' | execute "iunmap <buffer> <A-Right>"'
108108
let b:undo_ftplugin .= ' | execute "sunmap <buffer> <A-Right>"'
109-
imap <buffer> <silent> <A-Left> <C-o>:call xolox#notes#indent_list(-1, line('.'), line('.'))<CR>
110-
smap <buffer> <silent> <A-Left> <C-o>:<C-u>call xolox#notes#indent_list(-1, line("'<"), line("'>"))<CR><C-o>gv
109+
inoremap <buffer> <silent> <A-Left> <C-o>:call xolox#notes#indent_list(-1, line('.'), line('.'))<CR>
110+
snoremap <buffer> <silent> <A-Left> <C-o>:<C-u>call xolox#notes#indent_list(-1, line("'<"), line("'>"))<CR><C-o>gv
111111
let b:undo_ftplugin .= ' | execute "iunmap <buffer> <A-Left>"'
112112
let b:undo_ftplugin .= ' | execute "sunmap <buffer> <A-Left>"'
113113

@@ -117,13 +117,13 @@ let b:undo_ftplugin .= ' | execute "iunmap <buffer> <CR>"'
117117

118118
" Shortcuts to create new notes from the selected text. {{{1
119119

120-
vmap <buffer> <silent> <Leader>en :NoteFromSelectedText<CR>
120+
vnoremap <buffer> <silent> <Leader>en :NoteFromSelectedText<CR>
121121
let b:undo_ftplugin .= ' | execute "vunmap <buffer> <Leader>en"'
122122

123-
vmap <buffer> <silent> <Leader>sn :SplitNoteFromSelectedText<CR>
123+
vnoremap <buffer> <silent> <Leader>sn :SplitNoteFromSelectedText<CR>
124124
let b:undo_ftplugin .= ' | execute "vunmap <buffer> <Leader>sn"'
125125

126-
vmap <buffer> <silent> <Leader>tn :TabNoteFromSelectedText<CR>
126+
vnoremap <buffer> <silent> <Leader>tn :TabNoteFromSelectedText<CR>
127127
let b:undo_ftplugin .= ' | execute "vunmap <buffer> <Leader>tn"'
128128

129129
" }}}1

0 commit comments

Comments
 (0)