all repos — dotfiles @ 7370c9c8a57c265e1ff7e0810f4ed72c1631b47c

my *nix dotfiles

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-- use a python3 venv
 61g.python3_host_prog = vim.env.HOME .. '/leet/vim-python3/bin/python3'
 62
 63-- window-local options
 64o.number = false
 65o.list = true
 66o.wrap = false
 67
 68-- buffer-local options
 69o.expandtab = true
 70
 71-- set statusline
 72stl = require('statusline.line')
 73o.statusline = '%!luaeval("stl.statusline()")'
 74
 75-- augroups don't have an interface yet
 76u.create_augroup({
 77    { 'BufRead,BufNewFile', '/tmp/nail-*', 'setlocal', 'ft=mail' },
 78    { 'BufRead,BufNewFile', '*s-nail-*', 'setlocal', 'ft=mail' },
 79}, 'ftmail')
 80
 81-- restore cursor
 82cmd([[ au BufReadPost * call setpos(".", getpos("'\"")) ]])
 83
 84-- unknown files are 'text'
 85cmd('au BufNewFile,BufRead * if &ft == "" | set ft=text | endif')
 86
 87-- coq.nvim
 88g.coq_settings = {
 89  auto_start = 'shut-up',
 90  display = {
 91    icons = {
 92      mode = 'none'
 93    },
 94    preview = {
 95      border = 'rounded',
 96    },
 97  },
 98}
 99
100-- filetype.nvim
101g.did_load_filetypes = 1
102
103-- disable built-in plugins
104local disabled_built_ins = {
105  'gzip',
106  'shada_plugin',
107  'tarPlugin',
108  'tar',
109  'zipPlugin',
110  'zip',
111  'netrwPlugin',
112}
113
114for i = 1, 7 do
115  g['loaded_' .. disabled_built_ins[i]] = 1
116end