summaryrefslogtreecommitdiff
path: root/lua/tjk/options.lua
blob: ee547537cfd7df5244e1fac6c7103c6f97233c26 (plain)
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
local opt = vim.opt
local api = vim.api

-- misc
opt.autochdir = true             -- stay in current directory when opening a file
opt.splitright = true            -- open splits on right instead of left
opt.splitbelow = true            -- open splits on bottom instead of top
opt.termguicolors = true         -- truecolor in terminal emulator, will be disabled in tty
opt.wrap = false                 -- disable word wrapping
opt.cursorline = true            -- highlight current line
opt.title = true                 -- set window title of the terminal emulator to current nvim buffer

-- line numbers
opt.number = true                -- enable line numbers
opt.relativenumber = true        -- enable relative line numbers

-- show whitespace characters
opt.list = true                  -- show whitespace characters defined in listchars
opt.listchars = "tab:▏ ,space:·" -- highlight tabs and spaces

-- tabbing
opt.tabstop = 4                  -- set tabwidth to 4 instead of 8
opt.shiftwidth = 4               -- tab key will only insert one tab

-- search
opt.ignorecase = true            -- case-insensitive search...
opt.smartcase = true             -- ...unless the search term is capital

-- experimental
opt.smartindent = true
opt.wildmode = "longest:list:full"  -- Better auto-complete

-- dont continue comments on to new lines (:help fo-table)
api.nvim_create_autocmd("FileType", { pattern = "*", callback = function()
	opt.formatoptions:remove { "c", "r", "o" }
end})

-- ignore __pycache__ directories in file listings
opt.wildignore = "__pycache__/,*/__pycache__/"