From ac53964865c15885759d11cb8a22fdb91f0ee279 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Mon, 13 Mar 2023 20:43:34 +0000 Subject: [PATCH] reformatted lua files to follow a single standard --- nvim/after/plugin/dap.lua | 26 +++++++++++++------------- nvim/after/plugin/fugitive.lua | 2 +- nvim/after/plugin/harpoon.lua | 16 ++++++++-------- nvim/after/plugin/lsp.lua | 26 +++++++++++++------------- nvim/after/plugin/treesitter.lua | 4 ++-- nvim/after/plugin/undotree.lua | 2 +- nvim/init.lua | 2 +- nvim/lua/luke-else/init.lua | 4 ++-- nvim/lua/luke-else/packer.lua | 11 ++++++----- nvim/lua/luke-else/set.lua | 6 +++--- scripts/install.sh | 4 ++-- 11 files changed, 52 insertions(+), 51 deletions(-) diff --git a/nvim/after/plugin/dap.lua b/nvim/after/plugin/dap.lua index 1efdc6d..52321e2 100644 --- a/nvim/after/plugin/dap.lua +++ b/nvim/after/plugin/dap.lua @@ -1,24 +1,24 @@ -vim.keymap.set("n", "", function() require('dap').continue() end) -vim.keymap.set("n", 'b', function() require('dap').toggle_breakpoint() end) +vim.keymap.set('n', '', function() require('dap').continue() end) +vim.keymap.set('n', 'b', function() require('dap').toggle_breakpoint() end) -require("dap").adapters.lldb = { - type = "executable", - command = "/usr/bin/lldb-vscode", -- adjust as needed - name = "lldb", +require('dap').adapters.lldb = { + type = 'executable', + command = '/usr/bin/lldb-vscode', -- adjust as needed + name = 'lldb', } local lldb = { - name = "Launch lldb", - type = "lldb", -- matches the adapter - request = "launch", -- could also attach to a currently running process + name = 'Launch lldb', + type = 'lldb', -- matches the adapter + request = 'launch', -- could also attach to a currently running process program = function() return vim.fn.input( - "Path to executable: ", - vim.fn.getcwd() .. "/", - "file" + 'Path to executable: ', + vim.fn.getcwd() .. '/', + 'file' ) end, - cwd = "${workspaceFolder}", + cwd = '${workspaceFolder}', stopOnEntry = false, args = {}, runInTerminal = false, diff --git a/nvim/after/plugin/fugitive.lua b/nvim/after/plugin/fugitive.lua index 0a3d5a6..b9b29ba 100644 --- a/nvim/after/plugin/fugitive.lua +++ b/nvim/after/plugin/fugitive.lua @@ -1 +1 @@ -vim.keymap.set("n", "gs", vim.cmd.Git) \ No newline at end of file +vim.keymap.set('n', 'gs', vim.cmd.Git) \ No newline at end of file diff --git a/nvim/after/plugin/harpoon.lua b/nvim/after/plugin/harpoon.lua index 9d7b359..469f914 100644 --- a/nvim/after/plugin/harpoon.lua +++ b/nvim/after/plugin/harpoon.lua @@ -1,10 +1,10 @@ -local mark = require("harpoon.mark") -local ui = require("harpoon.ui") +local mark = require('harpoon.mark') +local ui = require('harpoon.ui') -vim.keymap.set("n", "a", mark.add_file) -vim.keymap.set("n", "", ui.toggle_quick_menu) +vim.keymap.set('n', 'a', mark.add_file) +vim.keymap.set('n', '', ui.toggle_quick_menu) -vim.keymap.set("n", "", function() ui.nav_file(1) end) -vim.keymap.set("n", "", function() ui.nav_file(2) end) -vim.keymap.set("n", "", function() ui.nav_file(3) end) -vim.keymap.set("n", "", function() ui.nav_file(4) end) +vim.keymap.set('n', '', function() ui.nav_file(1) end) +vim.keymap.set('n', '', function() ui.nav_file(2) end) +vim.keymap.set('n', '', function() ui.nav_file(3) end) +vim.keymap.set('n', '', function() ui.nav_file(4) end) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index 97b028b..7e0212e 100644 --- a/nvim/after/plugin/lsp.lua +++ b/nvim/after/plugin/lsp.lua @@ -1,6 +1,6 @@ -local lsp = require("lsp-zero") +local lsp = require('lsp-zero') -lsp.preset("recommended") +lsp.preset('recommended') lsp.ensure_installed({ 'rust_analyzer', @@ -25,7 +25,7 @@ local cmp_mappings = lsp.defaults.cmp_mappings({ [''] = cmp.mapping.select_prev_item(cmp_select), [''] = cmp.mapping.select_next_item(cmp_select), [''] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping.complete(), + [''] = cmp.mapping.complete(), }) cmp_mappings[''] = nil @@ -48,16 +48,16 @@ lsp.set_preferences({ lsp.on_attach(function(client, bufnr) local opts = {buffer = bufnr, remap = false} - vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) - vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) - vim.keymap.set("n", "fr", function() vim.lsp.buf.references() end, opts) - vim.keymap.set("n", "rn", function() vim.lsp.buf.rename() end, opts) - vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts) - vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) - vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) - vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) - vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) + vim.keymap.set('n', 'gd', function() vim.lsp.buf.definition() end, opts) + vim.keymap.set('n', 'K', function() vim.lsp.buf.hover() end, opts) + vim.keymap.set('n', 'fr', function() vim.lsp.buf.references() end, opts) + vim.keymap.set('n', 'rn', function() vim.lsp.buf.rename() end, opts) + vim.keymap.set('n', 'vws', function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set('n', 'vd', function() vim.diagnostic.open_float() end, opts) + vim.keymap.set('n', 'vca', function() vim.lsp.buf.code_action() end, opts) + vim.keymap.set('n', '[d', function() vim.diagnostic.goto_next() end, opts) + vim.keymap.set('n', ']d', function() vim.diagnostic.goto_prev() end, opts) + vim.keymap.set('i', '', function() vim.lsp.buf.signature_help() end, opts) end) lsp.setup() diff --git a/nvim/after/plugin/treesitter.lua b/nvim/after/plugin/treesitter.lua index 48db901..d16c96b 100644 --- a/nvim/after/plugin/treesitter.lua +++ b/nvim/after/plugin/treesitter.lua @@ -1,6 +1,6 @@ require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" - ensure_installed = { "help", "c", "cpp", "lua", "rust" }, + -- A list of parser names, or 'all' + ensure_installed = { 'help', 'c', 'cpp', 'lua', 'rust' }, -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, diff --git a/nvim/after/plugin/undotree.lua b/nvim/after/plugin/undotree.lua index b6b9276..a346462 100644 --- a/nvim/after/plugin/undotree.lua +++ b/nvim/after/plugin/undotree.lua @@ -1 +1 @@ -vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) +vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle) diff --git a/nvim/init.lua b/nvim/init.lua index bfda8e3..50dba48 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1 +1 @@ -require("luke-else") \ No newline at end of file +require('luke-else') \ No newline at end of file diff --git a/nvim/lua/luke-else/init.lua b/nvim/lua/luke-else/init.lua index 833a693..76296f8 100644 --- a/nvim/lua/luke-else/init.lua +++ b/nvim/lua/luke-else/init.lua @@ -1,2 +1,2 @@ -require("luke-else.packer") -require("luke-else.set") \ No newline at end of file +require('luke-else.packer') +require('luke-else.set') \ No newline at end of file diff --git a/nvim/lua/luke-else/packer.lua b/nvim/lua/luke-else/packer.lua index 1c83671..18912f7 100644 --- a/nvim/lua/luke-else/packer.lua +++ b/nvim/lua/luke-else/packer.lua @@ -20,12 +20,12 @@ return require('packer').startup(function(use) use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) use('theprimeagen/harpoon') - use("mbbill/undotree") - use("tpope/vim-fugitive") + use('mbbill/undotree') + use('tpope/vim-fugitive') use { - "windwp/nvim-autopairs", - config = function() require("nvim-autopairs").setup {} end + 'windwp/nvim-autopairs', + config = function() require('nvim-autopairs').setup {} end } use { @@ -52,5 +52,6 @@ return require('packer').startup(function(use) } -- Debugger - use { "rcarriga/nvim-dap-ui", requires = {"mfussenegger/nvim-dap"} } + use 'nvim-lua/plenary.nvim' + use { 'rcarriga/nvim-dap-ui', requires = {'mfussenegger/nvim-dap'} } end) \ No newline at end of file diff --git a/nvim/lua/luke-else/set.lua b/nvim/lua/luke-else/set.lua index e40d612..8936e2f 100644 --- a/nvim/lua/luke-else/set.lua +++ b/nvim/lua/luke-else/set.lua @@ -12,7 +12,7 @@ vim.opt.wrap = false vim.opt.swapfile = false vim.opt.backup = false -vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undodir = os.getenv('HOME') .. '/.vim/undodir' vim.opt.undofile = true vim.opt.hlsearch = false @@ -21,7 +21,7 @@ vim.opt.incsearch = true vim.opt.termguicolors = true vim.opt.scrolloff = 8 -vim.opt.signcolumn = "yes" -vim.opt.isfname:append("@-@") +vim.opt.signcolumn = 'yes' +vim.opt.isfname:append('@-@') vim.opt.updatetime = 50 diff --git a/scripts/install.sh b/scripts/install.sh index 9f3e6d2..4fdc338 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -35,8 +35,8 @@ yay brave-bin mkdir ~/git cd ~/git -git config --global user.name "Luke Else" -git config --global user.email "mail@luke-else.co.uk" +git config --global user.name 'Luke Else' +git config --global user.email 'mail@luke-else.co.uk' git clone ssh://git@git.luke-else.co.uk:222/luke-else/dwm.git git clone ssh://git@git.luke-else.co.uk:222/luke-else/dmenu.git