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(
'DoubleSpaces',
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("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("GuessIndent")
end,
@ -290,11 +292,11 @@ require('nvim-treesitter.configs').setup {
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
node_decremental = '<c-backspace>',
scope_incremental = '<c-S>'
}
init_selection = '<C-space>',
node_incremental = '<C-space>',
node_decremental = '<C-backspace>',
pscope_incremental = '<C-S>'
},
},
textobjects = {
select = {
@ -330,6 +332,7 @@ require('guess-indent').setup {
"netrw",
"tutor",
},
buftype_exclude = { -- A list of buffer types for which the auto command gets disabled
"help",
"nofile",