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 /init.lua | |
| parent | 8ed38b8d12679c1ea9f71edcf8f8c2511b4cd5fb (diff) | |
| download | vis-lspc-85e8aced46fecc5acbdf96bac5dc3af6217ba16e.tar.gz vis-lspc-85e8aced46fecc5acbdf96bac5dc3af6217ba16e.zip | |
extract bindings into a seperate source file
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 65 |
1 files changed, 3 insertions, 62 deletions
@@ -1350,71 +1350,12 @@ vis.events.subscribe(vis.events.FILE_OPEN, function(file) lspc_open(ls, win, file) end) --- 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') - vis:option_register('lspc-highlight-diagnostics', 'bool', function(value) lspc.highlight_diagnostics = value return true end, 'Should lspc highlight diagnostics if available') +local source_str = debug.getinfo(1, 'S').source:sub(2) +local script_path = source_str:match('(.*/)') +dofile(script_path .. 'bindings.lua') return lspc |
