summaryrefslogtreecommitdiff
path: root/dot_config
diff options
context:
space:
mode:
authorChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-05-04 10:51:07 -0400
committerChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-05-04 10:51:07 -0400
commit74877c136c1601ab5468c4892716a0bff3f1121a (patch)
tree56e3abe78a094b9fa070da9e8526a3105135a4b3 /dot_config
parentadd ~ 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.lua39
-rw-r--r--dot_config/nvim/lua/plugins/langs.lua1
-rw-r--r--dot_config/nvim/post.lua2
-rw-r--r--dot_config/nvim/pre.lua26
4 files changed, 42 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'
diff --git a/dot_config/nvim/lua/plugins/langs.lua b/dot_config/nvim/lua/plugins/langs.lua
index fd08024..1d88996 100644
--- a/dot_config/nvim/lua/plugins/langs.lua
+++ b/dot_config/nvim/lua/plugins/langs.lua
@@ -29,6 +29,7 @@ return {
{
'janet-lang/janet.vim',
ft = 'janet',
+ enabled = false,
},
{
'preservim/vim-markdown',
diff --git a/dot_config/nvim/post.lua b/dot_config/nvim/post.lua
new file mode 100644
index 0000000..6647590
--- /dev/null
+++ b/dot_config/nvim/post.lua
@@ -0,0 +1,2 @@
+-- custom filetypes
+vim.filetype.add {extension = { janet = 'janet' }}
diff --git a/dot_config/nvim/pre.lua b/dot_config/nvim/pre.lua
new file mode 100644
index 0000000..3788e18
--- /dev/null
+++ b/dot_config/nvim/pre.lua
@@ -0,0 +1,26 @@
+vim.g.mapleader = ' '
+vim.g.maplocalleader = ','
+
+-- 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