blob: 276714378fbbe9b6d4d6f3da5e83d454d1219deb (
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
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
|
local opt = vim.opt
-- Don't highlight on search
opt.hlsearch = false
opt.incsearch = true
-- Enable line numbers by default
opt.number = true
opt.relativenumber = true
-- Tab settings
opt.tabstop = 4
opt.softtabstop = 4
opt.shiftwidth = 4
opt.expandtab = true
-- Enable smart indenting
opt.smartindent = true
-- Enable break indent
opt.breakindent = true
-- History settings
opt.undofile = true
opt.undodir = os.getenv("HOME") .. "/.local/state/nvim"
opt.swapfile = true
opt.swapfile = true
-- Case-insensitive searching UNLESS \C or capital in search
opt.ignorecase = true
opt.smartcase = true
-- Keep signcolumn on by default
opt.signcolumn = "yes"
-- Decrease update time
opt.updatetime = 50
opt.timeoutlen = 300
-- Set completeopt to have a better completion experience
opt.completeopt = "menuone,noselect"
-- Enable true color support
opt.termguicolors = true
-- Enable scroll off
opt.scrolloff = 8
-- Don't show mode I'm in, already have a nice status line for that
opt.showmode = false
-- Better split options
opt.splitbelow = true
opt.splitright = true
-- shared clipboard
opt.clipboard = "unnamed"
-- do not highlight matched bracket
opt.showmatch = false
-- highlight line at cursor
opt.cursorline = true
-- status line
-- show ruler
opt.ruler = true
-- show command
opt.showcmd = true
opt.wildmenu = true
opt.mouse = ""
opt.backspace = "indent,eol,start"
opt.laststatus = 2
opt.history = 200
opt.encoding = "utf-8"
opt.fileencoding = "utf-8"
opt.smartindent = true
opt.scrolloff = 8
opt.spelllang = "en_us,nl"
opt.formatoptions = "cqrnj"
-- Get the current working directory, replace the $HOME portion of the path with ~,
-- and extract the last three directories
local cwd = vim.fn.getcwd():gsub(os.getenv('HOME'), '~')
local last_dirs = string.match(cwd, "[^/]+/[^/]+/[^/]+/?$")
if last_dirs then
opt.titlestring = last_dirs .. " -> %t"
else
opt.titlestring = cwd .. " -> %t"
end
opt.title = true
|