diff options
Diffstat (limited to 'nvim')
| -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> |
