Made ctrl space work and added json support
This commit is contained in:
@@ -55,6 +55,14 @@ return {
|
|||||||
-- change here to key="b", mods="CMD" for ^+b equivalent in tmux.
|
-- change here to key="b", mods="CMD" for ^+b equivalent in tmux.
|
||||||
leader = { key = "b", mods = "CTRL", timeout_milliseconds = 1000 },
|
leader = { key = "b", mods = "CTRL", timeout_milliseconds = 1000 },
|
||||||
keys = {
|
keys = {
|
||||||
|
{
|
||||||
|
key = " ",
|
||||||
|
mods = "CTRL",
|
||||||
|
action = act.SendKey({
|
||||||
|
key = " ",
|
||||||
|
mods = "CTRL",
|
||||||
|
}),
|
||||||
|
},
|
||||||
{ key = "LeftArrow", mods = "OPT", action = act.SendString("\x1bb") },
|
{ key = "LeftArrow", mods = "OPT", action = act.SendString("\x1bb") },
|
||||||
{ key = "RightArrow", mods = "OPT", action = act.SendString("\x1bf") },
|
{ key = "RightArrow", mods = "OPT", action = act.SendString("\x1bf") },
|
||||||
|
|
||||||
|
|||||||
@@ -564,6 +564,7 @@ require('lazy').setup({
|
|||||||
}, -- hybrid mode is default
|
}, -- hybrid mode is default
|
||||||
html = {},
|
html = {},
|
||||||
cssls = {},
|
cssls = {},
|
||||||
|
jsonls = {},
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
@@ -601,6 +602,8 @@ require('lazy').setup({
|
|||||||
'isort',
|
'isort',
|
||||||
'black',
|
'black',
|
||||||
'debugpy',
|
'debugpy',
|
||||||
|
'prettierd',
|
||||||
|
'json-lsp',
|
||||||
})
|
})
|
||||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||||
-- Installed LSPs are configured and enabled automatically with mason-lspconfig
|
-- Installed LSPs are configured and enabled automatically with mason-lspconfig
|
||||||
@@ -661,6 +664,7 @@ require('lazy').setup({
|
|||||||
javascriptreact = {},
|
javascriptreact = {},
|
||||||
xml = { 'xmlformatter' },
|
xml = { 'xmlformatter' },
|
||||||
python = { 'black', 'isort' },
|
python = { 'black', 'isort' },
|
||||||
|
json = { 'prettierd' },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -936,5 +940,21 @@ require('lazy').setup({
|
|||||||
-- end,
|
-- end,
|
||||||
-- })
|
-- })
|
||||||
|
|
||||||
|
-- Autoindent json by 2 spaces
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
pattern = 'json',
|
||||||
|
callback = function()
|
||||||
|
vim.bo.shiftwidth = 2
|
||||||
|
vim.bo.tabstop = 2
|
||||||
|
vim.bo.softtabstop = 2
|
||||||
|
vim.bo.expandtab = true
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
-- Keymap to reload config
|
||||||
|
vim.keymap.set('n', '<leader>rr', function()
|
||||||
|
dofile(vim.env.MYVIMRC)
|
||||||
|
print 'Reloaded init.lua'
|
||||||
|
end, { desc = 'Reload init.lua' })
|
||||||
|
|
||||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
|||||||
@@ -123,16 +123,16 @@ return {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- Change breakpoint icons
|
-- Change breakpoint icons
|
||||||
-- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' })
|
vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' })
|
||||||
-- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' })
|
vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' })
|
||||||
-- local breakpoint_icons = vim.g.have_nerd_font
|
local breakpoint_icons = vim.g.have_nerd_font
|
||||||
-- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' }
|
and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' }
|
||||||
-- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' }
|
or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' }
|
||||||
-- for type, icon in pairs(breakpoint_icons) do
|
for type, icon in pairs(breakpoint_icons) do
|
||||||
-- local tp = 'Dap' .. type
|
local tp = 'Dap' .. type
|
||||||
-- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak'
|
local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak'
|
||||||
-- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl })
|
vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl })
|
||||||
-- end
|
end
|
||||||
|
|
||||||
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
||||||
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
||||||
|
|||||||
Reference in New Issue
Block a user