neovim/emacs: I'm a 4-space guy now

This commit is contained in:
FollieHiyuki 2021-06-13 13:52:07 +03:00
parent 4e108abbbd
commit 5ca2f568df
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
3 changed files with 21 additions and 6 deletions

View File

@ -15,9 +15,9 @@
(setq-default
;; Tab vs space
indent-tabs-mode nil
tab-width 2
evil-shift-width 2
standard-indent 2
tab-width 4
evil-shift-width 4
standard-indent 4
line-spacing 2
;; From @tecosaur
delete-by-moving-to-trash t

View File

@ -19,8 +19,8 @@ set formatoptions-=cro
set clipboard+=unnamedplus
set number relativenumber
" set cursorline
set tabstop=2 softtabstop=2 " 2 spaces for 1 tab
set shiftwidth=2 " 2 spaces for 1 indent
set tabstop=4 softtabstop=4 " 4 spaces for 1 tab
set shiftwidth=4 " 4 spaces for 1 indent
set smarttab
set expandtab " convert tabs to spaces
set smartindent

View File

@ -4,7 +4,7 @@ inoremap kj <Esc>
" Better Y
nmap Y y$
" Basic file commands
nnoremap <A-t> :!touch<Space>
nnoremap <A-f> :!touch<Space>
nnoremap <A-e> :!crf<Space>
nnoremap <A-d> :!mkdir<Space>
nnoremap <A-m> :!mv<Space>%<Space>
@ -59,3 +59,18 @@ cnoreabbrev Qa qa
cnoreabbrev QA qa
cnoreabbrev Wqa wqa
cnoreabbrev WQa wqa
function! ToggleIndentStyle()
if &expandtab == 1
set noexpandtab
set softtabstop&
set shiftwidth&
echomsg "Switched to indent with tabs."
else
set expandtab
set softtabstop = 4
set shiftwidth = 4
echomsg "Switched to indent with 4 spaces."
endif
endfunction
noremap <A-t> :call ToggleIndentStyle()<CR>