all repos — dotfiles @ 4b4ed3c815afc4922f3e3d971d46fd6ec1c9fbaf

my *nix dotfiles

config/nvim/lua/settings.lua (view raw)

 1u = 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
44-- i couldn't figure out how to set the colorscheme in lua
45vim.cmd('syntax on')
46vim.cmd('colorscheme plain')
47o.background = 'dark'
48
49-- gitgutter options
50g.gitgutter_override_sign_column_highlight = 0
51g.gitgutter_sign_added                     = '+'
52g.gitgutter_sign_modified                  = '±'
53g.gitgutter_sign_removed                   = '-'
54g.gitgutter_sign_removed_first_line        = '^'
55g.gitgutter_sign_modified_removed          = '#'
56
57-- speed up python
58g.python3_host_prog = '$HOME/.pyenv/versions/3.9.1/bin/python3.9'
59
60-- window-local options
61o.number = false
62o.list = true
63o.wrap = false
64
65-- buffer-local options
66o.expandtab = true
67
68-- augroups don't have an interface yet
69u.create_augroup({
70    { 'BufRead,BufNewFile', '/tmp/nail-*', 'setlocal', 'ft=mail' },
71    { 'BufRead,BufNewFile', '*s-nail-*', 'setlocal', 'ft=mail' },
72}, 'ftmail')
73
74-- restore cursor
75cmd([[ au BufReadPost * call setpos(".", getpos("'\"")) ]])
76
77-- unknown files are 'text'
78cmd('au BufNewFile,BufRead * if &ft == "" | set ft=text | endif')
79
80
81-- completion-nvim
82cmd('au BufEnter * lua require"completion".on_attach()')
83g.completion_chain_complete_list = {
84  default = {
85    { complete_items = { 'lsp' } },
86    { complete_items = { 'buffers' } },
87    { mode = { '<c-p>' } },
88    { mode = { '<c-n>' } }
89  },
90}