config/nvim: change default indentation

This commit is contained in:
xeruf 2021-11-23 13:02:34 +01:00
parent db7558105a
commit 8715a26674
2 changed files with 8 additions and 7 deletions

View File

@ -2,7 +2,7 @@ set termguicolors
set mouse=nvh " Disable mouse in insert mode to allow middle-click paste in remote session - https://vi.stackexchange.com/q/23080 set mouse=nvh " Disable mouse in insert mode to allow middle-click paste in remote session - https://vi.stackexchange.com/q/23080
set clipboard+=unnamedplus " Merge with system clipboard set clipboard+=unnamedplus " Merge with system clipboard
set shiftwidth=2 expandtab " Default simple indentation set shiftwidth=0 tabstop=3 noexpandtab " Default simple indentation
set wildmode=longest,list,full " Auto-completion for cmdline set wildmode=longest,list,full " Auto-completion for cmdline
set splitright diffopt+=vertical,filler set splitright diffopt+=vertical,filler
@ -37,6 +37,7 @@ if !isdirectory(&backupdir)
execute "!mkdir " . &backupdir execute "!mkdir " . &backupdir
endif endif
let &backupext="_" . strftime("%y%m%dT%H%M") let &backupext="_" . strftime("%y%m%dT%H%M")
set backupskip=
" FILETYPES " FILETYPES
syntax on syntax on
@ -55,8 +56,8 @@ autocmd BufNewFile *.sh,$HOME/.local/bin/* execute 'silent! 1s/.*/#!\/bin\/sh\r'
"autocmd BufNewFile * if !empty(&filetype) | execute 'silent! 1s/.*/#!\/usr\/bin\/' . &filetype . '\r\r'| :startinsert | endif "autocmd BufNewFile * if !empty(&filetype) | execute 'silent! 1s/.*/#!\/usr\/bin\/' . &filetype . '\r\r'| :startinsert | endif
set spelllang=en_us,de_de set spelllang=en_us,de_de
autocmd BufEnter *.txt,*jrnl* setlocal ts=4 sw=4 " formatoptions+=b textwidth=78 autocmd BufEnter *.txt,*jrnl* setlocal tabstop=4 expandtab " formatoptions+=b textwidth=78
autocmd FileType markdown setlocal wrap spell colorcolumn= " Spell checking & no guiding columns in markdown autocmd FileType markdown setlocal wrap spell colorcolumn= tabstop=4 expandtab " Spell checking & no guiding columns in markdown
" Center on insert mode " Center on entering insert mode
autocmd InsertEnter * norm zz autocmd InsertEnter * norm zz

View File

@ -7,7 +7,7 @@ command! WS write <bar> source $MYVIMRC
command! FormatJSON %!python -m json.tool command! FormatJSON %!python -m json.tool
command! DiffSwap :diffsp % " Diff for swap - superseded by 'chrisbra/Recover.vim' command! DiffSwap :diffsp % " Diff for swap - superseded by 'chrisbra/Recover.vim'
" @c now takes an indented code block and surrounds it in backticks instead " takes an indented code block and surrounds it in backticks instead
let @c = '/^\n i```Ni```j0/``` lllkxNA' let @c = '/^\n i```Ni```j0/``` lllkxNA'
" Sane yanking " Sane yanking
@ -54,5 +54,5 @@ map <leader>lw :setlocal colorcolumn=81 textwidth=80<CR>
map <leader>ln :setlocal colorcolumn= textwidth=0 wrap<CR> map <leader>ln :setlocal colorcolumn= textwidth=0 wrap<CR>
" Quickly switch indentation settings " Quickly switch indentation settings
map <leader>t :setlocal shiftwidth=4 tabstop=4 noexpandtab<CR> map <leader>t :setlocal shiftwidth=2 expandtab<CR>
map <leader>T :setlocal shiftwidth=2 expandtab<CR> map <leader>T :setlocal shiftwidth=3 tabstop=3 noexpandtab<CR>