From 51b67bb5a07ee3eaab080c14a8b01dc43c52c21f Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Fri, 15 Nov 2019 17:10:16 +0100 Subject: Add filetype specific indentations --- .vimrc | 22 +++++++--------------- after/ftplugin/eruby.vim | 1 + after/ftplugin/python.vim | 4 ++++ after/ftplugin/ruby.vim | 8 ++++++++ 4 files changed, 20 insertions(+), 15 deletions(-) create mode 120000 after/ftplugin/eruby.vim create mode 100644 after/ftplugin/python.vim create mode 100644 after/ftplugin/ruby.vim diff --git a/.vimrc b/.vimrc index fab5c5a..0a44e8c 100644 --- a/.vimrc +++ b/.vimrc @@ -67,7 +67,7 @@ set number " set numbers column on the left set complete-=i " Faster vim completion set nrformats-=octal " Increment numbers decimally using Ctrl+A and Ctrl+X set autoindent " Auto indent -set smartindent " Smart indet +" set smartindent " Smart indet (causes problems having differnt files indentation) set smarttab set softtabstop=2 " indentation set tabstop=2 " indentation @@ -147,20 +147,12 @@ set omnifunc=pythoncomplete#Complete """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Specific FileTypes configurations """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete -autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1 -autocmd FileType ruby,eruby let g:rubycomplete_rails = 1 -autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1 -autocmd FileType ruby,eruby let g:rubycomplete_include_object = 1 -autocmd FileType ruby,eruby let g:rubycomplete_include_objectspace = 1 -autocmd FileType ruby,eruby setlocal spell " allow spell checking for ruby documentation -autocmd FileType ruby,eruby set complete+=k " allow spell autocompletion using CTRL-N -autocmd BufNewFile,BufRead *.html.erb set filetype=html " for ruby erb template files -autocmd BufNewFile,BufRead *.json.jbuilder set filetype=ruby " for ruby json template files -autocmd BufRead,BufNewFile *.md setlocal spell " spell check md files -autocmd BufRead,BufNewFile *.markdown setlocal spell " spell check md files -autocmd FileType gitcommit setlocal spell " spell check commits -autocmd FileType gitcommit set complete+=k " allow spell autocompletion using CTRL-N +autocmd BufNewFile,BufRead *.html.erb set filetype=html " for ruby erb template files +autocmd BufNewFile,BufRead *.json.jbuilder set filetype=ruby " for ruby json template files +autocmd BufRead,BufNewFile *.md setlocal spell " spell check md files +autocmd BufRead,BufNewFile *.markdown setlocal spell " spell check md files +autocmd FileType gitcommit setlocal spell " spell check commits +autocmd FileType gitcommit set complete+=k " allow spell autocompletion using CTRL-N autocmd FileType javascript noremap :call JsBeautify() autocmd FileType json noremap :call JsonBeautify() autocmd FileType html noremap :call HtmlBeautify() diff --git a/after/ftplugin/eruby.vim b/after/ftplugin/eruby.vim new file mode 120000 index 0000000..af11168 --- /dev/null +++ b/after/ftplugin/eruby.vim @@ -0,0 +1 @@ +ruby.vim \ No newline at end of file diff --git a/after/ftplugin/python.vim b/after/ftplugin/python.vim new file mode 100644 index 0000000..e847d12 --- /dev/null +++ b/after/ftplugin/python.vim @@ -0,0 +1,4 @@ +setlocal tabstop=8 +setlocal expandtab +setlocal shiftwidth=4 +setlocal softtabstop=4 diff --git a/after/ftplugin/ruby.vim b/after/ftplugin/ruby.vim new file mode 100644 index 0000000..ad4ed03 --- /dev/null +++ b/after/ftplugin/ruby.vim @@ -0,0 +1,8 @@ +set omnifunc=rubycomplete#Complete +let g:rubycomplete_buffer_loading = 1 +let g:rubycomplete_rails = 1 +let g:rubycomplete_classes_in_global = 1 +let g:rubycomplete_include_object = 1 +let g:rubycomplete_include_objectspace = 1 +setlocal spell " allow spell checking for ruby documentation +set complete+=k " allow spell autocompletion using CTRL-N -- cgit v1.2.3