commit 4b1999d7f8273c746fd2e0a4e56af009985faff3
parent 82856e85736e4b8931de10adb8fa585d703aa33d
Author: Andrew <andrewlaack1@gmail.com>
Date: Sat, 23 Nov 2024 03:41:21 -0600
This is the last, I promise, I got the formatter to work correctly
Diffstat:
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua
@@ -136,4 +136,3 @@ vim.keymap.set("n", "-", [[<cmd>vertical resize -5<cr>]]) -- make the window sma
vim.keymap.set("n", "+", [[<cmd>horizontal resize +2<cr>]]) -- make the window bigger horizontally by pressing shift and =
vim.keymap.set("n", "_", [[<cmd>horizontal resize -2<cr>]]) -- make the window smaller horizontally by pressing shift and -
-vim.keymap.set("n", "<leader>r", vim.lsp.buf.format)
diff --git a/lua/core/plugins.lua b/lua/core/plugins.lua
@@ -76,18 +76,25 @@ return require('packer').startup(function(use)
-- formatting
- use 'jose-elias-alvarez/null-ls.nvim'
- local null_ls = require("null-ls")
-
- null_ls.setup({
- sources = {
- null_ls.builtins.formatting.stylua,
- null_ls.builtins.diagnostics.eslint,
- null_ls.builtins.completion.spell,
- null_ls.builtins.formatting.csharpier
- },
+ use 'stevearc/conform.nvim'
+ require("conform").setup({
+ formatters_by_ft = {
+ lua = { "stylua" },
+ python = { "black" },
+ cs = {"csharpier"},
+ javascript = {"prettier"}
+
+ },
})
+require("conform").setup({
+ format_on_save = {
+ timeout_ms = 500,
+ lsp_format = "fallback",
+ },
+})
+
+
-- status bar
use {
'nvim-lualine/lualine.nvim',