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

This commit is contained in:
FollieHiyuki 2021-06-13 13:52:07 +03:00
parent 325509ba46
commit 7031bc4280
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 (setq-default
;; Tab vs space ;; Tab vs space
indent-tabs-mode nil indent-tabs-mode nil
tab-width 2 tab-width 4
evil-shift-width 2 evil-shift-width 4
standard-indent 2 standard-indent 4
line-spacing 2 line-spacing 2
;; From @tecosaur ;; From @tecosaur
delete-by-moving-to-trash t delete-by-moving-to-trash t

View File

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

View File

@ -4,7 +4,7 @@ inoremap kj <Esc>
" Better Y " Better Y
nmap Y y$ nmap Y y$
" Basic file commands " Basic file commands
nnoremap <A-t> :!touch<Space> nnoremap <A-f> :!touch<Space>
nnoremap <A-e> :!crf<Space> nnoremap <A-e> :!crf<Space>
nnoremap <A-d> :!mkdir<Space> nnoremap <A-d> :!mkdir<Space>
nnoremap <A-m> :!mv<Space>%<Space> nnoremap <A-m> :!mv<Space>%<Space>
@ -59,3 +59,18 @@ cnoreabbrev Qa qa
cnoreabbrev QA qa cnoreabbrev QA qa
cnoreabbrev Wqa wqa cnoreabbrev Wqa wqa
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>