updates for video

14-null-ls
christianchiarulli 3 years ago
parent 65466d0b00
commit 8309138032

@ -69,3 +69,4 @@ keymap("t", "<C-l>", "<C-\\><C-N><C-w>l", term_opts)
-- Nvimtree
keymap("n", "<leader>e", ":NvimTreeToggle<cr>", opts)
keymap("n", "<leader>f", ":Format<cr>", opts)

@ -72,13 +72,7 @@ local function lsp_keymaps(bufnr)
-- vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
-- vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>f", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", '<cmd>lua vim.diagnostic.goto_prev({ border = "rounded" })<CR>', opts)
vim.api.nvim_buf_set_keymap(
bufnr,
"n",
"gl",
'<cmd>lua vim.diagnostic.open_float()<CR>',
opts
)
vim.api.nvim_buf_set_keymap(bufnr, "n", "gl", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", '<cmd>lua vim.diagnostic.goto_next({ border = "rounded" })<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]]

@ -1,6 +1,6 @@
local null_ls_status_ok, null_ls = pcall(require, "null-ls")
if not null_ls_status_ok then
return
return
end
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
@ -8,12 +8,13 @@ local formatting = null_ls.builtins.formatting
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
local diagnostics = null_ls.builtins.diagnostics
null_ls.setup({
debug = false,
sources = {
formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }),
formatting.black.with({ extra_args = { "--fast" } }),
formatting.stylua,
diagnostics.flake8
},
})
null_ls.setup {
debug = false,
sources = {
formatting.prettier.with { extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } },
formatting.black.with { extra_args = { "--fast" } },
-- formatting.yapf,
formatting.stylua,
diagnostics.flake8,
},
}

Loading…
Cancel
Save