diff options
| author | ivan-boikov <ik.boikov.public@protonmail.com> | 2024-09-05 21:29:32 +0200 |
|---|---|---|
| committer | ivan-boikov <ik.boikov.public@protonmail.com> | 2024-09-05 21:29:32 +0200 |
| commit | 56393fa2b5677095d3ccac3ba70120f24a7064ea (patch) | |
| tree | c8aea36c7ff0d44691372eedce4f123878dfabe4 /nvim/.config | |
| parent | 092763a2149898ab6ae71778f9b18ef6904e2750 (diff) | |
nvim retabbing, use tabs by default
Diffstat (limited to 'nvim/.config')
| -rw-r--r-- | nvim/.config/nvim/init.vim | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 1f8a062..86366fb 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -140,7 +140,7 @@ set tabstop=4 " The width of a TAB is set to 4. " a width of 4. set shiftwidth=4 " Indents will have a width of 4 set softtabstop=4 " Sets the number of columns for a TAB -set noexpandtab " Expand TABs to spaces +set expandtab " spaces to tabs set shiftround " Round indent to multiple of 'shiftwidth' set smartindent " Do smart indenting when starting a new line set autoindent " Copy indent from current line, over to the new line @@ -177,6 +177,21 @@ set formatoptions-=t " show tabs set list set listchars=tab:>- +set listchars+=space:ยท + +function TabSpaceToggle() + if &expandtab + set shiftwidth=4 + set softtabstop=0 + set noexpandtab + else + set shiftwidth=4 + set softtabstop=4 + set expandtab + endif + execute('%retab!') +endfunction +nmap <leader>t mz:execute TabSpaceToggle()<CR>'z nmap <M-Tab> :bnext<CR> |
