From 44aa9216c6b395f4f4857b879d7698f0d2d8b22a Mon Sep 17 00:00:00 2001 From: desktop Date: Tue, 5 Dec 2023 22:06:39 +0300 Subject: [PATCH] nvim : reindent with tab. --- .config/nvim/lua/config/autoread.lua | 4 +- .config/nvim/lua/key/rekey.lua | 20 +++--- .config/nvim/lua/key/update.lua | 4 +- .config/nvim/lua/plugin/autoclose.lua | 23 ++++--- .config/nvim/lua/plugin/bufferline.lua | 6 +- .config/nvim/lua/plugin/closebuffers.lua | 10 +-- .config/nvim/lua/plugin/filetree.lua | 22 +++---- .config/nvim/lua/plugin/gitsigns.lua | 78 ++++++++++++------------ .config/nvim/lua/plugin/lsp/rust.lua | 14 ++--- .config/nvim/lua/plugin/lsp/tex.lua | 40 ++++++------ 10 files changed, 108 insertions(+), 113 deletions(-) diff --git a/.config/nvim/lua/config/autoread.lua b/.config/nvim/lua/config/autoread.lua index a7c4300..bc9a40c 100644 --- a/.config/nvim/lua/config/autoread.lua +++ b/.config/nvim/lua/config/autoread.lua @@ -1,5 +1,5 @@ vim.o.autoread = true vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "CursorHoldI", "FocusGained" }, { - command = "if mode() != 'c' | checktime | endif", - pattern = { "*" }, + command = "if mode() != 'c' | checktime | endif", + pattern = { "*" }, }) diff --git a/.config/nvim/lua/key/rekey.lua b/.config/nvim/lua/key/rekey.lua index b699cc9..286042f 100644 --- a/.config/nvim/lua/key/rekey.lua +++ b/.config/nvim/lua/key/rekey.lua @@ -1,39 +1,39 @@ local function rekey(t, key, command) - vim.api.nvim_set_keymap(t, key, command, { noremap = true }) + vim.api.nvim_set_keymap(t, key, command, { noremap = true }) end local function remap(t, key, command) - vim.api.nvim_set_keymap(t, key, command, { noremap = false }) + vim.api.nvim_set_keymap(t, key, command, { noremap = false }) end function rekey_normal(key, command) - rekey('n', key, command) + rekey('n', key, command) end function rekey_input(key, command) - rekey('i', key, command) + rekey('i', key, command) end function rekey_visual(key, command) - rekey('v', key, command) + rekey('v', key, command) end function rekey_terminal(key, command) - rekey('t', key, command) + rekey('t', key, command) end function remap_normal(key, command) - remap('n', key, command) + remap('n', key, command) end function remap_input(key, command) - remap('i', key, command) + remap('i', key, command) end function remap_visual(key, command) - remap('v', key, command) + remap('v', key, command) end function remap_terminal(key, command) - remap('t', key, command) + remap('t', key, command) end diff --git a/.config/nvim/lua/key/update.lua b/.config/nvim/lua/key/update.lua index 776330f..8657484 100644 --- a/.config/nvim/lua/key/update.lua +++ b/.config/nvim/lua/key/update.lua @@ -1,4 +1,4 @@ vim.api.nvim_create_user_command('Update', function (args) - vim.cmd('PackerUpdate') - vim.cmd('TSUpdate') + vim.cmd('PackerUpdate') + vim.cmd('TSUpdate') end, { desc = "Update everything." }) diff --git a/.config/nvim/lua/plugin/autoclose.lua b/.config/nvim/lua/plugin/autoclose.lua index 66e0496..7ce50eb 100644 --- a/.config/nvim/lua/plugin/autoclose.lua +++ b/.config/nvim/lua/plugin/autoclose.lua @@ -1,14 +1,13 @@ require("autoclose").setup({ - keys = { - ["'"] = { escape = false, close = false, pair = "''", disabled_filetypes = {} }, - - ["\""] = { escape = true, close = true, pair = "\"\"", disabled_filetypes = {} }, - ["{"] = { escape = true, close = true, pair = "{}", disabled_filetypes = {} }, - ["("] = { escape = true, close = true, pair = "()", disabled_filetypes = {} }, - ["<"] = { escape = true, close = true, pair = "<>", disabled_filetypes = {} }, - ["`"] = { escape = true, close = true, pair = "``", disabled_filetypes = {} }, - }, - -- options = { - -- disabled_filetypes = { "text", "markdown" }, - -- } + keys = { + ["\""] = { escape = true, close = true, pair = "\"\"", disabled_filetypes = {} }, + ["'"] = { escape = false, close = false, pair = "''", disabled_filetypes = {} }, + ["{"] = { escape = true, close = true, pair = "{}", disabled_filetypes = {} }, + ["("] = { escape = true, close = true, pair = "()", disabled_filetypes = {} }, + ["<"] = { escape = true, close = true, pair = "<>", disabled_filetypes = {} }, + ["`"] = { escape = true, close = true, pair = "``", disabled_filetypes = {} }, + }, + -- options = { + -- disabled_filetypes = { "text", "markdown" }, + -- } }) diff --git a/.config/nvim/lua/plugin/bufferline.lua b/.config/nvim/lua/plugin/bufferline.lua index 0282c6a..da65645 100644 --- a/.config/nvim/lua/plugin/bufferline.lua +++ b/.config/nvim/lua/plugin/bufferline.lua @@ -1,5 +1 @@ -require("bufferline").setup { - -- options = { - -- numbers = 'buffer_id' - -- } -} +require("bufferline").setup() diff --git a/.config/nvim/lua/plugin/closebuffers.lua b/.config/nvim/lua/plugin/closebuffers.lua index 8007559..1451515 100644 --- a/.config/nvim/lua/plugin/closebuffers.lua +++ b/.config/nvim/lua/plugin/closebuffers.lua @@ -1,7 +1,7 @@ require('close_buffers').setup({ - filetype_ignore = {}, -- Filetype to ignore when running deletions - file_glob_ignore = {}, -- File name glob pattern to ignore when running deletions (e.g. '*.md') - file_regex_ignore = {}, -- File name regex pattern to ignore when running deletions (e.g. '.*[.]md') - preserve_window_layout = { 'this', 'nameless' }, -- Types of deletion that should preserve the window layout - next_buffer_cmd = nil, -- Custom function to retrieve the next buffer when preserving window layout + filetype_ignore = {}, -- Filetype to ignore when running deletions + file_glob_ignore = {}, -- File name glob pattern to ignore when running deletions (e.g. '*.md') + file_regex_ignore = {}, -- File name regex pattern to ignore when running deletions (e.g. '.*[.]md') + preserve_window_layout = { 'this', 'nameless' }, -- Types of deletion that should preserve the window layout + next_buffer_cmd = nil, -- Custom function to retrieve the next buffer when preserving window layout }) diff --git a/.config/nvim/lua/plugin/filetree.lua b/.config/nvim/lua/plugin/filetree.lua index d8281da..07e7bf6 100644 --- a/.config/nvim/lua/plugin/filetree.lua +++ b/.config/nvim/lua/plugin/filetree.lua @@ -10,15 +10,15 @@ vim.opt.termguicolors = true -- OR setup with some options require("nvim-tree").setup({ - sort_by = "case_sensitive", - view = { - width = 30, - }, - renderer = { - group_empty = true, - }, - filters = { - dotfiles = false, - git_ignored = false - }, + sort_by = "case_sensitive", + view = { + width = 30, + }, + renderer = { + group_empty = true, + }, + filters = { + dotfiles = false, + git_ignored = false + }, }) diff --git a/.config/nvim/lua/plugin/gitsigns.lua b/.config/nvim/lua/plugin/gitsigns.lua index 2dc08c0..8f085a9 100644 --- a/.config/nvim/lua/plugin/gitsigns.lua +++ b/.config/nvim/lua/plugin/gitsigns.lua @@ -1,43 +1,43 @@ require('gitsigns').setup { - signs = { - add = { text = '│' }, - change = { text = '│' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - untracked = { text = '┆' }, - }, - signcolumn = false, -- Toggle with `:Gitsigns toggle_signs` - numhl = true, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` - watch_gitdir = { - follow_files = true - }, - attach_to_untracked = true, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - }, - current_line_blame_formatter = ', - ', - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - max_file_length = 40000, -- Disable if file is longer than this (in lines) - preview_config = { - -- Options passed to nvim_open_win - border = 'single', - style = 'minimal', - relative = 'cursor', - row = 0, - col = 1 - }, - yadm = { - enable = false - }, + signs = { + add = { text = '│' }, + change = { text = '│' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signcolumn = false, -- Toggle with `:Gitsigns toggle_signs` + numhl = true, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + follow_files = true + }, + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + }, + current_line_blame_formatter = ', - ', + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + border = 'single', + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1 + }, + yadm = { + enable = false + }, } vim.cmd('highlight gitsignscurrentlineblame guibg=#00000000 guifg=#aaaaaa') diff --git a/.config/nvim/lua/plugin/lsp/rust.lua b/.config/nvim/lua/plugin/lsp/rust.lua index 111eb6b..1d7ef72 100644 --- a/.config/nvim/lua/plugin/lsp/rust.lua +++ b/.config/nvim/lua/plugin/lsp/rust.lua @@ -1,13 +1,13 @@ local lspconfig = require("lspconfig") lspconfig.rust_analyzer.setup { - settings = { - ["rust-analyzer"] = { - rustfmt = { - extraArgs = { "--config", "tab_spaces=2", "brace_style=AlwaysNextLine", "control_brace_style=AlwaysNextLine" } - } - }, - }, + settings = { + ["rust-analyzer"] = { + rustfmt = { + extraArgs = { "--config", "tab_spaces=2", "brace_style=AlwaysNextLine", "control_brace_style=AlwaysNextLine" } + } + }, + }, } vim.g.rust_recommended_style = false diff --git a/.config/nvim/lua/plugin/lsp/tex.lua b/.config/nvim/lua/plugin/lsp/tex.lua index c322028..cca25f7 100644 --- a/.config/nvim/lua/plugin/lsp/tex.lua +++ b/.config/nvim/lua/plugin/lsp/tex.lua @@ -1,52 +1,52 @@ local lspconfig = require('lspconfig') local config = { - filetypes = { 'text', 'bib', 'gitcommit', 'markdown', 'org', 'plaintex', 'rst', 'rnoweb', 'tex', 'pandoc' }, - settings = { - ['ltex'] = { - language = "auto" - } - } + filetypes = { 'text', 'bib', 'gitcommit', 'markdown', 'org', 'plaintex', 'rst', 'rnoweb', 'tex', 'pandoc' }, + settings = { + ['ltex'] = { + language = "auto" + } + } } lspconfig.ltex.setup(config) vim.api.nvim_create_user_command('SCOn', function (args) - lspconfig.ltex.setup(config) + lspconfig.ltex.setup(config) end, { desc = "Enable spellcheck." }) vim.api.nvim_create_user_command('SCOff', function (args) - lspconfig.ltex.setup { filetypes = {} } + lspconfig.ltex.setup { filetypes = {} } end, { desc = "Disable spellcheck." }) vim.api.nvim_create_user_command('SCLangRU', function (args) - config.settings['ltex'].language = "ru-RU" - lspconfig.ltex.setup(config) + config.settings['ltex'].language = "ru-RU" + lspconfig.ltex.setup(config) end, { desc = "Set spellcheck to Russian." }) vim.api.nvim_create_user_command('SCLangEN', function (args) - config.settings['ltex'].language = "en-US" - lspconfig.ltex.setup(config) + config.settings['ltex'].language = "en-US" + lspconfig.ltex.setup(config) end, { desc = "Set spellcheck to English." }) vim.api.nvim_create_user_command('SCLangAuto', function (args) - config.settings['ltex'].language = "auto" - lspconfig.ltex.setup(config) + config.settings['ltex'].language = "auto" + lspconfig.ltex.setup(config) end, { desc = "Set spellcheck to Auto." }) vim.api.nvim_create_user_command('SCForce', function (args) - vim.cmd("setfiletype text") - vim.cmd("SCOn") + vim.cmd("setfiletype text") + vim.cmd("SCOn") end, { desc = "Set buffer type to text." }) vim.api.nvim_create_user_command('SCReset', function (args) - vim.cmd("filetype detect") - vim.cmd("SCLangAuto") + vim.cmd("filetype detect") + vim.cmd("SCLangAuto") end, { desc = "Set buffer type to auto." }) vim.api.nvim_create_user_command('SCInfo', function (args) - vim.cmd("LspInfo") + vim.cmd("LspInfo") end, { desc = "Show info about spellcheck." }) vim.api.nvim_create_user_command('SCInstall', function (args) - vim.cmd("MasonInstall ltex-ls") + vim.cmd("MasonInstall ltex-ls") end, { desc = "Install spellcheck (requires Mason)." })