diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2021-08-02 22:18:31 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2021-08-02 22:18:31 +0200 |
| commit | 85e8aced46fecc5acbdf96bac5dc3af6217ba16e (patch) | |
| tree | a0e2b3b6894b7ac4421fb900ddd65f3f1c228d3a /bindings.lua | |
| parent | 8ed38b8d12679c1ea9f71edcf8f8c2511b4cd5fb (diff) | |
| download | vis-lspc-85e8aced46fecc5acbdf96bac5dc3af6217ba16e.tar.gz vis-lspc-85e8aced46fecc5acbdf96bac5dc3af6217ba16e.zip | |
extract bindings into a seperate source file
Diffstat (limited to 'bindings.lua')
| -rw-r--r-- | bindings.lua | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/bindings.lua b/bindings.lua new file mode 100644 index 0000000..08ce1c9 --- /dev/null +++ b/bindings.lua @@ -0,0 +1,61 @@ +-- Copyright (c) 2021 Florian Fischer. All rights reserved. +-- Use of this source code is governed by a MIT license found in the LICENSE file. +-- vis-lspc default bindings +vis:map(vis.modes.NORMAL, '<F2>', function() + vis:command('lspc-start-server') +end, 'lspc: start lsp server') + +vis:map(vis.modes.NORMAL, '<F3>', function() + vis:command('lspc-open') +end, 'lspc: open current file') + +vis:map(vis.modes.NORMAL, '<C-]>', function() + vis:command('lspc-definition') +end, 'lspc: jump to definition') + +vis:map(vis.modes.NORMAL, '<C-t>', function() + vis:command('lspc-back') +end, 'lspc: go back position stack') + +vis:map(vis.modes.NORMAL, '<C- >', function() + vis:command('lspc-completion') +end, 'lspc: completion') + +vis:map(vis.modes.INSERT, '<C- >', function() + vis:command('lspc-completion') + vis.mode = vis.modes.INSERT +end, 'lspc: completion') + +-- bindings inspired by nvim +-- https://github.com/neovim/nvim-lspconfig +vis:map(vis.modes.NORMAL, 'gD', function() + vis:command('lspc-declaration') +end, 'lspc: jump to declaration') + +vis:map(vis.modes.NORMAL, 'gd', function() + vis:command('lspc-definition') +end, 'lspc: jump to definition') + +vis:map(vis.modes.NORMAL, 'gi', function() + vis:command('lspc-implementation') +end, 'lspc: jump to implementation') + +vis:map(vis.modes.NORMAL, 'gr', function() + vis:command('lspc-references') +end, 'lspc: show references') + +vis:map(vis.modes.NORMAL, ' D', function() + vis:command('lspc-typeDefinition') +end, 'lspc: jump to type definition') + +vis:map(vis.modes.NORMAL, ' e', function() + vis:command('lspc-show-diagnostics') +end, 'lspc: show diagnostic of current line') + +vis:map(vis.modes.NORMAL, 'K', function() + vis:command('lspc-hover') +end, 'lspc: hover over current position') + +vis:map(vis.modes.NORMAL, '<C-k>', function() + vis:command('lspc-signature-help') +end, 'lspc: signature help') |
