From 3c6fc1b28d53c64dc431f1f84e72542b1c9b7281 Mon Sep 17 00:00:00 2001 From: Ruthenic Date: Fri, 24 Dec 2021 22:20:33 -0500 Subject: [PATCH] Run stylua --- init.lua | 52 ++++++++-------- lua/config.lua | 13 ++-- lua/keybinds.lua | 26 ++++---- lua/plugins/lines.lua | 136 ++++++++++++++++++++++-------------------- lua/plugins/lsp.lua | 31 +++++----- lua/plugins/misc.lua | 17 +++--- 6 files changed, 139 insertions(+), 136 deletions(-) diff --git a/init.lua b/init.lua index 4e08f89..73e1011 100644 --- a/init.lua +++ b/init.lua @@ -1,29 +1,29 @@ vim.g.did_load_filetypes = 1 --TODO: switch to a more lua friendly plugin manager -require("paq")({ - 'savq/paq-nvim'; - 'nathom/filetype.nvim'; - 'neovim/nvim-lspconfig'; - 'kyazdani42/nvim-web-devicons'; - 'nvim-lualine/lualine.nvim'; - 'nvim-lua/plenary.nvim'; - 'nvim-telescope/telescope.nvim'; - 'sainnhe/sonokai'; - 'nvim-treesitter/nvim-treesitter'; - 'noib3/cokeline.nvim'; - 'andweeb/presence.nvim'; - 'folke/todo-comments.nvim'; - 'dstein64/vim-startuptime'; - {'nvim-telescope/telescope-fzf-native.nvim', run='make'}; - 'echasnovski/mini.nvim'; - 'hrsh7th/nvim-cmp'; - 'hrsh7th/cmp-buffer'; - 'hrsh7th/cmp-nvim-lsp'; - 'hrsh7th/cmp-nvim-lua'; - 'hrsh7th/vim-vsnip'; - 'hrsh7th/cmp-vsnip'; +require('paq')({ + 'savq/paq-nvim', + 'nathom/filetype.nvim', + 'neovim/nvim-lspconfig', + 'kyazdani42/nvim-web-devicons', + 'nvim-lualine/lualine.nvim', + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope.nvim', + 'sainnhe/sonokai', + 'nvim-treesitter/nvim-treesitter', + 'noib3/cokeline.nvim', + 'andweeb/presence.nvim', + 'folke/todo-comments.nvim', + 'dstein64/vim-startuptime', + { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }, + 'echasnovski/mini.nvim', + 'hrsh7th/nvim-cmp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-nvim-lua', + 'hrsh7th/vim-vsnip', + 'hrsh7th/cmp-vsnip', }) -require("colorscheme") -require("config") -require("plugins") -require("keybinds") +require('colorscheme') +require('config') +require('plugins') +require('keybinds') diff --git a/lua/config.lua b/lua/config.lua index 98ecaeb..fc585d6 100644 --- a/lua/config.lua +++ b/lua/config.lua @@ -2,14 +2,13 @@ local set = vim.opt -- Set some stuff up like clipboard and mouse -set.termguicolors = true -- Needed for literally any modern colorscheme -set.mouse = 'a' -- Mouse support +set.termguicolors = true -- Needed for literally any modern colorscheme +set.mouse = 'a' -- Mouse support set.clipboard = 'unnamedplus' -- Use X11 clipboard -set.pumheight = 5 -- Uhh whatever the fuck this does -set.number = true -- Show line numbers -set.tabstop = 4 -- Set up tabs -set.shiftwidth = 4 -- See above +set.pumheight = 5 -- Uhh whatever the fuck this does +set.number = true -- Show line numbers +set.tabstop = 4 -- Set up tabs +set.shiftwidth = 4 -- See above set.cursorline = false -- Autocmds - diff --git a/lua/keybinds.lua b/lua/keybinds.lua index abbde99..67af495 100644 --- a/lua/keybinds.lua +++ b/lua/keybinds.lua @@ -1,14 +1,14 @@ local map = vim.api.nvim_set_keymap -map('n', '', 'ggVG', {noremap=true, silent=true}) -map('i', '', 'ggVG', {noremap=true, silent=true}) -map('v', '', 'y', {noremap=true, silent=true}) -map('v', '', 'd', {noremap=true, silent=true}) -map('v', '', 'p', {noremap=true, silent=true}) -map('i', '', 'ui', {noremap=true, silent=true}) -map('i', '', ':redi', {noremap=true, silent=true}) -map('i', '', ':wi', {noremap=true}) -map('n', '', '(cokeline-focus-prev)', {noremap=false}) -map('n', '', '(cokeline-focus-next)', {noremap=false}) -map('n', '', 'Telescope find_files', {noremap=true}) -map('n', '', 'Telescope live_grep', {noremap=true}) -map('n', '', 'lua require("FTerm").toggle()', {noremap=true, silent=true}) +map('n', '', 'ggVG', { noremap = true, silent = true }) +map('i', '', 'ggVG', { noremap = true, silent = true }) +map('v', '', 'y', { noremap = true, silent = true }) +map('v', '', 'd', { noremap = true, silent = true }) +map('v', '', 'p', { noremap = true, silent = true }) +map('i', '', 'ui', { noremap = true, silent = true }) +map('i', '', ':redi', { noremap = true, silent = true }) +map('i', '', ':wi', { noremap = true }) +map('n', '', '(cokeline-focus-prev)', { noremap = false }) +map('n', '', '(cokeline-focus-next)', { noremap = false }) +map('n', '', 'Telescope find_files', { noremap = true }) +map('n', '', 'Telescope live_grep', { noremap = true }) +map('n', '', 'lua require("FTerm").toggle()', { noremap = true, silent = true }) diff --git a/lua/plugins/lines.lua b/lua/plugins/lines.lua index ba56b0a..651df01 100644 --- a/lua/plugins/lines.lua +++ b/lua/plugins/lines.lua @@ -15,74 +15,80 @@ local function filenameIfFileOpened() end require('lualine').setup({ - options = { - icons_enabled = true, - theme = 'sonokai', - component_separators = {left = '', right = ''}, - section_separators = {left = '', right = ''}, - disabled_filetypes = {} - }, - sections = { - lualine_a = {'mode'}, - lualine_b = {'branch'}, - lualine_c = {filenameIfFileOpened}, - lualine_x = {'fileformat'}, - lualine_y = {'diff'}, - lualine_z = {'filetype'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {filenameIfFileOpened}, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - extensions = {} + options = { + icons_enabled = true, + theme = 'sonokai', + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = '' }, + disabled_filetypes = {}, + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch' }, + lualine_c = { filenameIfFileOpened }, + lualine_x = { 'fileformat' }, + lualine_y = { 'diff' }, + lualine_z = { 'filetype' }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { filenameIfFileOpened }, + lualine_x = { 'location' }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + extensions = {}, }) -- Credit to the original author of cokeline for creating most of this config require('cokeline').setup({ - default_hl = { - focused = { - fg = get_hex('Normal', 'fg'), - bg = get_hex('Background', 'bg'), - }, - unfocused = { - fg = get_hex('Comment', 'fg'), - bg = get_hex('Background', 'bg'), - }, - }, + default_hl = { + focused = { + fg = get_hex('Normal', 'fg'), + bg = get_hex('Background', 'bg'), + }, + unfocused = { + fg = get_hex('Comment', 'fg'), + bg = get_hex('Background', 'bg'), + }, + }, - components = { - { - text = function(buffer) - if buffer.is_focused then - return '│ ' .. buffer.devicon.icon - else - return '| ' .. buffer.devicon.icon - end - end, - hl = { - fg = function(buffer) return buffer.devicon.color end, - }, - }, - { - text = function(buffer) return buffer.unique_prefix end, - hl = { - style = 'italic', - }, - }, - { - text = function(buffer) return buffer.filename .. ' ' end, - }, - { - text = 'X', - delete_buffer_on_left_click = true, - }, - { - text = ' ', - }, - }, + components = { + { + text = function(buffer) + if buffer.is_focused then + return '│ ' .. buffer.devicon.icon + else + return '| ' .. buffer.devicon.icon + end + end, + hl = { + fg = function(buffer) + return buffer.devicon.color + end, + }, + }, + { + text = function(buffer) + return buffer.unique_prefix + end, + hl = { + style = 'italic', + }, + }, + { + text = function(buffer) + return buffer.filename .. ' ' + end, + }, + { + text = 'X', + delete_buffer_on_left_click = true, + }, + { + text = ' ', + }, + }, }) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 3c56b0a..c32cd06 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -6,7 +6,7 @@ cmp.setup({ snippet = { expand = function(args) vim.fn['vsnip#anonymous'](args.body) - end + end, }, mapping = { [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), @@ -17,38 +17,38 @@ cmp.setup({ else fallback() end - end + end, }, sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'nvim_lua' }, { name = 'vsnip' }, - { name = 'buffer' } - }) + { name = 'buffer' }, + }), }) local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) require('lspconfig').clangd.setup({ - capabilities = capabilities + capabilities = capabilities, }) require('lspconfig').denols.setup({ - cmd = {'deno', 'lsp'}, - capabilities = capabilities + cmd = { 'deno', 'lsp' }, + capabilities = capabilities, }) require('lspconfig').vls.setup({ - cmd = {'/usr/local/bin/vls'}, - capabilities = capabilities + cmd = { '/usr/local/bin/vls' }, + capabilities = capabilities, }) --TODO: clean this up local runtime_path = vim.split(package.path, ';') -table.insert(runtime_path, "lua/?.lua") -table.insert(runtime_path, "lua/?/init.lua") +table.insert(runtime_path, 'lua/?.lua') +table.insert(runtime_path, 'lua/?/init.lua') local sumneko_root_path = '/home/ruthenic/lua-language-server/bin/Linux/' require('lspconfig').sumneko_lua.setup({ - cmd = {sumneko_root_path .. "lua-language-server", "-E", sumneko_root_path .. "main.lua"}, + cmd = { sumneko_root_path .. 'lua-language-server', '-E', sumneko_root_path .. 'main.lua' }, settings = { Lua = { runtime = { @@ -56,16 +56,15 @@ require('lspconfig').sumneko_lua.setup({ path = runtime_path, }, diagnostics = { - globals = {'vim', 'use'}, + globals = { 'vim', 'use' }, }, workspace = { - library = vim.api.nvim_get_runtime_file("", true), + library = vim.api.nvim_get_runtime_file('', true), }, telemetry = { enable = false, }, }, }, - capabilities = capabilities + capabilities = capabilities, }) - diff --git a/lua/plugins/misc.lua b/lua/plugins/misc.lua index da9d9eb..c164749 100644 --- a/lua/plugins/misc.lua +++ b/lua/plugins/misc.lua @@ -1,16 +1,15 @@ -require("filetype").setup { +require('filetype').setup({ overrides = { - extensions = {v = 'vlang'} - } -} + extensions = { v = 'vlang' }, + }, +}) - -require('nvim-treesitter.configs').setup { +require('nvim-treesitter.configs').setup({ highlight = { enable = true, - disable = {'lua'} - } -} + disable = { 'lua' }, + }, +}) require('telescope').load_extension('fzf')