Skip to content

Commit

Permalink
Merge pull request #3 from anilanar/disable_key_mappings
Browse files Browse the repository at this point in the history
make key mappings optional
  • Loading branch information
mklabs authored Jan 4, 2017
2 parents ab0f21a + 98b4850 commit 5c0e84a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion plugin/split-term.vim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

let s:force_vertical = exists('g:split_term_vertical') ? 1 : 0
let s:map_keys = exists('g:disable_key_mappings') ? 0 : 1

" utilities around neovim's :term

Expand Down Expand Up @@ -55,7 +56,9 @@ fun! s:openTerm(args, count, vertical)
call s:openBuffer(a:count, direction)
exe 'terminal' a:args
exe 'startinsert'
call s:defineMaps()
if s:map_keys
call s:defineMaps()
endif
endf

command! -count -nargs=* Term call s:openTerm(<q-args>, <count>, 0)
Expand Down
5 changes: 4 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,12 @@ REPL.
- `set splitright` will put the new window right of the current one when using `:VTerm`
- `set splitbelow` will put the new window below the current one when using `:Term`

- `g:disable_key_mappings` - disable key mappings of the plugin

## Mappings

The plugin remaps specifically a few keys for a better terminal buffer experience.
The plugin remaps specifically a few keys for a better terminal buffer experience. This
behaviour can be disabled using `g:disable_key_mappings`.

- `<Esc>` - Switch to normal mode (instead of `<C-\><C-n>`)
- Bind Alt+hjkl, Ctrl+arrows to navigate through windows (eg. switching to buffer/windows left, right etc.)
Expand Down

0 comments on commit 5c0e84a

Please sign in to comment.