summaryrefslogtreecommitdiff
path: root/vimscript
diff options
context:
space:
mode:
Diffstat (limited to 'vimscript')
-rw-r--r--vimscript/functions.vim50
-rw-r--r--vimscript/lv-vscode/init.vim84
2 files changed, 0 insertions, 134 deletions
diff --git a/vimscript/functions.vim b/vimscript/functions.vim
deleted file mode 100644
index c2edad21..00000000
--- a/vimscript/functions.vim
+++ /dev/null
@@ -1,50 +0,0 @@
-command! LspFormatting lua require 'lv-utils'.formatting()
-command! NextHunk lua require 'lv-utils'.next_hunk()
-command! PrevHunk lua require 'lv-utils'.prev_hunk()
-command! StageHunk lua require 'lv-utils'.stage_hunk()
-command! UndoStageHunk lua require 'lv-utils'.undo_stage_hunk()
-command! ResetHunk lua require 'lv-utils'.reset_hunk()
-command! ResetBuffer lua require 'lv-utils'.reset_buffer()
-command! PreviewHunk lua require 'lv-utils'.preview_hunk()
-command! BlameLine lua require 'lv-utils'.blame_line()
-
-" Debugging
-command! DebugToggleBreakpoint lua require'dap'.toggle_breakpoint()
-command! DebugStart lua require'dap'.continue()
-command! DebugContinue lua require'dap'.continue()
-command! DebugStepOver lua require'dap'.step_over()
-command! DebugStepOut lua require'dap'.step_out()
-command! DebugStepInto lua require'dap'.step_into()
-command! DebugToggleRepl lua require'dap'.repl.toggle()
-command! DebugGetSession lua require'dap'.session()
-
-" Available Debug Adapters:
-" https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/
-"
-" Adapter configuration and installation instructions:
-" https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
-"
-" Debug Adapter protocol:
-" https://microsoft.github.io/debug-adapter-protocol/
-
-" TODO Add full support later
-" nnoremap <silent> <F5> :lua require'dap'.continue()<CR>
-" nnoremap <silent> <F10> :lua require'dap'.step_over()<CR>
-" nnoremap <silent> <F11> :lua require'dap'.step_into()<CR>
-" nnoremap <silent> <F12> :lua require'dap'.step_out()<CR>
-" nnoremap <silent> <leader>b :lua require'dap'.toggle_breakpoint()<CR>
-" nnoremap <silent> <leader>B :lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>
-" nnoremap <silent> <leader>lp :lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<CR>
-" nnoremap <silent> <leader>dr :lua require'dap'.repl.open()<CR>
-" nnoremap <silent> <leader>dl :lua require'dap'.run_last()<CR>
-
-" autocmd! User GoyoEnter lua require('galaxyline').disable_galaxyline()
-" autocmd! User GoyoLeave lua require('galaxyline').galaxyline_augroup()
-
-function! QuickFixToggle()
- if empty(filter(getwininfo(), 'v:val.quickfix'))
- copen
- else
- cclose
- endif
-endfunction
diff --git a/vimscript/lv-vscode/init.vim b/vimscript/lv-vscode/init.vim
deleted file mode 100644
index 1aa30934..00000000
--- a/vimscript/lv-vscode/init.vim
+++ /dev/null
@@ -1,84 +0,0 @@
-" packadd quickscope
-
-execute 'luafile ' . stdpath('config') . '/lua/settings.lua'
-
-function! s:manageEditorSize(...)
- let count = a:1
- let to = a:2
- for i in range(1, count ? count : 1)
- call VSCodeNotify(to == 'increase' ? 'workbench.action.increaseViewSize' : 'workbench.action.decreaseViewSize')
- endfor
-endfunction
-
-function! s:vscodeCommentary(...) abort
- if !a:0
- let &operatorfunc = matchstr(expand('<sfile>'), '[^. ]*$')
- return 'g@'
- elseif a:0 > 1
- let [line1, line2] = [a:1, a:2]
- else
- let [line1, line2] = [line("'["), line("']")]
- endif
-
- call VSCodeCallRange("editor.action.commentLine", line1, line2, 0)
-endfunction
-
-function! s:openVSCodeCommandsInVisualMode()
- normal! gv
- let visualmode = visualmode()
- if visualmode == "V"
- let startLine = line("v")
- let endLine = line(".")
- call VSCodeNotifyRange("workbench.action.showCommands", startLine, endLine, 1)
- else
- let startPos = getpos("v")
- let endPos = getpos(".")
- call VSCodeNotifyRangePos("workbench.action.showCommands", startPos[1], endPos[1], startPos[2], endPos[2], 1)
- endif
-endfunction
-
-function! s:openWhichKeyInVisualMode()
- normal! gv
- let visualmode = visualmode()
- if visualmode == "V"
- let startLine = line("v")
- let endLine = line(".")
- call VSCodeNotifyRange("whichkey.show", startLine, endLine, 1)
- else
- let startPos = getpos("v")
- let endPos = getpos(".")
- call VSCodeNotifyRangePos("whichkey.show", startPos[1], endPos[1], startPos[2], endPos[2], 1)
- endif
-endfunction
-
-" Better Navigation
-nnoremap <silent> <C-j> :call VSCodeNotify('workbench.action.navigateDown')<CR>
-xnoremap <silent> <C-j> :call VSCodeNotify('workbench.action.navigateDown')<CR>
-nnoremap <silent> <C-k> :call VSCodeNotify('workbench.action.navigateUp')<CR>
-xnoremap <silent> <C-k> :call VSCodeNotify('workbench.action.navigateUp')<CR>
-nnoremap <silent> <C-h> :call VSCodeNotify('workbench.action.navigateLeft')<CR>
-xnoremap <silent> <C-h> :call VSCodeNotify('workbench.action.navigateLeft')<CR>
-nnoremap <silent> <C-l> :call VSCodeNotify('workbench.action.navigateRight')<CR>
-xnoremap <silent> <C-l> :call VSCodeNotify('workbench.action.navigateRight')<CR>
-
-nnoremap gr <Cmd>call VSCodeNotify('editor.action.goToReferences')<CR>
-
-" Bind C-/ to vscode commentary since calling from vscode produces double comments due to multiple cursors
-xnoremap <expr> <C-/> <SID>vscodeCommentary()
-nnoremap <expr> <C-/> <SID>vscodeCommentary() . '_'
-
-nnoremap <silent> <C-w>_ :<C-u>call VSCodeNotify('workbench.action.toggleEditorWidths')<CR>
-
-nnoremap <silent> <Space> :call VSCodeNotify('whichkey.show')<CR>
-xnoremap <silent> <Space> :<C-u>call <SID>openWhichKeyInVisualMode()<CR>
-
-xnoremap <silent> <C-P> :<C-u>call <SID>openVSCodeCommandsInVisualMode()<CR>
-
-xmap gc <Plug>VSCodeCommentary
-nmap gc <Plug>VSCodeCommentary
-omap gc <Plug>VSCodeCommentary
-nmap gcc <Plug>VSCodeCommentaryLine
-
-" Simulate same TAB behavior in VSCode
-nmap <Tab> :Tabnext<CR>
-nmap <S-Tab> :Tabprev<CR>