aboutsummaryrefslogtreecommitdiffstats
path: root/home/nvim/options.lua
blob: 4795bac4ac30b2b8b46b7268c0bb54231dcf2ad2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
vim.schedule(function()
	vim.opt.clipboard = "unnamedplus"
end)

vim.g.have_nerd_fonts = true

vim.o.fileencoding = "utf-8"
vim.o.mouse = "a" -- turn on mouse interaction
vim.o.shell = "nushell"
vim.o.signcolumn = "yes"
vim.o.termguicolors = true                 -- Enable GUI colors for the terminal to get truecolor
vim.opt.conceallevel = 0
vim.opt.title = true                       -- set the title of window to the value of the titlestring
vim.opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to
vim.o.guicursor = table.concat({
	"n-v-c:block-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",
	"i-ci:ver25-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100",
	"r:hor50-Cursor/lCursor-blinkwait100-blinkon100-blinkoff100",
}, ",")

vim.o.autoindent = true
vim.o.expandtab = false
vim.o.list = true -- show hidden characters by default
vim.o.shiftwidth = 4
vim.o.shiftwidth = 4
vim.o.smartindent = true
vim.o.smarttab = true -- <tab>/<BS> indent/dedent in leading whitespace
vim.o.softtabstop = 4
vim.o.tabstop = 4
vim.o.textwidth = 100
vim.o.updatetime = 100                                                         -- CursorHold interval
vim.opt.breakindent = true
vim.opt.completeopt = { "menu", "menuone", "noselect", "noinsert", "preview" } -- completion options
vim.opt.grepformat = "%f:%l:%c:%m"
vim.opt.grepprg = "rg --vimgrep"
vim.opt.hidden = true -- required to keep multiple buffers and open multiple buffers
vim.opt.inccommand = "split"
vim.opt.linebreak = true
vim.opt.shortmess:append("c")
vim.opt.smartcase = true
vim.opt.virtualedit = "block"
vim.opt.wrap = true

vim.o.undofile = true
vim.o.undodir = "/home/petri/.config/nvim/undo/"
vim.o.backupdir = "/home/petri/.config/nvim/backup/"
vim.o.directory = "/home/petri/.config/nvim//swp/"

vim.o.colorcolumn = "100"
vim.o.cursorline = true     -- highlight current line
vim.o.hlsearch = true       -- highlighted search results
vim.o.ignorecase = true     -- ignore case sensetive while searching
vim.o.incsearch = true      -- incremental search
vim.o.number = true         -- show line numbers
vim.o.relativenumber = true -- relative line numbers
vim.o.showmode = false      -- we are already showing mode
vim.opt.matchtime = 2       -- how long to show matching bracket
vim.opt.pumblend = 10       -- popup menu transparency
vim.opt.showmatch = true    -- show matching bracket
vim.opt.synmaxcol = 300
vim.opt.winblend = 0
vim.opt.winborder = "rounded"

vim.opt.autoread = true
vim.opt.path:append("**")       -- include subdirectories in search
vim.opt.selection = "exclusive" -- Selection behavior
vim.opt.showtabline = 2         -- show when multiple open
vim.opt.swapfile = false

vim.opt.foldenable = true -- Enable folding
vim.opt.foldlevel = 99    -- Start with all folds open
vim.opt.foldmethod = "syntax"

vim.opt.scrolloff = 8
vim.opt.sidescrolloff = 8

vim.opt.backspace = "indent,start,eol"                     -- make backspace behave like normal again
vim.opt.formatoptions:remove({ "c", "t" })
vim.opt.laststatus = 2                                     -- always show status line
vim.opt.lazyredraw = false                                 -- faster scrolling
vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "" }
vim.opt.splitbelow = true                                  -- open horizontal splits below current window
vim.opt.splitright = true                                  -- open vertical splits to the right of the current window
vim.opt.wildignore = vim.opt.wildignore + "*.o,*.rej,*.so" -- patterns to ignore during file-navigation

vim.opt.spell = false
vim.opt.spelllang = "en"
vim.opt.wildignore:append({ "*.pyc" })
vim.opt.wildmenu = true
vim.opt.wildmode = "longest:full,full"

vim.opt.diffopt:append("linematch:60")

vim.opt.redrawtime = 10000
vim.opt.maxmempattern = 50000

vim.cmd.colorscheme("nord")