all repos — dotfiles @ 8b97ddc74ce9518141fe403f8687d4b3f619b490

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 = true
30o.listchars='tab:│ ,nbsp:␣,trail:·,extends:>,precedes:<'
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.list = true
64wo.wrap = false
65
66-- buffer-local options
67bo.expandtab = true
68
69-- augroups don't have an interface yet
70u.create_augroup({
71    { 'BufRead,BufNewFile', '/tmp/nail-*', 'setlocal', 'ft=mail' },
72    { 'BufRead,BufNewFile', '*s-nail-*', 'setlocal', 'ft=mail' },
73}, 'ftmail')
74
75
76u.create_augroup({
77    { 'BufReadPost', '*', [[
78    if line("'\"") > 1 && line("'\"") <= line("$")
79      execute "normal! g`\""
80    endif
81    ]] }
82}, 'restorecursor')
83
84cmd('au BufNewFile,BufRead * if &ft == "" | set ft=text | endif')
85
86-- completion-nvim
87cmd('au BufEnter * lua require"completion".on_attach()')
88g.completion_chain_complete_list = {
89  default = {
90    { complete_items = { 'lsp' } },
91    { complete_items = { 'buffers' } },
92    { mode = { '<c-p>' } },
93    { mode = { '<c-n>' } }
94  },
95}