94 lines
1.9 KiB
Lua
94 lines
1.9 KiB
Lua
-- General global settings for neovim
|
|
|
|
local opt = vim.opt -- basically the same as set
|
|
|
|
opt.relativenumber = true -- might make this false if I hate it after using it
|
|
opt.number = true
|
|
vim.cmd([[colorscheme gruvbox]])
|
|
|
|
opt.ignorecase = true
|
|
opt.smartcase = true
|
|
opt.hlsearch = true
|
|
opt.incsearch = true
|
|
|
|
opt.splitright = true
|
|
opt.splitbelow = true
|
|
|
|
opt.updatetime = 1000
|
|
|
|
opt.scrolloff = 15
|
|
opt.sidescroll = 6
|
|
|
|
opt.termguicolors = true
|
|
|
|
opt.title = true
|
|
|
|
opt.spelllang='en_gb'
|
|
|
|
-- Ignore compiled files
|
|
opt.wildignore = "__pycache__"
|
|
opt.wildignore = opt.wildignore + { "*.o", "*~", "*.pyc", "*pycache*" }
|
|
|
|
-- Cool floating window popup menu for completion on command line
|
|
opt.pumblend = 17
|
|
opt.wildmode = "longest:full"
|
|
opt.wildoptions = "pum"
|
|
|
|
|
|
-- Cursorline highlighting control
|
|
-- Only have it on in the active buffer
|
|
opt.cursorline = true -- Highlight the current line
|
|
local group = vim.api.nvim_create_augroup("CursorLineControl", { clear = true })
|
|
local set_cursorline = function(event, value, pattern)
|
|
vim.api.nvim_create_autocmd(event, {
|
|
group = group,
|
|
pattern = pattern,
|
|
callback = function()
|
|
vim.opt_local.cursorline = value
|
|
end,
|
|
})
|
|
end
|
|
|
|
set_cursorline("WinLeave", false)
|
|
set_cursorline("WinEnter", true)
|
|
set_cursorline("FileType", false, "TelescopePrompt")
|
|
opt.showmode = false
|
|
opt.showcmd = true
|
|
opt.cmdheight = 1
|
|
|
|
|
|
-- TABS
|
|
opt.autoindent = true
|
|
opt.cindent = true
|
|
opt.wrap = true
|
|
|
|
opt.tabstop = 4
|
|
opt.shiftwidth = 4
|
|
opt.softtabstop = 4
|
|
opt.expandtab = false
|
|
|
|
|
|
opt.breakindent = true
|
|
opt.showbreak = string.rep(" ",3)
|
|
opt.linebreak = true
|
|
|
|
opt.belloff = "all" -- there is no need for the bell
|
|
|
|
opt.clipboard = "unnamedplus"
|
|
|
|
opt.mouse = "a"
|
|
|
|
local gr = vim.api.nvim_create_augroup("Formatting", {clear = true})
|
|
|
|
vim.api.nvim_create_autocmd("FileType",
|
|
{
|
|
group = gr,
|
|
pattern = "*",
|
|
callback = function ()
|
|
vim.opt.formatoptions = vim.opt.formatoptions
|
|
- "r"
|
|
- "o"
|
|
end
|
|
})
|
|
|