mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[nvim] fix filetype preferences for indentation
This commit is contained in:
parent
1bca05325f
commit
43959c4f9b
9 changed files with 9 additions and 5 deletions
1
nvim/after/ftplugin/make.vim
Normal file
1
nvim/after/ftplugin/make.vim
Normal file
|
@ -0,0 +1 @@
|
||||||
|
IndentTabs 2
|
|
@ -31,13 +31,16 @@ set commentstring=//%s
|
||||||
let g:indentLine_showFirstIndentLevel = 1
|
let g:indentLine_showFirstIndentLevel = 1
|
||||||
let g:indentLine_fileTypeExclude = ['text', 'help', 'tutor', 'man']
|
let g:indentLine_fileTypeExclude = ['text', 'help', 'tutor', 'man']
|
||||||
|
|
||||||
let g:detectindent_preferred_indent = 2
|
function s:DetectIndent()
|
||||||
let g:detectindent_preferred_expandtab = 1
|
if !empty(&bt) | return | endif
|
||||||
" let g:detectindent_verbosity = 0
|
let g:detectindent_preferred_indent = &l:shiftwidth
|
||||||
|
let g:detectindent_preferred_expandtab = &l:expandtab
|
||||||
|
DetectIndent
|
||||||
|
endfunction
|
||||||
|
|
||||||
augroup vimrc-detect-indent
|
augroup vimrc-detect-indent
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd FileType * if empty(&bt) | DetectIndent | endif
|
autocmd BufReadPost * call s:DetectIndent()
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
|
@ -4,7 +4,7 @@ set fileformats=unix,dos,mac
|
||||||
set wildignore+=.git,.svn,.hg,.DS_Store,*~
|
set wildignore+=.git,.svn,.hg,.DS_Store,*~
|
||||||
|
|
||||||
" arguably one of the most useful mappings
|
" arguably one of the most useful mappings
|
||||||
nnoremap <silent><expr> <CR> &buftype is# '' ? ":write<bar>wall\<CR>" : "\<CR>"
|
nnoremap <silent><expr> <CR> empty(&buftype) ? ":write<bar>wall\<CR>" : "\<CR>"
|
||||||
|
|
||||||
|
|
||||||
" ripgrep (rg) {{{
|
" ripgrep (rg) {{{
|
||||||
|
|
Loading…
Reference in a new issue