chore: better format on save for python

This commit is contained in:
Bogdan Buduroiu 2024-11-07 15:25:47 +08:00
parent 842cc8df30
commit fc6b1e5fe5
Signed by: bruvduroiu
GPG key ID: A8722B2334DE9499
5 changed files with 34 additions and 26 deletions

View file

@ -30,6 +30,7 @@
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" },
"vim-kitty-navigator": { "branch": "master", "commit": "20abf8613aa228a5def1ae02cd9da0f2d210352a" },
"vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" },
"vim-xcode": { "branch": "main", "commit": "2adc409bd7bb58499218f4f487c825e55306e46d" },
"volt": { "branch": "main", "commit": "43f72b49037c191eb3cfe26ba7a5574b4bfce226" },
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" },
"zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" }

View file

@ -3,7 +3,7 @@ local options = {
lua = { "stylua" },
css = { "prettier" },
html = { "prettier" },
python = { "ruff_format" },
python = { "ruff_format", "ruff_fix", "ruff_organize_imports" },
go = { "goimports", "gofmt" },
json = { "jq" },
},

View file

@ -13,8 +13,8 @@ local servers = {
},
ruff = {
lint = {
run = "onSave"
}
run = "onSave",
},
},
zls = {},
@ -33,7 +33,7 @@ local servers = {
ts_ls = {
settings = {
completions = {
completeFunctionCalls = true
completeFunctionCalls = true,
},
},
},
@ -51,4 +51,3 @@ for name, opts in pairs(servers) do
require("lspconfig")[name].setup(opts)
end

View file

@ -1,6 +1,6 @@
require "nvchad.options"
require("nvchad.options")
-- add yours here!
-- local o = vim.o
-- o.cursorlineopt ='both' -- to enable cursorline!
local o = vim.o
o.cursorlineopt = "both" -- to enable cursorline!

View file

@ -1,7 +1,7 @@
return {
{
"stevearc/conform.nvim",
event = 'BufWritePre', -- uncomment for format on save
event = "BufWritePre", -- uncomment for format on save
opts = require "configs.conform",
},
@ -17,9 +17,14 @@ return {
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"vim", "lua", "vimdoc",
"html", "css", "python",
"typescript", "go"
"vim",
"lua",
"vimdoc",
"html",
"css",
"python",
"typescript",
"go",
},
},
},
@ -28,13 +33,16 @@ return {
cmd = { "Git", "G", "Gdiffsplit", "Gvdiffsplit", "Gwrite", "Gread", "Ggrep", "GMove", "GDelete", "GBrowse" },
keys = {
{ "<leader>gs", "<cmd>vertical Git<cr>" },
desc = "Open Fugitive"
desc = "Open Fugitive",
},
opts = {
enabled = true
}
enabled = true,
},
dependencies = {
"tpope/vim-rhubarb",
},
},
{ "tpope/vim-rhubarb", opts = { enabled = true, lazy = false } },
{ "tpope/vim-rhubarb", opts = { enabled = true } },
{
"folke/zen-mode.nvim",
cmd = "ZenMode",
@ -54,12 +62,12 @@ return {
auto_open = false,
warn_no_results = false,
modes = {
symbols = { -- Configure symbols mode
symbols = { -- Configure symbols mode
win = {
type = "split", -- split window
relative = "win", -- relative to current window
type = "split", -- split window
relative = "win", -- relative to current window
position = "right", -- right side
size = 0.15, -- 30% of the window
size = 0.15, -- 30% of the window
},
},
},
@ -112,11 +120,11 @@ return {
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
},
},
@ -125,8 +133,8 @@ return {
enabled = true,
lazy = false,
build = {
"cp ./*.py ~/.config/kitty/"
}
"cp ./*.py ~/.config/kitty/",
},
},
{
"gfontenot/vim-xcode",