mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-09-01 08:15:20 +02:00
updates
This commit is contained in:
parent
73276a79c0
commit
592e348689
5 changed files with 145 additions and 234 deletions
|
@ -1,5 +1,3 @@
|
||||||
vim.api.nvim_set_keymap('n', '-', ':RnvimrToggle<CR>', {noremap = true, silent = true})
|
|
||||||
|
|
||||||
-- better window movement
|
-- better window movement
|
||||||
vim.api.nvim_set_keymap('n', '<C-h>', '<C-w>h', {silent = true})
|
vim.api.nvim_set_keymap('n', '<C-h>', '<C-w>h', {silent = true})
|
||||||
vim.api.nvim_set_keymap('n', '<C-j>', '<C-w>j', {silent = true})
|
vim.api.nvim_set_keymap('n', '<C-j>', '<C-w>j', {silent = true})
|
||||||
|
|
|
@ -1,54 +1,103 @@
|
||||||
|
-- TODO when autocommands are better in lua, scope these to plugins and langs
|
||||||
local utils = require('lv-utils')
|
local utils = require('lv-utils')
|
||||||
|
|
||||||
local auto_formatters = { }
|
local auto_formatters = {}
|
||||||
|
|
||||||
local python_autoformat = {'BufWritePre', '*.py', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
if O.lang.python.active then
|
||||||
if O.lang.python.autoformat then table.insert(auto_formatters, python_autoformat) end
|
local python_autoformat = {
|
||||||
|
'BufWritePre', '*.py', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
|
||||||
local javascript_autoformat = {'BufWritePre', '*.js', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
}
|
||||||
local javascriptreact_autoformat = {'BufWritePre', '*.jsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
if O.lang.python.autoformat then
|
||||||
local typescript_autoformat = {'BufWritePre', '*.ts', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
table.insert(auto_formatters, python_autoformat)
|
||||||
local typescriptreact_autoformat = {'BufWritePre', '*.tsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
end
|
||||||
if O.lang.tsserver.autoformat then
|
|
||||||
table.insert(auto_formatters, javascript_autoformat)
|
|
||||||
table.insert(auto_formatters, javascriptreact_autoformat)
|
|
||||||
table.insert(auto_formatters, typescript_autoformat)
|
|
||||||
table.insert(auto_formatters, typescriptreact_autoformat)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local lua_format = {'BufWritePre', '*.lua', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
if O.lang.tsserver.active then
|
||||||
if O.lang.lua.autoformat then table.insert(auto_formatters, lua_format) end
|
local javascript_autoformat = {
|
||||||
|
'BufWritePre', '*.js', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
|
||||||
|
}
|
||||||
|
local javascriptreact_autoformat = {
|
||||||
|
'BufWritePre', '*.jsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
|
||||||
|
}
|
||||||
|
local typescript_autoformat = {
|
||||||
|
'BufWritePre', '*.ts', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
|
||||||
|
}
|
||||||
|
local typescriptreact_autoformat = {
|
||||||
|
'BufWritePre', '*.tsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
|
||||||
|
}
|
||||||
|
if O.lang.tsserver.autoformat then
|
||||||
|
table.insert(auto_formatters, javascript_autoformat)
|
||||||
|
table.insert(auto_formatters, javascriptreact_autoformat)
|
||||||
|
table.insert(auto_formatters, typescript_autoformat)
|
||||||
|
table.insert(auto_formatters, typescriptreact_autoformat)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local json_format = {'BufWritePre', '*.json', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'}
|
if O.lang.lua.active then
|
||||||
if O.lang.json.autoformat then table.insert(auto_formatters, json_format) end
|
local lua_format = {
|
||||||
|
'BufWritePre', '*.lua', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
|
||||||
|
}
|
||||||
|
if O.lang.lua.autoformat then table.insert(auto_formatters, lua_format) end
|
||||||
|
end
|
||||||
|
|
||||||
local ruby_format = {'BufWritePre', '*.rb', 'lua vim.lsp.buf.formatting_sync(nil,1000)'}
|
if O.lang.json.active then
|
||||||
if O.lang.ruby.autoformat then table.insert(auto_formatters, ruby_format) end
|
local json_format = {
|
||||||
|
'BufWritePre', '*.json', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
|
||||||
|
}
|
||||||
|
if O.lang.json.autoformat then table.insert(auto_formatters, json_format) end
|
||||||
|
end
|
||||||
|
|
||||||
local go_format = {'BufWritePre', '*.go', 'lua vim.lsp.buf.formatting_sync(nil,1000)'}
|
if O.lang.ruby.active then
|
||||||
if O.lang.go.autoformat then table.insert(auto_formatters, go_format) end
|
local ruby_format = {
|
||||||
|
'BufWritePre', '*.rb', 'lua vim.lsp.buf.formatting_sync(nil,1000)'
|
||||||
|
}
|
||||||
|
if O.lang.ruby.autoformat then table.insert(auto_formatters, ruby_format) end
|
||||||
|
end
|
||||||
|
|
||||||
local rust_format = {'BufWritePre', '*.rs', 'lua vim.lsp.buf.formatting_sync(nil,1000)'}
|
if O.lang.go.active then
|
||||||
if O.lang.rust.autoformat then table.insert(auto_formatters, rust_format) end
|
local go_format = {
|
||||||
|
'BufWritePre', '*.go', 'lua vim.lsp.buf.formatting_sync(nil,1000)'
|
||||||
|
}
|
||||||
|
if O.lang.go.autoformat then table.insert(auto_formatters, go_format) end
|
||||||
|
end
|
||||||
|
|
||||||
|
if O.lang.rust.active then
|
||||||
|
local rust_format = {
|
||||||
|
'BufWritePre', '*.rs', 'lua vim.lsp.buf.formatting_sync(nil,1000)'
|
||||||
|
}
|
||||||
|
if O.lang.rust.autoformat then table.insert(auto_formatters, rust_format) end
|
||||||
|
end
|
||||||
|
|
||||||
utils.define_augroups({
|
utils.define_augroups({
|
||||||
_general_settings = {
|
_general_settings = {
|
||||||
{'TextYankPost', '*', 'lua require(\'vim.highlight\').on_yank({higroup = \'Search\', timeout = 200})'},
|
{
|
||||||
{'BufWinEnter', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'},
|
'TextYankPost', '*',
|
||||||
{'BufRead', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'},
|
'lua require(\'vim.highlight\').on_yank({higroup = \'Search\', timeout = 200})'
|
||||||
{'BufNewFile', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'},
|
}, {
|
||||||
{'VimLeavePre', '*', 'set title set titleold='},
|
'BufWinEnter', '*',
|
||||||
|
'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'BufRead', '*',
|
||||||
|
'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'
|
||||||
|
}, {
|
||||||
|
'BufNewFile', '*',
|
||||||
|
'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'
|
||||||
|
}, {'VimLeavePre', '*', 'set title set titleold='},
|
||||||
{'FileType', 'qf', 'set nobuflisted'},
|
{'FileType', 'qf', 'set nobuflisted'},
|
||||||
{'BufWinEnter', 'lv-config.lua', 'PackerCompile'},
|
-- {'BufWinEnter', 'lv-config.lua', 'PackerCompile'},
|
||||||
{'BufWinLeave', 'lv-config.lua', 'PackerCompile'},
|
-- {'BufWinLeave', 'lv-config.lua', 'PackerCompile'},
|
||||||
{'BufWritePost', 'lv-config.lua', 'PackerCompile'}
|
-- {'BufWritePost', 'lv-config.lua', 'PackerCompile'}
|
||||||
|
|
||||||
-- {'User', 'GoyoLeave', 'lua require(\'galaxyline\').disable_galaxyline()'},
|
-- {'User', 'GoyoLeave', 'lua require(\'galaxyline\').disable_galaxyline()'},
|
||||||
-- {'User', 'GoyoEnter', 'lua require(\'galaxyline\').galaxyline_augroup()'},
|
-- {'User', 'GoyoEnter', 'lua require(\'galaxyline\').galaxyline_augroup()'},
|
||||||
},
|
},
|
||||||
_java = {
|
_java = {
|
||||||
-- {'FileType', 'java', 'luafile '..CONFIG_PATH..'/lua/lsp/java-ls.lua'},
|
-- {'FileType', 'java', 'luafile '..CONFIG_PATH..'/lua/lsp/java-ls.lua'},
|
||||||
{'FileType', 'java', 'nnoremap ca <Cmd>lua require(\'jdtls\').code_action()<CR>'}
|
{
|
||||||
|
'FileType', 'java',
|
||||||
|
'nnoremap ca <Cmd>lua require(\'jdtls\').code_action()<CR>'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_go = {
|
_go = {
|
||||||
|
@ -56,16 +105,22 @@ utils.define_augroups({
|
||||||
{'FileType', 'go', 'setlocal tabstop=4'},
|
{'FileType', 'go', 'setlocal tabstop=4'},
|
||||||
{'FileType', 'go', 'setlocal shiftwidth=4'},
|
{'FileType', 'go', 'setlocal shiftwidth=4'},
|
||||||
{'FileType', 'go', 'setlocal softtabstop=4'},
|
{'FileType', 'go', 'setlocal softtabstop=4'},
|
||||||
{'FileType', 'go', 'setlocal noexpandtab'},
|
{'FileType', 'go', 'setlocal noexpandtab'}
|
||||||
},
|
},
|
||||||
_dashboard = {
|
_dashboard = {
|
||||||
-- seems to be nobuflisted that makes my stuff disapear will do more testing
|
-- seems to be nobuflisted that makes my stuff disapear will do more testing
|
||||||
{
|
{
|
||||||
'FileType', 'dashboard',
|
'FileType', 'dashboard',
|
||||||
'setlocal nocursorline noswapfile synmaxcol& signcolumn=no norelativenumber nocursorcolumn nospell nolist nonumber bufhidden=wipe colorcolumn= foldcolumn=0 matchpairs= '
|
'setlocal nocursorline noswapfile synmaxcol& signcolumn=no norelativenumber nocursorcolumn nospell nolist nonumber bufhidden=wipe colorcolumn= foldcolumn=0 matchpairs= '
|
||||||
}, {'FileType', 'dashboard', 'set showtabline=0 | autocmd BufLeave <buffer> set showtabline=2'}
|
}, {
|
||||||
|
'FileType', 'dashboard',
|
||||||
|
'set showtabline=0 | autocmd BufLeave <buffer> set showtabline=2'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_markdown = {
|
||||||
|
{'FileType', 'markdown', 'setlocal wrap'},
|
||||||
|
{'FileType', 'markdown', 'setlocal spell'}
|
||||||
},
|
},
|
||||||
_markdown = {{'FileType', 'markdown', 'setlocal wrap'}, {'FileType', 'markdown', 'setlocal spell'}},
|
|
||||||
-- _solidity = {
|
-- _solidity = {
|
||||||
-- {'BufWinEnter', '.sol', 'setlocal filetype=solidity'}, {'BufRead', '*.sol', 'setlocal filetype=solidity'},
|
-- {'BufWinEnter', '.sol', 'setlocal filetype=solidity'}, {'BufRead', '*.sol', 'setlocal filetype=solidity'},
|
||||||
-- {'BufNewFile', '*.sol', 'setlocal filetype=solidity'}
|
-- {'BufNewFile', '*.sol', 'setlocal filetype=solidity'}
|
||||||
|
@ -77,7 +132,7 @@ utils.define_augroups({
|
||||||
_buffer_bindings = {
|
_buffer_bindings = {
|
||||||
{'FileType', 'dashboard', 'nnoremap <silent> <buffer> q :q<CR>'},
|
{'FileType', 'dashboard', 'nnoremap <silent> <buffer> q :q<CR>'},
|
||||||
{'FileType', 'lspinfo', 'nnoremap <silent> <buffer> q :q<CR>'},
|
{'FileType', 'lspinfo', 'nnoremap <silent> <buffer> q :q<CR>'},
|
||||||
{'FileType', 'floaterm', 'nnoremap <silent> <buffer> q :q<CR>'},
|
{'FileType', 'floaterm', 'nnoremap <silent> <buffer> q :q<CR>'}
|
||||||
},
|
},
|
||||||
_auto_formatters = auto_formatters
|
_auto_formatters = auto_formatters
|
||||||
})
|
})
|
||||||
|
|
|
@ -22,169 +22,6 @@ function lv_utils.define_augroups(definitions) -- {{{1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- lsp
|
|
||||||
|
|
||||||
function lv_utils.add_to_workspace_folder()
|
|
||||||
vim.lsp.buf.add_workspace_folder()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.clear_references()
|
|
||||||
vim.lsp.buf.clear_references()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.code_action()
|
|
||||||
vim.lsp.buf.code_action()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.declaration()
|
|
||||||
vim.lsp.buf.declaration()
|
|
||||||
vim.lsp.buf.clear_references()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.definition()
|
|
||||||
vim.lsp.buf.definition()
|
|
||||||
vim.lsp.buf.clear_references()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.document_highlight()
|
|
||||||
vim.lsp.buf.document_highlight()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.document_symbol()
|
|
||||||
vim.lsp.buf.document_symbol()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.formatting()
|
|
||||||
vim.lsp.buf.formatting()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.formatting_sync()
|
|
||||||
vim.lsp.buf.formatting_sync()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.hover()
|
|
||||||
vim.lsp.buf.hover()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.implementation()
|
|
||||||
vim.lsp.buf.implementation()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.incoming_calls()
|
|
||||||
vim.lsp.buf.incoming_calls()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.list_workspace_folders()
|
|
||||||
vim.lsp.buf.list_workspace_folders()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.outgoing_calls()
|
|
||||||
vim.lsp.buf.outgoing_calls()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.range_code_action()
|
|
||||||
vim.lsp.buf.range_code_action()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.range_formatting()
|
|
||||||
vim.lsp.buf.range_formatting()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.references()
|
|
||||||
vim.lsp.buf.references()
|
|
||||||
vim.lsp.buf.clear_references()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.remove_workspace_folder()
|
|
||||||
vim.lsp.buf.remove_workspace_folder()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.rename()
|
|
||||||
vim.lsp.buf.rename()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.signature_help()
|
|
||||||
vim.lsp.buf.signature_help()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.type_definition()
|
|
||||||
vim.lsp.buf.type_definition()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.workspace_symbol()
|
|
||||||
vim.lsp.buf.workspace_symbol()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- diagnostic
|
|
||||||
|
|
||||||
function lv_utils.get_all()
|
|
||||||
vim.lsp.diagnostic.get_all()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.get_next()
|
|
||||||
vim.lsp.diagnostic.get_next()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.get_prev()
|
|
||||||
vim.lsp.diagnostic.get_prev()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.goto_next()
|
|
||||||
vim.lsp.diagnostic.goto_next()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.goto_prev()
|
|
||||||
vim.lsp.diagnostic.goto_prev()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.show_line_diagnostics()
|
|
||||||
vim.lsp.diagnostic.show_line_diagnostics()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- git signs
|
|
||||||
|
|
||||||
function lv_utils.next_hunk()
|
|
||||||
require('gitsigns').next_hunk()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.prev_hunk()
|
|
||||||
require('gitsigns').prev_hunk()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.stage_hunk()
|
|
||||||
require('gitsigns').stage_hunk()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.undo_stage_hunk()
|
|
||||||
require('gitsigns').undo_stage_hunk()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.reset_hunk()
|
|
||||||
require('gitsigns').reset_hunk()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.reset_buffer()
|
|
||||||
require('gitsigns').reset_buffer()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.preview_hunk()
|
|
||||||
require('gitsigns').preview_hunk()
|
|
||||||
end
|
|
||||||
|
|
||||||
function lv_utils.blame_line()
|
|
||||||
require('gitsigns').blame_line()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- misc
|
|
||||||
function lv_utils.file_exists(name)
|
|
||||||
local f = io.open(name, "r")
|
|
||||||
if f ~= nil then
|
|
||||||
io.close(f)
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return lv_utils
|
return lv_utils
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ local mappings = {
|
||||||
["f"] = "Find File",
|
["f"] = "Find File",
|
||||||
["h"] = "No Highlight",
|
["h"] = "No Highlight",
|
||||||
b = {
|
b = {
|
||||||
name = "+Buffers",
|
name = "Buffers",
|
||||||
j = {"<cmd>BufferPick<cr>", "jump to buffer"},
|
j = {"<cmd>BufferPick<cr>", "jump to buffer"},
|
||||||
w = {"<cmd>BufferWipeout<cr>", "wipeout buffer"},
|
w = {"<cmd>BufferWipeout<cr>", "wipeout buffer"},
|
||||||
e = {
|
e = {
|
||||||
|
@ -113,22 +113,31 @@ local mappings = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
d = {
|
-- diagnostics vanilla nvim
|
||||||
name = "Diagnostics",
|
-- -- diagnostic
|
||||||
t = {"<cmd>TroubleToggle<cr>", "trouble"},
|
-- function lv_utils.get_all()
|
||||||
w = {"<cmd>TroubleToggle lsp_workspace_diagnostics<cr>", "workspace"},
|
-- vim.lsp.diagnostic.get_all()
|
||||||
d = {"<cmd>TroubleToggle lsp_document_diagnostics<cr>", "document"},
|
-- end
|
||||||
q = {"<cmd>TroubleToggle quickfix<cr>", "quickfix"},
|
-- function lv_utils.get_next()
|
||||||
l = {"<cmd>TroubleToggle loclist<cr>", "loclist"},
|
-- vim.lsp.diagnostic.get_next()
|
||||||
r = {"<cmd>TroubleToggle lsp_references<cr>", "references"}
|
-- end
|
||||||
},
|
-- function lv_utils.get_prev()
|
||||||
|
-- vim.lsp.diagnostic.get_prev()
|
||||||
|
-- end
|
||||||
|
-- function lv_utils.goto_next()
|
||||||
|
-- vim.lsp.diagnostic.goto_next()
|
||||||
|
-- end
|
||||||
|
-- function lv_utils.goto_prev()
|
||||||
|
-- vim.lsp.diagnostic.goto_prev()
|
||||||
|
-- end
|
||||||
|
-- function lv_utils.show_line_diagnostics()
|
||||||
|
-- vim.lsp.diagnostic.show_line_diagnostics()
|
||||||
|
-- end
|
||||||
|
|
||||||
-- " Available Debug Adapters:
|
-- " Available Debug Adapters:
|
||||||
-- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/
|
-- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/
|
||||||
-- "
|
|
||||||
-- " Adapter configuration and installation instructions:
|
-- " Adapter configuration and installation instructions:
|
||||||
-- " https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
|
-- " https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
|
||||||
-- "
|
|
||||||
-- " Debug Adapter protocol:
|
-- " Debug Adapter protocol:
|
||||||
-- " https://microsoft.github.io/debug-adapter-protocol/
|
-- " https://microsoft.github.io/debug-adapter-protocol/
|
||||||
-- " Debugging
|
-- " Debugging
|
||||||
|
@ -151,15 +160,15 @@ local mappings = {
|
||||||
-- },
|
-- },
|
||||||
g = {
|
g = {
|
||||||
name = "Git",
|
name = "Git",
|
||||||
j = {"<cmd>lua require 'lv-utils'.next_hunk()<cr>", "Next Hunk"},
|
j = {"<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk"},
|
||||||
k = {"<cmd>lua require 'lv-utils'.prev_hunk()<cr>", "Prev Hunk"},
|
k = {"<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk"},
|
||||||
l = {"<cmd>lua require 'lv-utils'.blame_line()<cr>", "Blame"},
|
l = {"<cmd>lua require 'gitsigns'.blame_line()<cr>", "Blame"},
|
||||||
p = {"<cmd>lua require 'lv-utils'.preview_hunk()<cr>", "Preview Hunk"},
|
p = {"<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk"},
|
||||||
r = {"<cmd>lua require 'lv-utils'.reset_hunk()<cr>", "Reset Hunk"},
|
r = {"<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk"},
|
||||||
R = {"<cmd>lua require 'lv-utils'.reset_buffer()<cr>", "Reset Buffer"},
|
R = {"<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer"},
|
||||||
s = {"<cmd>lua require 'lv-utils'.stage_hunk()<cr>", "Stage Hunk"},
|
s = {"<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk"},
|
||||||
u = {
|
u = {
|
||||||
"<cmd>lua require 'lv-utils'.undo_stage_hunk()<cr>",
|
"<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
|
||||||
"Undo Stage Hunk"
|
"Undo Stage Hunk"
|
||||||
},
|
},
|
||||||
o = {"<cmd>Telescope git_status<cr>", "Open changed file"},
|
o = {"<cmd>Telescope git_status<cr>", "Open changed file"},
|
||||||
|
@ -182,7 +191,7 @@ local mappings = {
|
||||||
"<cmd>Telescope lsp_workspace_diagnostics<cr>",
|
"<cmd>Telescope lsp_workspace_diagnostics<cr>",
|
||||||
"Workspace Diagnostics"
|
"Workspace Diagnostics"
|
||||||
},
|
},
|
||||||
f = {"<cmd>lua require 'lv-utils'.formatting()<cr>", "Format"},
|
f = {"<cmd>lua vim.lsp.buf.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"},
|
||||||
|
@ -209,17 +218,17 @@ local mappings = {
|
||||||
name = "Search",
|
name = "Search",
|
||||||
b = {"<cmd>Telescope git_branches<cr>", "Checkout branch"},
|
b = {"<cmd>Telescope git_branches<cr>", "Checkout branch"},
|
||||||
c = {"<cmd>Telescope colorscheme<cr>", "Colorscheme"},
|
c = {"<cmd>Telescope colorscheme<cr>", "Colorscheme"},
|
||||||
d = {
|
-- d = {
|
||||||
"<cmd>Telescope lsp_document_diagnostics<cr>",
|
-- "<cmd>Telescope lsp_document_diagnostics<cr>",
|
||||||
"Document Diagnostics"
|
-- "Document Diagnostics"
|
||||||
},
|
-- },
|
||||||
D = {
|
-- D = {
|
||||||
"<cmd>Telescope lsp_workspace_diagnostics<cr>",
|
-- "<cmd>Telescope lsp_workspace_diagnostics<cr>",
|
||||||
"Workspace Diagnostics"
|
-- "Workspace Diagnostics"
|
||||||
},
|
-- },
|
||||||
f = {"<cmd>Telescope find_files<cr>", "Find File"},
|
f = {"<cmd>Telescope find_files<cr>", "Find File"},
|
||||||
h = {"<cmd>Telescope help_tags<cr>", "Find Help"},
|
h = {"<cmd>Telescope help_tags<cr>", "Find Help"},
|
||||||
m = {"<cmd>Telescope marks<cr>", "Marks"},
|
-- m = {"<cmd>Telescope marks<cr>", "Marks"},
|
||||||
M = {"<cmd>Telescope man_pages<cr>", "Man Pages"},
|
M = {"<cmd>Telescope man_pages<cr>", "Man Pages"},
|
||||||
r = {"<cmd>Telescope oldfiles<cr>", "Open Recent File"},
|
r = {"<cmd>Telescope oldfiles<cr>", "Open Recent File"},
|
||||||
R = {"<cmd>Telescope registers<cr>", "Registers"},
|
R = {"<cmd>Telescope registers<cr>", "Registers"},
|
||||||
|
@ -232,6 +241,18 @@ local mappings = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if O.plugin.trouble.active then
|
||||||
|
mappings['d'] = {
|
||||||
|
name = "Diagnostics",
|
||||||
|
t = {"<cmd>TroubleToggle<cr>", "trouble"},
|
||||||
|
w = {"<cmd>TroubleToggle lsp_workspace_diagnostics<cr>", "workspace"},
|
||||||
|
d = {"<cmd>TroubleToggle lsp_document_diagnostics<cr>", "document"},
|
||||||
|
q = {"<cmd>TroubleToggle quickfix<cr>", "quickfix"},
|
||||||
|
l = {"<cmd>TroubleToggle loclist<cr>", "loclist"},
|
||||||
|
r = {"<cmd>TroubleToggle lsp_references<cr>", "references"}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
if O.plugin.gitlinker.active then mappings["gy"] = "Gitlink" end
|
if O.plugin.gitlinker.active then mappings["gy"] = "Gitlink" end
|
||||||
if O.plugin.zen.active then
|
if O.plugin.zen.active then
|
||||||
vim.api.nvim_set_keymap("n", "<leader>z", ":ZenMode<CR>",
|
vim.api.nvim_set_keymap("n", "<leader>z", ":ZenMode<CR>",
|
||||||
|
|
|
@ -23,7 +23,7 @@ O.smart_case = true
|
||||||
-- After changing plugin config it is recommended to run :PackerCompile
|
-- After changing plugin config it is recommended to run :PackerCompile
|
||||||
O.plugin.hop.active = false
|
O.plugin.hop.active = false
|
||||||
O.plugin.dial.active = false
|
O.plugin.dial.active = false
|
||||||
O.plugin.dashboard.active = false
|
O.plugin.dashboard.active = true
|
||||||
O.plugin.matchup.active = false
|
O.plugin.matchup.active = false
|
||||||
O.plugin.colorizer.active = false
|
O.plugin.colorizer.active = false
|
||||||
O.plugin.numb.active = false
|
O.plugin.numb.active = false
|
||||||
|
@ -51,7 +51,7 @@ O.lang.clang.diagnostics.underline = false
|
||||||
-- add things like O.python.formatter.isort.exec_path
|
-- add things like O.python.formatter.isort.exec_path
|
||||||
O.lang.python.formatter = 'yapf'
|
O.lang.python.formatter = 'yapf'
|
||||||
-- O.python.linter = 'flake8'
|
-- O.python.linter = 'flake8'
|
||||||
O.lang.python.active = false
|
O.lang.python.active = true
|
||||||
O.lang.python.isort = true
|
O.lang.python.isort = true
|
||||||
O.lang.python.autoformat = true
|
O.lang.python.autoformat = true
|
||||||
O.lang.python.diagnostics.virtual_text = true
|
O.lang.python.diagnostics.virtual_text = true
|
||||||
|
@ -63,7 +63,7 @@ O.lang.python.analysis.use_library_code_types = true
|
||||||
|
|
||||||
-- lua
|
-- lua
|
||||||
-- TODO look into stylua
|
-- TODO look into stylua
|
||||||
O.lang.lua.active = false
|
O.lang.lua.active = true
|
||||||
O.lang.lua.formatter = 'lua-format'
|
O.lang.lua.formatter = 'lua-format'
|
||||||
-- O.lua.formatter = 'lua-format'
|
-- O.lua.formatter = 'lua-format'
|
||||||
O.lang.lua.autoformat = false
|
O.lang.lua.autoformat = false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue