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