fixed formatoptions not behaving
This commit is contained in:
parent
6110d93076
commit
8a5a751b99
2 changed files with 26 additions and 16 deletions
|
@ -1,5 +1,5 @@
|
|||
require("tsousa.remap")
|
||||
require("tsousa.set")
|
||||
require("tsousa.remap")
|
||||
require("tsousa.lazy")
|
||||
|
||||
local augroup = vim.api.nvim_create_augroup
|
||||
|
@ -12,6 +12,14 @@ function R(name)
|
|||
require("plenary.reload").reload_module(name)
|
||||
end
|
||||
|
||||
autocmd('BufWinEnter',{
|
||||
group= TsousaGroup,
|
||||
pattern = '*',
|
||||
callback = function()
|
||||
vim.opt.formatoptions:remove('o')
|
||||
end
|
||||
})
|
||||
|
||||
autocmd('TextYankPost', {
|
||||
group = yank_group,
|
||||
pattern = '*',
|
||||
|
@ -46,7 +54,6 @@ autocmd("LspAttach", {
|
|||
end
|
||||
})
|
||||
|
||||
|
||||
vim.g.netrw_browse_split = 0
|
||||
vim.g.netrw_banner = 0
|
||||
vim.g.netrw_winsize = 25
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
vim.opt.wildignore = "__pycache__"
|
||||
vim.opt.wildignore:append { "*.o", "*~", "*.pyc", "*pycache*" }
|
||||
vim.opt.wildignore:append { "Cargo.lock", "Cargo.Bazel.lock" }
|
||||
|
||||
vim.opt.guicursor = ""
|
||||
|
||||
vim.opt.nu = true
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.errorbells = false
|
||||
|
@ -22,7 +26,7 @@ vim.opt.showmode = false
|
|||
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true
|
||||
|
||||
vim.opt.showmatch = true
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
|
@ -31,15 +35,15 @@ vim.opt.isfname:append("@-@")
|
|||
|
||||
-- from tj devries
|
||||
vim.opt.formatoptions = vim.opt.formatoptions
|
||||
- "o" -- O and o, don't continue comments
|
||||
- "a" -- Auto formatting is BAD.
|
||||
- "t" -- Don't auto format my code. I got linters for that.
|
||||
- "2" -- I'm not in gradeschool anymore
|
||||
+ "c" -- In general, I like it when comments respect textwidth
|
||||
+ "q" -- Allow formatting comments w/ gq
|
||||
- "o" -- O and o, don't continue comments
|
||||
+ "r" -- But do continue when pressing enter.
|
||||
+ "n" -- Indent past the formatlistpat, not underneath it.
|
||||
+ "j" -- Auto-remove comments if possible.
|
||||
- "2" -- I'm not in gradeschool anymore
|
||||
|
||||
-- Give more space for displaying messages.
|
||||
vim.opt.cmdheight = 1
|
||||
|
@ -54,4 +58,3 @@ vim.opt.shortmess:append("c")
|
|||
vim.opt.colorcolumn = "80"
|
||||
|
||||
vim.g.mapleader = " "
|
||||
|
||||
|
|
Loading…
Reference in a new issue