Selaa lähdekoodia

less vimscript

christianchiarulli 4 vuotta sitten
vanhempi
commit
832b55fa23
4 muutettua tiedostoa jossa 28 lisäystä ja 68 poistoa
  1. 0 3
      init.lua
  2. 28 15
      lua/lv-which-key/init.lua
  3. 0 0
      utils/lv-vscode/init.vim
  4. 0 50
      vimscript/functions.vim

+ 0 - 3
init.lua

@@ -12,9 +12,6 @@ require('lv-treesitter')
 require('lv-autopairs')
 require('lv-which-key')
 
--- TODO gotta get rid of this for speed
-vim.cmd('source ' .. CONFIG_PATH .. '/vimscript/functions.vim')
-
 -- LSP
 require('lsp')
 -- TODO should I put this in the filetype files?

+ 28 - 15
lua/lv-which-key/init.lua

@@ -89,6 +89,7 @@ local mappings = {
     ["h"] = "No Highlight",
     ["p"] = "Projects",
     ["z"] = "Zen",
+    [";"] = "Dashboard",
     b = {
       name = "+Buffers",
       j = {"<cmd>BufferPick<cr>", "jump to buffer"},
@@ -100,13 +101,6 @@ local mappings = {
       L = {"<cmd>BufferOrderByLanguage<cr>", "sort BufferLines automatically by language"},
     },
 
-    -- ["/"] = {"<cmd>CommentToggle<cr>", "Comment"},
-    [";"] = {"<cmd>Dashboard<cr>", "Dashboard"},
-    -- ["c"] = {"<cmd>BufferClose<cr>", "Close Buffer"},
-    -- ["e"] = {"<cmd>NvimTreeToggle<cr>", "Explorer"},
-    -- ["f"] = {"<cmd>Telescope find_files<cr>", "Find File"},
-    -- ["h"] = {"<cmd>set hlsearch!<cr>", "No Highlight"},
-    -- ["p"] = {"<cmd>lua require'telescope'.extensions.project.project{}<cr>", "Projects"},
 
     d = {
         name = "Diagnostics",
@@ -117,6 +111,24 @@ local mappings = {
         l = {"<cmd>TroubleToggle loclist<cr>", "loclist"},
         r = {"<cmd>TroubleToggle lsp_references<cr>", "references"}
     },
+
+-- " 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/
+-- " 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()
     D = {
         name = "Debug",
         b = {"<cmd>DebugToggleBreakpoint<cr>", "Toggle Breakpoint"},
@@ -128,13 +140,14 @@ local mappings = {
     },
     g = {
         name = "Git",
-        j = {"<cmd>NextHunk<cr>", "Next Hunk"},
-        k = {"<cmd>PrevHunk<cr>", "Prev Hunk"},
-        p = {"<cmd>PreviewHunk<cr>", "Preview Hunk"},
-        r = {"<cmd>ResetHunk<cr>", "Reset Hunk"},
-        R = {"<cmd>ResetBuffer<cr>", "Reset Buffer"},
-        s = {"<cmd>StageHunk<cr>", "Stage Hunk"},
-        u = {"<cmd>UndoStageHunk<cr>", "Undo Stage Hunk"},
+        j = {"<cmd>lua require 'lv-utils'.next_hunk()<cr>", "Next Hunk"},
+        k = {"<cmd>lua require 'lv-utils'.prev_hunk()<cr>", "Prev Hunk"},
+        l = {"<cmd>lua require 'lv-utils'.blame_line()<cr>", "Blame"},
+        p = {"<cmd>lua require 'lv-utils'.preview_hunk()<cr>", "Preview Hunk"},
+        r = {"<cmd>lua require 'lv-utils'.reset_hunk()<cr>", "Reset Hunk"},
+        R = {"<cmd>lua require 'lv-utils'.reset_buffer()<cr>", "Reset Buffer"},
+        s = {"<cmd>lua require 'lv-utils'.stage_hunk()<cr>", "Stage Hunk"},
+        u = {"<cmd>lua require 'lv-utils'.undo_stage_hunk()<cr>", "Undo Stage Hunk"},
         o = {"<cmd>Telescope git_status<cr>", "Open changed file"},
         b = {"<cmd>Telescope git_branches<cr>", "Checkout branch"},
         c = {"<cmd>Telescope git_commits<cr>", "Checkout commit"},
@@ -146,7 +159,7 @@ local mappings = {
         A = {"<cmd>Lspsaga range_code_action<cr>", "Selected Action"},
         d = {"<cmd>Telescope lsp_document_diagnostics<cr>", "Document Diagnostics"},
         D = {"<cmd>Telescope lsp_workspace_diagnostics<cr>", "Workspace Diagnostics"},
-        f = {"<cmd>LspFormatting<cr>", "Format"},
+        f = {"<cmd>lua require 'lv-utils'.formatting()<cr>", "Format"},
         h = {"<cmd>Lspsaga hover_doc<cr>", "Hover Doc"},
         i = {"<cmd>LspInfo<cr>", "Info"},
         l = {"<cmd>Lspsaga lsp_finder<cr>", "LSP Finder"},

+ 0 - 0
vimscript/lv-vscode/init.vim → utils/lv-vscode/init.vim


+ 0 - 50
vimscript/functions.vim

@@ -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