mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-31 15:19:26 +02:00
less vimscript
This commit is contained in:
parent
54edde8e1e
commit
832b55fa23
4 changed files with 28 additions and 68 deletions
3
init.lua
3
init.lua
|
@ -12,9 +12,6 @@ require('lv-treesitter')
|
||||||
require('lv-autopairs')
|
require('lv-autopairs')
|
||||||
require('lv-which-key')
|
require('lv-which-key')
|
||||||
|
|
||||||
-- TODO gotta get rid of this for speed
|
|
||||||
vim.cmd('source ' .. CONFIG_PATH .. '/vimscript/functions.vim')
|
|
||||||
|
|
||||||
-- LSP
|
-- LSP
|
||||||
require('lsp')
|
require('lsp')
|
||||||
-- TODO should I put this in the filetype files?
|
-- TODO should I put this in the filetype files?
|
||||||
|
|
|
@ -89,6 +89,7 @@ local mappings = {
|
||||||
["h"] = "No Highlight",
|
["h"] = "No Highlight",
|
||||||
["p"] = "Projects",
|
["p"] = "Projects",
|
||||||
["z"] = "Zen",
|
["z"] = "Zen",
|
||||||
|
[";"] = "Dashboard",
|
||||||
b = {
|
b = {
|
||||||
name = "+Buffers",
|
name = "+Buffers",
|
||||||
j = {"<cmd>BufferPick<cr>", "jump to buffer"},
|
j = {"<cmd>BufferPick<cr>", "jump to buffer"},
|
||||||
|
@ -100,13 +101,6 @@ local mappings = {
|
||||||
L = {"<cmd>BufferOrderByLanguage<cr>", "sort BufferLines automatically by language"},
|
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 = {
|
d = {
|
||||||
name = "Diagnostics",
|
name = "Diagnostics",
|
||||||
|
@ -117,6 +111,24 @@ local mappings = {
|
||||||
l = {"<cmd>TroubleToggle loclist<cr>", "loclist"},
|
l = {"<cmd>TroubleToggle loclist<cr>", "loclist"},
|
||||||
r = {"<cmd>TroubleToggle lsp_references<cr>", "references"}
|
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 = {
|
D = {
|
||||||
name = "Debug",
|
name = "Debug",
|
||||||
b = {"<cmd>DebugToggleBreakpoint<cr>", "Toggle Breakpoint"},
|
b = {"<cmd>DebugToggleBreakpoint<cr>", "Toggle Breakpoint"},
|
||||||
|
@ -128,13 +140,14 @@ local mappings = {
|
||||||
},
|
},
|
||||||
g = {
|
g = {
|
||||||
name = "Git",
|
name = "Git",
|
||||||
j = {"<cmd>NextHunk<cr>", "Next Hunk"},
|
j = {"<cmd>lua require 'lv-utils'.next_hunk()<cr>", "Next Hunk"},
|
||||||
k = {"<cmd>PrevHunk<cr>", "Prev Hunk"},
|
k = {"<cmd>lua require 'lv-utils'.prev_hunk()<cr>", "Prev Hunk"},
|
||||||
p = {"<cmd>PreviewHunk<cr>", "Preview Hunk"},
|
l = {"<cmd>lua require 'lv-utils'.blame_line()<cr>", "Blame"},
|
||||||
r = {"<cmd>ResetHunk<cr>", "Reset Hunk"},
|
p = {"<cmd>lua require 'lv-utils'.preview_hunk()<cr>", "Preview Hunk"},
|
||||||
R = {"<cmd>ResetBuffer<cr>", "Reset Buffer"},
|
r = {"<cmd>lua require 'lv-utils'.reset_hunk()<cr>", "Reset Hunk"},
|
||||||
s = {"<cmd>StageHunk<cr>", "Stage Hunk"},
|
R = {"<cmd>lua require 'lv-utils'.reset_buffer()<cr>", "Reset Buffer"},
|
||||||
u = {"<cmd>UndoStageHunk<cr>", "Undo Stage Hunk"},
|
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"},
|
o = {"<cmd>Telescope git_status<cr>", "Open changed file"},
|
||||||
b = {"<cmd>Telescope git_branches<cr>", "Checkout branch"},
|
b = {"<cmd>Telescope git_branches<cr>", "Checkout branch"},
|
||||||
c = {"<cmd>Telescope git_commits<cr>", "Checkout commit"},
|
c = {"<cmd>Telescope git_commits<cr>", "Checkout commit"},
|
||||||
|
@ -146,7 +159,7 @@ local mappings = {
|
||||||
A = {"<cmd>Lspsaga range_code_action<cr>", "Selected Action"},
|
A = {"<cmd>Lspsaga range_code_action<cr>", "Selected Action"},
|
||||||
d = {"<cmd>Telescope lsp_document_diagnostics<cr>", "Document Diagnostics"},
|
d = {"<cmd>Telescope lsp_document_diagnostics<cr>", "Document Diagnostics"},
|
||||||
D = {"<cmd>Telescope lsp_workspace_diagnostics<cr>", "Workspace 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"},
|
h = {"<cmd>Lspsaga hover_doc<cr>", "Hover Doc"},
|
||||||
i = {"<cmd>LspInfo<cr>", "Info"},
|
i = {"<cmd>LspInfo<cr>", "Info"},
|
||||||
l = {"<cmd>Lspsaga lsp_finder<cr>", "LSP Finder"},
|
l = {"<cmd>Lspsaga lsp_finder<cr>", "LSP Finder"},
|
||||||
|
|
|
@ -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
|
|
Loading…
Add table
Add a link
Reference in a new issue