From 7031bc42806cb5e086f3cbe4ed098dcc5ccf450a Mon Sep 17 00:00:00 2001 From: FollieHiyuki Date: Sun, 13 Jun 2021 13:52:07 +0300 Subject: [PATCH] neovim/emacs: I'm a 4-space guy now --- home/.config/doom/config.el | 6 +++--- home/.config/nvim/general/basic-settings.vim | 4 ++-- home/.config/nvim/plugin/keybindings.vim | 17 ++++++++++++++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/home/.config/doom/config.el b/home/.config/doom/config.el index db275a7..6a5e37d 100644 --- a/home/.config/doom/config.el +++ b/home/.config/doom/config.el @@ -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 diff --git a/home/.config/nvim/general/basic-settings.vim b/home/.config/nvim/general/basic-settings.vim index 6ec9750..e4c6d23 100644 --- a/home/.config/nvim/general/basic-settings.vim +++ b/home/.config/nvim/general/basic-settings.vim @@ -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 diff --git a/home/.config/nvim/plugin/keybindings.vim b/home/.config/nvim/plugin/keybindings.vim index 61f2edd..93d0214 100644 --- a/home/.config/nvim/plugin/keybindings.vim +++ b/home/.config/nvim/plugin/keybindings.vim @@ -4,7 +4,7 @@ inoremap kj " Better Y nmap Y y$ " Basic file commands -nnoremap :!touch +nnoremap :!touch nnoremap :!crf nnoremap :!mkdir nnoremap :!mv% @@ -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 :call ToggleIndentStyle()