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 -- Nvimtree
keymap("n", "<leader>e", ":NvimTreeToggle<cr>", opts) 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>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", "<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", "[d", '<cmd>lua vim.diagnostic.goto_prev({ border = "rounded" })<CR>', opts)
vim.api.nvim_buf_set_keymap( vim.api.nvim_buf_set_keymap(bufnr, "n", "gl", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
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", "]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.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()' ]] 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") local null_ls_status_ok, null_ls = pcall(require, "null-ls")
if not null_ls_status_ok then if not null_ls_status_ok then
return return
end end
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting -- 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 -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
local diagnostics = null_ls.builtins.diagnostics local diagnostics = null_ls.builtins.diagnostics
null_ls.setup({ null_ls.setup {
debug = false, debug = false,
sources = { sources = {
formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }), formatting.prettier.with { extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } },
formatting.black.with({ extra_args = { "--fast" } }), formatting.black.with { extra_args = { "--fast" } },
formatting.stylua, -- formatting.yapf,
diagnostics.flake8 formatting.stylua,
}, diagnostics.flake8,
}) },
}

Loading…
Cancel
Save