diff --git a/lua/custom/autocmd.lua b/lua/custom/autocmd.lua index 4612db2..d6d992a 100644 --- a/lua/custom/autocmd.lua +++ b/lua/custom/autocmd.lua @@ -53,15 +53,3 @@ vim.g.VM_Insert_hl = "DiffChange" -- 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, --- }) diff --git a/lua/plugins/vertcolumn.lua b/lua/plugins/vertcolumn.lua index e461fe7..4e48f46 100644 --- a/lua/plugins/vertcolumn.lua +++ b/lua/plugins/vertcolumn.lua @@ -13,6 +13,17 @@ if vim.g.pcode_columnline then }, 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, }, } diff --git a/lua/user/autocommands.lua b/lua/user/autocommands.lua index ca9a573..f89c2aa 100644 --- a/lua/user/autocommands.lua +++ b/lua/user/autocommands.lua @@ -4,11 +4,11 @@ vim.cmd [[ autocmd! autocmd FileType qf,help,man,lspinfo nnoremap q :close autocmd TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Visual', timeout = 200}) - autocmd BufWinEnter * :set formatoptions=croql - autocmd BufWinEnter * :set textwidth=80 - autocmd BufWinEnter * :set colorcolumn=+1 - autocmd BufWinEnter * :set nolazyredraw - autocmd BufWinEnter * :hi ColorColumn guibg=#1B243000 ctermbg=246 + " autocmd BufWinEnter * :set formatoptions=croql + " autocmd BufWinEnter * :set textwidth=80 + " autocmd BufWinEnter * :set colorcolumn=+1 + " autocmd BufWinEnter * :set nolazyredraw + " autocmd BufWinEnter * :hi ColorColumn guibg=#1B243000 ctermbg=246 autocmd FileType qf set nobuflisted augroup end diff --git a/lua/user/options.lua b/lua/user/options.lua index 963075a..841f9b8 100644 --- a/lua/user/options.lua +++ b/lua/user/options.lua @@ -1,62 +1,62 @@ local options = { - backspace = vim.opt.backspace + { "nostop" }, -- Don't stop backspace at insert - clipboard = "unnamedplus", -- Connection to the system clipboard - cmdheight = 0, -- hide command line unless needed - completeopt = { "menuone", "noselect" }, -- Options for insert mode completion - copyindent = true, -- Copy the previous indentation on autoindenting - cursorline = true, -- Highlight the text line of the cursor - expandtab = true, -- Enable the use of space in tab - fileencoding = "utf-8", -- File content encoding for the buffer - fillchars = { eob = " " }, -- Disable `~` on nonexistent lines - history = 100, -- Number of commands to remember in a history table - ignorecase = true, -- Case insensitive searching + backspace = vim.opt.backspace + { "nostop" }, -- Don't stop backspace at insert + clipboard = "unnamedplus", -- Connection to the system clipboard + cmdheight = 0, -- hide command line unless needed + completeopt = { "menuone", "noselect" }, -- Options for insert mode completion + copyindent = true, -- Copy the previous indentation on autoindenting + cursorline = true, -- Highlight the text line of the cursor + expandtab = true, -- Enable the use of space in tab + fileencoding = "utf-8", -- File content encoding for the buffer + fillchars = { eob = " " }, -- Disable `~` on nonexistent lines + history = 100, -- Number of commands to remember in a history table + ignorecase = true, -- Case insensitive searching - 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", + 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", - lazyredraw = true, -- lazily redraw screen - mouse = "a", -- Enable mouse support - number = true, -- Show numberline - preserveindent = true, -- Preserve indent structure as much as possible - pumheight = 10, -- Height of the pop up menu - relativenumber = true, -- Show relative numberline - scrolloff = 8, -- Number of lines to keep above and below the cursor - shiftwidth = 2, -- Number of space inserted for indentation - showmode = false, -- Disable showing modes in command line - showtabline = 2, -- always display tabline - sidescrolloff = 8, -- Number of columns to keep at the sides of the cursor - signcolumn = "yes", -- Always show the sign column - smartcase = true, -- Case sensitivie searching - splitbelow = true, -- Splitting a new window below the current one - splitright = true, -- Splitting a new window at the right of the current one - swapfile = false, -- Disable use of swapfile for the buffer - tabstop = 2, -- Number of space in a tab - termguicolors = true, -- Enable 24-bit RGB color in the TUI - timeoutlen = 300, -- Length of time to wait for a mapped sequence - undofile = true, -- Enable persistent undo - updatetime = 300, -- Length of time to wait before triggering the plugin - wrap = false, -- Disable wrapping of lines longer than the width of window - writebackup = false, -- Disable making a backup before overwriting a file - -- minimal number of screen columns either side of cursor if wrap is `false` - -- guifont = "monospace:h17", -- the font used in graphical neovim applications - -- guifont = "SauceCodePro Nerd Font:h15", -- the font used in graphical neovim applications - guifont = "Hasklug Nerd Font:h15", -- the font used in graphical neovim applications - -- guifont = "Hack Nerd Font:h17", -- the font used in graphical neovim applications - whichwrap = "bs<>[]hl", -- which "horizontal" keys are allowed to travel to prev/next line -- which "horizontal" keys are allowed to travel to prev/next line + lazyredraw = false, -- lazily redraw screen + mouse = "a", -- Enable mouse support + number = true, -- Show numberline + preserveindent = true, -- Preserve indent structure as much as possible + pumheight = 10, -- Height of the pop up menu + relativenumber = true, -- Show relative numberline + scrolloff = 8, -- Number of lines to keep above and below the cursor + shiftwidth = 2, -- Number of space inserted for indentation + showmode = false, -- Disable showing modes in command line + showtabline = 2, -- always display tabline + sidescrolloff = 8, -- Number of columns to keep at the sides of the cursor + signcolumn = "yes", -- Always show the sign column + smartcase = true, -- Case sensitivie searching + splitbelow = true, -- Splitting a new window below the current one + splitright = true, -- Splitting a new window at the right of the current one + swapfile = false, -- Disable use of swapfile for the buffer + tabstop = 2, -- Number of space in a tab + termguicolors = true, -- Enable 24-bit RGB color in the TUI + timeoutlen = 300, -- Length of time to wait for a mapped sequence + undofile = true, -- Enable persistent undo + updatetime = 300, -- Length of time to wait before triggering the plugin + wrap = false, -- Disable wrapping of lines longer than the width of window + writebackup = false, -- Disable making a backup before overwriting a file + -- minimal number of screen columns either side of cursor if wrap is `false` + -- guifont = "monospace:h17", -- the font used in graphical neovim applications + -- guifont = "SauceCodePro Nerd Font:h15", -- the font used in graphical neovim applications + guifont = "Hasklug Nerd Font:h15", -- the font used in graphical neovim applications + -- guifont = "Hack Nerd Font:h17", -- the font used in graphical neovim applications + whichwrap = "bs<>[]hl", -- which "horizontal" keys are allowed to travel to prev/next line -- which "horizontal" keys are allowed to travel to prev/next line } for k, v in pairs(options) do - vim.opt[k] = v + vim.opt[k] = v end -- vim.opt.shortmess = "ilmnrx" -- flags to shorten vim messages, see :help 'shortmess' -- vim.o.winbar = "%{%v:lua.require'nvim-navic'.get_location()%}" -vim.opt.shortmess:append("c") -- don't give |ins-completion-menu| messages -vim.opt.iskeyword:append("-") -- hyphenated words recognized by searches -vim.opt.formatoptions:remove({ "t", "c", "q", "j" }) +vim.opt.shortmess:append "c" -- don't give |ins-completion-menu| messages +vim.opt.iskeyword:append "-" -- hyphenated words recognized by searches +vim.opt.formatoptions:remove { "t", "c", "q", "j" } 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 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 -- vim.opt.guicursor = { -- "n-v-c:block-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",