|
|
|
|
@@ -5,43 +5,43 @@ vim.wo.number = true
|
|
|
|
|
vim.opt.relativenumber = true
|
|
|
|
|
vim.opt.mouse = "a"
|
|
|
|
|
vim.opt.clipboard = "unnamedplus"
|
|
|
|
|
vim.opt.breakindent = true -- Enable break indent
|
|
|
|
|
vim.opt.undofile = true -- Save undo history
|
|
|
|
|
vim.opt.ignorecase = true -- ignore case in searches by default
|
|
|
|
|
vim.opt.smartcase = true -- but make it case sensitive if an uppercase is entered
|
|
|
|
|
vim.w.signcolumn = "yes" -- Keep signcolumn on by default
|
|
|
|
|
vim.opt.updatetime = 250 -- Decrease update time
|
|
|
|
|
vim.opt.timeoutlen = 300 -- time to wait for a mapped sequence to complete (in milliseconds)
|
|
|
|
|
vim.opt.backup = false -- creates a backup file
|
|
|
|
|
vim.opt.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
|
|
|
|
|
vim.opt.breakindent = true -- Enable break indent
|
|
|
|
|
vim.opt.undofile = true -- Save undo history
|
|
|
|
|
vim.opt.ignorecase = true -- ignore case in searches by default
|
|
|
|
|
vim.opt.smartcase = true -- but make it case sensitive if an uppercase is entered
|
|
|
|
|
vim.w.signcolumn = "yes" -- Keep signcolumn on by default
|
|
|
|
|
vim.opt.updatetime = 250 -- Decrease update time
|
|
|
|
|
vim.opt.timeoutlen = 300 -- time to wait for a mapped sequence to complete (in milliseconds)
|
|
|
|
|
vim.opt.backup = false -- creates a backup file
|
|
|
|
|
vim.opt.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
|
|
|
|
|
vim.opt.completeopt = "menuone,noselect" -- Set completeopt to have a better completion experience
|
|
|
|
|
vim.opt.termguicolors = true -- set termguicolors to enable highlight groups
|
|
|
|
|
vim.opt.whichwrap = "bs<>[]hl" -- which "horizontal" keys are allowed to travel to prev/next line
|
|
|
|
|
vim.opt.wrap = false -- display lines as one long line
|
|
|
|
|
vim.opt.linebreak = true -- companion to wrap don't split words
|
|
|
|
|
vim.opt.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor
|
|
|
|
|
vim.opt.sidescrolloff = 8 -- minimal number of screen columns either side of cursor if wrap is `false`
|
|
|
|
|
vim.opt.numberwidth = 2 -- set number column width to 2 {default 4}
|
|
|
|
|
vim.opt.shiftwidth = 4 -- Number of spaces inserted when indenting
|
|
|
|
|
vim.opt.tabstop = 4 -- A TAB character looks like 4 spaces
|
|
|
|
|
vim.opt.softtabstop = 4 -- Number of spaces inserted instead of a TAB character
|
|
|
|
|
vim.opt.expandtab = true -- Pressing the TAB key will insert spaces instead of a TAB character
|
|
|
|
|
vim.opt.termguicolors = true -- set termguicolors to enable highlight groups
|
|
|
|
|
vim.opt.whichwrap = "bs<>[]hl" -- which "horizontal" keys are allowed to travel to prev/next line
|
|
|
|
|
vim.opt.wrap = false -- display lines as one long line
|
|
|
|
|
vim.opt.linebreak = true -- companion to wrap don't split words
|
|
|
|
|
vim.opt.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor
|
|
|
|
|
vim.opt.sidescrolloff = 8 -- minimal number of screen columns either side of cursor if wrap is `false`
|
|
|
|
|
vim.opt.numberwidth = 2 -- set number column width to 2 {default 4}
|
|
|
|
|
vim.opt.shiftwidth = 4 -- Number of spaces inserted when indenting
|
|
|
|
|
vim.opt.tabstop = 4 -- A TAB character looks like 4 spaces
|
|
|
|
|
vim.opt.softtabstop = 4 -- Number of spaces inserted instead of a TAB character
|
|
|
|
|
vim.opt.expandtab = true -- Pressing the TAB key will insert spaces instead of a TAB character
|
|
|
|
|
vim.opt.cursorline = true
|
|
|
|
|
vim.opt.splitbelow = true -- open new vertical split bottom
|
|
|
|
|
vim.opt.splitright = true -- open new horizontal splits right
|
|
|
|
|
vim.opt.swapfile = false -- creates a swapfile
|
|
|
|
|
vim.opt.smartindent = true -- make indenting smarter again
|
|
|
|
|
vim.opt.showtabline = 2 -- always show tabs
|
|
|
|
|
vim.opt.backspace = "indent,eol,start" -- allow backspace on
|
|
|
|
|
vim.opt.pumheight = 10 -- pop up menu height
|
|
|
|
|
vim.wo.conceallevel = 0 -- so that `` is visible in markdown files
|
|
|
|
|
vim.opt.encoding = "utf-8" -- the encoding written to a file
|
|
|
|
|
vim.opt.cmdheight = 1 -- more space in the neovim command line for displaying messages
|
|
|
|
|
vim.opt.splitbelow = true -- open new vertical split bottom
|
|
|
|
|
vim.opt.splitright = true -- open new horizontal splits right
|
|
|
|
|
vim.opt.swapfile = false -- creates a swapfile
|
|
|
|
|
vim.opt.smartindent = true -- make indenting smarter again
|
|
|
|
|
vim.opt.showtabline = 2 -- always show tabs
|
|
|
|
|
vim.opt.backspace = "indent,eol,start" -- allow backspace on
|
|
|
|
|
vim.opt.pumheight = 10 -- pop up menu height
|
|
|
|
|
vim.wo.conceallevel = 0 -- so that `` is visible in markdown files
|
|
|
|
|
vim.opt.encoding = "utf-8" -- the encoding written to a file
|
|
|
|
|
vim.opt.cmdheight = 1 -- more space in the neovim command line for displaying messages
|
|
|
|
|
vim.opt.autoindent = true
|
|
|
|
|
|
|
|
|
|
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({ "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.shortmess:append("c") -- don't give |ins-completion-menu| messages
|
|
|
|
|
vim.opt.iskeyword:append("-") -- hyphenated words recognized by searches
|
|
|
|
|
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.foldmethod = "expr"
|
|
|
|
|
@@ -52,31 +52,27 @@ vim.opt.foldlevelstart = 99
|
|
|
|
|
vim.opt.foldnestmax = 6
|
|
|
|
|
vim.opt.incsearch = true -- search as characters are entered
|
|
|
|
|
|
|
|
|
|
vim.opt.tags:append({ ".git/tags", "tags" })
|
|
|
|
|
|
|
|
|
|
vim.opt.shell = "/bin/zsh"
|
|
|
|
|
|
|
|
|
|
-- remove trailing whitespace
|
|
|
|
|
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
|
|
|
|
pattern = { "*" },
|
|
|
|
|
callback = function()
|
|
|
|
|
local save_cursor = vim.fn.getpos(".")
|
|
|
|
|
pcall(function()
|
|
|
|
|
vim.cmd([[%s/\s\+$//e]])
|
|
|
|
|
end)
|
|
|
|
|
vim.fn.setpos(".", save_cursor)
|
|
|
|
|
end,
|
|
|
|
|
pattern = { "*" },
|
|
|
|
|
callback = function()
|
|
|
|
|
local save_cursor = vim.fn.getpos(".")
|
|
|
|
|
pcall(function()
|
|
|
|
|
vim.cmd([[%s/\s\+$//e]])
|
|
|
|
|
end)
|
|
|
|
|
vim.fn.setpos(".", save_cursor)
|
|
|
|
|
end,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
-- local uv = vim.uv
|
|
|
|
|
local uv = vim.loop
|
|
|
|
|
|
|
|
|
|
vim.api.nvim_create_autocmd({ "VimEnter", "VimLeave" }, {
|
|
|
|
|
callback = function()
|
|
|
|
|
if vim.env.TMUX_PLUGIN_MANAGER_PATH then
|
|
|
|
|
uv.spawn(vim.env.TMUX_PLUGIN_MANAGER_PATH .. "/tmux-window-name/scripts/rename_session_windows.py", {})
|
|
|
|
|
end
|
|
|
|
|
end,
|
|
|
|
|
callback = function()
|
|
|
|
|
if vim.env.TMUX_PLUGIN_MANAGER_PATH then
|
|
|
|
|
uv.spawn(vim.env.TMUX_PLUGIN_MANAGER_PATH .. "/tmux-window-name/scripts/rename_session_windows.py", {})
|
|
|
|
|
end
|
|
|
|
|
end,
|
|
|
|
|
})
|
|
|
|
|
--
|
|
|
|
|
-- Filetypes to enable spellcheck
|
|
|
|
|
@@ -90,11 +86,10 @@ vim.api.nvim_create_augroup("Spellcheck", { clear = true })
|
|
|
|
|
|
|
|
|
|
-- Create an autocommand to enable spellcheck for specified file types
|
|
|
|
|
vim.api.nvim_create_autocmd({ "FileType" }, {
|
|
|
|
|
group = "Spellcheck", -- Grouping the command for easier management
|
|
|
|
|
pattern = spell_types, -- Only apply to these file types
|
|
|
|
|
callback = function()
|
|
|
|
|
vim.opt_local.spell = true -- Enable spellcheck for these file types
|
|
|
|
|
end,
|
|
|
|
|
desc = "Enable spellcheck for defined filetypes", -- Description for clarity
|
|
|
|
|
group = "Spellcheck", -- Grouping the command for easier management
|
|
|
|
|
pattern = spell_types, -- Only apply to these file types
|
|
|
|
|
callback = function()
|
|
|
|
|
vim.opt_local.spell = true -- Enable spellcheck for these file types
|
|
|
|
|
end,
|
|
|
|
|
desc = "Enable spellcheck for defined filetypes", -- Description for clarity
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|