diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2021-07-09 17:19:56 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2021-07-09 17:19:56 +0200 |
| commit | 40ba58172eb303cd71ea2e03d39483a4dab74817 (patch) | |
| tree | a8612a8bd271f9b26179f43924ef82ef4184fa8b /init.lua | |
| parent | b6804dadf09598922763f15bd3d68da39e980dd8 (diff) | |
| download | vis-lspc-40ba58172eb303cd71ea2e03d39483a4dab74817.tar.gz vis-lspc-40ba58172eb303cd71ea2e03d39483a4dab74817.zip | |
add default keybindings from nvim
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 39 |
1 files changed, 33 insertions, 6 deletions
@@ -1124,28 +1124,55 @@ end) vis:map(vis.modes.NORMAL, '<F2>', function() vis:command('lspc-start-server') -end) +end, 'lspc: start lsp server') vis:map(vis.modes.NORMAL, '<F3>', function() vis:command('lspc-open') -end) +end, 'lspc: open current file') vis:map(vis.modes.NORMAL, '<C-]>', function() vis:command('lspc-definition') -end) +end, 'lspc: jump to definition') vis:map(vis.modes.NORMAL, '<C-t>', function() vis:command('lspc-back') -end) +end, 'lspc: go back position stack') vis:map(vis.modes.NORMAL, '<C- >', function() vis:command('lspc-completion') -end) +end, 'lspc: completion') vis:map(vis.modes.INSERT, '<C- >', function() vis:command('lspc-completion') vis.mode = vis.modes.INSERT -end) +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:option_register('lspc-highlight-diagnostics', 'bool', function(value) lspc.highlight_diagnostics = value |
