enc: move config auto br from autocmd to vertcolumn config

This commit is contained in:
asep.komarudin 2024-06-08 06:10:53 +07:00
parent e7cf581b2a
commit 33335939d0
4 changed files with 63 additions and 64 deletions

View file

@ -53,15 +53,3 @@ vim.g.VM_Insert_hl = "DiffChange"
-- end -- end
-- end, -- end,
-- }) -- })
-- Mengatur colum color max 80 caracter
-- vim.api.nvim_create_autocmd("BufWinEnter", {
-- pattern = "*",
-- callback = function()
-- vim.opt.formatoptions = "croql"
-- vim.opt.textwidth = 80
-- vim.opt.colorcolumn = "+1"
-- vim.opt.lazyredraw = false
-- vim.cmd "hi ColorColumn guibg=#1B2430 ctermbg=246"
-- end,
-- })

View file

@ -13,6 +13,17 @@ if vim.g.pcode_columnline then
}, },
char = icons.ui.LineMiddle, char = icons.ui.LineMiddle,
} }
-- Mengatur colum color max 80 caracter
vim.api.nvim_create_autocmd("BufWinEnter", {
pattern = "*",
callback = function()
vim.opt.formatoptions = "croql"
vim.opt.textwidth = 80
vim.opt.colorcolumn = "+1"
vim.opt.lazyredraw = false
-- vim.cmd "hi ColorColumn guibg=#1B2430 ctermbg=246"
end,
})
end, end,
}, },
} }

View file

@ -4,11 +4,11 @@ vim.cmd [[
autocmd! autocmd!
autocmd FileType qf,help,man,lspinfo nnoremap <silent> <buffer> q :close<CR> autocmd FileType qf,help,man,lspinfo nnoremap <silent> <buffer> q :close<CR>
autocmd TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Visual', timeout = 200}) autocmd TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Visual', timeout = 200})
autocmd BufWinEnter * :set formatoptions=croql " autocmd BufWinEnter * :set formatoptions=croql
autocmd BufWinEnter * :set textwidth=80 " autocmd BufWinEnter * :set textwidth=80
autocmd BufWinEnter * :set colorcolumn=+1 " autocmd BufWinEnter * :set colorcolumn=+1
autocmd BufWinEnter * :set nolazyredraw " autocmd BufWinEnter * :set nolazyredraw
autocmd BufWinEnter * :hi ColorColumn guibg=#1B243000 ctermbg=246 " autocmd BufWinEnter * :hi ColorColumn guibg=#1B243000 ctermbg=246
autocmd FileType qf set nobuflisted autocmd FileType qf set nobuflisted
augroup end augroup end

View file

@ -14,7 +14,7 @@ local options = {
laststatus = 3, -- globalstatus laststatus = 3, -- globalstatus
guicursor = "n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175", guicursor = "n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175",
lazyredraw = true, -- lazily redraw screen lazyredraw = false, -- lazily redraw screen
mouse = "a", -- Enable mouse support mouse = "a", -- Enable mouse support
number = true, -- Show numberline number = true, -- Show numberline
preserveindent = true, -- Preserve indent structure as much as possible preserveindent = true, -- Preserve indent structure as much as possible
@ -51,12 +51,12 @@ end
-- vim.opt.shortmess = "ilmnrx" -- flags to shorten vim messages, see :help 'shortmess' -- vim.opt.shortmess = "ilmnrx" -- flags to shorten vim messages, see :help 'shortmess'
-- vim.o.winbar = "%{%v:lua.require'nvim-navic'.get_location()%}" -- vim.o.winbar = "%{%v:lua.require'nvim-navic'.get_location()%}"
vim.opt.shortmess:append("c") -- don't give |ins-completion-menu| messages vim.opt.shortmess:append "c" -- don't give |ins-completion-menu| messages
vim.opt.iskeyword:append("-") -- hyphenated words recognized by searches vim.opt.iskeyword:append "-" -- hyphenated words recognized by searches
vim.opt.formatoptions:remove({ "t", "c", "q", "j" }) vim.opt.formatoptions:remove { "t", "c", "q", "j" }
vim.opt.formatoptions = "croql" vim.opt.formatoptions = "croql"
-- vim.opt.formatoptions:remove({ "c", "r", "o" }) -- don't insert the current comment leader automatically for auto-wrapping comments using 'textwidth', hitting <Enter> in insert mode, or hitting 'o' or 'O' in normal mode. -- vim.opt.formatoptions:remove({ "c", "r", "o" }) -- don't insert the current comment leader automatically for auto-wrapping comments using 'textwidth', hitting <Enter> in insert mode, or hitting 'o' or 'O' in normal mode.
vim.opt.runtimepath:remove("/usr/share/vim/vimfiles") -- separate vim plugins from neovim in case vim still in use vim.opt.runtimepath:remove "/usr/share/vim/vimfiles" -- separate vim plugins from neovim in case vim still in use
-- config for blink cursor in normal, visual and insert mode -- config for blink cursor in normal, visual and insert mode
-- vim.opt.guicursor = { -- vim.opt.guicursor = {
-- "n-v-c:block-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100", -- "n-v-c:block-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",