diff --git a/lua/keymaps.lua b/lua/keymaps.lua index e90d3d2..48dcef7 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -46,24 +46,18 @@ map("n", "dbp", function() require("dap").toggle_breakpoint() end) map("n", "drc", function() require("dap").run_to_cursor() end) -- Barbar -local bk = vim.fn.has("macunix") == 1 and "M" or "A" -local bar = { - [","] = "BufferPrevious", - ["."] = "BufferNext", - ["<"] = "BufferMovePrevious", - [">"] = "BufferMoveNext", - ["p"] = "BufferPin", - ["w"] = "BufferClose", - ["0"] = "BufferLast", -} -for k, cmd in pairs(bar) do - map("n", ("<%s-%s>"):format(bk, k), ("%s"):format(cmd), silent) -end +map("n", "H", "BufferPrevious", silent) +map("n", "L", "BufferNext", silent) +map("n", "<", "BufferMovePrevious", silent) +map("n", ">", "BufferMoveNext", silent) +map("n", "bp", "BufferPin", silent) +map("n", "bw", "BufferClose", silent) +map("n", "b$", "BufferLast", silent) +map("n", "bb", "BufferPick", silent) +map("n", "bd", "BufferPickDelete", silent) for i = 1, 9 do - map("n", ("<%s-%d>"):format(bk, i), ("BufferGoto %d"):format(i), silent) + map("n", ("%d"):format(i), ("BufferGoto %d"):format(i), silent) end -map("n", "", "BufferPick", silent) -map("n", "", "BufferPickDelete", silent) -- Flash map({ "n", "x", "o" }, "s", function() require("flash").jump() end, { desc = "Flash" }) diff --git a/lua/plugins.lua b/lua/plugins.lua index ec1ceb6..c36e4b6 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -3,9 +3,9 @@ vim.pack.add({ { src = "https://github.com/stevearc/oil.nvim" }, { src = "https://github.com/echasnovski/mini.pick" }, { src = "https://github.com/neovim/nvim-lspconfig" }, - { src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" }, + { src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" }, { src = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects", version = "main" }, - { src = "https://github.com/Saghen/blink.cmp", version = "v1.7.0" }, + { src = "https://github.com/Saghen/blink.cmp", version = "v1.7.0" }, { src = "https://github.com/mason-org/mason.nvim" }, { src = "https://github.com/nvim-lualine/lualine.nvim.git" }, { src = "https://github.com/chomosuke/typst-preview.nvim" }, @@ -25,6 +25,7 @@ vim.pack.add({ { src = "https://github.com/nvim-neotest/nvim-nio" }, { src = "https://github.com/rcarriga/nvim-dap-ui" }, { src = "https://github.com/michaelrommel/nvim-silicon" }, + { src = "https://github.com/hat0uma/csvview.nvim.git" }, }) pcall(vim.cmd.colorscheme, "gruvbox") @@ -34,7 +35,7 @@ vim.api.nvim_set_hl(0, "FlashLabel", { fg = "#1d2021", bg = "#fe8019", bold = tr for _, name in ipairs({ "oil", "mini.pick", "mason", "typst-preview", "nvim-autopairs", "trouble", "gitsigns", "nvim-web-devicons", "barbar", - "mini.ai", "nvim-ts-autotag", "todo-comments", "flash", + "mini.ai", "nvim-ts-autotag", "todo-comments", "flash", "cssview", }) do pcall(function() require(name).setup() end) end @@ -53,6 +54,7 @@ require("conform").setup({ json = prettier, markdown = prettier, yaml = prettier, + haskell = { "fourmolu" }, }, formatters = { prettier = { prepend_args = { "--tab-width", "4", "--use-tabs", "false" } }, @@ -140,9 +142,14 @@ vim.api.nvim_create_autocmd("FileType", { -- TS textobjects local tso = require("nvim-treesitter-textobjects.select") -local textobj = { af = "@function.outer", ["if"] = "@function.inner", - ac = "@class.outer", ic = "@class.inner", - al = "@loop.outer", il = "@loop.inner" } +local textobj = { + af = "@function.outer", + ["if"] = "@function.inner", + ac = "@class.outer", + ic = "@class.inner", + al = "@loop.outer", + il = "@loop.inner" +} for lhs, query in pairs(textobj) do vim.keymap.set({ "x", "o" }, lhs, function() tso.select_textobject(query, "textobjects") end)