fix: nvim fix :DoubleSpaces

nix-components
pegasust 2022-11-19 15:24:41 +00:00
parent e5379edd80
commit d392b8dbe1
1 changed files with 27 additions and 24 deletions

View File

@ -174,9 +174,11 @@ vim.api.nvim_create_user_command(
vim.api.nvim_create_user_command( vim.api.nvim_create_user_command(
'DoubleSpaces', 'DoubleSpaces',
function(opts) function(opts)
vim.api.nvim_command("set ts=1 sts=1 noet") -- cannot really do 1-space tab. The minimum is 2-space to begin
-- doubling
vim.api.nvim_command("set ts=2 sts=2 noet")
vim.api.nvim_command("retab!") vim.api.nvim_command("retab!")
vim.api.nvim_command("set ts=2 sts=2 et") vim.api.nvim_command("set ts=4 sts=4 et")
vim.api.nvim_command("retab") vim.api.nvim_command("retab")
vim.api.nvim_command("GuessIndent") vim.api.nvim_command("GuessIndent")
end, end,
@ -290,11 +292,11 @@ require('nvim-treesitter.configs').setup {
incremental_selection = { incremental_selection = {
enable = true, enable = true,
keymaps = { keymaps = {
init_selection = '<c-space>', init_selection = '<C-space>',
node_incremental = '<c-space>', node_incremental = '<C-space>',
node_decremental = '<c-backspace>', node_decremental = '<C-backspace>',
scope_incremental = '<c-S>' pscope_incremental = '<C-S>'
} },
}, },
textobjects = { textobjects = {
select = { select = {
@ -330,6 +332,7 @@ require('guess-indent').setup {
"netrw", "netrw",
"tutor", "tutor",
}, },
buftype_exclude = { -- A list of buffer types for which the auto command gets disabled buftype_exclude = { -- A list of buffer types for which the auto command gets disabled
"help", "help",
"nofile", "nofile",