move java mappings to java.lua
This commit is contained in:
parent
8393fc12ae
commit
fb47b1f896
@ -251,3 +251,46 @@ keymap('n', '<leader>ju', '<Cmd>JdtUpdateConfig<CR>', opts)
|
|||||||
keymap('v', '<leader>jv', "<Esc><Cmd>lua require('jdtls').extract_variable(true)<CR>", opts)
|
keymap('v', '<leader>jv', "<Esc><Cmd>lua require('jdtls').extract_variable(true)<CR>", opts)
|
||||||
keymap('v', '<leader>jc', "<Esc><Cmd>lua require('jdtls').extract_constant(true)<CR>", opts)
|
keymap('v', '<leader>jc', "<Esc><Cmd>lua require('jdtls').extract_constant(true)<CR>", opts)
|
||||||
keymap('v', '<leader>jm', "<Esc><Cmd>lua require('jdtls').extract_method(true)<CR>", opts)
|
keymap('v', '<leader>jm', "<Esc><Cmd>lua require('jdtls').extract_method(true)<CR>", opts)
|
||||||
|
|
||||||
|
local wk = require 'which-key'
|
||||||
|
local optsj = {
|
||||||
|
mode = 'n', -- NORMAL mode
|
||||||
|
prefix = '<leader>',
|
||||||
|
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||||
|
silent = true, -- use `silent` when creating keymaps
|
||||||
|
noremap = true, -- use `noremap` when creating keymaps
|
||||||
|
nowait = true, -- use `nowait` when creating keymaps
|
||||||
|
}
|
||||||
|
|
||||||
|
local vopts = {
|
||||||
|
mode = 'v', -- VISUAL mode
|
||||||
|
prefix = '<leader>',
|
||||||
|
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||||
|
silent = true, -- use `silent` when creating keymaps
|
||||||
|
noremap = true, -- use `noremap` when creating keymaps
|
||||||
|
nowait = true, -- use `nowait` when creating keymaps
|
||||||
|
}
|
||||||
|
|
||||||
|
local mappingsj = {
|
||||||
|
L = {
|
||||||
|
name = 'Java',
|
||||||
|
o = { "<Cmd>lua require'jdtls'.organize_imports()<CR>", 'Organize Imports' },
|
||||||
|
v = { "<Cmd>lua require('jdtls').extract_variable()<CR>", 'Extract Variable' },
|
||||||
|
c = { "<Cmd>lua require('jdtls').extract_constant()<CR>", 'Extract Constant' },
|
||||||
|
t = { "<Cmd>lua require'jdtls'.test_nearest_method()<CR>", 'Test Method' },
|
||||||
|
T = { "<Cmd>lua require'jdtls'.test_class()<CR>", 'Test Class' },
|
||||||
|
u = { '<Cmd>JdtUpdateConfig<CR>', 'Update Config' },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local vmappings = {
|
||||||
|
L = {
|
||||||
|
name = 'Java',
|
||||||
|
v = { "<Esc><Cmd>lua require('jdtls').extract_variable(true)<CR>", 'Extract Variable' },
|
||||||
|
c = { "<Esc><Cmd>lua require('jdtls').extract_constant(true)<CR>", 'Extract Constant' },
|
||||||
|
m = { "<Esc><Cmd>lua require('jdtls').extract_method(true)<CR>", 'Extract Method' },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
wk.register(mappingsj, optsj)
|
||||||
|
wk.register(vmappings, vopts)
|
||||||
|
@ -86,13 +86,13 @@ function UnMapDHM()
|
|||||||
vim.api.nvim_del_keymap('n', 'N')
|
vim.api.nvim_del_keymap('n', 'N')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- local handle = io.popen 'lsusb | grep -c Sofle'
|
local handle = io.popen 'lsusb | grep -c Sofle'
|
||||||
-- local automap = handle:read '*n'
|
local automap = handle:read '*n'
|
||||||
-- handle:close()
|
handle:close()
|
||||||
|
|
||||||
-- if automap or os.getenv("SSH_TTY") then
|
if not automap or os.getenv 'SSH_TTY' then
|
||||||
MapDHM()
|
MapDHM()
|
||||||
-- end
|
end
|
||||||
|
|
||||||
local wk = require 'which-key'
|
local wk = require 'which-key'
|
||||||
|
|
||||||
@ -220,45 +220,3 @@ local mappings = {
|
|||||||
}
|
}
|
||||||
-- }}}
|
-- }}}
|
||||||
wk.register(mappings, opts)
|
wk.register(mappings, opts)
|
||||||
|
|
||||||
local optsj = {
|
|
||||||
mode = "n", -- NORMAL mode
|
|
||||||
prefix = "<leader>",
|
|
||||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
|
||||||
silent = true, -- use `silent` when creating keymaps
|
|
||||||
noremap = true, -- use `noremap` when creating keymaps
|
|
||||||
nowait = true, -- use `nowait` when creating keymaps
|
|
||||||
}
|
|
||||||
|
|
||||||
local vopts = {
|
|
||||||
mode = "v", -- VISUAL mode
|
|
||||||
prefix = "<leader>",
|
|
||||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
|
||||||
silent = true, -- use `silent` when creating keymaps
|
|
||||||
noremap = true, -- use `noremap` when creating keymaps
|
|
||||||
nowait = true, -- use `nowait` when creating keymaps
|
|
||||||
}
|
|
||||||
|
|
||||||
local mappingsj = {
|
|
||||||
L = {
|
|
||||||
name = "Java",
|
|
||||||
o = { "<Cmd>lua require'jdtls'.organize_imports()<CR>", "Organize Imports" },
|
|
||||||
v = { "<Cmd>lua require('jdtls').extract_variable()<CR>", "Extract Variable" },
|
|
||||||
c = { "<Cmd>lua require('jdtls').extract_constant()<CR>", "Extract Constant" },
|
|
||||||
t = { "<Cmd>lua require'jdtls'.test_nearest_method()<CR>", "Test Method" },
|
|
||||||
T = { "<Cmd>lua require'jdtls'.test_class()<CR>", "Test Class" },
|
|
||||||
u = { "<Cmd>JdtUpdateConfig<CR>", "Update Config" },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
local vmappings = {
|
|
||||||
L = {
|
|
||||||
name = "Java",
|
|
||||||
v = { "<Esc><Cmd>lua require('jdtls').extract_variable(true)<CR>", "Extract Variable" },
|
|
||||||
c = { "<Esc><Cmd>lua require('jdtls').extract_constant(true)<CR>", "Extract Constant" },
|
|
||||||
m = { "<Esc><Cmd>lua require('jdtls').extract_method(true)<CR>", "Extract Method" },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
wk.register(mappingsj, optsj)
|
|
||||||
wk.register(vmappings, vopts)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user