Minor formatting change

This commit is contained in:
flyingscorpio@clevo 2022-08-02 14:19:13 +02:00
parent 6d39ae8ac1
commit 6c7d9ee7c8
2 changed files with 62 additions and 62 deletions

View file

@ -3,79 +3,79 @@
local group = vim.api.nvim_create_augroup("configgroup", { clear = true }) local group = vim.api.nvim_create_augroup("configgroup", { clear = true })
-- Run Flake8 on write in python files -- Run Flake8 on write in python files
vim.api.nvim_create_autocmd("BufWritePost", { vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*.py", pattern = "*.py",
command = "call flake8#Flake8()", command = "call flake8#Flake8()",
group = group group = group
}) })
-- Open pdf after entering .ly file for side-by-side -- Open pdf after entering .ly file for side-by-side
vim.api.nvim_create_autocmd("VimEnter", { vim.api.nvim_create_autocmd("VimEnter", {
pattern = "*.ly", pattern = "*.ly",
command = "silent ![ -f ./%:r.pdf ] && zathura %:r.pdf &", command = "silent ![ -f ./%:r.pdf ] && zathura %:r.pdf &",
group = group group = group
}) })
-- Run lilypond after save on .ly files -- Run lilypond after save on .ly files
vim.api.nvim_create_autocmd("BufWritePost", { vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*.ly", pattern = "*.ly",
command = "!lilypond --silent %", command = "!lilypond --silent %",
group = group group = group
}) })
-- Toggle relative number and absolute number according to focus and insert -- Toggle relative number and absolute number according to focus and insert
vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "InsertLeave" }, { vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "InsertLeave" }, {
command = "set relativenumber", command = "set relativenumber",
group = group group = group
}) })
vim.api.nvim_create_autocmd({ "BufLeave", "FocusLost", "InsertEnter" }, { vim.api.nvim_create_autocmd({ "BufLeave", "FocusLost", "InsertEnter" }, {
command = "set norelativenumber", command = "set norelativenumber",
group = group group = group
}) })
-- FileType autocommands -- FileType autocommands
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = "rust", pattern = "rust",
command = "nnoremap <F9> :RustFmt<CR>", command = "nnoremap <F9> :RustFmt<CR>",
group = group group = group
}) })
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = "python", pattern = "python",
command = "nnoremap <F9> :Black<CR>", command = "nnoremap <F9> :Black<CR>",
group = group group = group
}) })
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = { "html", "htmldjango", "lilypond", "python", "tex", "plaintex", "yaml" }, pattern = { "html", "htmldjango", "lilypond", "python", "tex", "plaintex", "yaml" },
command = "setlocal foldmethod=indent", command = "setlocal foldmethod=indent",
group = group group = group
}) })
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = "python", pattern = "python",
command = "setlocal colorcolumn=80", command = "setlocal colorcolumn=80",
group = group group = group
}) })
vim.api.nvim_create_autocmd("BufEnter", { vim.api.nvim_create_autocmd("BufEnter", {
pattern = { "Makefile", "*.asm" }, pattern = { "Makefile", "*.asm" },
command = "setlocal noexpandtab tabstop=6 shiftwidth=6 softtabstop=0", command = "setlocal noexpandtab tabstop=6 shiftwidth=6 softtabstop=0",
group = group group = group
}) })
vim.api.nvim_create_autocmd("BufEnter", { vim.api.nvim_create_autocmd("BufEnter", {
pattern = "*.sh", pattern = "*.sh",
command = "setlocal shiftwidth=2 tabstop=2 softtabstop=2 foldlevel=0 foldmethod=marker", command = "setlocal shiftwidth=2 tabstop=2 softtabstop=2 foldlevel=0 foldmethod=marker",
group = group group = group
}) })
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = "yaml", pattern = "yaml",
command = "setlocal shiftwidth=4 tabstop=4 softtabstop=4", command = "setlocal shiftwidth=4 tabstop=4 softtabstop=4",
group = group group = group
}) })
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = { "lua", "vhdl" }, pattern = { "lua", "vhdl" },
command = "setlocal shiftwidth=2 tabstop=2 softtabstop=2", command = "setlocal shiftwidth=2 tabstop=2 softtabstop=2",
group = group group = group
}) })
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = "*/playbooks/*.yml", pattern = "*/playbooks/*.yml",
command = "set filetype=yaml.ansible", command = "set filetype=yaml.ansible",
group = group group = group
}) })
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = "*.neomuttrc", pattern = "*.neomuttrc",
command = "set filetype=neomuttrc", command = "set filetype=neomuttrc",
group = group group = group
}) })

View file

@ -1,31 +1,31 @@
local fn = vim.fn local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then 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}) packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd [[packadd packer.nvim]] vim.cmd [[packadd packer.nvim]]
end end
return require('packer').startup(function(use) return require('packer').startup(function(use)
-- Packer can manage itself -- Packer can manage itself
use 'wbthomason/packer.nvim' use 'wbthomason/packer.nvim'
-- Nvim LSP -- Nvim LSP
use 'neovim/nvim-lspconfig' use 'neovim/nvim-lspconfig'
-- COLOR SCHEMES -- COLOR SCHEMES
use 'morhetz/gruvbox' use 'morhetz/gruvbox'
use 'sjl/badwolf' use 'sjl/badwolf'
-- NERDTree -- NERDTree
use 'preservim/nerdtree' use 'preservim/nerdtree'
use 'Xuyuanp/nerdtree-git-plugin' -- A NERDTree plugin showing git status use 'Xuyuanp/nerdtree-git-plugin' -- A NERDTree plugin showing git status
-- VimTeX -- VimTeX
use 'lervag/vimtex' use 'lervag/vimtex'
-- Automatically set up your configuration after cloning packer.nvim -- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins -- Put this at the end after all plugins
if packer_bootstrap then if packer_bootstrap then
require('packer').sync() require('packer').sync()
end end
end) end)