From 8c76161eb8cf752c00a65cccccd381fb3bc5955d Mon Sep 17 00:00:00 2001 From: seth Date: Sat, 13 Jul 2024 20:21:43 -0400 Subject: factor out vim.{opt,g} --- lua/getchoo/efmls.lua | 58 ------------------------------------------- lua/getchoo/globals.lua | 2 ++ lua/getchoo/init.lua | 27 ++------------------ lua/getchoo/options.lua | 12 +++++++++ lua/getchoo/plugins/efmls.lua | 58 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 74 insertions(+), 83 deletions(-) delete mode 100644 lua/getchoo/efmls.lua create mode 100644 lua/getchoo/globals.lua create mode 100644 lua/getchoo/options.lua create mode 100644 lua/getchoo/plugins/efmls.lua (limited to 'lua') diff --git a/lua/getchoo/efmls.lua b/lua/getchoo/efmls.lua deleted file mode 100644 index 92d61e9..0000000 --- a/lua/getchoo/efmls.lua +++ /dev/null @@ -1,58 +0,0 @@ -local alex = require("efmls-configs.linters.alex") -alex.rootMarkers = nil -local actionlint = require("efmls-configs.linters.actionlint") -local beautysh = require("efmls-configs.formatters.beautysh") -local fish_indent = require("efmls-configs.formatters.fish_indent") -local prettier = require("efmls-configs.formatters.prettier") -local prettier_eslint = require("efmls-configs.formatters.prettier_eslint") -local selene = require("efmls-configs.linters.selene") -local statix = require("efmls-configs.linters.statix") -local stylua = require("efmls-configs.formatters.stylua") - -local languages = { - all = { alex }, - - bash = { - beautysh, - }, - - css = { prettier }, - - fish = { fish_indent }, - - html = { prettier }, - - javascript = { prettier_eslint }, - - json = { prettier }, - - lua = { selene, stylua }, - - nix = { statix }, - - sass = { prettier }, - - scss = { prettier }, - - sh = { beautysh }, - - typescript = { prettier_eslint }, - - yaml = { prettier, actionlint }, - - zsh = { beautysh }, -} - -return { - filetypes = vim.tbl_keys(languages), - - settings = { - rootMarkers = { ".git/" }, - languages = languages, - }, - - init_options = { - documentFormatting = true, - documentRangeFormatting = true, - }, -} diff --git a/lua/getchoo/globals.lua b/lua/getchoo/globals.lua new file mode 100644 index 0000000..a9ff734 --- /dev/null +++ b/lua/getchoo/globals.lua @@ -0,0 +1,2 @@ +vim.g.mapleader = "," +vim.g.do_filetype_lua = 1 diff --git a/lua/getchoo/init.lua b/lua/getchoo/init.lua index a919bc8..25f6baf 100644 --- a/lua/getchoo/init.lua +++ b/lua/getchoo/init.lua @@ -1,25 +1,2 @@ -local opt = vim.opt - -opt.shiftwidth = 2 -opt.tabstop = 2 --- https://www.reddit.com/r/neovim/comments/14n6iiy/if_you_have_treesitter_make_sure_to_disable --- TLDR: this breaks things with treesitter indent -opt.smartindent = false -opt.number = true -opt.wrap = true -opt.syntax = "on" -opt.termguicolors = true -opt.mouse = "a" - -local backupDir = vim.fn.stdpath("state") .. "/backup" -local b = io.open(backupDir, "r") -if b then - b:close() -else - os.execute("mkdir -p " .. backupDir) -end - -opt.backupdir = backupDir - -vim.g.mapleader = "," -vim.g.do_filetype_lua = 1 +require("getchoo.options") +require("getchoo.globals") diff --git a/lua/getchoo/options.lua b/lua/getchoo/options.lua new file mode 100644 index 0000000..5ddf964 --- /dev/null +++ b/lua/getchoo/options.lua @@ -0,0 +1,12 @@ +local opt = vim.opt + +opt.shiftwidth = 2 +opt.tabstop = 2 +-- https://www.reddit.com/r/neovim/comments/14n6iiy/if_you_have_treesitter_make_sure_to_disable +-- TLDR: this breaks things with treesitter indent +opt.smartindent = false +opt.number = true +opt.wrap = true +opt.syntax = "on" +opt.termguicolors = true +opt.mouse = "a" diff --git a/lua/getchoo/plugins/efmls.lua b/lua/getchoo/plugins/efmls.lua new file mode 100644 index 0000000..92d61e9 --- /dev/null +++ b/lua/getchoo/plugins/efmls.lua @@ -0,0 +1,58 @@ +local alex = require("efmls-configs.linters.alex") +alex.rootMarkers = nil +local actionlint = require("efmls-configs.linters.actionlint") +local beautysh = require("efmls-configs.formatters.beautysh") +local fish_indent = require("efmls-configs.formatters.fish_indent") +local prettier = require("efmls-configs.formatters.prettier") +local prettier_eslint = require("efmls-configs.formatters.prettier_eslint") +local selene = require("efmls-configs.linters.selene") +local statix = require("efmls-configs.linters.statix") +local stylua = require("efmls-configs.formatters.stylua") + +local languages = { + all = { alex }, + + bash = { + beautysh, + }, + + css = { prettier }, + + fish = { fish_indent }, + + html = { prettier }, + + javascript = { prettier_eslint }, + + json = { prettier }, + + lua = { selene, stylua }, + + nix = { statix }, + + sass = { prettier }, + + scss = { prettier }, + + sh = { beautysh }, + + typescript = { prettier_eslint }, + + yaml = { prettier, actionlint }, + + zsh = { beautysh }, +} + +return { + filetypes = vim.tbl_keys(languages), + + settings = { + rootMarkers = { ".git/" }, + languages = languages, + }, + + init_options = { + documentFormatting = true, + documentRangeFormatting = true, + }, +} -- cgit v1.2.3