From 8ad0a0320d9515f91e8c6121229e1e88891e33e0 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 30 Jul 2024 00:07:10 -0300 Subject: Fix: use setlocal for filetypes --- vim.dot.link/filetype.vim | 10 +++++----- vim.dot.link/ftplugin/mail.vim | 2 +- vim.dot.link/ftplugin/markdown.vim | 8 ++++---- vim.dot.link/ftplugin/python.vim | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'vim.dot.link') diff --git a/vim.dot.link/filetype.vim b/vim.dot.link/filetype.vim index 68c9bba..7284bd7 100644 --- a/vim.dot.link/filetype.vim +++ b/vim.dot.link/filetype.vim @@ -34,7 +34,7 @@ augroup filetypedetect " This handling is disabled by default, since it may be conflicting " with something. " - " Markdown folding through NestedMarkdownFolds() are not correctly working + " Markdown folding through NestedMarkdownFolds() is not working correctly " with this configuration. " " Maybe what's happenning is that setting the "markdown" filetype @@ -54,10 +54,10 @@ augroup END " won't be correctly applied in some Markdown files loaded in new windows. augroup filetype_markdown autocmd! - "autocmd BufRead,BufNewFile,BufEnter *.md set foldexpr=NestedMarkdownFolds() - "autocmd BufRead,BufNewFile,BufEnter *.md set autoindent smartindent - "autocmd BufRead,BufNewFile,BufEnter *.md set formatoptions=tcroqn2 comments=n:> - autocmd BufRead,BufNewFile,BufEnter *.md set tabstop=2 softtabstop=2 shiftwidth=2 expandtab + "autocmd BufRead,BufNewFile,BufEnter *.md setlocal foldexpr=NestedMarkdownFolds() + "autocmd BufRead,BufNewFile,BufEnter *.md setlocal autoindent smartindent + "autocmd BufRead,BufNewFile,BufEnter *.md setlocal formatoptions=tcroqn2 comments=n:> + autocmd BufRead,BufNewFile,BufEnter *.md setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab augroup END " }}} diff --git a/vim.dot.link/ftplugin/mail.vim b/vim.dot.link/ftplugin/mail.vim index f21ff9c..c518239 100644 --- a/vim.dot.link/ftplugin/mail.vim +++ b/vim.dot.link/ftplugin/mail.vim @@ -2,4 +2,4 @@ " " Workaround for mail editing. There must be a plugin enabling autoindent in " mail composition, which is annoying. -set noautoindent +setlocal noautoindent diff --git a/vim.dot.link/ftplugin/markdown.vim b/vim.dot.link/ftplugin/markdown.vim index b40908e..aafef72 100644 --- a/vim.dot.link/ftplugin/markdown.vim +++ b/vim.dot.link/ftplugin/markdown.vim @@ -9,9 +9,9 @@ " These settings are configured directly on filetype.vim instead. " Basic {{{ -"set autoindent smartindent -"set tabstop=2 softtabstop=2 shiftwidth=2 expandtab -"set formatoptions=tcroqn2 comments=n:> +"setlocal autoindent smartindent +"setlocal formatoptions=tcroqn2 comments=n:> +"setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab " }}} " Markdown configuration without vim-markdown plugin {{{ @@ -21,7 +21,7 @@ " " This is an alternative to the following method: " https://codereview.stackexchange.com/questions/202620/vim-plugin-for-folding-markdown-lists -"set foldexpr=NestedMarkdownFolds() +"setlocal foldexpr=NestedMarkdownFolds() " }}} " Markdown configuration with vim-markdown plugin {{{ diff --git a/vim.dot.link/ftplugin/python.vim b/vim.dot.link/ftplugin/python.vim index 3e27472..047760c 100644 --- a/vim.dot.link/ftplugin/python.vim +++ b/vim.dot.link/ftplugin/python.vim @@ -1,2 +1,2 @@ " Python -set autoindent smartindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab +setlocal autoindent smartindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab -- cgit v1.2.3