diff options
| author | 2023-05-04 10:51:07 -0400 | |
|---|---|---|
| committer | 2023-05-04 10:51:07 -0400 | |
| commit | 74877c136c1601ab5468c4892716a0bff3f1121a (patch) | |
| tree | 56e3abe78a094b9fa070da9e8526a3105135a4b3 /dot_config/nvim/init.lua | |
| parent | add ~ level editorconfig (diff) | |
nvim: many changes
* add pre and post dot lua with dofile
* disable janet plugin (todo: remove once I confirm that the treesitter
impl is good enough)
* treesitter on janet
* custom janet ft detection
Diffstat (limited to '')
| -rw-r--r-- | dot_config/nvim/init.lua | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index c251a12..4dcf175 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -1,33 +1,17 @@ -vim.g.mapleader = ' ' -vim.g.maplocalleader = ',' +-- allow running code unconditionally before or after plugins / noplugins are loaded +local function doif(path) + local cpath = vim.fn.stdpath 'config' .. '/' + if vim.fn.filereadable(cpath .. path) > 0 then + dofile(cpath .. path) + end +end --- options -local options = { - timeoutlen = 300, - clipboard = 'unnamedplus', - completeopt = 'menu,menuone,noselect', - mouse = 'a', - smartcase = true, - smartindent = true, - backup = false, - swapfile = false, - termguicolors = true, - expandtab = false, - shiftwidth = 4, - tabstop = 4, - number = true, - numberwidth = 2, - scrolloff = 4, - sidescrolloff = 4, - foldmethod = 'expr', - foldexpr = 'nvim_treesitter#foldexpr()', - foldlevelstart = 99, -} -for k, v in pairs(options) do vim.opt[k] = v end +-- leader, localleader, options +doif 'pre.lua' -- plugins if vim.fn.executable 'git' == 0 then - require 'noplugins' + doif 'noplugins.lua' else local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then @@ -45,3 +29,6 @@ else require 'bindings' vim.cmd [[colorscheme starlight]] end + +-- custom file associations etc +doif 'post.lua' |
