]> gitweb.fluxo.info Git - rhatto/dotfiles/vim.git/commitdiff
Fix: config sorting
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 28 Jul 2024 13:10:40 +0000 (10:10 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 28 Jul 2024 13:10:40 +0000 (10:10 -0300)
vim.dot.link/filetype.vim
vimrc.dot.link

index fb7370322094576d5998d73955f51935f14b52be..6679641db88f92699c27133d6bc878512297b9f7 100644 (file)
@@ -37,6 +37,13 @@ augroup puppet
   autocmd BufRead,BufNewFile *.pp setfiletype puppet
 augroup END
 
+" PHP
+augroup php
+  autocmd!
+  autocmd BufRead,BufNewFile *.php setfiletype php
+  autocmd FileType             php let php_sql_query=1
+augroup END
+
 " Drupal *.module and *.install files.
 if has("autocmd")
   augroup module
index 5c5a1fdb4b15d53bed152a0d9540fe2aa644a012..b179acc8c8949aaf17960074df2b39dd81fe533f 100644 (file)
@@ -21,13 +21,18 @@ set ignorecase
 set smartcase
 let mapleader="-"
 
-" Syntax highlight
+" Syntax highlighting
 syntax on
 
 " Indenting
 filetype indent off
 filetype plugin indent on
 
+" Syntax check
+let g:syntastic_mode_map={ 'mode': 'passive',
+                           \ 'active_filetypes': [],
+                           \ 'passive_filetypes': [] }
+
 " Folding
 " Disabled due to slowness
 "set foldmethod=syntax
@@ -42,34 +47,20 @@ filetype plugin indent on
 "let vimsyn_folding='af'
 "let xml_syntax_folding=1
 
-" See http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file
-"set autochdir
-augroup changedir
-  autocmd!
-  autocmd BufEnter * silent! lcd %:p:h
-augroup END
-
 " Command mode completion
 " See https://stackoverflow.com/questions/526858/how-do-i-make-vim-do-normal-bash-like-tab-completion-for-file-names
 "set wildmode=longest,list
 set wildmode=longest,list,full
 set wildmenu
 
-" PHP
-let php_sql_query=1
-
-" No modelines
+" Disable modelines
+"
 " https://lwn.net/Articles/20249/
 " http://usevim.com/2012/03/28/modelines/
 " http://www.techrepublic.com/blog/it-security/turn-off-modeline-support-in-vim/
 set nomodeline
 set modelines=0
 
-" Syntax check
-let g:syntastic_mode_map={ 'mode': 'passive',
-                           \ 'active_filetypes': [],
-                           \ 'passive_filetypes': [] }
-
 " Color scheme
 "colorscheme github
 "colorscheme solarized
@@ -86,6 +77,11 @@ else
   colorscheme zenburn
 endif
 
+" Status and tab lines
+set laststatus=2  " Always display the statusline in all windows
+set showtabline=2 " Always display the tabline, even if there is only one tab
+set noshowmode    " Hide the default mode text (e.g. -- INSERT -- below the statusline)
+
 " Airline
 if $WINDOWID != ""
   let g:airline_powerline_fonts=1
@@ -99,38 +95,46 @@ endif
 "python powerline_setup()
 "python del powerline_setup
 
-set laststatus=2  " Always display the statusline in all windows
-set showtabline=2 " Always display the tabline, even if there is only one tab
-set noshowmode    " Hide the default mode text (e.g. -- INSERT -- below the statusline)
-
-" See
+" Autoread
+"
 " http://vim.wikia.com/wiki/Have_Vim_check_automatically_if_the_file_has_changed_externally
 " http://stackoverflow.com/questions/2490227/how-does-vims-autoread-work
 " http://stackoverflow.com/questions/2490227/how-does-vims-autoread-work
 "au FocusGained,BufEnter * :silent! !
 "au FocusLost,WinLeave * :silent! w
 
-" Session management, see:
+" Autosave
+" See https://github.com/vim-scripts/vim-auto-save
+"let g:auto_save = 1
+
+" Auto change dir
+"
+" Automatically set the current working directory to the current buffer file's
+" directory
+"
+" See http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file
+"set autochdir
+augroup changedir
+  autocmd!
+  autocmd BufEnter * silent! lcd %:p:h
+augroup END
+
+" Session management
+"
 " http://usevim.com/2013/07/05/sessions/
 " https://github.com/xolox/vim-session
 " https://github.com/tpope/vim-obsession
 " http://stackoverflow.com/questions/1642611/how-to-save-a-session-in-vim
 " https://bocoup.com/weblog/sessions-the-vim-feature-you-probably-arent-using/
 " http://vimdoc.sourceforge.net/htmldoc/usr_21.html#21.4
-"let g:session_autosave_periodic=1
-let g:session_autosave_silent=1
-let g:session_autosave='yes'
-let g:session_autoload='no'
-let g:session_directory='~/.local/share/vim/sessions'
-
-" Session options
 " https://github.com/xolox/vim-session?tab=readme-ov-file#options
+"let g:session_autosave_periodic=1
 set sessionoptions-=buffers
 set sessionoptions-=blank
 set sessionoptions-=resize
 set sessionoptions-=winsize
 set sessionoptions-=winpos
-
-" Autosave
-" See https://github.com/vim-scripts/vim-auto-save
-"let g:auto_save = 1
+let g:session_autosave_silent=1
+let g:session_autosave='yes'
+let g:session_autoload='no'
+let g:session_directory='~/.local/share/vim/sessions'