Skip to content

Commit

Permalink
iMac Home (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
🤖 automated authored and chrisgrieser committed Sep 14, 2024
1 parent e137fae commit 8140737
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
49 changes: 26 additions & 23 deletions nvim/lua/config/options.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
--------------------------------------------------------------------------------
-- GENERAL

vim.opt.undofile = true -- enables persistent undo history
Expand All @@ -15,19 +14,8 @@ vim.opt.splitright = true -- split right instead of left
vim.opt.splitbelow = true -- split down instead of up

vim.opt.cursorline = true
vim.opt.signcolumn = "yes:1"

-- By default, vim automatically sets `textwidth` to follow the
-- `max_line_length` value of `editorconfig`. However, I prefer to keep have
-- different values for `textwidth` and `max_line_length`, so vim behavior like
-- `gww` or auto-breaking comment still follows `textwidth`, while using a wider
-- line length setting for formatters. Setting those values independently is not
-- possible normally, so we disable the respective in the `editorconfig` module
-- instead as a workaround.
require("editorconfig").properties.max_line_length = nil
vim.opt.textwidth = 80

vim.opt.colorcolumn = "+1" -- one more than textwidth
vim.opt.signcolumn = "yes:1"

vim.opt.wrap = false
vim.opt.breakindent = true -- indent wrapped lines
Expand All @@ -47,15 +35,9 @@ vim.opt.sidescrolloff = 12
vim.g.baseScrolloff = 12 -- so scrolloff-changing functions can use this
vim.opt.scrolloff = vim.g.baseScrolloff

-- mostly set by .editorconfig, therefore only fallback
vim.opt.expandtab = false
vim.opt.tabstop = 3
vim.opt.shiftwidth = 3

vim.opt.shiftround = true
vim.opt.smartindent = true

-- Formatting `vim.opt.formatoptions:remove("o")` would not work, since it's overwritten by ftplugins having the `o` option (which many do). Therefore needs to be set via autocommand.
-- Formatting `vim.opt.formatoptions:remove("o")` would not work, since it's
-- overwritten by ftplugins having the `o` option (which many do). Therefore
-- needs to be set via autocommand.
vim.api.nvim_create_autocmd("FileType", {
callback = function(ctx)
if ctx.match ~= "markdown" then
Expand All @@ -65,6 +47,27 @@ vim.api.nvim_create_autocmd("FileType", {
end,
})

--------------------------------------------------------------------------------
-- EDITORCONFIG

-- By default, vim automatically sets `textwidth` to follow the
-- `max_line_length` value of `editorconfig`. However, I prefer to keep have
-- different values for `textwidth` and `max_line_length`, so vim behavior like
-- `gww` or auto-breaking comment still follows `textwidth`, while using a wider
-- line length setting for formatters. Setting those values independently is not
-- possible normally, so we disable the respective in the `editorconfig` module
-- instead as a workaround.
require("editorconfig").properties.max_line_length = nil
vim.opt.textwidth = 80

-- mostly set by `editorconfig`, therefore only fallback
vim.opt.expandtab = false
vim.opt.tabstop = 3
vim.opt.shiftwidth = 3

vim.opt.shiftround = true
vim.opt.smartindent = true

--------------------------------------------------------------------------------
-- FILETYPES

Expand All @@ -77,7 +80,7 @@ vim.filetype.add {
--------------------------------------------------------------------------------
-- DIRECTORIES

-- move to custom location where they are synced independently from the dotfiles repo
-- move to custom location where they are synced independently from the dotfiles
vim.opt.undodir = vim.g.syncedData .. "/undo"
vim.opt.viewdir = vim.g.syncedData .. "/view"
vim.opt.shadafile = vim.g.syncedData .. "/main.shada"
Expand Down
3 changes: 2 additions & 1 deletion nvim/lua/plugins/editing-support.lua
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,9 @@ return {
}
opts.langs = {
python = { string_content = gww }, -- python docstrings
rst = { paragraph = gww }, -- python docstrings (when rsg is injected)
rst = { paragraph = gww }, -- python docstrings (when rst is injected)
comment = { source = gww, element = gww }, -- comments in any language
lua = { comment = gww },
jsdoc = { source = gww, description = gww },
javascript = joinWithoutCurly,
typescript = joinWithoutCurly,
Expand Down

0 comments on commit 8140737

Please sign in to comment.