nvim: styles, keybindings, etc

This commit is contained in:
insects 2025-04-10 18:09:58 +02:00
parent 4e1fba9299
commit 8a30fffd64
5 changed files with 87 additions and 21 deletions

View file

@ -1 +1,2 @@
require("settings")
require("config.lazy") require("config.lazy")

View file

@ -11,9 +11,46 @@ return {
dashboard = { enabled = true }, dashboard = { enabled = true },
indent = { enabled = true, animate = { enabled = false } }, indent = { enabled = true, animate = { enabled = false } },
input = { enabled = true }, input = { enabled = true },
lazygit = { enabled = true }, lazygit = { enabled = true, configure = true },
picker = { enabled = true },
quickfile = { enabled = true }, quickfile = { enabled = true },
statuscolumn = { enabled = true } statuscolumn = { enabled = true },
} },
} keys = {
{
"<leader>gg",
function()
require("snacks").lazygit()
end,
desc = "Open LazyGit",
},
},
},
{
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
lua = { "stylua" },
},
format_on_save = {
timeout_ms = 500,
lsp_format = "fallback",
},
},
},
{
"zapling/mason-conform.nvim",
depends = {
"williamboman/mason.nvim",
"stevearc/conform.nvim",
},
opts = {},
},
{
"mrjones2014/legendary.nvim",
priority = 999,
opts = {
extensions = { lazy_nvim = true },
},
},
} }

View file

@ -5,14 +5,21 @@ return {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
config = function() config = function()
local telescope = require("telescope") local telescope = require("telescope")
telescope.setup() telescope.setup({})
telescope.load_extension("chezmoi") telescope.load_extension("chezmoi")
end end,
keys = {
{
"<leader><space>",
"<cmd>Telescope find_files<cr>",
desc = "Find files",
},
},
}, },
{ {
"xvzc/chezmoi.nvim", "xvzc/chezmoi.nvim",
config = function() config = function()
require("chezmoi").setup { require("chezmoi").setup({
-- Treat all files in my chezmoi source directory as source files -- Treat all files in my chezmoi source directory as source files
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" }, pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" },
@ -22,9 +29,9 @@ return {
require("chezmoi.commands.__edit").watch(bufnr) require("chezmoi.commands.__edit").watch(bufnr)
end end
vim.schedule(edit_watch) vim.schedule(edit_watch)
end end,
}),
}) })
} end,
end
}, },
} }

View file

@ -0,0 +1,18 @@
local o = vim.opt
o.number = true -- line numbers
o.clipboard = "unnamedplus" -- use the clipboard register
o.syntax = "on" -- syntaxxxx
o.autoindent = true -- keep indents from prev line
o.cursorline = true -- highlight bg of current line
o.expandtab = true -- in insert, handle <tab> correctly
o.shiftwidth = 2 -- 2 spaces
o.tabstop = 2 -- 2-wide tabs
o.encoding = "UTF-8" -- obligatory
o.ruler = true -- show location of cursor
o.mouse = "a" -- enable mouse on all modes
o.title = true -- update the window title
o.wildmenu = true -- get wild
o.showmatch = true -- jump to matching bracket
o.splitright = true -- split right
o.splitbelow = true -- split below

View file

@ -0,0 +1,3 @@
indent_type = "Spaces"
indent_width = 2
column_width = 120