From 47fdfe1d06fb690188e0816f1891556c24b37d60 Mon Sep 17 00:00:00 2001 From: saibotk Date: Wed, 23 Feb 2022 00:18:26 +0100 Subject: [PATCH] nvim: cleanup lua files style inconsistencies --- nvim/init.lua | 4 +-- nvim/lua/autocompletion.lua | 22 +++++++-------- nvim/lua/filemanager.lua | 40 +++++++++++++------------- nvim/lua/options.lua | 56 ++++++++++++++++++------------------- 4 files changed, 61 insertions(+), 61 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index a408a6e..d96d897 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,4 +1,4 @@ -local nvim_config_root = "~/.config/nvim" +local nvim_config_root = '~/.config/nvim' -- BASIC OPTIONS require('plugins') @@ -6,7 +6,7 @@ require('options') require('mappings') -- VIM PLUGIN OPTIONS -vim.cmd("source " .. nvim_config_root .. "/pluginoptions.vim") +vim.cmd('source ' .. nvim_config_root .. '/pluginoptions.vim') -- LUA PLUGIN OPTIONS require('telescopeconfig') diff --git a/nvim/lua/autocompletion.lua b/nvim/lua/autocompletion.lua index d41e526..fb37c34 100644 --- a/nvim/lua/autocompletion.lua +++ b/nvim/lua/autocompletion.lua @@ -4,7 +4,7 @@ local cmp = require'cmp' cmp.setup({ snippet = { expand = function(args) - vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. + vim.fn['UltiSnips#Anon'](args.body) -- For `ultisnips` users. end, }, mapping = { @@ -49,21 +49,21 @@ local on_attach = function(client, bufnr) end local opts = { noremap = true, silent = true } - buf_set_keymap("n", "gd", "Telescope lsp_definitions", opts) - buf_set_keymap("n", "gh", "lua vim.lsp.buf.hover()", opts) - buf_set_keymap("n", "gD", "Telescope lsp_implementations", opts) - buf_set_keymap("n", "gs", "lua vim.lsp.buf.signature_help()", opts) - buf_set_keymap("n", "gR", "lua vim.lsp.buf.rename()", opts) - buf_set_keymap("n", "gH", "Telescope lsp_code_actions()", opts) - buf_set_keymap("n", "gr", "Telescope lsp_references", opts) - buf_set_keymap("n", "ge", "lua vim.diagnostic.open_float()", opts) + buf_set_keymap('n', 'gd', 'Telescope lsp_definitions', opts) + buf_set_keymap('n', 'gh', 'lua vim.lsp.buf.hover()', opts) + buf_set_keymap('n', 'gD', 'Telescope lsp_implementations', opts) + buf_set_keymap('n', 'gs', 'lua vim.lsp.buf.signature_help()', opts) + buf_set_keymap('n', 'gR', 'lua vim.lsp.buf.rename()', opts) + buf_set_keymap('n', 'gH', 'Telescope lsp_code_actions()', opts) + buf_set_keymap('n', 'gr', 'Telescope lsp_references', opts) + buf_set_keymap('n', 'ge', 'lua vim.diagnostic.open_float()', opts) end -local lsp_installer = require "nvim-lsp-installer" +local lsp_installer = require 'nvim-lsp-installer' lsp_installer.on_server_ready(function(server) local opts = {} opts.on_attach = on_attach - opts.capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) + opts.capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) server:setup(opts) vim.cmd [[ do User LspAttachBuffers ]] diff --git a/nvim/lua/filemanager.lua b/nvim/lua/filemanager.lua index 9ea122e..f825da9 100644 --- a/nvim/lua/filemanager.lua +++ b/nvim/lua/filemanager.lua @@ -4,33 +4,33 @@ vim.g.nvim_tree_icons = { default = '', symlink = '', git = { - unstaged = "✗", - staged = "✓", - unmerged = "", - renamed = "➜", - untracked = "★", - deleted = "", + unstaged = '✗', + staged = '✓', + unmerged = '', + renamed = '➜', + untracked = '★', + deleted = '', }, folder = { - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - symlink_open = "", + default = '', + open = '', + empty = '', + empty_open = '', + symlink = '', + symlink_open = '', }, } -- extra options -vim.g.nvim_tree_indent_markers=1 -vim.g.nvim_tree_add_trailing=1 -vim.g.nvim_tree_special_files= { - ["README.md"] = true, - ["readme.md"] = true, +vim.g.nvim_tree_indent_markers = 1 +vim.g.nvim_tree_add_trailing = 1 +vim.g.nvim_tree_special_files = { + ['README.md'] = true, + ['readme.md'] = true, Pipfile = true, Makefile = true, - ["package.json"] = true, + ['package.json'] = true, } -- colors @@ -57,7 +57,7 @@ require'nvim-tree'.setup { auto_open = true, }, system_open = { - cmd = "open" + cmd = 'open' }, filters = { dotfiles = true @@ -74,6 +74,6 @@ require'nvim-tree'.setup { }, }, trash = { - cmd = "trash" + cmd = 'trash' } } diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua index c5b5975..ca5543e 100644 --- a/nvim/lua/options.lua +++ b/nvim/lua/options.lua @@ -10,45 +10,45 @@ vim.cmd [[ ]] -- color settings -vim.opt.termguicolors=true +vim.opt.termguicolors = true -- random settings -vim.opt.number=true -vim.opt.rnu=true -vim.opt.clipboard='unnamed' -vim.opt.mouse='nvi' +vim.opt.number = true +vim.opt.rnu = true +vim.opt.clipboard = 'unnamed' +vim.opt.mouse = 'nvi' -vim.opt.visualbell=true -vim.opt.virtualedit='block' -vim.opt.scrolloff=1 -vim.opt.wildmenu=true -vim.opt.autoread=true -vim.opt.lazyredraw=true -vim.opt.history=250 -vim.opt.showmode=false +vim.opt.visualbell = true +vim.opt.virtualedit = 'block' +vim.opt.scrolloff = 1 +vim.opt.wildmenu = true +vim.opt.autoread = true +vim.opt.lazyredraw = true +vim.opt.history = 250 +vim.opt.showmode = false -vim.opt.completeopt='menuone,noinsert,noselect' +vim.opt.completeopt = 'menuone,noinsert,noselect' -- tabs and line wrap -vim.opt.wrapmargin=8 -vim.opt.backspace='indent,eol,start' -vim.opt.encoding='utf-8' -vim.opt.autoindent=true +vim.opt.wrapmargin = 8 +vim.opt.backspace = 'indent,eol,start' +vim.opt.encoding = 'utf-8' +vim.opt.autoindent = true -- search -vim.opt.incsearch=true -vim.opt.hlsearch=true -vim.opt.smartcase=true +vim.opt.incsearch = true +vim.opt.hlsearch = true +vim.opt.smartcase = true -- Disable Backup and Swap files -vim.opt.swapfile=false -vim.opt.backup=false -vim.opt.writebackup=false +vim.opt.swapfile = false +vim.opt.backup = false +vim.opt.writebackup = false -- setup split -vim.opt.splitbelow=true -vim.opt.splitright=true +vim.opt.splitbelow = true +vim.opt.splitright = true -- Enable folding -vim.opt.foldmethod='indent' -vim.opt.foldlevel=99 +vim.opt.foldmethod = 'indent' +vim.opt.foldlevel = 99