diff --git a/roles/neovim/files/lua/autocommands.lua b/roles/neovim/files/lua/autocommands.lua index aaafa69..f1933d7 100644 --- a/roles/neovim/files/lua/autocommands.lua +++ b/roles/neovim/files/lua/autocommands.lua @@ -3,79 +3,79 @@ local group = vim.api.nvim_create_augroup("configgroup", { clear = true }) -- Run Flake8 on write in python files vim.api.nvim_create_autocmd("BufWritePost", { - pattern = "*.py", - command = "call flake8#Flake8()", - group = group + pattern = "*.py", + command = "call flake8#Flake8()", + group = group }) -- Open pdf after entering .ly file for side-by-side vim.api.nvim_create_autocmd("VimEnter", { - pattern = "*.ly", - command = "silent ![ -f ./%:r.pdf ] && zathura %:r.pdf &", - group = group + pattern = "*.ly", + command = "silent ![ -f ./%:r.pdf ] && zathura %:r.pdf &", + group = group }) -- Run lilypond after save on .ly files vim.api.nvim_create_autocmd("BufWritePost", { - pattern = "*.ly", - command = "!lilypond --silent %", - group = group + pattern = "*.ly", + command = "!lilypond --silent %", + group = group }) -- Toggle relative number and absolute number according to focus and insert vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "InsertLeave" }, { - command = "set relativenumber", - group = group + command = "set relativenumber", + group = group }) vim.api.nvim_create_autocmd({ "BufLeave", "FocusLost", "InsertEnter" }, { - command = "set norelativenumber", - group = group + command = "set norelativenumber", + group = group }) -- FileType autocommands vim.api.nvim_create_autocmd("FileType", { - pattern = "rust", - command = "nnoremap :RustFmt", - group = group + pattern = "rust", + command = "nnoremap :RustFmt", + group = group }) vim.api.nvim_create_autocmd("FileType", { - pattern = "python", - command = "nnoremap :Black", - group = group + pattern = "python", + command = "nnoremap :Black", + group = group }) vim.api.nvim_create_autocmd("FileType", { - pattern = { "html", "htmldjango", "lilypond", "python", "tex", "plaintex", "yaml" }, - command = "setlocal foldmethod=indent", - group = group + pattern = { "html", "htmldjango", "lilypond", "python", "tex", "plaintex", "yaml" }, + command = "setlocal foldmethod=indent", + group = group }) vim.api.nvim_create_autocmd("FileType", { - pattern = "python", - command = "setlocal colorcolumn=80", - group = group + pattern = "python", + command = "setlocal colorcolumn=80", + group = group }) vim.api.nvim_create_autocmd("BufEnter", { - pattern = { "Makefile", "*.asm" }, - command = "setlocal noexpandtab tabstop=6 shiftwidth=6 softtabstop=0", - group = group + pattern = { "Makefile", "*.asm" }, + command = "setlocal noexpandtab tabstop=6 shiftwidth=6 softtabstop=0", + group = group }) vim.api.nvim_create_autocmd("BufEnter", { - pattern = "*.sh", - command = "setlocal shiftwidth=2 tabstop=2 softtabstop=2 foldlevel=0 foldmethod=marker", - group = group + pattern = "*.sh", + command = "setlocal shiftwidth=2 tabstop=2 softtabstop=2 foldlevel=0 foldmethod=marker", + group = group }) vim.api.nvim_create_autocmd("FileType", { - pattern = "yaml", - command = "setlocal shiftwidth=4 tabstop=4 softtabstop=4", - group = group + pattern = "yaml", + command = "setlocal shiftwidth=4 tabstop=4 softtabstop=4", + group = group }) vim.api.nvim_create_autocmd("FileType", { - pattern = { "lua", "vhdl" }, - command = "setlocal shiftwidth=2 tabstop=2 softtabstop=2", - group = group + pattern = { "lua", "vhdl" }, + command = "setlocal shiftwidth=2 tabstop=2 softtabstop=2", + group = group }) vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { - pattern = "*/playbooks/*.yml", - command = "set filetype=yaml.ansible", - group = group + pattern = "*/playbooks/*.yml", + command = "set filetype=yaml.ansible", + group = group }) vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { - pattern = "*.neomuttrc", - command = "set filetype=neomuttrc", - group = group + pattern = "*.neomuttrc", + command = "set filetype=neomuttrc", + group = group }) diff --git a/roles/neovim/files/lua/plugins.lua b/roles/neovim/files/lua/plugins.lua index b0bb1f1..d838dcf 100644 --- a/roles/neovim/files/lua/plugins.lua +++ b/roles/neovim/files/lua/plugins.lua @@ -1,31 +1,31 @@ local fn = vim.fn local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' if fn.empty(fn.glob(install_path)) > 0 then - packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) - vim.cmd [[packadd packer.nvim]] + packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + vim.cmd [[packadd packer.nvim]] end return require('packer').startup(function(use) - -- Packer can manage itself - use 'wbthomason/packer.nvim' + -- Packer can manage itself + use 'wbthomason/packer.nvim' - -- Nvim LSP - use 'neovim/nvim-lspconfig' + -- Nvim LSP + use 'neovim/nvim-lspconfig' - -- COLOR SCHEMES - use 'morhetz/gruvbox' - use 'sjl/badwolf' + -- COLOR SCHEMES + use 'morhetz/gruvbox' + use 'sjl/badwolf' - -- NERDTree - use 'preservim/nerdtree' - use 'Xuyuanp/nerdtree-git-plugin' -- A NERDTree plugin showing git status + -- NERDTree + use 'preservim/nerdtree' + use 'Xuyuanp/nerdtree-git-plugin' -- A NERDTree plugin showing git status - -- VimTeX - use 'lervag/vimtex' + -- VimTeX + use 'lervag/vimtex' - -- Automatically set up your configuration after cloning packer.nvim - -- Put this at the end after all plugins - if packer_bootstrap then - require('packer').sync() - end + -- Automatically set up your configuration after cloning packer.nvim + -- Put this at the end after all plugins + if packer_bootstrap then + require('packer').sync() + end end)