From 5ff925c80c576e18c97f9e45c22659397741bd04 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 9 Jan 2022 00:07:35 +0000 Subject: [PATCH] style: format lua with StyLua --- roles/neovim/files/after/plugin/luasnip.lua | 33 +++---- roles/neovim/files/after/plugin/zen-mode.lua | 6 +- roles/neovim/files/init.lua | 26 +++--- roles/neovim/files/lua/opdavies/autopairs.lua | 11 ++- roles/neovim/files/lua/opdavies/colours.lua | 2 +- roles/neovim/files/lua/opdavies/comment.lua | 4 +- .../neovim/files/lua/opdavies/completion.lua | 23 +++-- roles/neovim/files/lua/opdavies/floaterm.lua | 8 +- .../files/lua/opdavies/lsp/handlers.lua | 5 +- roles/neovim/files/lua/opdavies/lsp/init.lua | 14 ++- .../neovim/files/lua/opdavies/lsp/null-ls.lua | 16 ++-- .../opdavies/lsp/settings/intelephense.lua | 2 +- .../lua/opdavies/lsp/settings/sumneko_lua.lua | 10 +- .../lua/opdavies/lsp/settings/tailwindcss.lua | 2 +- roles/neovim/files/lua/opdavies/options.lua | 49 +++++----- roles/neovim/files/lua/opdavies/plugins.lua | 92 +++++++++---------- roles/neovim/files/lua/opdavies/seiya.lua | 2 +- .../files/lua/opdavies/telescope/init.lua | 66 +++++++------ .../neovim/files/lua/opdavies/treesitter.lua | 4 +- roles/neovim/files/lua/opdavies/vim-test.lua | 14 +-- stylua.toml | 5 + 21 files changed, 200 insertions(+), 194 deletions(-) create mode 100644 stylua.toml diff --git a/roles/neovim/files/after/plugin/luasnip.lua b/roles/neovim/files/after/plugin/luasnip.lua index 966e669..a5442fa 100644 --- a/roles/neovim/files/after/plugin/luasnip.lua +++ b/roles/neovim/files/after/plugin/luasnip.lua @@ -19,34 +19,29 @@ local snippets = {} -- Snippets for both JavaScript and TypeScript. local js_ts = { - s( - { trig = 'log', dscr = 'console.log' }, - { t('console.log('), i(1, 'value'), t(');') } - ), + s({ trig = "log", dscr = "console.log" }, { t "console.log(", i(1, "value"), t ");" }), } snippets.js = js_ts snippets.markdown = { s( - { trig = 'frontmatter', dscr = 'Document frontmatter' }, - { t({'---', 'tags: '}), i(1, 'value'), t({'', '---', ''}), i(0) } - ) + { trig = "frontmatter", dscr = "Document frontmatter" }, + { t { "---", "tags: " }, i(1, "value"), t { "", "---", "" }, i(0) } + ), } snippets.php = { - s( - { trig = 'test', dscr = 'Test block' }, - { - t({ "/* @test **/", "" }), - t("public function "), - c(1, { t "test", t "it", t "should" }), -- The test method name prefix. - i(2), -- The test method name. - t({ "(): void {", "" }), - t(" "), i(0), -- The method body. - t({ "", "}" }) - } - ), + s({ trig = "test", dscr = "Test block" }, { + t { "/* @test **/", "" }, + t "public function ", + c(1, { t "test", t "it", t "should" }), -- The test method name prefix. + i(2), -- The test method name. + t { "(): void {", "" }, + t " ", + i(0), -- The method body. + t { "", "}" }, + }), } snippets.typescript = js_ts diff --git a/roles/neovim/files/after/plugin/zen-mode.lua b/roles/neovim/files/after/plugin/zen-mode.lua index 9fc9f8c..8ce1dba 100644 --- a/roles/neovim/files/after/plugin/zen-mode.lua +++ b/roles/neovim/files/after/plugin/zen-mode.lua @@ -5,14 +5,14 @@ end zen_mode.setup { window = { - backdrop = .95, + backdrop = 0.95, height = 1, width = 120, options = { relativenumber = false, number = false, signcolumn = "no", - } + }, }, plugins = { options = { @@ -21,5 +21,5 @@ zen_mode.setup { }, gitsigns = { enabled = true }, tmux = { enabled = true }, - } + }, } diff --git a/roles/neovim/files/init.lua b/roles/neovim/files/init.lua index eb8b83c..7ae79a7 100644 --- a/roles/neovim/files/init.lua +++ b/roles/neovim/files/init.lua @@ -1,14 +1,14 @@ -require("opdavies.autopairs") -require("opdavies.colours") -require("opdavies.comment") -require("opdavies.completion") -require("opdavies.floaterm") -require("opdavies.gitsigns") -require("opdavies.indent-blankline") -require("opdavies.lsp") +require "opdavies.autopairs" +require "opdavies.colours" +require "opdavies.comment" +require "opdavies.completion" +require "opdavies.floaterm" +require "opdavies.gitsigns" +require "opdavies.indent-blankline" +require "opdavies.lsp" require("opdavies.options").setup() -require("opdavies.plugins") -require("opdavies.seiya") -require("opdavies.telescope") -require("opdavies.treesitter") -require("opdavies.vim-test") +require "opdavies.plugins" +require "opdavies.seiya" +require "opdavies.telescope" +require "opdavies.treesitter" +require "opdavies.vim-test" diff --git a/roles/neovim/files/lua/opdavies/autopairs.lua b/roles/neovim/files/lua/opdavies/autopairs.lua index f0ab653..ea4424e 100644 --- a/roles/neovim/files/lua/opdavies/autopairs.lua +++ b/roles/neovim/files/lua/opdavies/autopairs.lua @@ -10,7 +10,10 @@ if not cmp_status_ok then return end -local cmp = require('cmp') -cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done({ - map_char = { tex = '' } -})) +local cmp = require "cmp" +cmp.event:on( + "confirm_done", + cmp_autopairs.on_confirm_done { + map_char = { tex = "" }, + } +) diff --git a/roles/neovim/files/lua/opdavies/colours.lua b/roles/neovim/files/lua/opdavies/colours.lua index 1a53409..af4c3b3 100644 --- a/roles/neovim/files/lua/opdavies/colours.lua +++ b/roles/neovim/files/lua/opdavies/colours.lua @@ -8,6 +8,6 @@ if not colorizer_status_ok then return end -colorbuddy.colorscheme("gruvbuddy") +colorbuddy.colorscheme "gruvbuddy" colorizer.setup() diff --git a/roles/neovim/files/lua/opdavies/comment.lua b/roles/neovim/files/lua/opdavies/comment.lua index 829e55a..eb350eb 100644 --- a/roles/neovim/files/lua/opdavies/comment.lua +++ b/roles/neovim/files/lua/opdavies/comment.lua @@ -7,8 +7,8 @@ comment.setup { padding = true, opleader = { - line = 'gc', - block = 'gb', + line = "gc", + block = "gb", }, mappings = { diff --git a/roles/neovim/files/lua/opdavies/completion.lua b/roles/neovim/files/lua/opdavies/completion.lua index 22fed42..3b68b25 100644 --- a/roles/neovim/files/lua/opdavies/completion.lua +++ b/roles/neovim/files/lua/opdavies/completion.lua @@ -14,7 +14,7 @@ cmp.setup { snippet = { expand = function(args) luasnip.lsp_expand(args.body) - end + end, }, mapping = { @@ -44,17 +44,20 @@ cmp.setup { }, formatting = { - format = require("lspkind").cmp_format({with_text = true, menu = ({ - buffer = "[buf]", - cmp_tabnine = "[tn]", - luasnip = "[snip]", - nvim_lsp = "[lsp]", - nvim_lua = "[lua]", - path = "[path]", - })}), + format = require("lspkind").cmp_format { + with_text = true, + menu = { + buffer = "[buf]", + cmp_tabnine = "[tn]", + luasnip = "[snip]", + nvim_lsp = "[lsp]", + nvim_lua = "[lua]", + path = "[path]", + }, + }, }, experimental = { - ghost_text = true + ghost_text = true, }, } diff --git a/roles/neovim/files/lua/opdavies/floaterm.lua b/roles/neovim/files/lua/opdavies/floaterm.lua index a4acdf9..723a095 100644 --- a/roles/neovim/files/lua/opdavies/floaterm.lua +++ b/roles/neovim/files/lua/opdavies/floaterm.lua @@ -2,7 +2,7 @@ local map = vim.api.nvim_set_keymap local options = { noremap = true } -map('n', 'ld', 'FloatermNew --autoclose=2 --height=0.9 --width=0.9 lazydocker', options) -map('n', 'lg', 'FloatermNew --autoclose=2 --height=0.9 --width=0.9 lazygit', options) -map('n', 'nn', 'FloatermNew --autoclose=2 --height=0.5 --width=0.5 nnn -Hde', options) -map('n', 'tt', 'FloatermNew --autoclose=2 --height=0.9 --width=0.9 zsh', options) +map("n", "ld", "FloatermNew --autoclose=2 --height=0.9 --width=0.9 lazydocker", options) +map("n", "lg", "FloatermNew --autoclose=2 --height=0.9 --width=0.9 lazygit", options) +map("n", "nn", "FloatermNew --autoclose=2 --height=0.5 --width=0.5 nnn -Hde", options) +map("n", "tt", "FloatermNew --autoclose=2 --height=0.9 --width=0.9 zsh", options) diff --git a/roles/neovim/files/lua/opdavies/lsp/handlers.lua b/roles/neovim/files/lua/opdavies/lsp/handlers.lua index 1f5c035..f876880 100644 --- a/roles/neovim/files/lua/opdavies/lsp/handlers.lua +++ b/roles/neovim/files/lua/opdavies/lsp/handlers.lua @@ -12,7 +12,7 @@ M.setup = function() source = "always", header = "", prefix = "", - } + }, } vim.diagnostic.config(config) @@ -39,7 +39,8 @@ local function lsp_keymaps(--[[ bufnr ]]) end M.on_attach = function(--[[ bufnr ]]) - lsp_keymaps(--[[ bufnr ]]) + lsp_keymaps(--[[ bufnr ]] + ) end M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities) diff --git a/roles/neovim/files/lua/opdavies/lsp/init.lua b/roles/neovim/files/lua/opdavies/lsp/init.lua index 2168246..5c5d9ff 100644 --- a/roles/neovim/files/lua/opdavies/lsp/init.lua +++ b/roles/neovim/files/lua/opdavies/lsp/init.lua @@ -22,19 +22,17 @@ for _, lsp in ipairs(servers) do lspconfig[lsp].setup(opts) end -local intelephense_opts = require("opdavies.lsp.settings.intelephense") +local intelephense_opts = require "opdavies.lsp.settings.intelephense" lspconfig.intelephense.setup { - vim.tbl_deep_extend("force", intelephense_opts, opts) + vim.tbl_deep_extend("force", intelephense_opts, opts), } -local sumneko_lua_opts = require("opdavies.lsp.settings.sumneko_lua") -lspconfig.sumneko_lua.setup( - vim.tbl_deep_extend("force", sumneko_lua_opts, opts) -) +local sumneko_lua_opts = require "opdavies.lsp.settings.sumneko_lua" +lspconfig.sumneko_lua.setup(vim.tbl_deep_extend("force", sumneko_lua_opts, opts)) -local tailwindcss_opts = require("opdavies.lsp.settings.tailwindcss") +local tailwindcss_opts = require "opdavies.lsp.settings.tailwindcss" lspconfig.tailwindcss.setup { - vim.tbl_deep_extend("force", tailwindcss_opts, opts) + vim.tbl_deep_extend("force", tailwindcss_opts, opts), } require("opdavies.lsp.handlers").setup() diff --git a/roles/neovim/files/lua/opdavies/lsp/null-ls.lua b/roles/neovim/files/lua/opdavies/lsp/null-ls.lua index 8737bb6..6934640 100644 --- a/roles/neovim/files/lua/opdavies/lsp/null-ls.lua +++ b/roles/neovim/files/lua/opdavies/lsp/null-ls.lua @@ -3,11 +3,11 @@ if not status_ok then return end -null_ls.setup({ - sources = { - null_ls.builtins.formatting.prettier, - null_ls.builtins.formatting.stylua, - null_ls.builtins.diagnostics.eslint, - null_ls.builtins.completion.spell, - }, -}) +null_ls.setup { + sources = { + null_ls.builtins.formatting.prettier, + null_ls.builtins.formatting.stylua, + null_ls.builtins.diagnostics.eslint, + null_ls.builtins.completion.spell, + }, +} diff --git a/roles/neovim/files/lua/opdavies/lsp/settings/intelephense.lua b/roles/neovim/files/lua/opdavies/lsp/settings/intelephense.lua index 33f156d..51bc041 100644 --- a/roles/neovim/files/lua/opdavies/lsp/settings/intelephense.lua +++ b/roles/neovim/files/lua/opdavies/lsp/settings/intelephense.lua @@ -1,3 +1,3 @@ return { - filetypes = { "php", "module", "test", "inc" } + filetypes = { "php", "module", "test", "inc" }, } diff --git a/roles/neovim/files/lua/opdavies/lsp/settings/sumneko_lua.lua b/roles/neovim/files/lua/opdavies/lsp/settings/sumneko_lua.lua index 41ec464..2512baf 100644 --- a/roles/neovim/files/lua/opdavies/lsp/settings/sumneko_lua.lua +++ b/roles/neovim/files/lua/opdavies/lsp/settings/sumneko_lua.lua @@ -2,14 +2,14 @@ return { settings = { Lua = { diagnostics = { - globals = { "use", "vim" } + globals = { "use", "vim" }, }, workspace = { - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - }, + library = { + [vim.fn.expand "$VIMRUNTIME/lua"] = true, + [vim.fn.stdpath "config" .. "/lua"] = true, }, + }, }, }, } diff --git a/roles/neovim/files/lua/opdavies/lsp/settings/tailwindcss.lua b/roles/neovim/files/lua/opdavies/lsp/settings/tailwindcss.lua index 5a647ab..3a994b3 100644 --- a/roles/neovim/files/lua/opdavies/lsp/settings/tailwindcss.lua +++ b/roles/neovim/files/lua/opdavies/lsp/settings/tailwindcss.lua @@ -1,3 +1,3 @@ return { - filetypes = { "html", "html.twig", "lua" } + filetypes = { "html", "html.twig", "lua" }, } diff --git a/roles/neovim/files/lua/opdavies/options.lua b/roles/neovim/files/lua/opdavies/options.lua index f7925d1..c6c0a7f 100644 --- a/roles/neovim/files/lua/opdavies/options.lua +++ b/roles/neovim/files/lua/opdavies/options.lua @@ -1,7 +1,7 @@ local M = {} local function set_autocmd() - vim.cmd[[ + vim.cmd [[ autocmd BufRead,BufNewFile *.test set filetype=php autocmd BufWritePost plugins.lua luafile % @@ -15,7 +15,7 @@ local function set_autocmd() end local function set_filetypes() - vim.cmd[[ + vim.cmd [[ filetype indent on filetype on filetype plugin on @@ -27,45 +27,40 @@ local function set_key_mappings() local options = { noremap = true } - map('n', 'so', ':luafile ~/.config/nvim/init.lua', options) + map("n", "so", ":luafile ~/.config/nvim/init.lua", options) -- Format paragraphs to an 80 character line length. - map('n', 'g', 'gqap', options) - map('x', 'g', 'gqa', options) + map("n", "g", "gqap", options) + map("x", "g", "gqa", options) -- Make the current file executable - map('n', 'x', ':!chmod +x %', options) + map("n", "x", ":!chmod +x %", options) -- Yank from the current column to the end of the line - map('n', 'Y', 'yg$', options) + map("n", "Y", "yg$", options) -- Keep things centred - map('n', 'n', 'nzzzv', options) - map('n', 'N', 'Nzzzv', options) + map("n", "n", "nzzzv", options) + map("n", "N", "Nzzzv", options) -- Remove arrow keys - map('v', '', '', options) - map('v', '', '', options) - map('v', '', '', options) - map('v', '', '', options) + map("v", "", "", options) + map("v", "", "", options) + map("v", "", "", options) + map("v", "", "", options) -- Clears hlsearch after doing a search, otherwise just does normal stuff - vim.cmd[[ nnoremap {-> v:hlsearch ? ":nohl\" : "\"}() ]] + vim.cmd [[ nnoremap {-> v:hlsearch ? ":nohl\" : "\"}() ]] - map( - 'n', - '', - ':silent !tmux neww tmux-sessioniser', - { noremap = true, silent = true } - ) + map("n", "", ":silent !tmux neww tmux-sessioniser", { noremap = true, silent = true }) end local function set_highlights() - vim.cmd[[highlight Comment cterm=italic gui=italic]] + vim.cmd [[highlight Comment cterm=italic gui=italic]] end local function set_vim_g() - vim.g.mapleader = ' ' + vim.g.mapleader = " " end local function set_vim_o() @@ -76,10 +71,10 @@ local function set_vim_o() expandtab = true, foldlevel = 1, foldlevelstart = 1, - foldmethod = 'indent', - formatoptions = 'lm', + foldmethod = "indent", + formatoptions = "lm", linebreak = true, - mouse = 'n', + mouse = "n", number = true, pumblend = 10, pumheight = 10, @@ -92,7 +87,7 @@ local function set_vim_o() splitbelow = true, splitright = true, swapfile = false, - syntax = 'on', + syntax = "on", tabstop = 2, termguicolors = true, textwidth = 0, @@ -104,7 +99,7 @@ local function set_vim_o() vim.o[key] = value end - vim.opt.clipboard:append 'unnamedplus' + vim.opt.clipboard:append "unnamedplus" end M.setup = function() diff --git a/roles/neovim/files/lua/opdavies/plugins.lua b/roles/neovim/files/lua/opdavies/plugins.lua index 4606127..68887f8 100644 --- a/roles/neovim/files/lua/opdavies/plugins.lua +++ b/roles/neovim/files/lua/opdavies/plugins.lua @@ -6,81 +6,81 @@ end packer.init { display = { open_fn = function() - return require'packer.util'.float {} + return require("packer.util").float {} end, }, } return packer.startup(function() - use 'wbthomason/packer.nvim' + use "wbthomason/packer.nvim" -- Utilities - use 'cakebaker/scss-syntax.vim' - use 'christoomey/vim-sort-motion' - use 'christoomey/vim-tmux-navigator' - use 'editorconfig/editorconfig-vim' - use 'folke/twilight.nvim' - use 'folke/zen-mode.nvim' - use 'icatalina/vim-case-change' - use 'kyazdani42/nvim-web-devicons' - use 'lewis6991/gitsigns.nvim' - use 'lukas-reineke/indent-blankline.nvim' - use 'machakann/vim-highlightedyank' - use 'miyakogi/seiya.vim' - use 'norcalli/nvim-colorizer.lua' - use 'numToStr/Comment.nvim' - use 'nvim-lua/plenary.nvim' - use 'nvim-lua/popup.nvim' - use 'sheerun/vim-polyglot' - use 'tpope/vim-surround' - use 'vim-test/vim-test' - use 'voldikss/vim-floaterm' - use 'windwp/nvim-autopairs' - use { 'mg979/vim-visual-multi', branch = 'master' } + use "cakebaker/scss-syntax.vim" + use "christoomey/vim-sort-motion" + use "christoomey/vim-tmux-navigator" + use "editorconfig/editorconfig-vim" + use "folke/twilight.nvim" + use "folke/zen-mode.nvim" + use "icatalina/vim-case-change" + use "kyazdani42/nvim-web-devicons" + use "lewis6991/gitsigns.nvim" + use "lukas-reineke/indent-blankline.nvim" + use "machakann/vim-highlightedyank" + use "miyakogi/seiya.vim" + use "norcalli/nvim-colorizer.lua" + use "numToStr/Comment.nvim" + use "nvim-lua/plenary.nvim" + use "nvim-lua/popup.nvim" + use "sheerun/vim-polyglot" + use "tpope/vim-surround" + use "vim-test/vim-test" + use "voldikss/vim-floaterm" + use "windwp/nvim-autopairs" + use { "mg979/vim-visual-multi", branch = "master" } -- Themes use { - 'tjdevries/gruvbuddy.nvim', + "tjdevries/gruvbuddy.nvim", requires = { - 'tjdevries/colorbuddy.vim' + "tjdevries/colorbuddy.vim", }, } -- Navigation - use 'ThePrimeagen/harpoon' + use "ThePrimeagen/harpoon" -- Treesitter use { - 'nvim-treesitter/nvim-treesitter', - run = ':TSUpdate', + "nvim-treesitter/nvim-treesitter", + run = ":TSUpdate", } -- Completion use { - 'hrsh7th/nvim-cmp', + "hrsh7th/nvim-cmp", requires = { - 'L3MON4D3/LuaSnip', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-path', - 'onsails/lspkind-nvim', - 'saadparwaiz1/cmp_luasnip', + "L3MON4D3/LuaSnip", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-path", + "onsails/lspkind-nvim", + "saadparwaiz1/cmp_luasnip", { - 'tzachar/cmp-tabnine', - run = './install.sh' - } - } + "tzachar/cmp-tabnine", + run = "./install.sh", + }, + }, } -- Snippets - use 'L3MON4D3/LuaSnip' - use 'rafamadriz/friendly-snippets' + use "L3MON4D3/LuaSnip" + use "rafamadriz/friendly-snippets" -- LSP - use 'neovim/nvim-lspconfig' - use 'jose-elias-alvarez/null-ls.nvim' + use "neovim/nvim-lspconfig" + use "jose-elias-alvarez/null-ls.nvim" -- Telescope - use 'nvim-telescope/telescope.nvim' - use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } + use "nvim-telescope/telescope.nvim" + use { "nvim-telescope/telescope-fzf-native.nvim", run = "make" } end) diff --git a/roles/neovim/files/lua/opdavies/seiya.lua b/roles/neovim/files/lua/opdavies/seiya.lua index 7e61d0f..96c3493 100644 --- a/roles/neovim/files/lua/opdavies/seiya.lua +++ b/roles/neovim/files/lua/opdavies/seiya.lua @@ -1,3 +1,3 @@ vim.g.seiya_auto_enable = 1 -vim.g.seiya_target_groups = { 'guibg' } +vim.g.seiya_target_groups = { "guibg" } diff --git a/roles/neovim/files/lua/opdavies/telescope/init.lua b/roles/neovim/files/lua/opdavies/telescope/init.lua index a7c654f..9f5a98f 100644 --- a/roles/neovim/files/lua/opdavies/telescope/init.lua +++ b/roles/neovim/files/lua/opdavies/telescope/init.lua @@ -3,38 +3,39 @@ if not status_ok then return end -local previewers = require('telescope.previewers') -local Job = require('plenary.job') +local previewers = require "telescope.previewers" +local Job = require "plenary.job" -- Create a new maker that won't preview binary files -- https://github.com/nvim-telescope/telescope.nvim/wiki/Configuration-Recipes#dont-preview-binaries local new_maker = function(filepath, bufnr, opts) filepath = vim.fn.expand(filepath) - Job:new({ - command = 'file', - args = { '--mime-type', '-b', filepath }, - on_exit = function(j) - local mime_type = vim.split(j:result()[1], '/')[1] - if mime_type == "text" then - previewers.buffer_previewer_maker(filepath, bufnr, opts) - else - vim.schedule(function() - vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, { 'BINARY' }) - end) - end - end - }):sync() + Job + :new({ + command = "file", + args = { "--mime-type", "-b", filepath }, + on_exit = function(j) + local mime_type = vim.split(j:result()[1], "/")[1] + if mime_type == "text" then + previewers.buffer_previewer_maker(filepath, bufnr, opts) + else + vim.schedule(function() + vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, { "BINARY" }) + end) + end + end, + }) + :sync() end -telescope.setup{ +telescope.setup { defaults = { buffer_previewer_maker = new_maker, - prompt_prefix = "$ " - } + prompt_prefix = "$ ", + }, } - -telescope.load_extension("fzf") +telescope.load_extension "fzf" local map = vim.api.nvim_set_keymap local options = { @@ -43,15 +44,20 @@ local options = { } -- Builtin -map('n', 'fb', 'lua require("telescope.builtin").buffers()', options) -map('n', 'fc', 'lua require("telescope.builtin").lsp_code_actions()', options) -map('n', 'fd', 'lua require("telescope.builtin").lsp_workspace_diagnostics()', options) -map('n', 'fe', 'lua require("telescope.builtin").file_browser{ cwd = vim.fn.expand("%:p:h") }', options) -map('n', 'fg', 'lua require("telescope.builtin").git_files{}', options) -map('n', 'fh', 'lua require("telescope.builtin").help_tags()', options) -map('n', 'fl', 'lua require("telescope.builtin").live_grep()', options) -map('n', 'fr', 'lua require("telescope.builtin").registers()', options) -map('n', 'fr', 'lua require("telescope.builtin").registers()', options) +map("n", "fb", 'lua require("telescope.builtin").buffers()', options) +map("n", "fc", 'lua require("telescope.builtin").lsp_code_actions()', options) +map("n", "fd", 'lua require("telescope.builtin").lsp_workspace_diagnostics()', options) +map( + "n", + "fe", + 'lua require("telescope.builtin").file_browser{ cwd = vim.fn.expand("%:p:h") }', + options +) +map("n", "fg", 'lua require("telescope.builtin").git_files{}', options) +map("n", "fh", 'lua require("telescope.builtin").help_tags()', options) +map("n", "fl", 'lua require("telescope.builtin").live_grep()', options) +map("n", "fr", 'lua require("telescope.builtin").registers()', options) +map("n", "fr", 'lua require("telescope.builtin").registers()', options) -- Custom map("n", "en", 'lua require("opdavies.telescope.mappings").edit_neovim()', options) diff --git a/roles/neovim/files/lua/opdavies/treesitter.lua b/roles/neovim/files/lua/opdavies/treesitter.lua index 1e88cd4..1d5d8ea 100644 --- a/roles/neovim/files/lua/opdavies/treesitter.lua +++ b/roles/neovim/files/lua/opdavies/treesitter.lua @@ -5,7 +5,7 @@ end configs.setup { context_commenting = { - enable = true + enable = true, }, ensure_installed = "maintained", highlight = { @@ -14,5 +14,5 @@ configs.setup { indent = { disable = { "yaml" }, enable = true, - } + }, } diff --git a/roles/neovim/files/lua/opdavies/vim-test.lua b/roles/neovim/files/lua/opdavies/vim-test.lua index 366d950..2834b3c 100644 --- a/roles/neovim/files/lua/opdavies/vim-test.lua +++ b/roles/neovim/files/lua/opdavies/vim-test.lua @@ -1,13 +1,13 @@ local map = vim.api.nvim_set_keymap local options = { - silent = true + silent = true, } -map('n', 't', ':TestFile', options) -map('n', 't', ':TestVisit', options) -map('n', 't', ':TestLast', options) -map('n', 't', ':TestNearest', options) -map('n', 't', ':TestSuite', options) +map("n", "t", ":TestFile", options) +map("n", "t", ":TestVisit", options) +map("n", "t", ":TestLast", options) +map("n", "t", ":TestNearest", options) +map("n", "t", ":TestSuite", options) -vim.g['test#strategy'] = "neovim" +vim.g["test#strategy"] = "neovim" diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..348650b --- /dev/null +++ b/stylua.toml @@ -0,0 +1,5 @@ +indent_type = "Spaces" +indent_width = 2 +line_endings = "Unix" +no_call_parentheses = true +quote_style = "AutoPreferDouble"