config/nvim/lua/settings.lua (view raw)
1local u = require('utils')
2
3local o = vim.opt
4local g = vim.g
5local cmd = vim.cmd
6
7-- global options
8o.swapfile = true
9o.dir = '/tmp'
10o.smartcase = true
11o.laststatus = 2
12o.hlsearch = true
13o.incsearch = true
14o.ignorecase = true
15o.scrolloff = 12
16o.timeoutlen = 3000
17o.ttimeoutlen = 100
18o.undodir = '~/.cache/nvim/undodir'
19o.cursorline = false
20o.foldenable = false
21o.conceallevel = 2
22o.mouse = 'a'
23o.wildmenu = true
24o.tabstop = 4
25o.shiftwidth = 4
26o.softtabstop = 4
27o.showmode = true
28o.listchars='tab:│ ,nbsp:␣,trail:·,extends:>,precedes:<'
29o.hidden = true
30o.completeopt = { 'menuone', 'noselect', 'noinsert' }
31o.signcolumn = 'yes:2'
32o.wildignore = [[
33.git,.hg,.svn
34*.aux,*.out,*.toc
35*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
36*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
37*.avi,*.divx,*.mp4,*.webm,*.mov,*.m2ts,*.mkv,*.vob,*.mpg,*.mpeg
38*.mp3,*.oga,*.ogg,*.wav,*.flac
39*.eot,*.otf,*.ttf,*.woff
40*.doc,*.pdf,*.cbr,*.cbz
41*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb
42*.swp,.lock,.DS_Store,._*
43]]
44
45vim.cmd("syntax on")
46-- i couldn't figure out how to set the colorscheme in lua
47vim.cmd('colorscheme plain')
48
49vim.cmd('au TextYankPost * lua vim.highlight.on_yank{timeout=200}')
50o.background = 'light'
51
52-- gitgutter options
53g.gitgutter_override_sign_column_highlight = 0
54g.gitgutter_sign_added = '+'
55g.gitgutter_sign_modified = '±'
56g.gitgutter_sign_removed = '-'
57g.gitgutter_sign_removed_first_line = '^'
58g.gitgutter_sign_modified_removed = '#'
59
60-- window-local options
61o.number = false
62o.list = true
63o.wrap = false
64
65-- buffer-local options
66o.expandtab = true
67
68-- set statusline
69stl = require('statusline.line')
70o.statusline = '%!luaeval("stl.statusline()")'
71
72-- augroups don't have an interface yet
73u.create_augroup({
74 { 'BufRead,BufNewFile', '/tmp/nail-*', 'setlocal', 'ft=mail' },
75 { 'BufRead,BufNewFile', '*s-nail-*', 'setlocal', 'ft=mail' },
76}, 'ftmail')
77
78-- restore cursor
79cmd([[ au BufReadPost * call setpos(".", getpos("'\"")) ]])
80
81-- unknown files are 'text'
82cmd('au BufNewFile,BufRead * if &ft == "" | set ft=text | endif')
83
84-- coq.nvim
85g.coq_settings = {
86 auto_start = 'shut-up',
87 display = {
88 icons = {
89 mode = 'none'
90 },
91 preview = {
92 border = 'rounded',
93 },
94 },
95}
96
97-- filetype.nvim
98g.did_load_filetypes = 1
99
100-- disable built-in plugins
101local disabled_built_ins = {
102 'gzip',
103 'shada_plugin',
104 'tarPlugin',
105 'tar',
106 'zipPlugin',
107 'zip',
108 'netrwPlugin',
109}
110
111for i = 1, 7 do
112 g['loaded_' .. disabled_built_ins[i]] = 1
113end