nvim : reindent with tab.

This commit is contained in:
Dmitry Voronin 2023-12-05 22:06:39 +03:00
parent a095e63b15
commit 44aa9216c6
10 changed files with 108 additions and 113 deletions

View file

@ -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 = { "*" },
})

View file

@ -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

View file

@ -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." })

View file

@ -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" },
-- }
})

View file

@ -1,5 +1 @@
require("bufferline").setup {
-- options = {
-- numbers = 'buffer_id'
-- }
}
require("bufferline").setup()

View file

@ -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
})

View file

@ -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
},
})

View file

@ -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 = '<author>, <author_time:%Y-%m-%d> - <summary>',
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 = '<author>, <author_time:%Y-%m-%d> - <summary>',
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')

View file

@ -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

View file

@ -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)." })