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.wildignore = [[
32.git,.hg,.svn
33*.aux,*.out,*.toc
34*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
35*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
36*.avi,*.divx,*.mp4,*.webm,*.mov,*.m2ts,*.mkv,*.vob,*.mpg,*.mpeg
37*.mp3,*.oga,*.ogg,*.wav,*.flac
38*.eot,*.otf,*.ttf,*.woff
39*.doc,*.pdf,*.cbr,*.cbz
40*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb
41*.swp,.lock,.DS_Store,._*
42]]
43
44vim.cmd("syntax on")
45-- i couldn't figure out how to set the colorscheme in lua
46vim.cmd('colorscheme plain')
47
48vim.cmd('au TextYankPost * lua vim.highlight.on_yank{timeout=200}')
49o.background = 'light'
50
51-- gitgutter options
52g.gitgutter_override_sign_column_highlight = 0
53g.gitgutter_sign_added = '+'
54g.gitgutter_sign_modified = '±'
55g.gitgutter_sign_removed = '-'
56g.gitgutter_sign_removed_first_line = '^'
57g.gitgutter_sign_modified_removed = '#'
58
59-- use a python3 venv
60g.python3_host_prog = vim.env.HOME .. '/leet/vim-python3/bin/python3'
61
62-- window-local options
63o.number = false
64o.list = true
65o.wrap = false
66
67-- buffer-local options
68o.expandtab = true
69
70-- set statusline
71stl = require('statusline.line')
72o.statusline = '%!luaeval("stl.statusline()")'
73
74-- augroups don't have an interface yet
75u.create_augroup({
76 { 'BufRead,BufNewFile', '/tmp/nail-*', 'setlocal', 'ft=mail' },
77 { 'BufRead,BufNewFile', '*s-nail-*', 'setlocal', 'ft=mail' },
78}, 'ftmail')
79
80-- restore cursor
81cmd([[ au BufReadPost * call setpos(".", getpos("'\"")) ]])
82
83-- unknown files are 'text'
84cmd('au BufNewFile,BufRead * if &ft == "" | set ft=text | endif')
85
86-- coq.nvim
87g.coq_settings = {
88 auto_start = 'shut-up',
89 display = {
90 icons = {
91 mode = 'none'
92 },
93 preview = {
94 border = 'solid',
95 },
96 },
97}
98
99-- filetype.nvim
100g.did_load_filetypes = 1
101
102-- disable built-in plugins
103local disabled_built_ins = {
104 'gzip',
105 'man',
106 'shada_plugin',
107 'tarPlugin',
108 'tar',
109 'zipPlugin',
110 'zip',
111 'netrwPlugin',
112}
113
114for i = 1, 8 do
115 g['loaded_' .. disabled_built_ins[i]] = 1
116end