From b9d119413306b1a8bf947484f60e2ce643dfa171 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Sat, 30 Jan 2021 16:46:41 +0200 Subject: [PATCH] Add neoformatter and format lua files --- home/.config/nvim/lua/keybinds.lua | 3 +- home/.config/nvim/lua/pluginmanager.lua | 52 ++++++++++---------- home/.config/nvim/lua/plugins/airline.lua | 2 +- home/.config/nvim/lua/plugins/lsp.lua | 2 +- home/.config/nvim/lua/plugins/nerdtree.lua | 0 home/.config/nvim/lua/plugins/treesitter.lua | 14 ++---- 6 files changed, 35 insertions(+), 38 deletions(-) delete mode 100644 home/.config/nvim/lua/plugins/nerdtree.lua diff --git a/home/.config/nvim/lua/keybinds.lua b/home/.config/nvim/lua/keybinds.lua index e9feb391..b8942423 100644 --- a/home/.config/nvim/lua/keybinds.lua +++ b/home/.config/nvim/lua/keybinds.lua @@ -1,5 +1,6 @@ local map = function(type, key, value) - vim.fn.nvim_buf_set_keymap(0, type, key, value, {noremap = true, silent = true}) + vim.fn.nvim_buf_set_keymap(0, type, key, value, + {noremap = true, silent = true}) end -- Open/close nerdtree diff --git a/home/.config/nvim/lua/pluginmanager.lua b/home/.config/nvim/lua/pluginmanager.lua index 1a091cb1..7cf0540e 100644 --- a/home/.config/nvim/lua/pluginmanager.lua +++ b/home/.config/nvim/lua/pluginmanager.lua @@ -2,48 +2,50 @@ local fn = vim.fn local cmd = vim.cmd -- Install packer if it's not yet installed -local install_path = fn.stdpath('data')..'/site/pack/packer/opt/packer.nvim' +local install_path = fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim' local packer_not_installed = fn.empty(fn.glob(install_path)) if packer_not_installed > 0 then - print('Packer is not installed, cloning it now...') - cmd ('silent !git clone https://github.com/wbthomason/packer.nvim ' .. install_path) + print('Packer is not installed, cloning it now...') + cmd('silent !git clone https://github.com/wbthomason/packer.nvim ' .. + install_path) end -- Configure packer cmd 'packadd packer.nvim' require('packer').startup(function() - -- The plugin manager itself - use {'wbthomason/packer.nvim', opt = true} + -- The plugin manager itself + use {'wbthomason/packer.nvim', opt = true} - -- Colorscheme - use 'joshdick/onedark.vim' + -- Colorscheme + use 'joshdick/onedark.vim' - -- Custom status and tabline - use 'vim-airline/vim-airline' + -- Custom status and tabline + use 'vim-airline/vim-airline' - -- Tree explorer - use 'scrooloose/nerdtree' + -- Tree explorer + use 'scrooloose/nerdtree' - -- Fuzzy finder - use 'junegunn/fzf' - use 'junegunn/fzf.vim' + -- Fuzzy finder + use 'junegunn/fzf' + use 'junegunn/fzf.vim' - -- Do stuff as sudo - use 'lambdalisue/suda.vim' + -- Do stuff as sudo + use 'lambdalisue/suda.vim' - -- Configs for built-in LSP - use 'neovim/nvim-lspconfig' + -- Configs for built-in LSP + use 'neovim/nvim-lspconfig' - -- Completion framework - use 'nvim-lua/completion-nvim' + -- Completion framework + use 'nvim-lua/completion-nvim' - -- Treesitter syntax highlight - use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } + -- Treesitter syntax highlight + use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate'} + + -- Formatter plugin + use 'sbdchd/neoformat' end) -- Install plugins if packer was not installed -if packer_not_installed > 0 then - cmd 'PackerInstall' -end +if packer_not_installed > 0 then cmd 'PackerInstall' end diff --git a/home/.config/nvim/lua/plugins/airline.lua b/home/.config/nvim/lua/plugins/airline.lua index 9a30505f..e399cbe8 100644 --- a/home/.config/nvim/lua/plugins/airline.lua +++ b/home/.config/nvim/lua/plugins/airline.lua @@ -3,7 +3,7 @@ local o = vim.o o.showmode = false o.laststatus = 2 -g["airline#extensions#tabline#enabled"]= 1 +g["airline#extensions#tabline#enabled"] = 1 g.airline_powerline_fonts = 1 g.airline_section_warning = '' g.airline_section_error = '' diff --git a/home/.config/nvim/lua/plugins/lsp.lua b/home/.config/nvim/lua/plugins/lsp.lua index 7dfc32e1..770220e6 100644 --- a/home/.config/nvim/lua/plugins/lsp.lua +++ b/home/.config/nvim/lua/plugins/lsp.lua @@ -1,3 +1,3 @@ local cmd = vim.cmd -require 'lspconfig'.rust_analyzer.setup{} +require'lspconfig'.rust_analyzer.setup {} diff --git a/home/.config/nvim/lua/plugins/nerdtree.lua b/home/.config/nvim/lua/plugins/nerdtree.lua deleted file mode 100644 index e69de29b..00000000 diff --git a/home/.config/nvim/lua/plugins/treesitter.lua b/home/.config/nvim/lua/plugins/treesitter.lua index 985dd7cc..12ab42bc 100644 --- a/home/.config/nvim/lua/plugins/treesitter.lua +++ b/home/.config/nvim/lua/plugins/treesitter.lua @@ -1,12 +1,6 @@ require'nvim-treesitter.configs'.setup { - ensure_installed = 'maintained', - highlight = { - enable = true - }, - indent = { - enable = true - }, - incremental_selection = { - enable = true - } + ensure_installed = 'maintained', + highlight = {enable = true}, + indent = {enable = true}, + incremental_selection = {enable = true} }