Skip to content

Commit

Permalink
disable format on save, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
brightpuddle committed Jul 30, 2024
1 parent f95d70a commit 4b233c8
Show file tree
Hide file tree
Showing 17 changed files with 678 additions and 1,996 deletions.
326 changes: 264 additions & 62 deletions .Brewfile

Large diffs are not rendered by default.

52 changes: 25 additions & 27 deletions .config/alacritty/alacritty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,31 @@ duration = 0
[colors]
draw_bold_text_with_bright_colors = false

[colors.bright]
black = "#C6C3C3"
red = "#94253E"
green = "#3F5A22"
yellow = "#803D1C"
blue = "#1D5573"
magenta = "#7B3B70"
cyan = "#2B747C"
white = "#5C5C5C"
[colors.cursor]
cursor = "#353535"
text = "#EEEEEE"
[colors.normal]
black = "#EEEEEE"
blue = "#286486"
cyan = "#3B8992"
green = "#4F6C31"
magenta = "#88507D"
red = "#A8334C"
white = "#353535"
yellow = "#944927"
[colors.primary]
background = "#EEEEEE"
foreground = "#353535"
background = '#2E3440'
foreground = '#D8DEE9'

# Normal colors
[colors.normal]
black = '#3B4252'
red = '#BF616A'
green = '#A3BE8C'
yellow = '#EBCB8B'
blue = '#81A1C1'
magenta = '#B48EAD'
cyan = '#88C0D0'
white = '#E5E9F0'

# Bright colors
[colors.bright]
black = '#4C566A'
red = '#BF616A'
green = '#A3BE8C'
yellow = '#EBCB8B'
blue = '#81A1C1'
magenta = '#B48EAD'
cyan = '#8FBCBB'
white = '#ECEFF4'
[cursor]
style = "Block"
unfocused_hollow = true
Expand All @@ -58,12 +59,9 @@ style = "Medium Italic"
style = "Italic"

[font.normal]
family = "Noto Sans Mono"
family = "RobotoMono Nerd Font"
style = "Regular"

[font.offset]
# y = 2

[[keyboard.bindings]]
action = "CreateNewWindow"
key = "N"
Expand Down
2 changes: 1 addition & 1 deletion .config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require("config.filetype")
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
Expand Down
79 changes: 40 additions & 39 deletions .config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,70 @@
{
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"CopilotChat.nvim": { "branch": "canary", "commit": "4a5e07185b37d3132e5541d8fa42aa874b774476" },
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LazyVim": { "branch": "main", "commit": "d82c11f889b03effa5248170ac1b4b4681391f08" },
"LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" },
"LazyVim": { "branch": "main", "commit": "12818a6cb499456f4903c5d8e68af43753ebc869" },
"LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" },
"Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" },
"barbar.nvim": { "branch": "master", "commit": "d181f2cfd4b828f9c6f1e10e69c68241de59f54f" },
"barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" },
"barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
"better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" },
"better-escape.nvim": { "branch": "master", "commit": "f45b52f8f87792e8659526f23261ffe278a54be5" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "797d1f622a23d4a21bb58218bdf5999a9beac4ef" },
"copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" },
"dressing.nvim": { "branch": "master", "commit": "e3714c8049b2243e792492c4149e4cc395c68eb9" },
"gitsigns.nvim": { "branch": "main", "commit": "de18f6b749f6129eb9042a2038590872df4c94a9" },
"go.nvim": { "branch": "master", "commit": "8f8ab4b968d08bd70ecda1f2909fb5e6177452ca" },
"conform.nvim": { "branch": "master", "commit": "25d48271e3d4404ba017cb92a37d3a681c1ad149" },
"copilot.lua": { "branch": "master", "commit": "86537b286f18783f8b67bccd78a4ef4345679625" },
"dressing.nvim": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" },
"gitsigns.nvim": { "branch": "main", "commit": "f074844b60f9e151970fbcdbeb8a2cd52b6ef25a" },
"go.nvim": { "branch": "master", "commit": "86844a54b909f14229342ea540c5b68bddaf8431" },
"guihua.lua": { "branch": "master", "commit": "225db770e36aae6a1e9e3a65578095c8eb4038d3" },
"indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
"lazy.nvim": { "branch": "main", "commit": "eb4957442e3182f051b0ae11da32e06d22c190e3" },
"lsp-format.nvim": { "branch": "master", "commit": "3612642b0e2eb85015838df5dcfbacb61f15db98" },
"lsp-zero.nvim": { "branch": "v3.x", "commit": "16de3b18c5f7b6230d89b8e64ce9a4801b6f8d08" },
"lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"lush.nvim": { "branch": "main", "commit": "7c0e27f50901481fe83b974493c4ea67a4296aeb" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" },
"indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" },
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
"lsp-zero.nvim": { "branch": "v3.x", "commit": "56db3d5ce5476b183783160e6045f7337ba12b83" },
"lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" },
"lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" },
"lush.nvim": { "branch": "main", "commit": "6a254139d077ad53be7e4f3602c8da0c84447fd9" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "ba9c2f0b93deb48d0a99ae0e8d8dd36f7cc286d6" },
"mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" },
"mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" },
"neotest": { "branch": "master", "commit": "f30bab1faef13d47f3905e065215c96a42d075ad" },
"none-ls.nvim": { "branch": "main", "commit": "8691504118b252d64fc5023a104aedd100ab754a" },
"nui.nvim": { "branch": "main", "commit": "322978c734866996274467de084a95e4f9b5e0b1" },
"nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" },
"neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" },
"none-ls.nvim": { "branch": "main", "commit": "cfa65d86e21eeb60544d5e823f6db43941322a53" },
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
"nvim-autopairs": { "branch": "master", "commit": "e38c5d837e755ce186ae51d2c48e1b387c4425c6" },
"nvim-bufdel": { "branch": "main", "commit": "523d58e94e7212fff3e05c247b962dc8f93bcfde" },
"nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" },
"nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" },
"nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" },
"nvim-lspconfig": { "branch": "master", "commit": "4d38bece98300e3e5cd24a9aa0d0ebfea4951c16" },
"nvim-dap": { "branch": "master", "commit": "bc03b83c94d0375145ff5ac6a6dcf28c1241e06f" },
"nvim-dap-ui": { "branch": "master", "commit": "a5606bc5958db86f8d92803bea7400ee26a8d7e4" },
"nvim-lspconfig": { "branch": "master", "commit": "fdc44768a09a65140aa00c92872a5381ad486485" },
"nvim-navbuddy": { "branch": "master", "commit": "f22bac988f2dd073601d75ba39ea5636ab6e38cb" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-surround": { "branch": "main", "commit": "b36bf49d097a09781ad6ac0cfea28b40b74570a3" },
"nvim-treesitter": { "branch": "master", "commit": "26171d8f105d97746371d1b6c07c8d88bf13fec2" },
"nvim-ts-autotag": { "branch": "main", "commit": "06fe07d7523ba8c755fac7c913fceba43b1720ee" },
"nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" },
"oil.nvim": { "branch": "master", "commit": "c82b26eb4ba35c0eb7ec38d88dd400597fb34883" },
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
"nvim-treesitter": { "branch": "master", "commit": "cc69a061fed0fa1caae08079f7c5a55ded4a0765" },
"nvim-ts-autotag": { "branch": "main", "commit": "dc5e1687ab76ee02e0f11c5ce137f530b36e98b3" },
"nvim-web-devicons": { "branch": "master", "commit": "5be6c4e685618b99c3210a69375b38a1202369b4" },
"oil.nvim": { "branch": "master", "commit": "fcca212c2e966fc3dec1d4baf888e670631d25d1" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"render-markdown": { "branch": "main", "commit": "64969bc94a9d633dc23b59a382cab407c99fecb1" },
"render-markdown": { "branch": "main", "commit": "345596bb6ef2b0c0a145c59906c2e84dbddfbbd4" },
"rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" },
"sad.nvim": { "branch": "master", "commit": "869c7f3ca3dcd28fd78023db6a7e1bf8af0f4714" },
"smart-open.nvim": { "branch": "0.2.x", "commit": "87626ee8748b9bba22093adec7bb58c63e7214f0" },
"sqlite.lua": { "branch": "master", "commit": "d0ffd703b56d090d213b497ed4eb840495f14a11" },
"symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
"telescope.nvim": { "branch": "master", "commit": "f12b15e1b3a33524eb06a1ae7bc852fb1fd92197" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
"telescope.nvim": { "branch": "master", "commit": "10b8a82b042caf50b78e619d92caf0910211973d" },
"templ.vim": { "branch": "main", "commit": "5cc48b93a4538adca0003c4bc27af844bb16ba24" },
"todo-comments.nvim": { "branch": "main", "commit": "51e10f838e84b4756c16311d0b1ef0972c6482d2" },
"trouble.nvim": { "branch": "main", "commit": "60b0ac3772e991bc194207afc28368a5f15d913a" },
"todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" },
"trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" },
"vim-js": { "branch": "master", "commit": "90f340d31907590fad059cd9aab03a55ab49e352" },
"vim-jsx-pretty": { "branch": "master", "commit": "6989f1663cc03d7da72b5ef1c03f87e6ddb70b41" },
"vim-matchup": { "branch": "master", "commit": "1535a769d5dca851fe7d41b0be95f7c7203a4bef" },
"vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" },
"vim-terraform": { "branch": "master", "commit": "24de93afb05078bac6a2e966402cc1f672277708" },
"which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" },
"zenbones.nvim": { "branch": "main", "commit": "5746d0277439fe264108a2ecace83f09f1b57e1f" }
}
"which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" },
"zenbones.nvim": { "branch": "main", "commit": "e9ba8305f65524f9355515cdd8704b2c6ba2def6" }
}
32 changes: 23 additions & 9 deletions .config/nvim/lua/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,29 @@ local k = vim.keymap
-- Move them into the whichkey configuration

-- Search
k.set("n", "<C-p>", "<cmd>Telescope smart_open<cr>")
k.set("n", "<C-o>fa", "<cmd>Telescope<cr>")
k.set("n", "<C-o>fb", "<cmd>Telescope buffers<cr>")
k.set("n", "<C-p>", function()
require("telescope").extensions.smart_open.smart_open({ cwd_only = true })
end)
k.set("n", "<C-o>fa", "<cmd>Telescope<cr>", { desc = "Find all files" })
k.set("n", "<C-o>fb", "<cmd>Telescope buffers<cr>", { desc = "Find buffers" })
k.set("n", "<leader>fa", "<cmd>Telescope find_files<cr>", { desc = "Find files" })
k.set("n", "<leader>fb", "<cmd>Telescope buffers<cr>", { desc = "Find buffers" })
k.set("n", "<leader>fg", "<cmd>Telescope live_grep<cr>", { desc = "Find in files" })
k.set("n", "<leader>ft", "<cmd>Telescope tags<cr>", { desc = "Find tags" })
k.set("n", "<leader>fs", "<cmd>Telescope lsp_document_symbols<cr>", { desc = "Find symbols" })

-- j/k for wrapped text
k.set({ "n", "v" }, "j", "gj", { silent = true })
k.set({ "n", "v" }, "k", "gk", { silent = true })

-- Save
k.set({ "n", "i" }, "<C-o>w", "<cmd>write<cr>", { silent = true })
k.set({ "n", "i" }, "<C-o>w", "<cmd>write<cr>", { silent = true, desc = "Save" })
-- Exit
k.set({ "n", "i" }, "<C-d>", "<cmd>BufDel<cr>", { silent = true })
k.set({ "n", "i" }, "<C-d>", "<cmd>BufDel<cr>", { silent = true, desc = "Quit" })
-- Undo
k.set({ "n", "i" }, "<C-o>z", "<cmd>undo<cr>")
k.set({ "n", "i" }, "<C-o>z", "<cmd>undo<cr>", { desc = "Undo" })
-- Format
k.set({ "n", "i" }, "<C-o>t", "<cmd>Format<cr>", { desc = "Format" })

-- Navigation
k.set({ "n", "i" }, "<C-w>h", "<cmd>NavigatorLeft<cr>")
Expand All @@ -28,10 +37,15 @@ k.set({ "n", "i" }, "<C-h>", "<cmd>NavigatorLeft<cr>")
k.set({ "n", "i" }, "<C-j>", "<cmd>NavigatorDown<cr>")
k.set({ "n", "i" }, "<C-k>", "<cmd>NavigatorUp<cr>")
k.set({ "n", "i" }, "<C-l>", "<cmd>NavigatorRight<cr>")

k.set("n", "<leader>h", "<cmd>NavigatorLeft<cr>", { desc = "Window left" })
k.set("n", "<leader>j", "<cmd>NavigatorDown<cr>", { desc = "Window down" })
k.set("n", "<leader>k", "<cmd>NavigatorUp<cr>", { desc = "Window up" })
k.set("n", "<leader>l", "<cmd>NavigatorRight<cr>", { desc = "Window right" })
k.set("n", "<leader>wo", "<cmd>only<cr>")

-- Copilot
k.set({ "n", "i" }, "<C-o>c", "<cmd>Copilot panel<cr>")
k.set({ "n", "i" }, "<C-o>c", "<cmd>Copilot panel<cr>", { desc = "Copilot" })

-- Buffer navigation
k.set("n", "<leader>]", "<cmd>BufferNext<cr>")
Expand All @@ -51,8 +65,8 @@ k.set({ "n", "i" }, "<C-o>b", "<cmd>Neotree toggle<cr>")
k.set("n", "<leader>ob", "<cmd>Neotree toggle buffers<cr>")

-- Diagnostics
k.set({ "n", "i" }, "<C-o>j", "<cmd>Trouble diagnostics toggle<cr>", { silent = true })
k.set("n", "<leader>oj", "<cmd>TroubleToggle<cr>")
k.set({ "n", "i" }, "<C-o>j", "<cmd>Trouble diagnostics toggle<cr>", { silent = true, desc = "Trouble Diagnostics" })
k.set("n", "<leader>oj", "<cmd>TroubleToggle<cr>", { desc = "Trouble Diagnostics" })
k.set("n", "<leader>j", "<cmd>lua vim.diagnostic.goto_next()<cr>")
k.set("n", "<leader>k", "<cmd>lua vim.diagnostic.goto_prev()<cr>")
k.set({ "n", "i" }, "<C-o>k", "<cmd>SymbolsOutline<cr>", { silent = true })
Expand Down
32 changes: 22 additions & 10 deletions .config/nvim/lua/plugins/conform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ return {
},
},
formatters_by_ft = {
go = { "gofumpt", "golines" },
go = { "gofumpt" },
gohtmltmpl = { "djlint", "rustywind" },
javascript = { "biome", "rustywind" },
javascriptreact = { "biome", "rustywind" },
json = { "fixjson" },
json = { "jq" },
lua = { "stylua" },
python = { "isort", "ruff_fix", "ruff_format" },
sh = { "shfmt" },
Expand All @@ -22,17 +22,29 @@ return {
toml = { "taplo" },
v = { "vfmt" },
xml = { "xmllint" },
yaml = { "yamlfmt" },
yaml = { "yq" },
},
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return { timeout_ms = 500, lsp_fallback = true }
end,
-- format_on_save = function(bufnr)
-- -- Disable with a global or buffer-local variable
-- if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
-- return
-- end
-- return { timeout_ms = 500, lsp_fallback = true }
-- end,
})

vim.api.nvim_create_user_command("Format", function(args)
local range = nil
if args.count ~= -1 then
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
range = {
start = { args.line1, 0 },
["end"] = { args.line2, end_line:len() },
}
end
require("conform").format({ async = true, lsp_format = "fallback", range = range })
end, { range = true })

vim.api.nvim_create_user_command("FormatDisable", function(args)
if args.bang then
-- FormatDisable! will disable formatting just for this buffer
Expand Down
18 changes: 16 additions & 2 deletions .config/nvim/lua/plugins/copilot.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
return {
"zbirenbaum/copilot.lua",
cmd = "Copilot",
"CopilotC-Nvim/CopilotChat.nvim",
branch = "canary",
dependencies = {
{ "zbirenbaum/copilot.lua" },
{ "nvim-lua/plenary.nvim" },
},
cmd = { "Copilot", "CopilotChat" },
event = "InsertEnter",
config = function()
require("copilot").setup({
Expand All @@ -9,5 +14,14 @@ return {
auto_trigger = true,
},
})
require("CopilotChat").setup({
debug = true,
})
end,
}

-- return {
-- "zbirenbaum/copilot.lua",
-- cmd = "Copilot",
-- event = "InsertEnter",
-- }
Loading

0 comments on commit 4b233c8

Please sign in to comment.