all repos — dotfiles @ a1473167a4f0d7628a0a6127c9029ad5187bcc43

my *nix dotfiles

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

 1u = require('utils')
 2
 3local o = vim.o
 4local wo = vim.wo
 5local bo = vim.bo
 6local g = vim.g
 7local cmd = vim.cmd
 8
 9-- global options
10o.swapfile = true
11o.dir = '/tmp'
12o.smartcase = true
13o.laststatus = 2
14o.hlsearch = true
15o.incsearch = true
16o.ignorecase = true
17o.scrolloff = 12
18o.timeoutlen = 3000
19o.ttimeoutlen = 100
20o.undodir = '~/.cache/nvim/undodir'
21o.cursorline = false
22o.foldenable = false
23o.conceallevel = 2
24o.mouse = 'a'
25o.wildmenu = true
26o.tabstop = 4
27o.shiftwidth = 4
28o.softtabstop = 4
29o.showmode = false
30o.clipboard = 'unnamedplus'
31o.hidden = true
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
45-- i couldn't figure out how to set the colorscheme in lua
46vim.cmd('syntax on')
47vim.cmd('colorscheme plain')
48o.background = 'dark'
49
50-- gitgutter options
51g.gitgutter_override_sign_column_highlight = 0
52g.gitgutter_sign_added                     = '+'
53g.gitgutter_sign_modified                  = '±'
54g.gitgutter_sign_removed                   = '-'
55g.gitgutter_sign_removed_first_line        = '^'
56g.gitgutter_sign_modified_removed          = '#'
57
58-- speed up python
59g.python3_host_prog = '$HOME/.pyenv/versions/3.9.1/bin/python3.9'
60
61-- window-local options
62wo.number = false
63wo.wrap = false
64
65-- buffer-local options
66bo.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
75u.create_augroup({
76    { 'BufReadPost', '*', [[
77    if line("'\"") > 1 && line("'\"") <= line("$")
78      execute "normal! g`\""
79    endif
80    ]] }
81}, 'restorecursor')
82
83cmd('au BufNewFile,BufRead * if &ft == "" | set ft=text | endif')